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

Side by Side Diff: content/public/test/test_renderer_host.cc

Issue 803873004: ContentBrowserSanityChecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jiggle the comments. Created 5 years, 12 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
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 "content/public/test/test_renderer_host.h" 5 #include "content/public/test/test_renderer_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 9 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/renderer_host/render_view_host_factory.h" 10 #include "content/browser/renderer_host/render_view_host_factory.h"
11 #include "content/browser/renderer_host/render_widget_host_impl.h" 11 #include "content/browser/renderer_host/render_widget_host_impl.h"
12 #include "content/browser/site_instance_impl.h" 12 #include "content/browser/site_instance_impl.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "content/public/test/content_browser_sanity_checker.h"
16 #include "content/public/test/mock_render_process_host.h" 17 #include "content/public/test/mock_render_process_host.h"
17 #include "content/public/test/test_browser_context.h" 18 #include "content/public/test/test_browser_context.h"
18 #include "content/test/browser_side_navigation_test_utils.h" 19 #include "content/test/browser_side_navigation_test_utils.h"
19 #include "content/test/test_render_frame_host.h" 20 #include "content/test/test_render_frame_host.h"
20 #include "content/test/test_render_frame_host_factory.h" 21 #include "content/test/test_render_frame_host_factory.h"
21 #include "content/test/test_render_view_host.h" 22 #include "content/test/test_render_view_host.h"
22 #include "content/test/test_render_view_host_factory.h" 23 #include "content/test/test_render_view_host_factory.h"
23 #include "content/test/test_web_contents.h" 24 #include "content/test/test_web_contents.h"
24 25
25 #if defined(OS_WIN) 26 #if defined(OS_WIN)
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 bool enable_pixel_output = false; 186 bool enable_pixel_output = false;
186 ui::ContextFactory* context_factory = 187 ui::ContextFactory* context_factory =
187 ui::InitializeContextFactoryForTests(enable_pixel_output); 188 ui::InitializeContextFactoryForTests(enable_pixel_output);
188 189
189 aura_test_helper_.reset( 190 aura_test_helper_.reset(
190 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); 191 new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
191 aura_test_helper_->SetUp(context_factory); 192 aura_test_helper_->SetUp(context_factory);
192 new wm::DefaultActivationClient(aura_test_helper_->root_window()); 193 new wm::DefaultActivationClient(aura_test_helper_->root_window());
193 #endif 194 #endif
194 195
196 sanity_checker_.reset(new ContentBrowserSanityChecker());
197
195 DCHECK(!browser_context_); 198 DCHECK(!browser_context_);
196 browser_context_.reset(CreateBrowserContext()); 199 browser_context_.reset(CreateBrowserContext());
197 200
198 SetContents(CreateTestWebContents()); 201 SetContents(CreateTestWebContents());
199 202
200 if (CommandLine::ForCurrentProcess()->HasSwitch( 203 if (CommandLine::ForCurrentProcess()->HasSwitch(
201 switches::kEnableBrowserSideNavigation)) { 204 switches::kEnableBrowserSideNavigation)) {
202 BrowserSideNavigationSetUp(); 205 BrowserSideNavigationSetUp();
203 } 206 }
204 } 207 }
(...skipping 30 matching lines...) Expand all
235 browser_context_.release()); 238 browser_context_.release());
236 thread_bundle_.reset(); 239 thread_bundle_.reset();
237 } 240 }
238 241
239 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { 242 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() {
240 return new TestBrowserContext(); 243 return new TestBrowserContext();
241 } 244 }
242 245
243 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 246 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
244 RenderProcessHostFactory* factory) { 247 RenderProcessHostFactory* factory) {
245 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 248 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
246 } 249 }
247 250
248 } // namespace content 251 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698