| 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 a5e9eee453dcc0706edc707d6641da296fe7db6a..1fe773ec8a940b8ba8714fb66556a32a6ad0faed 100644
|
| --- a/chrome/browser/history/top_sites_unittest.cc
|
| +++ b/chrome/browser/history/top_sites_unittest.cc
|
| @@ -858,59 +858,6 @@ TEST_F(TopSitesTest, DeleteNotifications) {
|
| }
|
| }
|
|
|
| -TEST_F(TopSitesTest, PinnedURLsDeleted) {
|
| - GURL google1_url("http://google.com");
|
| - GURL google2_url("http://google.com/redirect");
|
| - GURL google3_url("http://www.google.com");
|
| - string16 google_title(ASCIIToUTF16("Google"));
|
| - GURL news_url("http://news.google.com");
|
| - string16 news_title(ASCIIToUTF16("Google News"));
|
| -
|
| - AddPageToHistory(google1_url, google_title);
|
| - AddPageToHistory(news_url, news_title);
|
| -
|
| - RefreshTopSitesAndRecreate();
|
| -
|
| - {
|
| - TopSitesQuerier querier;
|
| - querier.QueryTopSites(top_sites(), false);
|
| -
|
| - // Take into account prepopulated URLs.
|
| - ASSERT_EQ(GetPrepopulatePages().size() + 2, querier.urls().size());
|
| - }
|
| -
|
| - top_sites()->AddPinnedURL(news_url, 3);
|
| - EXPECT_TRUE(top_sites()->IsURLPinned(news_url));
|
| -
|
| - DeleteURL(news_url);
|
| - WaitForHistory();
|
| -
|
| - {
|
| - TopSitesQuerier querier;
|
| - querier.QueryTopSites(top_sites(), false);
|
| -
|
| - // Take into account prepopulated URLs.
|
| - ASSERT_EQ(GetPrepopulatePages().size() + 1, querier.urls().size());
|
| - EXPECT_FALSE(top_sites()->IsURLPinned(news_url));
|
| - }
|
| -
|
| - history_service()->ExpireHistoryBetween(
|
| - std::set<GURL>(), base::Time(), base::Time(),
|
| - consumer(), base::Bind(&TopSitesTest::EmptyCallback,
|
| - base::Unretained(this))),
|
| - WaitForHistory();
|
| -
|
| - {
|
| - TopSitesQuerier querier;
|
| - querier.QueryTopSites(top_sites(), false);
|
| -
|
| - // Take into account prepopulated URLs.
|
| - ASSERT_EQ(GetPrepopulatePages().size(), querier.urls().size());
|
| - EXPECT_FALSE(top_sites()->IsURLPinned(google1_url));
|
| - ASSERT_NO_FATAL_FAILURE(ContainsPrepopulatePages(querier, 0));
|
| - }
|
| -}
|
| -
|
| // Makes sure GetUpdateDelay is updated appropriately.
|
| TEST_F(TopSitesTest, GetUpdateDelay) {
|
| SetLastNumUrlsChanged(0);
|
| @@ -1207,104 +1154,6 @@ TEST_F(TopSitesTest, Blacklisting) {
|
| }
|
| }
|
|
|
| -// Tests variations of pinning/unpinning urls.
|
| -TEST_F(TopSitesTest, PinnedURLs) {
|
| - MostVisitedURLList pages;
|
| - MostVisitedURL url, url1;
|
| - url.url = GURL("http://bbc.com/");
|
| - url.redirects.push_back(url.url);
|
| - pages.push_back(url);
|
| - url1.url = GURL("http://google.com/");
|
| - url1.redirects.push_back(url1.url);
|
| - pages.push_back(url1);
|
| -
|
| - SetTopSites(pages);
|
| -
|
| - EXPECT_FALSE(top_sites()->IsURLPinned(GURL("http://bbc.com/")));
|
| -
|
| - {
|
| - TopSitesQuerier q;
|
| - q.QueryTopSites(top_sites(), true);
|
| - ASSERT_EQ(2u + GetPrepopulatePages().size(), q.urls().size());
|
| - EXPECT_EQ("http://bbc.com/", q.urls()[0].url.spec());
|
| - EXPECT_EQ("http://google.com/", q.urls()[1].url.spec());
|
| - ASSERT_NO_FATAL_FAILURE(ContainsPrepopulatePages(q, 2));
|
| - }
|
| -
|
| - top_sites()->AddPinnedURL(GURL("http://google.com/"), 3);
|
| - EXPECT_FALSE(top_sites()->IsURLPinned(GURL("http://bbc.com/")));
|
| - EXPECT_FALSE(top_sites()->IsURLPinned(GetPrepopulatePages()[0].url));
|
| -
|
| - {
|
| - TopSitesQuerier q;
|
| - q.QueryTopSites(top_sites(), true);
|
| - ASSERT_EQ(4u, q.urls().size());
|
| - EXPECT_EQ("http://bbc.com/", q.urls()[0].url.spec());
|
| - ASSERT_NO_FATAL_FAILURE(ContainsPrepopulatePages(q, 1));
|
| - EXPECT_EQ("http://google.com/", q.urls()[3].url.spec());
|
| - }
|
| -
|
| - top_sites()->RemovePinnedURL(GURL("http://google.com/"));
|
| - EXPECT_FALSE(top_sites()->IsURLPinned(GURL("http://google.com/")));
|
| - {
|
| - TopSitesQuerier q;
|
| - q.QueryTopSites(top_sites(), true);
|
| -
|
| - ASSERT_EQ(2u + GetPrepopulatePages().size(), q.urls().size());
|
| - EXPECT_EQ("http://bbc.com/", q.urls()[0].url.spec());
|
| - EXPECT_EQ("http://google.com/", q.urls()[1].url.spec());
|
| - ASSERT_NO_FATAL_FAILURE(ContainsPrepopulatePages(q, 2));
|
| - }
|
| -
|
| - GURL prepopulate_url = GetPrepopulatePages()[0].url;
|
| - top_sites()->AddPinnedURL(GURL("http://bbc.com"), 1);
|
| - top_sites()->AddPinnedURL(prepopulate_url, 0);
|
| - {
|
| - TopSitesQuerier q;
|
| - q.QueryTopSites(top_sites(), true);
|
| -
|
| - ASSERT_EQ(3u + GetPrepopulatePages().size() - 1, q.urls().size());
|
| - EXPECT_EQ(prepopulate_url, q.urls()[0].url);
|
| - EXPECT_EQ("http://bbc.com/", q.urls()[1].url.spec());
|
| - EXPECT_EQ("http://google.com/", q.urls()[2].url.spec());
|
| - if (GetPrepopulatePages().size() > 1)
|
| - EXPECT_EQ(GetPrepopulatePages()[1].url, q.urls()[3].url);
|
| - }
|
| -
|
| - // Recreate and make sure state remains the same.
|
| - RecreateTopSitesAndBlock();
|
| - {
|
| - TopSitesQuerier q;
|
| - q.QueryTopSites(top_sites(), true);
|
| -
|
| - ASSERT_EQ(3u + GetPrepopulatePages().size() - 1, q.urls().size());
|
| - EXPECT_EQ(prepopulate_url, q.urls()[0].url);
|
| - EXPECT_EQ("http://bbc.com/", q.urls()[1].url.spec());
|
| - EXPECT_EQ("http://google.com/", q.urls()[2].url.spec());
|
| - if (GetPrepopulatePages().size() > 1)
|
| - EXPECT_EQ(GetPrepopulatePages()[1].url, q.urls()[3].url);
|
| - }
|
| -}
|
| -
|
| -// Tests blacklisting and pinning.
|
| -TEST_F(TopSitesTest, BlacklistingAndPinnedURLs) {
|
| - MostVisitedURLList prepopulate_urls = GetPrepopulatePages();
|
| - if (prepopulate_urls.size() < 2)
|
| - return;
|
| -
|
| - top_sites()->AddPinnedURL(prepopulate_urls[0].url, 1);
|
| - top_sites()->AddBlacklistedURL(prepopulate_urls[1].url);
|
| -
|
| - {
|
| - TopSitesQuerier q;
|
| - q.QueryTopSites(top_sites(), true);
|
| -
|
| - ASSERT_LE(2u, q.urls().size());
|
| - EXPECT_EQ(GURL(), q.urls()[0].url);
|
| - EXPECT_EQ(prepopulate_urls[0].url, q.urls()[1].url);
|
| - }
|
| -}
|
| -
|
| // Makes sure prepopulated pages exist.
|
| TEST_F(TopSitesTest, AddPrepopulatedPages) {
|
| TopSitesQuerier q;
|
|
|