Index: chrome/browser/browsing_data/hosted_apps_counter_unittest.cc |
diff --git a/chrome/browser/browsing_data/hosted_apps_counter_unittest.cc b/chrome/browser/browsing_data/hosted_apps_counter_unittest.cc |
index cc920e5c4d52483edb35703d322f0ca84c9dc789..f20deeaf241277fae87fdd5924b6253940d314d3 100644 |
--- a/chrome/browser/browsing_data/hosted_apps_counter_unittest.cc |
+++ b/chrome/browser/browsing_data/hosted_apps_counter_unittest.cc |
@@ -14,6 +14,7 @@ |
#include "base/values.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/test/base/testing_profile.h" |
+#include "components/browsing_data/browsing_data_utils.h" |
#include "components/crx_file/id_util.h" |
#include "components/prefs/pref_service.h" |
#include "extensions/browser/extension_registry.h" |
@@ -33,7 +34,7 @@ class HostedAppsCounterTest : public testing::Test { |
extension_registry_ = extensions::ExtensionRegistry::Get(profile_.get()); |
SetHostedAppsDeletionPref(true); |
- SetDeletionPeriodPref(BrowsingDataRemover::EVERYTHING); |
+ SetDeletionPeriodPref(EVERYTHING); |
} |
// Adding and removing apps and extensions. ---------------------------------- |
@@ -99,7 +100,7 @@ class HostedAppsCounterTest : public testing::Test { |
GetProfile()->GetPrefs()->SetBoolean(prefs::kDeleteHostedAppsData, value); |
} |
- void SetDeletionPeriodPref(BrowsingDataRemover::TimePeriod period) { |
+ void SetDeletionPeriodPref(TimePeriod period) { |
GetProfile()->GetPrefs()->SetInteger( |
prefs::kDeleteTimePeriod, static_cast<int>(period)); |
} |
@@ -146,10 +147,11 @@ class HostedAppsCounterTest : public testing::Test { |
// Tests that we count the total number of hosted apps correctly. |
TEST_F(HostedAppsCounterTest, Count) { |
- HostedAppsCounter counter; |
- counter.Init(GetProfile(), |
- base::Bind(&HostedAppsCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = GetProfile(); |
+ HostedAppsCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&HostedAppsCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
EXPECT_EQ(0u, GetNumHostedApps()); |
@@ -172,10 +174,11 @@ TEST_F(HostedAppsCounterTest, Count) { |
// Tests that we only count hosted apps, not packaged apps or extensions. |
TEST_F(HostedAppsCounterTest, OnlyHostedApps) { |
- HostedAppsCounter counter; |
- counter.Init(GetProfile(), |
- base::Bind(&HostedAppsCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = GetProfile(); |
+ HostedAppsCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&HostedAppsCounterTest::Callback, base::Unretained(this))); |
AddHostedApp(); // 1 |
AddExtension(); |
@@ -209,10 +212,11 @@ TEST_F(HostedAppsCounterTest, OnlyHostedApps) { |
// Tests that the counter results contain names of the first two hosted apps |
// in lexicographic ordering. |
TEST_F(HostedAppsCounterTest, Examples) { |
- HostedAppsCounter counter; |
- counter.Init(GetProfile(), |
- base::Bind(&HostedAppsCounterTest::Callback, |
- base::Unretained(this))); |
+ Profile* profile = GetProfile(); |
+ HostedAppsCounter counter(profile); |
+ counter.Init( |
+ profile->GetPrefs(), prefs::kDeleteTimePeriod, |
+ base::Bind(&HostedAppsCounterTest::Callback, base::Unretained(this))); |
counter.Restart(); |
EXPECT_EQ(0u, GetExamples().size()); |