Index: chrome/browser/browsing_data/autofill_counter_browsertest.cc |
diff --git a/chrome/browser/browsing_data/autofill_counter_browsertest.cc b/chrome/browser/browsing_data/autofill_counter_browsertest.cc |
index 3a03de8220296daa09c8d6d049578623e85c8513..16e8947fbaf3dcd5873082b1cb8ae5d631cdcb1e 100644 |
--- a/chrome/browser/browsing_data/autofill_counter_browsertest.cc |
+++ b/chrome/browser/browsing_data/autofill_counter_browsertest.cc |
@@ -198,10 +198,11 @@ class AutofillCounterTest : public InProcessBrowserTest { |
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, PrefIsFalse) { |
SetAutofillDeletionPref(false); |
- AutofillCounter counter; |
- counter.Init(browser()->profile(), |
- base::Bind(&AutofillCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = browser()->profile(); |
+ AutofillCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&AutofillCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
EXPECT_FALSE(counter.HasPendingQuery()); |
@@ -209,10 +210,11 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, PrefIsFalse) { |
// Tests that we count the correct number of autocomplete suggestions. |
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, AutocompleteSuggestions) { |
- AutofillCounter counter; |
- counter.Init(browser()->profile(), |
- base::Bind(&AutofillCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = browser()->profile(); |
+ AutofillCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&AutofillCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
WaitForCounting(); |
EXPECT_EQ(0, GetNumSuggestions()); |
@@ -245,10 +247,11 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, AutocompleteSuggestions) { |
// Tests that we count the correct number of credit cards. |
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, CreditCards) { |
- AutofillCounter counter; |
- counter.Init(browser()->profile(), |
- base::Bind(&AutofillCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = browser()->profile(); |
+ AutofillCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&AutofillCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
WaitForCounting(); |
EXPECT_EQ(0, GetNumCreditCards()); |
@@ -281,10 +284,11 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, CreditCards) { |
// Tests that we count the correct number of addresses. |
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, Addresses) { |
- AutofillCounter counter; |
- counter.Init(browser()->profile(), |
- base::Bind(&AutofillCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = browser()->profile(); |
+ AutofillCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&AutofillCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
WaitForCounting(); |
EXPECT_EQ(0, GetNumAddresses()); |
@@ -331,10 +335,11 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, ComplexResult) { |
AddAddress("Jane", "Smith", "Main Street 12346"); |
AddAddress("John", "Smith", "Side Street 47"); |
- AutofillCounter counter; |
- counter.Init(browser()->profile(), |
- base::Bind(&AutofillCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = browser()->profile(); |
+ AutofillCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&AutofillCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
WaitForCounting(); |
EXPECT_EQ(5, GetNumSuggestions()); |
@@ -384,10 +389,11 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, TimeRanges) { |
{ time3, 1, 1, 0} |
}; |
- AutofillCounter counter; |
- counter.Init(browser()->profile(), |
- base::Bind(&AutofillCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = browser()->profile(); |
+ AutofillCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&AutofillCounterTest::Callback, base::Unretained(this))); |
for (const TestCase& test_case : test_cases) { |
counter.SetPeriodStartForTesting(test_case.period_start); |