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

Unified Diff: content/browser/plugin_service_browsertest.cc

Issue 7387010: Add PluginServiceFilter interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 5 months 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
Index: content/browser/plugin_service_browsertest.cc
diff --git a/content/browser/plugin_service_browsertest.cc b/content/browser/plugin_service_browsertest.cc
index e1e15b72983c78f3c3a439db8feecb25453e7823..38a6c6a68cca5a13b40c0e690b103c6e778691c0 100644
--- a/content/browser/plugin_service_browsertest.cc
+++ b/content/browser/plugin_service_browsertest.cc
@@ -7,8 +7,10 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/resource_context.h"
#include "content/common/content_switches.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "webkit/plugins/npapi/plugin_list.h"
@@ -33,8 +35,11 @@ class MockPluginProcessHostClient : public PluginProcessHost::Client,
}
// Client implementation.
- int ID() { return 42; }
- bool OffTheRecord() { return false; }
+ virtual int ID() OVERRIDE { return 42; }
+ virtual bool OffTheRecord() OVERRIDE { return false; }
+ virtual content::BrowserContext* GetBrowserContext() OVERRIDE {
+ return &profile_;
+ }
void OnChannelOpened(const IPC::ChannelHandle& handle) {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -63,6 +68,7 @@ class MockPluginProcessHostClient : public PluginProcessHost::Client,
MOCK_METHOD0(OnChannelListenError, void());
private:
+ TestingProfile profile_;
IPC::Channel* channel_;
bool set_plugin_info_called_;
DISALLOW_COPY_AND_ASSIGN(MockPluginProcessHostClient);
@@ -82,13 +88,18 @@ class PluginServiceTest : public InProcessBrowserTest {
browser_directory.AppendASCII("plugins"));
#endif
}
+
+ static void OpenChannelOnIOThread(PluginProcessHost::Client* client) {
+ PluginService::GetInstance()->OpenChannelToNpapiPlugin(
+ 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, client);
+ }
};
// Try to open a channel to the test plugin. Minimal plugin process spawning
// test for the PluginService interface.
IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) {
- MockPluginProcessHostClient mock_client;
+ ::testing::StrictMock<MockPluginProcessHostClient> mock_client;
PluginService::GetInstance()->OpenChannelToNpapiPlugin(
- 0, 0, GURL(), kNPAPITestPluginMimeType, &mock_client);
+ 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, &mock_client);
ui_test_utils::RunMessageLoop();
}

Powered by Google App Engine
This is Rietveld 408576698