summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 18:47:07 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 18:47:07 +0000
commitad4703ed344d3987bfc4fa351ee2c44836d60e00 (patch)
treec24b1c1849f94007ed5a60638cbc75d88d14d8aa /chrome/test
parenta4a16bbc5a15fecf65d04128b55e51298286c15a (diff)
downloadchromium_src-ad4703ed344d3987bfc4fa351ee2c44836d60e00.zip
chromium_src-ad4703ed344d3987bfc4fa351ee2c44836d60e00.tar.gz
chromium_src-ad4703ed344d3987bfc4fa351ee2c44836d60e00.tar.bz2
This CL ensures that plugins always peek in the context of outgoing sync calls.
I will be watching the reliability test runs closely for any crashes which creep in due to reentrancies into plugins caused by this CL. This fixes bug http://code.google.com/p/chromium/issues/detail?id=15985 It is a touch tricky to implement a test case for this. Will add one hopefully in a subsequent CL Bug=15985 Test=Covered by UI test Review URL: http://codereview.chromium.org/173211 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html39
-rw-r--r--chrome/test/ui/npapi_uitest.cc10
2 files changed, 49 insertions, 0 deletions
diff --git a/chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html b/chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html
new file mode 100644
index 0000000..f840278
--- /dev/null
+++ b/chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<title>Test for verifying if plugins pump messages in sync calls.</title>
+<script src="npapi.js"></script>
+<script>
+function SetFocusToPlugin2() {
+ var plugin = window.document["plugin2"];
+ plugin.resetFocus = 1;
+}
+</script>
+</head>
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+<h2>Test to verify whether plugins pump messages in sync calls.</h2>
+
+<p>
+This test verifies whether a plugin continues to pump messages in outgoing
+sync calls. This ensures that it remains responsive and does not cause
+other plugins and the browser to hang
+</p>
+
+<DIV ID=PluginDiv>
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="src_plugin_for_outgoing_sync_call"
+ id="1"
+ mode="np_embed">
+</embed>
+</DIV>
+
+<embed name="plugin2" type="application/x-webkit-test-netscape" resetFocusWindow="1"></embed>
+
+</body>
+</html>
+
diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc
index eb19042..a4fa299 100644
--- a/chrome/test/ui/npapi_uitest.cc
+++ b/chrome/test/ui/npapi_uitest.cc
@@ -298,3 +298,13 @@ TEST_F(NPAPIVisiblePluginTester, MultipleInstancesSyncCalls) {
kTestCompleteSuccess, kShortWaitTimeout);
}
+TEST_F(NPAPIVisiblePluginTester, EnsurePluginsPumpInSyncCalls) {
+ if (UITest::in_process_renderer())
+ return;
+
+ GURL url = GetTestUrl(L"npapi",
+ L"ensure_plugins_pump_messages_in_sync_calls.html");
+ NavigateToURL(url);
+ WaitForFinish("src_plugin_for_outgoing_sync_call", "1", url,
+ kTestCompleteCookie, kTestCompleteSuccess, kShortWaitTimeout);
+}