summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/expire_history_backend_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/history/expire_history_backend_unittest.cc')
-rw-r--r--chrome/browser/history/expire_history_backend_unittest.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc
index ca822bc..95b391f 100644
--- a/chrome/browser/history/expire_history_backend_unittest.cc
+++ b/chrome/browser/history/expire_history_backend_unittest.cc
@@ -16,8 +16,10 @@
#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/history/text_database_manager.h"
#include "chrome/browser/history/thumbnail_database.h"
+#include "chrome/browser/history/top_sites.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/thumbnail_score.h"
+#include "chrome/test/testing_profile.h"
#include "chrome/tools/profiles/thumbnail-inl.h"
#include "gfx/codec/jpeg_codec.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -90,6 +92,8 @@ class ExpireHistoryTest : public testing::Test,
scoped_ptr<ArchivedDatabase> archived_db_;
scoped_ptr<ThumbnailDatabase> thumb_db_;
scoped_ptr<TextDatabaseManager> text_db_;
+ TestingProfile profile_;
+ scoped_refptr<TopSites> top_sites_;
// Time at the beginning of the test, so everybody agrees what "now" is.
const Time now_;
@@ -134,6 +138,7 @@ class ExpireHistoryTest : public testing::Test,
expirer_.SetDatabases(main_db_.get(), archived_db_.get(), thumb_db_.get(),
text_db_.get());
+ top_sites_ = profile_.GetTopSites();
}
void TearDown() {
@@ -145,6 +150,7 @@ class ExpireHistoryTest : public testing::Test,
archived_db_.reset();
thumb_db_.reset();
text_db_.reset();
+ TopSites::DeleteTopSites(top_sites_);
file_util::Delete(dir_, true);
}
@@ -211,9 +217,9 @@ void ExpireHistoryTest::AddExampleData(URLID url_ids[3], Time visit_times[4]) {
Time time;
GURL gurl;
- thumb_db_->SetPageThumbnail(gurl, url_ids[0], *thumbnail, score, time);
- thumb_db_->SetPageThumbnail(gurl, url_ids[1], *thumbnail, score, time);
- thumb_db_->SetPageThumbnail(gurl, url_ids[2], *thumbnail, score, time);
+ 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;
@@ -271,8 +277,12 @@ bool ExpireHistoryTest::HasFavIcon(FavIconID favicon_id) {
}
bool ExpireHistoryTest::HasThumbnail(URLID url_id) {
- std::vector<unsigned char> temp_data;
- return thumb_db_->GetPageThumbnail(url_id, &temp_data);
+ URLRow info;
+ if (!main_db_->GetURLRow(url_id, &info))
+ return false;
+ GURL url = info.url();
+ RefCountedBytes *data;
+ return top_sites_->GetPageThumbnail(url, &data);
}
int ExpireHistoryTest::CountTextMatchesForURL(const GURL& url) {