1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BROWSERETEST_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BROWSERETEST_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "content/common/browser_plugin/browser_plugin_messages.h"
12 #include "content/public/test/render_view_test.h"
13 #include "content/renderer/browser_plugin/mock_browser_plugin_manager.h"
14 #include "content/renderer/render_view_impl.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "third_party/WebKit/public/platform/WebSize.h"
17 #include "third_party/WebKit/public/web/WebView.h"
19 class RenderThreadImpl
;
23 class MockBrowserPlugin
;
25 class BrowserPluginTest
: public RenderViewTest
{
28 virtual ~BrowserPluginTest();
30 virtual void SetUp() OVERRIDE
;
31 virtual void TearDown() OVERRIDE
;
32 virtual ContentRendererClient
* CreateContentRendererClient() OVERRIDE
;
34 MockBrowserPluginManager
* browser_plugin_manager() const {
35 return static_cast<MockBrowserPluginManager
*>(
36 static_cast<RenderViewImpl
*>(view_
)->GetBrowserPluginManager());
38 std::string
ExecuteScriptAndReturnString(const std::string
& script
);
39 int ExecuteScriptAndReturnInt(const std::string
& script
);
40 bool ExecuteScriptAndReturnBool(const std::string
& script
, bool* result
);
41 // Returns NULL if there is no plugin.
42 MockBrowserPlugin
* GetCurrentPlugin();
43 // Returns NULL if there is no plugin.
44 MockBrowserPlugin
* GetCurrentPluginWithAttachParams(
45 BrowserPluginHostMsg_Attach_Params
* params
);
48 } // namespace content
50 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BROWSERETEST_H_