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

Unified Diff: chrome/browser/history/expire_history_backend_unittest.cc

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra inclusion from testing_profile.h Created 5 years, 11 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/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 d5e1981671a0e8e177e3819890eb6a92acf630f9..228a6f3c3a81459f407db5cb3e1735760ec401fa 100644
--- a/chrome/browser/history/expire_history_backend_unittest.cc
+++ b/chrome/browser/history/expire_history_backend_unittest.cc
@@ -15,6 +15,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/history/top_sites.h"
+#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/tools/profiles/thumbnail-inl.h"
#include "components/history/core/browser/expire_history_backend.h"
@@ -104,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_;
@@ -133,11 +133,9 @@ class ExpireHistoryTest : public testing::Test,
expirer_.SetDatabases(main_db_.get(), thumb_db_.get());
profile_.CreateTopSites();
profile_.BlockUntilTopSitesLoaded();
- top_sites_ = profile_.GetTopSites();
}
void TearDown() override {
- top_sites_ = NULL;
ClearLastNotifications();
@@ -221,9 +219,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 =
+ TopSitesFactory::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;
@@ -303,7 +303,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 =
+ TopSitesFactory::GetForProfile(&profile_);
+ return top_sites->GetPageThumbnail(url, false, &data);
}
void ExpireHistoryTest::EnsureURLInfoGone(const URLRow& row, bool expired) {
« no previous file with comments | « chrome/browser/extensions/api/top_sites/top_sites_apitest.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698