Index: chrome/browser/history/expire_history_backend_unittest.cc |
diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc |
index 29b9d436c5578da2eef830215a5888c293a817ff..16c80bdcac286f49595d3d4f3cefa587d41c190d 100644 |
--- a/chrome/browser/history/expire_history_backend_unittest.cc |
+++ b/chrome/browser/history/expire_history_backend_unittest.cc |
@@ -105,7 +105,6 @@ class ExpireHistoryTest : public testing::Test, |
scoped_ptr<HistoryDatabase> main_db_; |
scoped_ptr<ThumbnailDatabase> thumb_db_; |
TestingProfile profile_; |
- scoped_refptr<TopSites> top_sites_; |
// Time at the beginning of the test, so everybody agrees what "now" is. |
const Time now_; |
@@ -138,14 +137,11 @@ class ExpireHistoryTest : public testing::Test, |
thumb_db_.reset(); |
expirer_.SetDatabases(main_db_.get(), thumb_db_.get()); |
- profile_.CreateTopSites(); |
+ profile_.CreateTopSitesService(); |
profile_.BlockUntilTopSitesLoaded(); |
- top_sites_ = profile_.GetTopSites(); |
} |
void TearDown() override { |
- top_sites_ = NULL; |
- |
ClearLastNotifications(); |
expirer_.SetDatabases(NULL, NULL); |
@@ -228,9 +224,11 @@ void ExpireHistoryTest::AddExampleData(URLID url_ids[3], Time visit_times[4]) { |
Time time; |
GURL gurl; |
- top_sites_->SetPageThumbnail(url_row1.url(), thumbnail, score); |
- top_sites_->SetPageThumbnail(url_row2.url(), thumbnail, score); |
- top_sites_->SetPageThumbnail(url_row3.url(), thumbnail, score); |
+ scoped_refptr<history::TopSites> top_sites = |
+ TopSitesServiceFactory::GetForProfile(profile_); |
+ top_sites->SetPageThumbnail(url_row1.url(), thumbnail, score); |
+ top_sites->SetPageThumbnail(url_row2.url(), thumbnail, score); |
+ top_sites->SetPageThumbnail(url_row3.url(), thumbnail, score); |
// Four visits. |
VisitRow visit_row1; |
@@ -310,7 +308,9 @@ bool ExpireHistoryTest::HasThumbnail(URLID url_id) { |
return false; |
GURL url = info.url(); |
scoped_refptr<base::RefCountedMemory> data; |
- return top_sites_->GetPageThumbnail(url, false, &data); |
+ scoped_refptr<history::TopSites> top_sites = |
+ TopSitesServiceFactory::GetForProfile(profile_); |
+ return top_sites->GetPageThumbnail(url, false, &data); |
} |
void ExpireHistoryTest::EnsureURLInfoGone(const URLRow& row, bool expired) { |