Index: chrome/browser/autofill/autofill_metrics_unittest.cc |
diff --git a/chrome/browser/autofill/autofill_metrics_unittest.cc b/chrome/browser/autofill/autofill_metrics_unittest.cc |
index 7ca9144eb5f0b339a7985f87138f9ef7a60838be..ffc8d3fad43c34de53088ec063ef9a0c5acda0bb 100644 |
--- a/chrome/browser/autofill/autofill_metrics_unittest.cc |
+++ b/chrome/browser/autofill/autofill_metrics_unittest.cc |
@@ -147,7 +147,8 @@ class TestPersonalDataManager : public PersonalDataManager { |
class TestFormStructure : public FormStructure { |
public: |
- explicit TestFormStructure(const FormData& form) : FormStructure(form) {} |
+ explicit TestFormStructure(const FormData& form) |
+ : FormStructure(form, false) {} |
virtual ~TestFormStructure() {} |
void SetFieldTypes(const std::vector<AutofillFieldType>& heuristic_types, |
@@ -299,6 +300,7 @@ class AutofillMetricsTest : public ChromeRenderViewHostTestHarness { |
content::TestBrowserThread ui_thread_; |
content::TestBrowserThread file_thread_; |
+ content::TestBrowserThread io_thread_; |
scoped_refptr<TestAutofillManager> autofill_manager_; |
TestAutocheckoutManager autocheckout_manager_; |
@@ -314,6 +316,7 @@ AutofillMetricsTest::AutofillMetricsTest() |
: ChromeRenderViewHostTestHarness(), |
ui_thread_(BrowserThread::UI, &message_loop_), |
file_thread_(BrowserThread::FILE), |
+ io_thread_(BrowserThread::IO), |
autocheckout_manager_(NULL) { |
} |
@@ -324,11 +327,13 @@ AutofillMetricsTest::~AutofillMetricsTest() { |
} |
void AutofillMetricsTest::SetUp() { |
- Profile* profile = new TestingProfile(); |
+ TestingProfile* profile = new TestingProfile(); |
+ profile->CreateRequestContext(); |
browser_context_.reset(profile); |
PersonalDataManagerFactory::GetInstance()->SetTestingFactory(profile, NULL); |
ChromeRenderViewHostTestHarness::SetUp(); |
+ io_thread_.StartIOThread(); |
TabAutofillManagerDelegate::CreateForWebContents(web_contents()); |
personal_data_.SetBrowserContext(profile); |
autofill_manager_ = new TestAutofillManager( |
@@ -357,8 +362,10 @@ void AutofillMetricsTest::TearDown() { |
// AutofillManager is tied to the lifetime of the WebContents, so it must |
// be destroyed at the destruction of the WebContents. |
autofill_manager_ = NULL; |
+ profile()->ResetRequestContext(); |
file_thread_.Stop(); |
ChromeRenderViewHostTestHarness::TearDown(); |
+ io_thread_.Stop(); |
} |
scoped_ptr<ConfirmInfoBarDelegate> AutofillMetricsTest::CreateDelegate( |