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

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

Issue 6813040: Add TopSites::GetTemporaryThumbnailScore(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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/top_sites_unittest.cc
diff --git a/chrome/browser/history/top_sites_unittest.cc b/chrome/browser/history/top_sites_unittest.cc
index a806b8d83fac96d7bdda5c96ab588aca94fcba95..31aea0a3e9d1b0365390f6eaa0f08f1373a33de1 100644
--- a/chrome/browser/history/top_sites_unittest.cc
+++ b/chrome/browser/history/top_sites_unittest.cc
@@ -1095,9 +1095,16 @@ TEST_F(TopSitesTest, AddTemporaryThumbnail) {
thumbnail,
medium_score));
- // We shouldn't get the thumnail back though (the url isn't in to sites yet).
+ // The URL is unknown.
+ EXPECT_FALSE(top_sites()->IsKnownURL(unknown_url));
+ // We should be able to get the thumnail back even if the url isn't in
+ // to sites yet.
scoped_refptr<RefCountedBytes> out;
- EXPECT_FALSE(top_sites()->GetPageThumbnail(unknown_url, &out));
+ EXPECT_TRUE(top_sites()->GetPageThumbnail(unknown_url, &out));
+ EXPECT_TRUE(ThumbnailEqualsBytes(thumbnail, out.get()));
+ ThumbnailScore out_score;
+ EXPECT_TRUE(top_sites()->GetPageThumbnailScore(unknown_url, &out_score));
+ EXPECT_TRUE(medium_score.Equals(out_score));
std::vector<MostVisitedURL> list;
@@ -1108,11 +1115,10 @@ TEST_F(TopSitesTest, AddTemporaryThumbnail) {
mv.redirects.push_back(url1b);
list.push_back(mv);
- // Update URLs. This should result in using thumbnail.
+ // Update URLs. This should result in making the URL known.
SetTopSites(list);
- ASSERT_TRUE(top_sites()->GetPageThumbnail(unknown_url, &out));
- EXPECT_TRUE(ThumbnailEqualsBytes(thumbnail, out.get()));
+ EXPECT_TRUE(top_sites()->IsKnownURL(unknown_url));
}
// Tests variations of blacklisting.

Powered by Google App Engine
This is Rietveld 408576698