Commit f32d1c4c authored by fsamuel's avatar fsamuel Committed by Commit bot

Remove BrowserPlugin tests (only one test remaining with existing coverage)

This test coverage already exists in chrome and extensions now.

BUG=330264

Review URL: https://codereview.chromium.org/617123005

Cr-Commit-Position: refs/heads/master@{#297874}
parent 32115e57
......@@ -104,9 +104,6 @@
'renderer/battery_status/battery_status_dispatcher.h',
'renderer/browser_plugin/browser_plugin.cc',
'renderer/browser_plugin/browser_plugin.h',
'renderer/browser_plugin/browser_plugin_manager_factory.h',
'renderer/browser_plugin/browser_plugin_manager_impl.cc',
'renderer/browser_plugin/browser_plugin_manager_impl.h',
'renderer/browser_plugin/browser_plugin_manager.cc',
'renderer/browser_plugin/browser_plugin_manager.h',
'renderer/clipboard_utils.cc',
......
......@@ -1222,12 +1222,6 @@
'browser/webui/web_ui_mojo_browsertest.cc',
'child/site_isolation_policy_browsertest.cc',
'renderer/accessibility/renderer_accessibility_browsertest.cc',
'renderer/browser_plugin/browser_plugin_browsertest.cc',
'renderer/browser_plugin/browser_plugin_browsertest.h',
'renderer/browser_plugin/mock_browser_plugin.cc',
'renderer/browser_plugin/mock_browser_plugin.h',
'renderer/browser_plugin/mock_browser_plugin_manager.cc',
'renderer/browser_plugin/mock_browser_plugin_manager.h',
'renderer/browser_render_view_browsertest.cc',
'renderer/dom_serializer_browsertest.cc',
'renderer/gin_browsertest.cc',
......
......@@ -137,8 +137,7 @@ class CONTENT_EXPORT BrowserPlugin :
private:
friend class base::DeleteHelper<BrowserPlugin>;
// Only the manager is allowed to create a BrowserPlugin.
friend class BrowserPluginManagerImpl;
friend class MockBrowserPluginManager;
friend class BrowserPluginManager;
// For unit/integration tests.
friend class MockBrowserPlugin;
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/browser_plugin/browser_plugin_browsertest.h"
#include "base/debug/leak_annotations.h"
#include "base/files/file_path.h"
#include "base/memory/singleton.h"
#include "base/path_service.h"
#include "base/pickle.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/browser_plugin/browser_plugin_manager_factory.h"
#include "content/renderer/browser_plugin/mock_browser_plugin.h"
#include "content/renderer/browser_plugin/mock_browser_plugin_manager.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/renderer_webkitplatformsupport_impl.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/WebCursorInfo.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
namespace content {
namespace {
const char kHTMLForBrowserPluginObject[] =
"<object id='browserplugin' width='640px' height='480px'"
" src='foo' type='%s'></object>"
"<script>document.querySelector('object').nonExistentAttribute;</script>";
std::string GetHTMLForBrowserPluginObject() {
return base::StringPrintf(kHTMLForBrowserPluginObject,
kBrowserPluginMimeType);
}
} // namespace
// Test factory for creating test instances of BrowserPluginManager.
class TestBrowserPluginManagerFactory : public BrowserPluginManagerFactory {
public:
virtual MockBrowserPluginManager* CreateBrowserPluginManager(
RenderViewImpl* render_view) OVERRIDE {
return new MockBrowserPluginManager(render_view);
}
// Singleton getter.
static TestBrowserPluginManagerFactory* GetInstance() {
return Singleton<TestBrowserPluginManagerFactory>::get();
}
protected:
TestBrowserPluginManagerFactory() {}
virtual ~TestBrowserPluginManagerFactory() {}
private:
// For Singleton.
friend struct DefaultSingletonTraits<TestBrowserPluginManagerFactory>;
DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginManagerFactory);
};
BrowserPluginTest::BrowserPluginTest() {}
BrowserPluginTest::~BrowserPluginTest() {}
void BrowserPluginTest::SetUp() {
BrowserPluginManager::set_factory_for_testing(
TestBrowserPluginManagerFactory::GetInstance());
content::RenderViewTest::SetUp();
}
void BrowserPluginTest::TearDown() {
BrowserPluginManager::set_factory_for_testing(
TestBrowserPluginManagerFactory::GetInstance());
#if defined(LEAK_SANITIZER)
// Do this before shutting down V8 in RenderViewTest::TearDown().
// http://crbug.com/328552
__lsan_do_leak_check();
#endif
RenderViewTest::TearDown();
}
std::string BrowserPluginTest::ExecuteScriptAndReturnString(
const std::string& script) {
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Handle<v8::Value> value = GetMainFrame()->executeScriptAndReturnValue(
blink::WebScriptSource(blink::WebString::fromUTF8(script.c_str())));
if (value.IsEmpty() || !value->IsString())
return std::string();
v8::Local<v8::String> v8_str = value->ToString();
int length = v8_str->Utf8Length() + 1;
scoped_ptr<char[]> str(new char[length]);
v8_str->WriteUtf8(str.get(), length);
return str.get();
}
int BrowserPluginTest::ExecuteScriptAndReturnInt(
const std::string& script) {
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Handle<v8::Value> value = GetMainFrame()->executeScriptAndReturnValue(
blink::WebScriptSource(blink::WebString::fromUTF8(script.c_str())));
if (value.IsEmpty() || !value->IsInt32())
return 0;
return value->Int32Value();
}
// A return value of false means that a value was not present. The return value
// of the script is stored in |result|
bool BrowserPluginTest::ExecuteScriptAndReturnBool(
const std::string& script, bool* result) {
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Handle<v8::Value> value = GetMainFrame()->executeScriptAndReturnValue(
blink::WebScriptSource(blink::WebString::fromUTF8(script.c_str())));
if (value.IsEmpty() || !value->IsBoolean())
return false;
*result = value->BooleanValue();
return true;
}
MockBrowserPlugin* BrowserPluginTest::GetCurrentPlugin() {
BrowserPluginHostMsg_Attach_Params params;
return GetCurrentPluginWithAttachParams(&params);
}
MockBrowserPlugin* BrowserPluginTest::GetCurrentPluginWithAttachParams(
BrowserPluginHostMsg_Attach_Params* params) {
MockBrowserPlugin* browser_plugin = static_cast<MockBrowserPluginManager*>(
browser_plugin_manager())->last_plugin();
if (!browser_plugin)
return NULL;
browser_plugin->Attach();
int instance_id = 0;
const IPC::Message* msg =
browser_plugin_manager()->sink().GetUniqueMessageMatching(
BrowserPluginHostMsg_Attach::ID);
if (!msg)
return NULL;
PickleIterator iter(*msg);
if (!iter.ReadInt(&instance_id))
return NULL;
if (!IPC::ParamTraits<BrowserPluginHostMsg_Attach_Params>::Read(
msg, &iter, params)) {
return NULL;
}
browser_plugin->OnAttachACK(instance_id);
return browser_plugin;
}
// This test verifies that an initial resize occurs when we instantiate the
// browser plugin.
TEST_F(BrowserPluginTest, InitialResize) {
LoadHTML(GetHTMLForBrowserPluginObject().c_str());
// Verify that the information in Attach is correct.
BrowserPluginHostMsg_Attach_Params params;
MockBrowserPlugin* browser_plugin = GetCurrentPluginWithAttachParams(&params);
EXPECT_EQ(640, params.resize_guest_params.view_size.width());
EXPECT_EQ(480, params.resize_guest_params.view_size.height());
ASSERT_TRUE(browser_plugin);
}
} // namespace content
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BROWSERETEST_H_
#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BROWSERETEST_H_
#include <string>
#include "base/memory/scoped_ptr.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/public/test/render_view_test.h"
#include "content/renderer/browser_plugin/mock_browser_plugin_manager.h"
#include "content/renderer/render_view_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/WebKit/public/web/WebView.h"
class RenderThreadImpl;
namespace content {
class MockBrowserPlugin;
class BrowserPluginTest : public RenderViewTest {
public:
BrowserPluginTest();
virtual ~BrowserPluginTest();
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
MockBrowserPluginManager* browser_plugin_manager() const {
return static_cast<MockBrowserPluginManager*>(
static_cast<RenderViewImpl*>(view_)->GetBrowserPluginManager());
}
std::string ExecuteScriptAndReturnString(const std::string& script);
int ExecuteScriptAndReturnInt(const std::string& script);
bool ExecuteScriptAndReturnBool(const std::string& script, bool* result);
// Returns NULL if there is no plugin.
MockBrowserPlugin* GetCurrentPlugin();
// Returns NULL if there is no plugin.
MockBrowserPlugin* GetCurrentPluginWithAttachParams(
BrowserPluginHostMsg_Attach_Params* params);
};
} // namespace content
#endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BROWSERETEST_H_
......@@ -4,27 +4,18 @@
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread_local.h"
#include "base/values.h"
#include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/public/renderer/render_thread.h"
#include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/browser_plugin/browser_plugin_manager_factory.h"
#include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
namespace content {
// static
BrowserPluginManagerFactory* BrowserPluginManager::factory_ = NULL;
// static
BrowserPluginManager* BrowserPluginManager::Create(
RenderViewImpl* render_view) {
if (factory_)
return factory_->CreateBrowserPluginManager(render_view);
return new BrowserPluginManagerImpl(render_view);
return new BrowserPluginManager(render_view);
}
BrowserPluginManager::BrowserPluginManager(RenderViewImpl* render_view)
......@@ -77,4 +68,40 @@ void BrowserPluginManager::Attach(int browser_plugin_instance_id) {
plugin->Attach();
}
BrowserPlugin* BrowserPluginManager::CreateBrowserPlugin(
RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate) {
return new BrowserPlugin(render_view, frame, delegate.Pass());
}
void BrowserPluginManager::DidCommitCompositorFrame() {
IDMap<BrowserPlugin>::iterator iter(&instances_);
while (!iter.IsAtEnd()) {
iter.GetCurrentValue()->DidCommitCompositorFrame();
iter.Advance();
}
}
bool BrowserPluginManager::OnMessageReceived(
const IPC::Message& message) {
if (BrowserPlugin::ShouldForwardToBrowserPlugin(message)) {
int browser_plugin_instance_id = browser_plugin::kInstanceIDNone;
// All allowed messages must have |browser_plugin_instance_id| as their
// first parameter.
PickleIterator iter(message);
bool success = iter.ReadInt(&browser_plugin_instance_id);
DCHECK(success);
BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id);
if (plugin && plugin->OnMessageReceived(message))
return true;
}
return false;
}
bool BrowserPluginManager::Send(IPC::Message* msg) {
return RenderThread::Get()->Send(msg);
}
} // namespace content
......@@ -8,25 +8,17 @@
#include "base/id_map.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "content/public/renderer/render_view_observer.h"
#include "ipc/ipc_sender.h"
namespace base {
class DictionaryValue;
}
namespace blink {
class WebFrame;
class WebNode;
struct WebPluginParams;
}
namespace content {
class BrowserPlugin;
class BrowserPluginDelegate;
class BrowserPluginManagerFactory;
class RenderViewImpl;
// BrowserPluginManager manages the routing of messages to the appropriate
......@@ -38,22 +30,16 @@ class CONTENT_EXPORT BrowserPluginManager
// Returns the one BrowserPluginManager for this process.
static BrowserPluginManager* Create(RenderViewImpl* render_view);
// Overrides factory for testing. Default (NULL) value indicates regular
// (non-test) environment.
static void set_factory_for_testing(BrowserPluginManagerFactory* factory) {
BrowserPluginManager::factory_ = factory;
}
explicit BrowserPluginManager(RenderViewImpl* render_view);
// Creates a new BrowserPlugin object.
// BrowserPlugin is responsible for associating itself with the
// BrowserPluginManager via AddBrowserPlugin. When it is destroyed, it is
// responsible for removing its association via RemoveBrowserPlugin.
virtual BrowserPlugin* CreateBrowserPlugin(
BrowserPlugin* CreateBrowserPlugin(
RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate) = 0;
scoped_ptr<BrowserPluginDelegate> delegate);
void Attach(int browser_plugin_instance_id);
......@@ -67,10 +53,10 @@ class CONTENT_EXPORT BrowserPluginManager
RenderViewImpl* render_view() const { return render_view_.get(); }
int GetNextInstanceID();
// RenderViewObserver implementation.
// BrowserPluginManager must override the default Send behavior.
virtual bool Send(IPC::Message* msg) OVERRIDE = 0;
// RenderViewObserver override. Call on render thread.
virtual void DidCommitCompositorFrame() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual bool Send(IPC::Message* msg) OVERRIDE;
// Don't destroy the BrowserPluginManager when the RenderViewImpl goes away.
// BrowserPluginManager's lifetime is managed by a reference count. Once
......@@ -82,9 +68,6 @@ class CONTENT_EXPORT BrowserPluginManager
// Friend RefCounted so that the dtor can be non-public.
friend class base::RefCounted<BrowserPluginManager>;
// Static factory instance (always NULL for non-test).
static BrowserPluginManagerFactory* factory_;
virtual ~BrowserPluginManager();
// This map is keyed by guest instance IDs.
IDMap<BrowserPlugin> instances_;
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_FACTORY_H_
#define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_FACTORY_H_
namespace content {
class CONTENT_EXPORT BrowserPluginManagerFactory {
public:
virtual BrowserPluginManager* CreateBrowserPluginManager(
RenderViewImpl* render_view) = 0;
protected:
virtual ~BrowserPluginManagerFactory() {}
};
} // namespace content
#endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_FACTORY_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
#include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/cursors/webcursor.h"
#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/render_thread_impl.h"
#include "ui/gfx/point.h"
namespace content {
BrowserPluginManagerImpl::BrowserPluginManagerImpl(RenderViewImpl* render_view)
: BrowserPluginManager(render_view) {
}
BrowserPluginManagerImpl::~BrowserPluginManagerImpl() {
}
BrowserPlugin* BrowserPluginManagerImpl::CreateBrowserPlugin(
RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate) {
return new BrowserPlugin(render_view, frame, delegate.Pass());
}
bool BrowserPluginManagerImpl::Send(IPC::Message* msg) {
return RenderThread::Get()->Send(msg);
}
bool BrowserPluginManagerImpl::OnMessageReceived(
const IPC::Message& message) {
if (BrowserPlugin::ShouldForwardToBrowserPlugin(message)) {
int browser_plugin_instance_id = browser_plugin::kInstanceIDNone;
// All allowed messages must have |browser_plugin_instance_id| as their
// first parameter.
PickleIterator iter(message);
bool success = iter.ReadInt(&browser_plugin_instance_id);
DCHECK(success);
BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id);
if (plugin && plugin->OnMessageReceived(message))
return true;
}
return false;
}
void BrowserPluginManagerImpl::DidCommitCompositorFrame() {
IDMap<BrowserPlugin>::iterator iter(&instances_);
while (!iter.IsAtEnd()) {
iter.GetCurrentValue()->DidCommitCompositorFrame();
iter.Advance();
}
}
} // namespace content
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_
#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_
#include <map>
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "ui/gfx/size.h"
namespace gfx {
class Point;
}
namespace content {
class BrowserPluginManagerImpl : public BrowserPluginManager {
public:
explicit BrowserPluginManagerImpl(RenderViewImpl* render_view);
// BrowserPluginManager implementation.
virtual BrowserPlugin* CreateBrowserPlugin(
RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate) OVERRIDE;
// IPC::Sender implementation.
virtual bool Send(IPC::Message* msg) OVERRIDE;
// RenderViewObserver override. Call on render thread.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void DidCommitCompositorFrame() OVERRIDE;
private:
virtual ~BrowserPluginManagerImpl();
DISALLOW_COPY_AND_ASSIGN(BrowserPluginManagerImpl);
};
} // namespace content
#endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/browser_plugin/mock_browser_plugin.h"
#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/renderer/render_process_impl.h"
namespace content {
MockBrowserPlugin::MockBrowserPlugin(RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate)
: BrowserPlugin(render_view, frame, delegate.Pass()) {
}
MockBrowserPlugin::~MockBrowserPlugin() {}
} // namespace content
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_H_
#define CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_H_
#include "content/renderer/browser_plugin/browser_plugin.h"
namespace content {
class MockBrowserPlugin : public BrowserPlugin {
public:
MockBrowserPlugin(RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate);
virtual ~MockBrowserPlugin();
// Allow poking at a few private members.
using BrowserPlugin::OnAttachACK;
using BrowserPlugin::guest_crashed_;
};
} // namespace content
#endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/browser_plugin/mock_browser_plugin_manager.h"
#include "base/message_loop/message_loop.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/renderer/browser_plugin/mock_browser_plugin.h"
#include "ipc/ipc_message.h"
namespace content {
MockBrowserPluginManager::MockBrowserPluginManager(
RenderViewImpl* render_view)
: BrowserPluginManager(render_view),
last_plugin_(NULL) {
}
MockBrowserPluginManager::~MockBrowserPluginManager() {
}
BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin(
RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate) {
last_plugin_ = new MockBrowserPlugin(render_view, frame, delegate.Pass());
return last_plugin_;
}
bool MockBrowserPluginManager::Send(IPC::Message* msg) {
// This is a copy-and-paste from MockRenderThread::Send.
// We need to simulate a synchronous channel, thus we are going to receive
// through this function messages, messages with reply and reply messages.
// We can only handle one synchronous message at a time.
if (msg->is_reply()) {
if (reply_deserializer_) {
reply_deserializer_->SerializeOutputParameters(*msg);
reply_deserializer_.reset();
}
} else {
if (msg->is_sync()) {
// We actually need to handle deleting the reply deserializer for sync
// messages.
reply_deserializer_.reset(
static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer());
}
OnMessageReceived(*msg);
}
delete msg;
return true;
}
bool MockBrowserPluginManager::OnMessageReceived(
const IPC::Message& message) {
// Save the message in the sink.
sink_.OnMessageReceived(message);
return false;
}
} // namespace content
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_
#define CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/renderer/browser_plugin_delegate.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_test_sink.h"
namespace content {
class MockBrowserPlugin;
class MockBrowserPluginManager : public BrowserPluginManager {
public:
MockBrowserPluginManager(RenderViewImpl* render_view);
// BrowserPluginManager implementation.
virtual BrowserPlugin* CreateBrowserPlugin(
RenderViewImpl* render_view,
blink::WebFrame* frame,
scoped_ptr<BrowserPluginDelegate> delegate) OVERRIDE;
// Provides access to the messages that have been received by this thread.
IPC::TestSink& sink() { return sink_; }
// RenderViewObserver override.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual bool Send(IPC::Message* msg) OVERRIDE;
// Returns the latest browser plugin that was created by this manager.
MockBrowserPlugin* last_plugin() { return last_plugin_; }
protected:
virtual ~MockBrowserPluginManager();
IPC::TestSink sink_;
// The last known good deserializer for sync messages.
scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_;
MockBrowserPlugin* last_plugin_;
DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager);
};
} // namespace content
#endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_
......@@ -74,7 +74,6 @@
#include "content/renderer/accessibility/renderer_accessibility_focus_only.h"
#include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
#include "content/renderer/devtools/devtools_agent.h"
#include "content/renderer/disambiguation_popup_helper.h"
#include "content/renderer/dom_storage/webstoragenamespace_impl.h"
......
......@@ -26,7 +26,6 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
#include "content/renderer/render_process_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/renderer_main_platform_delegate.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment