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

Side by Side Diff: chrome/test/base/chrome_render_view_test.cc

Issue 2085443002: Remove the need for copy-pasting code in ChromeRenderViewTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove one more forgotten include. Created 4 years, 6 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
« no previous file with comments | « chrome/test/base/chrome_render_view_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/test/base/chrome_render_view_test.h" 5 #include "chrome/test/base/chrome_render_view_test.h"
6 6
7 #include "base/debug/leak_annotations.h" 7 #include "base/debug/leak_annotations.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 content::ContentBrowserClient* 132 content::ContentBrowserClient*
133 ChromeRenderViewTest::CreateContentBrowserClient() { 133 ChromeRenderViewTest::CreateContentBrowserClient() {
134 return new ChromeContentBrowserClient(); 134 return new ChromeContentBrowserClient();
135 } 135 }
136 136
137 content::ContentRendererClient* 137 content::ContentRendererClient*
138 ChromeRenderViewTest::CreateContentRendererClient() { 138 ChromeRenderViewTest::CreateContentRendererClient() {
139 ChromeContentRendererClient* client = new ChromeContentRendererClient(); 139 ChromeContentRendererClient* client = new ChromeContentRendererClient();
140 InitChromeContentRendererClient(client);
141 return client;
142 }
143
144 void ChromeRenderViewTest::InitChromeContentRendererClient(
145 ChromeContentRendererClient* client) {
140 #if defined(ENABLE_EXTENSIONS) 146 #if defined(ENABLE_EXTENSIONS)
141 extension_dispatcher_delegate_.reset( 147 extension_dispatcher_delegate_.reset(
142 new ChromeExtensionsDispatcherDelegate()); 148 new ChromeExtensionsDispatcherDelegate());
143 ChromeExtensionsRendererClient* ext_client = 149 ChromeExtensionsRendererClient* ext_client =
144 ChromeExtensionsRendererClient::GetInstance(); 150 ChromeExtensionsRendererClient::GetInstance();
145 ext_client->SetExtensionDispatcherForTest(base::WrapUnique( 151 ext_client->SetExtensionDispatcherForTest(base::WrapUnique(
146 new extensions::Dispatcher(extension_dispatcher_delegate_.get()))); 152 new extensions::Dispatcher(extension_dispatcher_delegate_.get())));
147 #endif 153 #endif
148 #if defined(ENABLE_SPELLCHECK) 154 #if defined(ENABLE_SPELLCHECK)
149 client->SetSpellcheck(new SpellCheck()); 155 client->SetSpellcheck(new SpellCheck());
150 #endif 156 #endif
151 return client;
152 } 157 }
153 158
154 void ChromeRenderViewTest::EnableUserGestureSimulationForAutofill() { 159 void ChromeRenderViewTest::EnableUserGestureSimulationForAutofill() {
155 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)), 160 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
156 IsUserGesture()).WillRepeatedly(Return(true)); 161 IsUserGesture()).WillRepeatedly(Return(true));
157 } 162 }
158 163
159 void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() { 164 void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() {
160 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)), 165 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
161 IsUserGesture()).WillRepeatedly(Return(false)); 166 IsUserGesture()).WillRepeatedly(Return(false));
162 } 167 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_render_view_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698