summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 17:33:29 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 17:33:29 +0000
commit2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0 (patch)
treeff3b26607ba232878732ac1e597b254cad7ccefb /chrome/test
parent71a329c66080f1c095afc642eef5fe10160dc125 (diff)
downloadchromium_src-2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0.zip
chromium_src-2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0.tar.gz
chromium_src-2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0.tar.bz2
Fix browser hang due to plugin deadlock
This involves two plugin instances with second instance making sync calls to the renderer while the first one is still servicing an incoming sync request. Our logic to unblock the renderer during the sync call fails since the 'in_dispatch_' counter is maintained per plugin channel (each plugin instance uses its own separate channel). Making 'in_dispatch_' counter static member of PluginChannelBase fixes this deadlock. Added a new NPAPI UI test for this scenario. BUG=12624 TEST=MultipleInstancesSyncCalls Review URL: http://codereview.chromium.org/119052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/npapi/multiple_instances_sync_calls.html38
-rw-r--r--chrome/test/ui/npapi_uitest.cc13
2 files changed, 51 insertions, 0 deletions
diff --git a/chrome/test/data/npapi/multiple_instances_sync_calls.html b/chrome/test/data/npapi/multiple_instances_sync_calls.html
new file mode 100644
index 0000000..5658a12
--- /dev/null
+++ b/chrome/test/data/npapi/multiple_instances_sync_calls.html
@@ -0,0 +1,38 @@
+<html>
+ <head>
+ <script src="npapi.js"></script>
+ <script>
+ function TestCallback() {
+ onSuccess("multiple_instances_sync_calls", 1);
+ }
+ </script>
+ </head>
+ <body>
+ <div id="statusPanel" style="border: 1px solid red; width: 100%">
+ Test running....
+ </div>
+
+ NPObject Proxy Test<p>
+
+ Tests the case that involves two plugin instances with second
+ instance making sync calls to the renderer while the first one
+ is still servicing an incoming sync request
+
+ <DIV ID="plugin">
+ <embed type="application/vnd.npapi-test"
+ src="foo"
+ name="multiple_instances_sync_calls"
+ id="1"
+ width="100"
+ height="100"
+ mode="np_embed"></embed>
+ <embed type="application/vnd.npapi-test"
+ src="foo"
+ name="multiple_instances_sync_calls"
+ id="2"
+ width="100"
+ height="100"
+ mode="np_embed"></embed>
+ </DIV>
+ </body>
+</html>
diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc
index 76176a9..83ea533 100644
--- a/chrome/test/ui/npapi_uitest.cc
+++ b/chrome/test/ui/npapi_uitest.cc
@@ -284,3 +284,16 @@ TEST_F(NPAPIIncognitoTester, PrivateEnabled) {
WaitForFinish("private", "1", url, kTestCompleteCookie,
kTestCompleteSuccess, kShortWaitTimeout);
}
+
+// Test a browser hang due to special case of multiple
+// plugin instances indulged in sync calls across renderer.
+TEST_F(NPAPIVisiblePluginTester, MultipleInstancesSyncCalls) {
+ if (UITest::in_process_renderer())
+ return;
+
+ GURL url = GetTestUrl(L"npapi", L"multiple_instances_sync_calls.html");
+ NavigateToURL(url);
+ WaitForFinish("multiple_instances_sync_calls", "1", url, kTestCompleteCookie,
+ kTestCompleteSuccess, kShortWaitTimeout);
+}
+