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

Unified Diff: content/browser/plugin_service_impl_browsertest.cc

Issue 12114045: Broke ContentSettingBubbleModelTest.Plugins on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « content/browser/plugin_service_impl.cc ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_service_impl_browsertest.cc
===================================================================
--- content/browser/plugin_service_impl_browsertest.cc (revision 180109)
+++ content/browser/plugin_service_impl_browsertest.cc (working copy)
@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "content/public/browser/browser_context.h"
-#include "content/public/browser/plugin_service_filter.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
@@ -37,11 +36,10 @@
class MockPluginProcessHostClient : public PluginProcessHost::Client,
public IPC::Listener {
public:
- MockPluginProcessHostClient(ResourceContext* context, bool expect_fail)
+ MockPluginProcessHostClient(ResourceContext* context)
: context_(context),
channel_(NULL),
- set_plugin_info_called_(false),
- expect_fail_(expect_fail) {
+ set_plugin_info_called_(false) {
}
virtual ~MockPluginProcessHostClient() {
@@ -82,8 +80,6 @@
return false;
}
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE {
- if (expect_fail_)
- FAIL();
QuitMessageLoop();
}
virtual void OnChannelError() OVERRIDE {
@@ -100,8 +96,7 @@
private:
void Fail() {
- if (!expect_fail_)
- FAIL();
+ FAIL();
QuitMessageLoop();
}
@@ -113,27 +108,9 @@
ResourceContext* context_;
IPC::Channel* channel_;
bool set_plugin_info_called_;
- bool expect_fail_;
DISALLOW_COPY_AND_ASSIGN(MockPluginProcessHostClient);
};
-class MockPluginServiceFilter : public content::PluginServiceFilter {
- public:
- MockPluginServiceFilter() {}
-
- virtual bool IsPluginEnabled(
- int render_process_id,
- int render_view_id,
- const void* context,
- const GURL& url,
- const GURL& policy_url,
- webkit::WebPluginInfo* plugin) OVERRIDE { return true; }
-
- virtual bool CanLoadPlugin(
- int render_process_id,
- const FilePath& path) OVERRIDE { return false; }
-};
-
class PluginServiceTest : public ContentBrowserTest {
public:
PluginServiceTest() {}
@@ -163,25 +140,13 @@
IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) {
if (!webkit::npapi::NPAPIPluginsSupported())
return;
- MockPluginProcessHostClient mock_client(GetResourceContext(), false);
+ MockPluginProcessHostClient mock_client(GetResourceContext());
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&OpenChannel, &mock_client));
RunMessageLoop();
}
-IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToDeniedPlugin) {
- if (!webkit::npapi::NPAPIPluginsSupported())
- return;
- MockPluginServiceFilter filter;
- PluginServiceImpl::GetInstance()->SetFilter(&filter);
- MockPluginProcessHostClient mock_client(GetResourceContext(), true);
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&OpenChannel, &mock_client));
- RunMessageLoop();
-}
-
// A strict mock that fails if any of the methods are called. They shouldn't be
// called since the request should get canceled before then.
class MockCanceledPluginServiceClient : public PluginProcessHost::Client {
« no previous file with comments | « content/browser/plugin_service_impl.cc ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698