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

Unified Diff: chrome/browser/autofill/autofill_metrics_unittest.cc

Issue 11867025: Download autocheckout whitelist and enable autocheckout for whitelisted sites only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head Created 7 years, 10 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 | « chrome/browser/autofill/autofill_metrics.cc ('k') | chrome/browser/autofill/form_structure.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36747ea5bae974634b1424c2537aade6e914929e..e7744a7e6197611b3e8c6472e493e25e35a79c0f 100644
--- a/chrome/browser/autofill/autofill_metrics_unittest.cc
+++ b/chrome/browser/autofill/autofill_metrics_unittest.cc
@@ -148,7 +148,8 @@ class TestPersonalDataManager : public PersonalDataManager {
class TestFormStructure : public FormStructure {
public:
- explicit TestFormStructure(const FormData& form) : FormStructure(form) {}
+ explicit TestFormStructure(const FormData& form)
+ : FormStructure(form, std::string()) {}
virtual ~TestFormStructure() {}
void SetFieldTypes(const std::vector<AutofillFieldType>& heuristic_types,
@@ -300,6 +301,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_;
@@ -315,6 +317,7 @@ AutofillMetricsTest::AutofillMetricsTest()
: ChromeRenderViewHostTestHarness(),
ui_thread_(BrowserThread::UI, &message_loop_),
file_thread_(BrowserThread::FILE),
+ io_thread_(BrowserThread::IO),
autocheckout_manager_(NULL) {
}
@@ -325,11 +328,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(
@@ -358,8 +363,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(
« no previous file with comments | « chrome/browser/autofill/autofill_metrics.cc ('k') | chrome/browser/autofill/form_structure.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698