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

Unified Diff: chrome/test/base/chrome_render_view_host_test_harness.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
Index: chrome/test/base/chrome_render_view_host_test_harness.cc
diff --git a/chrome/test/base/chrome_render_view_host_test_harness.cc b/chrome/test/base/chrome_render_view_host_test_harness.cc
index 3ae5c5448382ab1e241521896a7cf986efe42bcc..1dfe006ff5e06a26b274d7c9e2b7ae9e89918394 100644
--- a/chrome/test/base/chrome_render_view_host_test_harness.cc
+++ b/chrome/test/base/chrome_render_view_host_test_harness.cc
@@ -28,7 +28,7 @@ ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() {
}
TestingProfile* ChromeRenderViewHostTestHarness::profile() {
- return static_cast<TestingProfile*>(browser_context_.get());
+ return static_cast<TestingProfile*>(browser_context());
}
RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() {
@@ -50,14 +50,9 @@ static BrowserContextKeyedService* BuildSigninManagerFake(
}
void ChromeRenderViewHostTestHarness::SetUp() {
- Profile* profile = Profile::FromBrowserContext(browser_context_.get());
- if (!profile) {
- profile = new TestingProfile();
- browser_context_.reset(profile);
- }
- SigninManagerFactory::GetInstance()->SetTestingFactory(
- profile, BuildSigninManagerFake);
RenderViewHostTestHarness::SetUp();
+ SigninManagerFactory::GetInstance()->SetTestingFactory(
+ profile(), BuildSigninManagerFake);
}
void ChromeRenderViewHostTestHarness::TearDown() {
@@ -69,3 +64,8 @@ void ChromeRenderViewHostTestHarness::TearDown() {
aura::Env::DeleteInstance();
#endif
}
+
+content::BrowserContext*
+ChromeRenderViewHostTestHarness::CreateBrowserContext() {
+ return new TestingProfile();
+}
« no previous file with comments | « chrome/test/base/chrome_render_view_host_test_harness.h ('k') | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698