Index: content/public/test/test_renderer_host.cc |
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc |
index 64faf53cb7f55c65eb54e3015174e14bef7a335e..10acbadc65ddf283415db3ab328784268f875d36 100644 |
--- a/content/public/test/test_renderer_host.cc |
+++ b/content/public/test/test_renderer_host.cc |
@@ -125,10 +125,6 @@ WebContents* RenderViewHostTestHarness::CreateTestWebContents() { |
DCHECK(aura_test_helper_ != NULL); |
#endif |
- // See comment above browser_context_ decl for why we check for NULL here. |
- if (!browser_context_) |
- browser_context_.reset(new TestBrowserContext()); |
- |
// This will be deleted when the WebContentsImpl goes away. |
SiteInstance* instance = SiteInstance::Create(browser_context_.get()); |
@@ -166,6 +162,10 @@ void RenderViewHostTestHarness::SetUp() { |
new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
aura_test_helper_->SetUp(); |
#endif |
+ |
+ DCHECK(!browser_context_); |
+ browser_context_.reset(CreateBrowserContext()); |
+ |
SetContents(CreateTestWebContents()); |
} |
@@ -196,6 +196,10 @@ void RenderViewHostTestHarness::TearDown() { |
thread_bundle_.reset(); |
} |
+BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
+ return new TestBrowserContext(); |
+} |
+ |
void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
RenderProcessHostFactory* factory) { |
rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |