| 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_RENDER_VIEW_TEST_H_ | 5 #ifndef CHROME_TEST_RENDER_VIEW_TEST_H_ |
| 6 #define CHROME_TEST_RENDER_VIEW_TEST_H_ | 6 #define CHROME_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 "chrome/renderer/mock_keyboard.h" | 13 #include "chrome/renderer/mock_keyboard.h" |
| 14 #include "chrome/renderer/mock_render_thread.h" | 14 #include "chrome/renderer/mock_render_thread.h" |
| 15 #include "chrome/renderer/renderer_main_platform_delegate.h" | 15 #include "chrome/renderer/renderer_main_platform_delegate.h" |
| 16 #include "content/common/main_function_params.h" | 16 #include "content/common/main_function_params.h" |
| 17 #include "content/common/native_web_keyboard_event.h" | 17 #include "content/common/native_web_keyboard_event.h" |
| 18 #include "content/common/sandbox_init_wrapper.h" | 18 #include "content/common/sandbox_init_wrapper.h" |
| 19 #include "content/renderer/content_renderer_client.h" | 19 #include "content/renderer/content_renderer_client.h" |
| 20 #include "content/renderer/render_view.h" | 20 #include "content/renderer/render_view.h" |
| 21 #include "content/renderer/renderer_webkitclient_impl.h" | 21 #include "content/renderer/renderer_webkitclient_impl.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 24 | 24 |
| 25 namespace autofill { | 25 namespace autofill { |
| 26 class AutofillAgent; | 26 class AutofillAgent; |
| 27 class PasswordAutofillManager; | 27 class PasswordAutofillManager; |
| 28 } | 28 } |
| 29 |
| 30 class ExtensionDispatcher; |
| 29 class MockRenderProcess; | 31 class MockRenderProcess; |
| 30 | 32 |
| 31 class RenderViewTest : public testing::Test { | 33 class RenderViewTest : public testing::Test { |
| 32 public: | 34 public: |
| 33 // A special WebKitClientImpl class for getting rid off the dependency to the | 35 // A special WebKitClientImpl class for getting rid off the dependency to the |
| 34 // sandbox, which is not available in RenderViewTest. | 36 // sandbox, which is not available in RenderViewTest. |
| 35 class RendererWebKitClientImplNoSandbox : public RendererWebKitClientImpl { | 37 class RendererWebKitClientImplNoSandbox : public RendererWebKitClientImpl { |
| 36 public: | 38 public: |
| 37 virtual WebKit::WebSandboxSupport* sandboxSupport() { | 39 virtual WebKit::WebSandboxSupport* sandboxSupport() { |
| 38 return NULL; | 40 return NULL; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // the element was not found). | 89 // the element was not found). |
| 88 bool SimulateElementClick(const std::string& element_id); | 90 bool SimulateElementClick(const std::string& element_id); |
| 89 | 91 |
| 90 // testing::Test | 92 // testing::Test |
| 91 virtual void SetUp(); | 93 virtual void SetUp(); |
| 92 | 94 |
| 93 virtual void TearDown(); | 95 virtual void TearDown(); |
| 94 | 96 |
| 95 MessageLoop msg_loop_; | 97 MessageLoop msg_loop_; |
| 96 content::ContentRendererClient content_renderer_client_; | 98 content::ContentRendererClient content_renderer_client_; |
| 99 ExtensionDispatcher* extension_dispatcher_; |
| 97 MockRenderThread render_thread_; | 100 MockRenderThread render_thread_; |
| 98 scoped_ptr<MockRenderProcess> mock_process_; | 101 scoped_ptr<MockRenderProcess> mock_process_; |
| 99 scoped_refptr<RenderView> view_; | 102 scoped_refptr<RenderView> view_; |
| 100 RendererWebKitClientImplNoSandbox webkitclient_; | 103 RendererWebKitClientImplNoSandbox webkitclient_; |
| 101 scoped_ptr<MockKeyboard> mock_keyboard_; | 104 scoped_ptr<MockKeyboard> mock_keyboard_; |
| 102 | 105 |
| 103 // Used to setup the process so renderers can run. | 106 // Used to setup the process so renderers can run. |
| 104 scoped_ptr<RendererMainPlatformDelegate> platform_; | 107 scoped_ptr<RendererMainPlatformDelegate> platform_; |
| 105 scoped_ptr<MainFunctionParams> params_; | 108 scoped_ptr<MainFunctionParams> params_; |
| 106 scoped_ptr<CommandLine> command_line_; | 109 scoped_ptr<CommandLine> command_line_; |
| 107 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; | 110 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; |
| 108 | 111 |
| 109 autofill::PasswordAutofillManager* password_autofill_; | 112 autofill::PasswordAutofillManager* password_autofill_; |
| 110 autofill::AutofillAgent* autofill_agent_; | 113 autofill::AutofillAgent* autofill_agent_; |
| 111 }; | 114 }; |
| 112 | 115 |
| 113 #endif // CHROME_TEST_RENDER_VIEW_TEST_H_ | 116 #endif // CHROME_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |