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

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

Issue 3039029: New pinning algorithm. (Closed)
Patch Set: Add missing the else part. Created 10 years, 5 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
« no previous file with comments | « chrome/browser/history/top_sites.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 60d4a8626b85df9b8425dede8a270490c1182cea..c07c6fd9db5975cd43b14c08f5dae97f67fe0abe 100644
--- a/chrome/browser/history/top_sites_unittest.cc
+++ b/chrome/browser/history/top_sites_unittest.cc
@@ -1115,6 +1115,36 @@ TEST_F(TopSitesTest, PinnedURLs) {
EXPECT_EQ("http://google.com/", urls()[1].url.spec());
EXPECT_EQ(welcome_url(), urls()[2].url);
EXPECT_EQ(themes_url(), urls()[3].url);
+
+ top_sites().AddPinnedURL(GURL("http://bbc.com"), 1);
+ top_sites().AddPinnedURL(themes_url(), 0);
+ top_sites().GetMostVisitedURLs(
+ &c,
+ NewCallback(static_cast<TopSitesTest*>(this),
+ &TopSitesTest::OnTopSitesAvailable));
+
+ ASSERT_EQ(4u, urls().size());
+ EXPECT_EQ(themes_url(), urls()[0].url);
+ EXPECT_EQ("http://bbc.com/", urls()[1].url.spec());
+ EXPECT_EQ("http://google.com/", urls()[2].url.spec());
+ EXPECT_EQ(welcome_url(), urls()[3].url);
+
+ top_sites().RemovePinnedURL(GURL("http://bbc.com"));
+ top_sites().RemovePinnedURL(themes_url());
+
+ top_sites().AddPinnedURL(welcome_url(), 1);
+ top_sites().AddPinnedURL(GURL("http://bbc.com"), 3);
+
+ top_sites().GetMostVisitedURLs(
+ &c,
+ NewCallback(static_cast<TopSitesTest*>(this),
+ &TopSitesTest::OnTopSitesAvailable));
+
+ ASSERT_EQ(4u, urls().size());
+ EXPECT_EQ("http://google.com/", urls()[0].url.spec());
+ EXPECT_EQ(welcome_url(), urls()[1].url);
+ EXPECT_EQ(themes_url(), urls()[2].url);
+ EXPECT_EQ("http://bbc.com/", urls()[3].url.spec());
}
TEST_F(TopSitesTest, BlacklistingAndPinnedURLs) {
« no previous file with comments | « chrome/browser/history/top_sites.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698