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 #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" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 190 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
191 aura_test_helper_->SetUp(context_factory); | 191 aura_test_helper_->SetUp(context_factory); |
192 new wm::DefaultActivationClient(aura_test_helper_->root_window()); | 192 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
193 #endif | 193 #endif |
194 | 194 |
195 DCHECK(!browser_context_); | 195 DCHECK(!browser_context_); |
196 browser_context_.reset(CreateBrowserContext()); | 196 browser_context_.reset(CreateBrowserContext()); |
197 | 197 |
198 SetContents(CreateTestWebContents()); | 198 SetContents(CreateTestWebContents()); |
199 | 199 |
200 if (CommandLine::ForCurrentProcess()->HasSwitch( | 200 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
201 switches::kEnableBrowserSideNavigation)) { | 201 switches::kEnableBrowserSideNavigation)) { |
202 BrowserSideNavigationSetUp(); | 202 BrowserSideNavigationSetUp(); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 void RenderViewHostTestHarness::TearDown() { | 206 void RenderViewHostTestHarness::TearDown() { |
207 if (CommandLine::ForCurrentProcess()->HasSwitch( | 207 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
208 switches::kEnableBrowserSideNavigation)) { | 208 switches::kEnableBrowserSideNavigation)) { |
209 BrowserSideNavigationTearDown(); | 209 BrowserSideNavigationTearDown(); |
210 } | 210 } |
211 | 211 |
212 SetContents(NULL); | 212 SetContents(NULL); |
213 #if defined(USE_AURA) | 213 #if defined(USE_AURA) |
214 aura_test_helper_->TearDown(); | 214 aura_test_helper_->TearDown(); |
215 ui::TerminateContextFactoryForTests(); | 215 ui::TerminateContextFactoryForTests(); |
216 #endif | 216 #endif |
217 // Make sure that we flush any messages related to WebContentsImpl destruction | 217 // Make sure that we flush any messages related to WebContentsImpl destruction |
(...skipping 21 matching lines...) Expand all Loading... |
239 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 239 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
240 return new TestBrowserContext(); | 240 return new TestBrowserContext(); |
241 } | 241 } |
242 | 242 |
243 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 243 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
244 RenderProcessHostFactory* factory) { | 244 RenderProcessHostFactory* factory) { |
245 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 245 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
246 } | 246 } |
247 | 247 |
248 } // namespace content | 248 } // namespace content |
OLD | NEW |