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

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

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed deps Created 4 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/browsing_data/cache_counter_browsertest.cc
diff --git a/chrome/browser/browsing_data/cache_counter_browsertest.cc b/chrome/browser/browsing_data/cache_counter_browsertest.cc
index 1b1b67954a194e7941e8e25de6df2ecd7b4153e6..d05a00c4ab986b06012e8a0598777755bdd3866a 100644
--- a/chrome/browser/browsing_data/cache_counter_browsertest.cc
+++ b/chrome/browser/browsing_data/cache_counter_browsertest.cc
@@ -167,10 +167,12 @@ class CacheCounterTest : public InProcessBrowserTest {
// Tests that for the empty cache, the result is zero.
IN_PROC_BROWSER_TEST_F(CacheCounterTest, Empty) {
+ Profile* profile = browser()->profile();
+
CacheCounter counter;
- counter.Init(browser()->profile(),
- base::Bind(&CacheCounterTest::CountingCallback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), prefs::kDeleteTimePeriod,
+ base::Bind(&CacheCounterTest::CountingCallback, base::Unretained(this)));
counter.Restart();
WaitForIOThread();
@@ -181,10 +183,11 @@ IN_PROC_BROWSER_TEST_F(CacheCounterTest, Empty) {
IN_PROC_BROWSER_TEST_F(CacheCounterTest, NonEmpty) {
CreateCacheEntry();
- CacheCounter counter;
- counter.Init(browser()->profile(),
- base::Bind(&CacheCounterTest::CountingCallback,
- base::Unretained(this)));
+ Profile* profile = browser()->profile();
+ CacheCounter counter(profile);
+ counter.Init(
+ profile->GetPrefs(), prefs::kDeleteTimePeriod,
+ base::Bind(&CacheCounterTest::CountingCallback, base::Unretained(this)));
counter.Restart();
WaitForIOThread();
@@ -196,10 +199,11 @@ IN_PROC_BROWSER_TEST_F(CacheCounterTest, NonEmpty) {
IN_PROC_BROWSER_TEST_F(CacheCounterTest, AfterDoom) {
CreateCacheEntry();
- CacheCounter counter;
- counter.Init(browser()->profile(),
- base::Bind(&CacheCounterTest::CountingCallback,
- base::Unretained(this)));
+ Profile* profile = browser()->profile(0);
+ CacheCounter counter(profile);
+ counter.Init(
+ profile->GetPrefs(), prefs::kDeleteTimePeriod,
+ base::Bind(&CacheCounterTest::CountingCallback, base::Unretained(this)));
browsing_data::StoragePartitionHttpCacheDataRemover::CreateForRange(
content::BrowserContext::GetDefaultStoragePartition(browser()->profile()),
@@ -217,10 +221,11 @@ IN_PROC_BROWSER_TEST_F(CacheCounterTest, AfterDoom) {
IN_PROC_BROWSER_TEST_F(CacheCounterTest, PrefChanged) {
SetCacheDeletionPref(false);
- CacheCounter counter;
- counter.Init(browser()->profile(),
- base::Bind(&CacheCounterTest::CountingCallback,
- base::Unretained(this)));
+ Profile* profile = browser()->profile();
+ CacheCounter counter(profile);
+ counter.Init(
+ profile->GetPrefs(), prefs::kDeleteTimePeriod,
+ base::Bind(&CacheCounterTest::CountingCallback, base::Unretained(this)));
SetCacheDeletionPref(true);
WaitForIOThread();
@@ -231,10 +236,11 @@ IN_PROC_BROWSER_TEST_F(CacheCounterTest, PrefChanged) {
IN_PROC_BROWSER_TEST_F(CacheCounterTest, PrefIsFalse) {
SetCacheDeletionPref(false);
- CacheCounter counter;
- counter.Init(browser()->profile(),
- base::Bind(&CacheCounterTest::CountingCallback,
- base::Unretained(this)));
+ Profile* profile = browser()->profile();
+ CacheCounter counte(profile);
+ counter.Init(
+ profile->GetPrefs(), prefs::kDeleteTimePeriod,
+ base::Bind(&CacheCounterTest::CountingCallback, base::Unretained(this)));
counter.Restart();
EXPECT_FALSE(counter.Pending());
@@ -247,10 +253,11 @@ IN_PROC_BROWSER_TEST_F(CacheCounterTest, PrefIsFalse) {
IN_PROC_BROWSER_TEST_F(CacheCounterTest, PeriodChanged) {
CreateCacheEntry();
+ Profile* profile = browser()->profile();
CacheCounter counter;
- counter.Init(browser()->profile(),
- base::Bind(&CacheCounterTest::CountingCallback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), prefs::kDeleteTimePeriod,
+ base::Bind(&CacheCounterTest::CountingCallback, base::Unretained(this)));
SetDeletionPeriodPref(BrowsingDataRemover::LAST_HOUR);
WaitForIOThread();

Powered by Google App Engine
This is Rietveld 408576698