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

Unified Diff: chrome/browser/browsing_data/autofill_counter_browsertest.cc

Issue 2153863002: Move counters for passwords, history and autofill to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@separate_build_targets_in_components_bd
Patch Set: Addressed comments Created 4 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/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 c9a39a07328cd40589a50e456b6943935b6cc104..08f8bbefab946a06ae5ae5bf1844b576fec13197 100644
--- a/chrome/browser/browsing_data/autofill_counter_browsertest.cc
+++ b/chrome/browser/browsing_data/autofill_counter_browsertest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/browsing_data/autofill_counter.h"
+#include "components/browsing_data/core/counters/autofill_counter.h"
#include "base/guid.h"
#include "base/macros.h"
@@ -142,6 +142,10 @@ class AutofillCounterTest : public InProcessBrowserTest {
browsing_data::prefs::kDeleteTimePeriod, static_cast<int>(period));
}
+ scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() {
+ return web_data_service_;
+ }
+
// Callback and result retrieval ---------------------------------------------
void WaitForCounting() {
@@ -169,8 +173,9 @@ class AutofillCounterTest : public InProcessBrowserTest {
finished_ = result->Finished();
if (finished_) {
- AutofillCounter::AutofillResult* autofill_result =
- static_cast<AutofillCounter::AutofillResult*>(result.get());
+ browsing_data::AutofillCounter::AutofillResult* autofill_result =
+ static_cast<browsing_data::AutofillCounter::AutofillResult*>(
+ result.get());
num_suggestions_ = autofill_result->Value();
num_credit_cards_ = autofill_result->num_credit_cards();
@@ -203,7 +208,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, PrefIsFalse) {
SetAutofillDeletionPref(false);
Profile* profile = browser()->profile();
- AutofillCounter counter(profile);
+ browsing_data::AutofillCounter counter(GetWebDataService());
counter.Init(profile->GetPrefs(), base::Bind(&AutofillCounterTest::Callback,
base::Unretained(this)));
counter.Restart();
@@ -214,7 +219,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, PrefIsFalse) {
// Tests that we count the correct number of autocomplete suggestions.
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, AutocompleteSuggestions) {
Profile* profile = browser()->profile();
- AutofillCounter counter(profile);
+ browsing_data::AutofillCounter counter(GetWebDataService());
counter.Init(profile->GetPrefs(), base::Bind(&AutofillCounterTest::Callback,
base::Unretained(this)));
counter.Restart();
@@ -250,7 +255,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, AutocompleteSuggestions) {
// Tests that we count the correct number of credit cards.
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, CreditCards) {
Profile* profile = browser()->profile();
- AutofillCounter counter(profile);
+ browsing_data::AutofillCounter counter(GetWebDataService());
counter.Init(profile->GetPrefs(), base::Bind(&AutofillCounterTest::Callback,
base::Unretained(this)));
counter.Restart();
@@ -286,7 +291,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, CreditCards) {
// Tests that we count the correct number of addresses.
IN_PROC_BROWSER_TEST_F(AutofillCounterTest, Addresses) {
Profile* profile = browser()->profile();
- AutofillCounter counter(profile);
+ browsing_data::AutofillCounter counter(GetWebDataService());
counter.Init(profile->GetPrefs(), base::Bind(&AutofillCounterTest::Callback,
base::Unretained(this)));
counter.Restart();
@@ -336,7 +341,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, ComplexResult) {
AddAddress("John", "Smith", "Side Street 47");
Profile* profile = browser()->profile();
- AutofillCounter counter(profile);
+ browsing_data::AutofillCounter counter(GetWebDataService());
counter.Init(profile->GetPrefs(), base::Bind(&AutofillCounterTest::Callback,
base::Unretained(this)));
counter.Restart();
@@ -391,7 +396,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, TimeRanges) {
};
Profile* profile = browser()->profile();
- AutofillCounter counter(profile);
+ browsing_data::AutofillCounter counter(GetWebDataService());
counter.Init(profile->GetPrefs(), base::Bind(&AutofillCounterTest::Callback,
base::Unretained(this)));
« no previous file with comments | « chrome/browser/browsing_data/autofill_counter.cc ('k') | chrome/browser/browsing_data/browsing_data_counter_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698