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

Unified Diff: components/ntp_tiles/popular_sites_impl_unittest.cc

Issue 2841643005: [Popular Sites] Add Variations parameter to override URL path (Closed)
Patch Set: Created 3 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: components/ntp_tiles/popular_sites_impl_unittest.cc
diff --git a/components/ntp_tiles/popular_sites_impl_unittest.cc b/components/ntp_tiles/popular_sites_impl_unittest.cc
index 1deff6bd575927161c6b359c202d504d7595a3c4..7e94dcc0aee7e44a3cf5d5031e2fd5bca9699512 100644
--- a/components/ntp_tiles/popular_sites_impl_unittest.cc
+++ b/components/ntp_tiles/popular_sites_impl_unittest.cc
@@ -458,5 +458,18 @@ TEST_F(PopularSitesTest, RefetchesAfterFallback) {
EXPECT_THAT(sites[0].url, URLEq("https://www.chromium.org/"));
}
+TEST_F(PopularSitesTest, ShouldOverridePath) {
+ SetCountryAndVersion("ZZ", "9");
+ prefs_->SetString(prefs::kPopularSitesOverridePath, "foo/bar/");
+ RespondWithJSON("https://www.gstatic.com/foo/bar/suggested_sites_ZZ_9.json",
+ {kWikipedia});
+
+ PopularSites::SitesVector sites;
+ EXPECT_THAT(FetchPopularSites(/*force_download=*/false, &sites),
+ Eq(base::Optional<bool>(true)));
+
+ EXPECT_THAT(sites.size(), Eq(1u));
+}
+
} // namespace
} // namespace ntp_tiles

Powered by Google App Engine
This is Rietveld 408576698