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