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); |