| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_TEST_BASE_RENDER_VIEW_TEST_H_ | 5 #ifndef CONTENT_TEST_RENDER_VIEW_TEST_H_ |
| 6 #define CHROME_TEST_BASE_RENDER_VIEW_TEST_H_ | 6 #define CONTENT_TEST_RENDER_VIEW_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "chrome/renderer/autofill/autofill_agent.h" | |
| 15 #include "chrome/renderer/mock_keyboard.h" | |
| 16 #include "chrome/renderer/mock_render_thread.h" | |
| 17 #include "content/common/main_function_params.h" | 14 #include "content/common/main_function_params.h" |
| 18 #include "content/common/native_web_keyboard_event.h" | 15 #include "content/common/native_web_keyboard_event.h" |
| 19 #include "content/common/sandbox_init_wrapper.h" | 16 #include "content/common/sandbox_init_wrapper.h" |
| 17 #include "content/renderer/mock_content_renderer_client.h" |
| 20 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 18 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 21 #include "chrome/renderer/chrome_content_renderer_client.h" | 19 #include "content/test/mock_keyboard.h" |
| 20 #include "content/test/mock_render_thread.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 24 | 23 |
| 25 class ExtensionDispatcher; | |
| 26 class MockRenderProcess; | 24 class MockRenderProcess; |
| 27 class RendererMainPlatformDelegate; | 25 class RendererMainPlatformDelegate; |
| 28 struct ViewMsg_Navigate_Params; | 26 struct ViewMsg_Navigate_Params; |
| 29 | 27 |
| 30 namespace WebKit { | 28 namespace WebKit { |
| 31 class WebWidget; | 29 class WebWidget; |
| 32 } | 30 } |
| 33 | 31 |
| 34 namespace autofill { | |
| 35 class AutofillAgent; | |
| 36 class PasswordAutofillManager; | |
| 37 } | |
| 38 | |
| 39 namespace content { | 32 namespace content { |
| 40 class RenderView; | 33 class RenderView; |
| 41 } | 34 } |
| 42 | 35 |
| 43 namespace gfx { | 36 namespace gfx { |
| 44 class Rect; | 37 class Rect; |
| 45 } | 38 } |
| 46 | 39 |
| 40 namespace content { |
| 41 |
| 47 class RenderViewTest : public testing::Test { | 42 class RenderViewTest : public testing::Test { |
| 48 public: | 43 public: |
| 49 // A special WebKitPlatformSupportImpl class for getting rid off the | 44 // A special WebKitPlatformSupportImpl class for getting rid off the |
| 50 // dependency to the sandbox, which is not available in RenderViewTest. | 45 // dependency to the sandbox, which is not available in RenderViewTest. |
| 51 class RendererWebKitPlatformSupportImplNoSandbox : | 46 class RendererWebKitPlatformSupportImplNoSandbox : |
| 52 public RendererWebKitPlatformSupportImpl { | 47 public RendererWebKitPlatformSupportImpl { |
| 53 public: | 48 public: |
| 54 virtual WebKit::WebSandboxSupport* sandboxSupport() { | 49 virtual WebKit::WebSandboxSupport* sandboxSupport() { |
| 55 return NULL; | 50 return NULL; |
| 56 } | 51 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void DidNavigateWithinPage(WebKit::WebFrame* frame, bool is_new_navigation); | 101 void DidNavigateWithinPage(WebKit::WebFrame* frame, bool is_new_navigation); |
| 107 void SendContentStateImmediately(); | 102 void SendContentStateImmediately(); |
| 108 WebKit::WebWidget* GetWebWidget(); | 103 WebKit::WebWidget* GetWebWidget(); |
| 109 | 104 |
| 110 // testing::Test | 105 // testing::Test |
| 111 virtual void SetUp(); | 106 virtual void SetUp(); |
| 112 | 107 |
| 113 virtual void TearDown(); | 108 virtual void TearDown(); |
| 114 | 109 |
| 115 MessageLoop msg_loop_; | 110 MessageLoop msg_loop_; |
| 116 chrome::ChromeContentRendererClient chrome_content_renderer_client_; | |
| 117 ExtensionDispatcher* extension_dispatcher_; | |
| 118 MockRenderThread render_thread_; | |
| 119 scoped_ptr<MockRenderProcess> mock_process_; | 111 scoped_ptr<MockRenderProcess> mock_process_; |
| 120 // We use a naked pointer because we don't want to expose RenderViewImpl in | 112 // We use a naked pointer because we don't want to expose RenderViewImpl in |
| 121 // the embedder's namespace. | 113 // the embedder's namespace. |
| 122 content::RenderView* view_; | 114 content::RenderView* view_; |
| 123 RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; | 115 RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; |
| 116 MockContentRendererClient mock_content_renderer_client_; |
| 124 scoped_ptr<MockKeyboard> mock_keyboard_; | 117 scoped_ptr<MockKeyboard> mock_keyboard_; |
| 118 scoped_ptr<MockRenderThread> render_thread_; |
| 125 | 119 |
| 126 // Used to setup the process so renderers can run. | 120 // Used to setup the process so renderers can run. |
| 127 scoped_ptr<RendererMainPlatformDelegate> platform_; | 121 scoped_ptr<RendererMainPlatformDelegate> platform_; |
| 128 scoped_ptr<MainFunctionParams> params_; | 122 scoped_ptr<MainFunctionParams> params_; |
| 129 scoped_ptr<CommandLine> command_line_; | 123 scoped_ptr<CommandLine> command_line_; |
| 130 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; | 124 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; |
| 131 | |
| 132 autofill::PasswordAutofillManager* password_autofill_; | |
| 133 autofill::AutofillAgent* autofill_agent_; | |
| 134 }; | 125 }; |
| 135 | 126 |
| 136 #endif // CHROME_TEST_BASE_RENDER_VIEW_TEST_H_ | 127 } // namespace content |
| 128 |
| 129 #endif // CONTENT_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |