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

Unified Diff: content/public/test/test_renderer_host.cc

Issue 18068017: Change RenderViewHostTestHarness to create BrowserContext after thread startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/test_renderer_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « content/public/test/test_renderer_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698