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

Unified Diff: components/autofill/core/browser/autofill_manager_unittest.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: components/autofill/core/browser/autofill_manager_unittest.cc
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index 3f8497f4f2a70ccd0bab3963d5c2d80e6590f84d..d133cf3c5b68d31bedbc4f1aaeb1a9398b59fbf9 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -734,17 +734,15 @@ class TestAutofillExternalDelegate : public AutofillExternalDelegate {
class AutofillManagerTest : public ChromeRenderViewHostTestHarness {
public:
virtual void SetUp() OVERRIDE {
- TestingProfile* profile = CreateProfile();
- profile->CreateRequestContext();
- browser_context_.reset(profile);
+ ChromeRenderViewHostTestHarness::SetUp();
+
autofill::PersonalDataManagerFactory::GetInstance()->SetTestingFactory(
- profile, TestPersonalDataManager::Build);
+ profile(), TestPersonalDataManager::Build);
- ChromeRenderViewHostTestHarness::SetUp();
autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents());
- personal_data_.SetBrowserContext(profile);
+ personal_data_.SetBrowserContext(profile());
autofill_driver_.reset(new MockAutofillDriver(web_contents()));
autofill_manager_.reset(new TestAutofillManager(
autofill_driver_.get(),
@@ -772,8 +770,10 @@ class AutofillManagerTest : public ChromeRenderViewHostTestHarness {
personal_data_.SetBrowserContext(NULL);
}
- virtual TestingProfile* CreateProfile() {
- return new TestingProfile();
+ virtual content::BrowserContext* CreateBrowserContext() OVERRIDE {
+ TestingProfile* profile = new TestingProfile();
+ profile->CreateRequestContext();
+ return profile;
}
void GetAutofillSuggestions(int query_id,

Powered by Google App Engine
This is Rietveld 408576698