Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: content/test/render_view_test.h

Issue 8230034: Split most of RenderViewTest and associated classes into content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review! Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 IPC {
41 class Message;
jam 2011/10/13 17:35:32 nit: not needed
Jói 2011/10/13 18:47:27 Done.
42 }
43
44 namespace content {
45
47 class RenderViewTest : public testing::Test { 46 class RenderViewTest : public testing::Test {
48 public: 47 public:
49 // A special WebKitPlatformSupportImpl class for getting rid off the 48 // A special WebKitPlatformSupportImpl class for getting rid off the
50 // dependency to the sandbox, which is not available in RenderViewTest. 49 // dependency to the sandbox, which is not available in RenderViewTest.
51 class RendererWebKitPlatformSupportImplNoSandbox : 50 class RendererWebKitPlatformSupportImplNoSandbox :
52 public RendererWebKitPlatformSupportImpl { 51 public RendererWebKitPlatformSupportImpl {
53 public: 52 public:
54 virtual WebKit::WebSandboxSupport* sandboxSupport() { 53 virtual WebKit::WebSandboxSupport* sandboxSupport() {
55 return NULL; 54 return NULL;
56 } 55 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void DidNavigateWithinPage(WebKit::WebFrame* frame, bool is_new_navigation); 105 void DidNavigateWithinPage(WebKit::WebFrame* frame, bool is_new_navigation);
107 void SendContentStateImmediately(); 106 void SendContentStateImmediately();
108 WebKit::WebWidget* GetWebWidget(); 107 WebKit::WebWidget* GetWebWidget();
109 108
110 // testing::Test 109 // testing::Test
111 virtual void SetUp(); 110 virtual void SetUp();
112 111
113 virtual void TearDown(); 112 virtual void TearDown();
114 113
115 MessageLoop msg_loop_; 114 MessageLoop msg_loop_;
116 chrome::ChromeContentRendererClient chrome_content_renderer_client_;
117 ExtensionDispatcher* extension_dispatcher_;
118 MockRenderThread render_thread_;
119 scoped_ptr<MockRenderProcess> mock_process_; 115 scoped_ptr<MockRenderProcess> mock_process_;
120 // We use a naked pointer because we don't want to expose RenderViewImpl in 116 // We use a naked pointer because we don't want to expose RenderViewImpl in
121 // the embedder's namespace. 117 // the embedder's namespace.
122 content::RenderView* view_; 118 content::RenderView* view_;
123 RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; 119 RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_;
120 MockContentRendererClient mock_content_renderer_client_;
124 scoped_ptr<MockKeyboard> mock_keyboard_; 121 scoped_ptr<MockKeyboard> mock_keyboard_;
122 scoped_ptr<MockRenderThread> render_thread_;
125 123
126 // Used to setup the process so renderers can run. 124 // Used to setup the process so renderers can run.
127 scoped_ptr<RendererMainPlatformDelegate> platform_; 125 scoped_ptr<RendererMainPlatformDelegate> platform_;
128 scoped_ptr<MainFunctionParams> params_; 126 scoped_ptr<MainFunctionParams> params_;
129 scoped_ptr<CommandLine> command_line_; 127 scoped_ptr<CommandLine> command_line_;
130 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; 128 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_;
131
132 autofill::PasswordAutofillManager* password_autofill_;
133 autofill::AutofillAgent* autofill_agent_;
134 }; 129 };
135 130
136 #endif // CHROME_TEST_BASE_RENDER_VIEW_TEST_H_ 131 } // namespace content
132
133 #endif // CONTENT_TEST_RENDER_VIEW_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698