Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1268)

Unified Diff: content/browser/plugin_service_browsertest.cc

Issue 8603012: Fix race in PluginDataRemoverImpl going away while it's still being used on the IO thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Move Context class to cc file Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_service_browsertest.cc
===================================================================
--- content/browser/plugin_service_browsertest.cc (revision 110950)
+++ content/browser/plugin_service_browsertest.cc (working copy)
@@ -23,6 +23,13 @@
const char kNPAPITestPluginMimeType[] = "application/vnd.npapi-test";
+void OpenChannel(PluginProcessHost::Client* client) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ // Start opening the channel
+ PluginService::GetInstance()->OpenChannelToNpapiPlugin(
+ 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, client);
+}
+
// Mock up of the Client and the Listener classes that would supply the
// communication channel with the plugin.
class MockPluginProcessHostClient : public PluginProcessHost::Client,
@@ -100,8 +107,9 @@
IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) {
::testing::StrictMock<MockPluginProcessHostClient> mock_client(
browser()->profile()->GetResourceContext());
- PluginService::GetInstance()->OpenChannelToNpapiPlugin(
- 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, &mock_client);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(OpenChannel, &mock_client));
ui_test_utils::RunMessageLoop();
}
@@ -234,13 +242,6 @@
DISALLOW_COPY_AND_ASSIGN(MockCanceledBeforeSentPluginProcessHostClient);
};
-void OpenChannel(PluginProcessHost::Client* client) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- // Start opening the channel
- PluginService::GetInstance()->OpenChannelToNpapiPlugin(
- 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, client);
-}
-
IN_PROC_BROWSER_TEST_F(
PluginServiceTest, CancelBeforeSentOpenChannelToPluginProcessHost) {
::testing::StrictMock<MockCanceledBeforeSentPluginProcessHostClient>
« no previous file with comments | « content/browser/plugin_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698