| Index: chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| index 03b176a28e020cbcc5173eaeb3b360bfd0595d07..a5cc61b4956988f052815b4d8b1fb8eb612212e8 100644
|
| --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
|
| @@ -335,11 +335,14 @@ class RemoveServerBoundCertTester : public net::SSLConfigService::Observer {
|
|
|
| class RemoveHistoryTester {
|
| public:
|
| - explicit RemoveHistoryTester(TestingProfile* profile)
|
| - : query_url_success_(false) {
|
| - profile->CreateHistoryService(true, false);
|
| + RemoveHistoryTester() : query_url_success_(false) {}
|
| +
|
| + bool Initialize(TestingProfile* profile) WARN_UNUSED_RESULT {
|
| + if (!profile->CreateHistoryService(true, false))
|
| + return false;
|
| history_service_ = HistoryServiceFactory::GetForProfile(
|
| profile, Profile::EXPLICIT_ACCESS);
|
| + return true;
|
| }
|
|
|
| // Returns true, if the given URL exists in the history service.
|
| @@ -828,7 +831,8 @@ TEST_F(BrowsingDataRemoverTest, RemoveLocalStorageForLastWeek) {
|
| }
|
|
|
| TEST_F(BrowsingDataRemoverTest, RemoveHistoryForever) {
|
| - RemoveHistoryTester tester(GetProfile());
|
| + RemoveHistoryTester tester;
|
| + ASSERT_TRUE(tester.Initialize(GetProfile()));
|
|
|
| tester.AddHistory(kOrigin1, base::Time::Now());
|
| ASSERT_TRUE(tester.HistoryContainsURL(kOrigin1));
|
| @@ -842,7 +846,8 @@ TEST_F(BrowsingDataRemoverTest, RemoveHistoryForever) {
|
| }
|
|
|
| TEST_F(BrowsingDataRemoverTest, RemoveHistoryForLastHour) {
|
| - RemoveHistoryTester tester(GetProfile());
|
| + RemoveHistoryTester tester;
|
| + ASSERT_TRUE(tester.Initialize(GetProfile()));
|
|
|
| base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);
|
|
|
| @@ -888,7 +893,8 @@ TEST_F(BrowsingDataRemoverTest, RemoveHistoryProhibited) {
|
|
|
| TEST_F(BrowsingDataRemoverTest, RemoveMultipleTypes) {
|
| // Add some history.
|
| - RemoveHistoryTester history_tester(GetProfile());
|
| + RemoveHistoryTester history_tester;
|
| + ASSERT_TRUE(history_tester.Initialize(GetProfile()));
|
| history_tester.AddHistory(kOrigin1, base::Time::Now());
|
| ASSERT_TRUE(history_tester.HistoryContainsURL(kOrigin1));
|
|
|
| @@ -1290,7 +1296,8 @@ TEST_F(BrowsingDataRemoverTest, RemoveQuotaManagedIgnoreExtensionsAndDevTools) {
|
| }
|
|
|
| TEST_F(BrowsingDataRemoverTest, OriginBasedHistoryRemoval) {
|
| - RemoveHistoryTester tester(GetProfile());
|
| + RemoveHistoryTester tester;
|
| + ASSERT_TRUE(tester.Initialize(GetProfile()));
|
|
|
| base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);
|
|
|
| @@ -1311,7 +1318,8 @@ TEST_F(BrowsingDataRemoverTest, OriginBasedHistoryRemoval) {
|
| }
|
|
|
| TEST_F(BrowsingDataRemoverTest, OriginAndTimeBasedHistoryRemoval) {
|
| - RemoveHistoryTester tester(GetProfile());
|
| + RemoveHistoryTester tester;
|
| + ASSERT_TRUE(tester.Initialize(GetProfile()));
|
|
|
| base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);
|
|
|
|
|