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

Unified Diff: trunk/src/chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 19714004: Revert 213148 "Add asserts to TestingProfile::CreateHistoryServi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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: trunk/src/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
===================================================================
--- trunk/src/chrome/browser/browsing_data/browsing_data_remover_unittest.cc (revision 213150)
+++ trunk/src/chrome/browser/browsing_data/browsing_data_remover_unittest.cc (working copy)
@@ -333,14 +333,11 @@
class RemoveHistoryTester {
public:
- RemoveHistoryTester() : query_url_success_(false), history_service_(NULL) {}
-
- bool Init(TestingProfile* profile) WARN_UNUSED_RESULT {
- if (!profile->CreateHistoryService(true, false))
- return false;
+ explicit RemoveHistoryTester(TestingProfile* profile)
+ : query_url_success_(false) {
+ profile->CreateHistoryService(true, false);
history_service_ = HistoryServiceFactory::GetForProfile(
profile, Profile::EXPLICIT_ACCESS);
- return true;
}
// Returns true, if the given URL exists in the history service.
@@ -829,8 +826,7 @@
}
TEST_F(BrowsingDataRemoverTest, RemoveHistoryForever) {
- RemoveHistoryTester tester;
- ASSERT_TRUE(tester.Init(GetProfile()));
+ RemoveHistoryTester tester(GetProfile());
tester.AddHistory(kOrigin1, base::Time::Now());
ASSERT_TRUE(tester.HistoryContainsURL(kOrigin1));
@@ -844,8 +840,7 @@
}
TEST_F(BrowsingDataRemoverTest, RemoveHistoryForLastHour) {
- RemoveHistoryTester tester;
- ASSERT_TRUE(tester.Init(GetProfile()));
+ RemoveHistoryTester tester(GetProfile());
base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);
@@ -891,8 +886,7 @@
TEST_F(BrowsingDataRemoverTest, RemoveMultipleTypes) {
// Add some history.
- RemoveHistoryTester history_tester;
- ASSERT_TRUE(history_tester.Init(GetProfile()));
+ RemoveHistoryTester history_tester(GetProfile());
history_tester.AddHistory(kOrigin1, base::Time::Now());
ASSERT_TRUE(history_tester.HistoryContainsURL(kOrigin1));
@@ -1294,8 +1288,7 @@
}
TEST_F(BrowsingDataRemoverTest, OriginBasedHistoryRemoval) {
- RemoveHistoryTester tester;
- ASSERT_TRUE(tester.Init(GetProfile()));
+ RemoveHistoryTester tester(GetProfile());
base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);
@@ -1316,8 +1309,7 @@
}
TEST_F(BrowsingDataRemoverTest, OriginAndTimeBasedHistoryRemoval) {
- RemoveHistoryTester tester;
- ASSERT_TRUE(tester.Init(GetProfile()));
+ RemoveHistoryTester tester(GetProfile());
base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);

Powered by Google App Engine
This is Rietveld 408576698