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

Unified Diff: components/ntp_tiles/most_visited_sites_unittest.cc

Issue 2577253003: ntp_tiles: Avoid redundant calls to TopSites (Closed)
Patch Set: Renamed weak ptr factory. Created 3 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
« no previous file with comments | « components/ntp_tiles/most_visited_sites.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/most_visited_sites_unittest.cc
diff --git a/components/ntp_tiles/most_visited_sites_unittest.cc b/components/ntp_tiles/most_visited_sites_unittest.cc
index 4273aee782520e4b9ce0b9ab6b2cf4656ce2b19a..eda087ea002db535843d5cb2cb6078d4f163ec8f 100644
--- a/components/ntp_tiles/most_visited_sites_unittest.cc
+++ b/components/ntp_tiles/most_visited_sites_unittest.cc
@@ -371,10 +371,6 @@ TEST_F(MostVisitedSitesWithEmptyCacheTest,
TEST_F(MostVisitedSitesWithEmptyCacheTest,
ShouldExposeTopSitesIfSuggestionsServiceFasterButEmpty) {
// Empty reply from suggestions service causes no update to our observer.
- // However, the current implementation issues a redundant query to TopSites.
- // TODO(mastiz): Avoid this redundant call.
- EXPECT_CALL(*mock_top_sites_, GetMostVisitedURLs(_, false))
- .WillOnce(Invoke(&top_sites_callbacks_, &TopSitesCallbackList::Add));
suggestions_service_callbacks_.Notify(SuggestionsProfile());
VerifyAndClearExpectations();
@@ -382,8 +378,7 @@ TEST_F(MostVisitedSitesWithEmptyCacheTest,
// TODO(mastiz): Avoid a second redundant call to the observer.
EXPECT_CALL(mock_observer_,
OnMostVisitedURLsAvailable(ElementsAre(MatchesTile(
- "Site 1", "http://site1/", NTPTileSource::TOP_SITES))))
- .Times(2);
+ "Site 1", "http://site1/", NTPTileSource::TOP_SITES))));
top_sites_callbacks_.ClearAndNotify(
{MakeMostVisitedURL("Site 1", "http://site1/")});
base::RunLoop().RunUntilIdle();
« no previous file with comments | « components/ntp_tiles/most_visited_sites.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698