| 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 CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_ |
| 6 #define CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_ | 6 #define CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/renderer/chrome_mock_render_thread.h" | 11 #include "chrome/renderer/chrome_mock_render_thread.h" |
| 12 #include "content/public/test/render_view_test.h" | 12 #include "content/public/test/render_view_test.h" |
| 13 | 13 |
| 14 class ChromeContentRendererClient; |
| 15 |
| 14 namespace autofill { | 16 namespace autofill { |
| 15 class AutofillAgent; | 17 class AutofillAgent; |
| 16 class TestPasswordAutofillAgent; | 18 class TestPasswordAutofillAgent; |
| 17 class TestPasswordGenerationAgent; | 19 class TestPasswordGenerationAgent; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace extensions { | 22 namespace extensions { |
| 21 class DispatcherDelegate; | 23 class DispatcherDelegate; |
| 22 } | 24 } |
| 23 | 25 |
| 24 class ChromeRenderViewTest : public content::RenderViewTest { | 26 class ChromeRenderViewTest : public content::RenderViewTest { |
| 25 public: | 27 public: |
| 26 ChromeRenderViewTest(); | 28 ChromeRenderViewTest(); |
| 27 ~ChromeRenderViewTest() override; | 29 ~ChromeRenderViewTest() override; |
| 28 | 30 |
| 29 protected: | 31 protected: |
| 30 // testing::Test | 32 // testing::Test |
| 31 void SetUp() override; | 33 void SetUp() override; |
| 32 void TearDown() override; | 34 void TearDown() override; |
| 33 content::ContentClient* CreateContentClient() override; | 35 content::ContentClient* CreateContentClient() override; |
| 34 content::ContentBrowserClient* CreateContentBrowserClient() override; | 36 content::ContentBrowserClient* CreateContentBrowserClient() override; |
| 35 content::ContentRendererClient* CreateContentRendererClient() override; | 37 content::ContentRendererClient* CreateContentRendererClient() override; |
| 36 | 38 |
| 39 // Initializes commonly needed global state and renderer client parts. |
| 40 // Use when overriding CreateContentRendererClient. |
| 41 void InitChromeContentRendererClient(ChromeContentRendererClient* client); |
| 42 |
| 37 void EnableUserGestureSimulationForAutofill(); | 43 void EnableUserGestureSimulationForAutofill(); |
| 38 void DisableUserGestureSimulationForAutofill(); | 44 void DisableUserGestureSimulationForAutofill(); |
| 39 | 45 |
| 40 #if defined(ENABLE_EXTENSIONS) | 46 #if defined(ENABLE_EXTENSIONS) |
| 41 std::unique_ptr<extensions::DispatcherDelegate> | 47 std::unique_ptr<extensions::DispatcherDelegate> |
| 42 extension_dispatcher_delegate_; | 48 extension_dispatcher_delegate_; |
| 43 #endif | 49 #endif |
| 44 | 50 |
| 45 autofill::TestPasswordAutofillAgent* password_autofill_agent_; | 51 autofill::TestPasswordAutofillAgent* password_autofill_agent_; |
| 46 autofill::TestPasswordGenerationAgent* password_generation_; | 52 autofill::TestPasswordGenerationAgent* password_generation_; |
| 47 autofill::AutofillAgent* autofill_agent_; | 53 autofill::AutofillAgent* autofill_agent_; |
| 48 | 54 |
| 49 // Naked pointer as ownership is with content::RenderViewTest::render_thread_. | 55 // Naked pointer as ownership is with content::RenderViewTest::render_thread_. |
| 50 ChromeMockRenderThread* chrome_render_thread_; | 56 ChromeMockRenderThread* chrome_render_thread_; |
| 51 }; | 57 }; |
| 52 | 58 |
| 53 #endif // CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_ | 59 #endif // CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_ |
| OLD | NEW |