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

Unified Diff: chrome/browser/profiles/profile_statistics_unittest.cc

Issue 2915053002: Replace profile statistics preference count with AutofillCounter (Closed)
Patch Set: change to SetBooleanWithoutPathExpansion Created 3 years, 6 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/profiles/profile_statistics_unittest.cc
diff --git a/chrome/browser/profiles/profile_statistics_unittest.cc b/chrome/browser/profiles/profile_statistics_unittest.cc
index 9f607aa07219aed30a02f2918e65560813265533..0c50de4b024aae47a3dba07fa323998a04014573 100644
--- a/chrome/browser/profiles/profile_statistics_unittest.cc
+++ b/chrome/browser/profiles/profile_statistics_unittest.cc
@@ -97,8 +97,9 @@ class ProfileStatisticsTest : public testing::Test {
TEST_F(ProfileStatisticsTest, WaitOrCountBookmarks) {
TestingProfile* profile = manager()->CreateTestingProfile("Test 1");
ASSERT_TRUE(profile);
- // We need a history service and a password store for the test to succeed.
+ // We need history, autofill and password services for the test to succeed.
ASSERT_TRUE(profile->CreateHistoryService(true, false));
+ profile->CreateWebDataService();
PasswordStoreFactory::GetInstance()->SetTestingFactory(
profile,
password_manager::BuildPasswordStore<
@@ -112,10 +113,9 @@ TEST_F(ProfileStatisticsTest, WaitOrCountBookmarks) {
BookmarkStatHelper bookmark_stat_helper;
base::RunLoop run_loop_aggregator_done;
- scoped_refptr<ProfileStatisticsAggregator> aggregator =
- new ProfileStatisticsAggregator(profile,
- run_loop_aggregator_done.QuitClosure());
- aggregator->AddCallbackAndStartAggregator(
+ ProfileStatisticsAggregator aggregator(
+ profile, run_loop_aggregator_done.QuitClosure());
+ aggregator.AddCallbackAndStartAggregator(
base::Bind(&BookmarkStatHelper::StatsCallback,
base::Unretained(&bookmark_stat_helper)));
@@ -125,7 +125,7 @@ TEST_F(ProfileStatisticsTest, WaitOrCountBookmarks) {
EXPECT_EQ(0, bookmark_stat_helper.GetNumOfTimesCalled());
// Run ProfileStatisticsAggregator::WaitOrCountBookmarks again.
- aggregator->AddCallbackAndStartAggregator(
+ aggregator.AddCallbackAndStartAggregator(
profiles::ProfileStatisticsCallback());
// Wait until ProfileStatisticsAggregator::WaitOrCountBookmarks is run.
base::RunLoop run_loop2;
« no previous file with comments | « chrome/browser/profiles/profile_statistics_common.cc ('k') | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698