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

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

Issue 2671743002: Separate state of basic and advanced tab in CBD dialog (Closed)
Patch Set: rebase and fix compilation Created 3 years, 10 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/history_counter_browsertest.cc
diff --git a/chrome/browser/browsing_data/history_counter_browsertest.cc b/chrome/browser/browsing_data/history_counter_browsertest.cc
index 2fcb864fe3d0edcc24552ce350ea30a79c8fefbd..b5a0a3244582bc063ba0339d03aa3786faa73c38 100644
--- a/chrome/browser/browsing_data/history_counter_browsertest.cc
+++ b/chrome/browser/browsing_data/history_counter_browsertest.cc
@@ -49,7 +49,7 @@ class HistoryCounterTest : public SyncTest {
browser()->profile()->GetRequestContext()));
SetHistoryDeletionPref(true);
- SetDeletionPeriodPref(browsing_data::ALL_TIME);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::ALL_TIME);
}
void AddVisit(const std::string url) {
@@ -181,8 +181,9 @@ IN_PROC_BROWSER_TEST_F(HistoryCounterTest, DuplicateVisits) {
base::Unretained(profile)),
ProfileSyncServiceFactory::GetForProfile(profile));
- counter.Init(profile->GetPrefs(), base::Bind(&HistoryCounterTest::Callback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), browsing_data::ClearBrowsingDataTab::ADVANCED,
+ base::Bind(&HistoryCounterTest::Callback, base::Unretained(this)));
counter.Restart();
WaitForCounting();
@@ -205,8 +206,9 @@ IN_PROC_BROWSER_TEST_F(HistoryCounterTest, PrefChanged) {
base::Unretained(profile)),
ProfileSyncServiceFactory::GetForProfile(profile));
- counter.Init(profile->GetPrefs(), base::Bind(&HistoryCounterTest::Callback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), browsing_data::ClearBrowsingDataTab::ADVANCED,
+ base::Bind(&HistoryCounterTest::Callback, base::Unretained(this)));
SetHistoryDeletionPref(true);
WaitForCounting();
@@ -246,26 +248,27 @@ IN_PROC_BROWSER_TEST_F(HistoryCounterTest, PeriodChanged) {
base::Unretained(profile)),
ProfileSyncServiceFactory::GetForProfile(profile));
- counter.Init(profile->GetPrefs(), base::Bind(&HistoryCounterTest::Callback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), browsing_data::ClearBrowsingDataTab::ADVANCED,
+ base::Bind(&HistoryCounterTest::Callback, base::Unretained(this)));
- SetDeletionPeriodPref(browsing_data::LAST_HOUR);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::LAST_HOUR);
WaitForCounting();
EXPECT_EQ(1u, GetLocalResult());
- SetDeletionPeriodPref(browsing_data::LAST_DAY);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::LAST_DAY);
WaitForCounting();
EXPECT_EQ(1u, GetLocalResult());
- SetDeletionPeriodPref(browsing_data::LAST_WEEK);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::LAST_WEEK);
WaitForCounting();
EXPECT_EQ(5u, GetLocalResult());
- SetDeletionPeriodPref(browsing_data::FOUR_WEEKS);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::FOUR_WEEKS);
WaitForCounting();
EXPECT_EQ(8u, GetLocalResult());
- SetDeletionPeriodPref(browsing_data::ALL_TIME);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::ALL_TIME);
WaitForCounting();
EXPECT_EQ(9u, GetLocalResult());
}
@@ -284,8 +287,9 @@ IN_PROC_BROWSER_TEST_F(HistoryCounterTest, Synced) {
false),
ProfileSyncServiceFactory::GetForProfile(profile));
- counter.Init(profile->GetPrefs(), base::Bind(&HistoryCounterTest::Callback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), browsing_data::ClearBrowsingDataTab::ADVANCED,
+ base::Bind(&HistoryCounterTest::Callback, base::Unretained(this)));
history::FakeWebHistoryService* service =
static_cast<history::FakeWebHistoryService*>(GetFakeWebHistoryService(
@@ -300,7 +304,7 @@ IN_PROC_BROWSER_TEST_F(HistoryCounterTest, Synced) {
// No entries locally. There are some entries in Sync, but they are out of the
// time range.
- SetDeletionPeriodPref(browsing_data::LAST_HOUR);
+ SetDeletionPeriodPref(browsing_data::TimePeriod::LAST_HOUR);
service->AddSyncedVisit(
"www.google.com", GetCurrentTime() - base::TimeDelta::FromHours(2));
service->AddSyncedVisit(
@@ -375,8 +379,9 @@ IN_PROC_BROWSER_TEST_F(HistoryCounterTest, DISABLED_RestartOnSyncChange) {
true),
sync_service);
- counter.Init(profile->GetPrefs(), base::Bind(&HistoryCounterTest::Callback,
- base::Unretained(this)));
+ counter.Init(
+ profile->GetPrefs(), browsing_data::ClearBrowsingDataTab::ADVANCED,
+ base::Bind(&HistoryCounterTest::Callback, base::Unretained(this)));
// Note that some Sync operations notify observers immediately (and thus there
// is no need to call |WaitForCounting()|; in fact, it would block the test),

Powered by Google App Engine
This is Rietveld 408576698