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

Side by Side Diff: components/ntp_tiles/popular_sites_impl_unittest.cc

Issue 2841643005: [Popular Sites] Add Variations parameter to override URL path (Closed)
Patch Set: Update ntp-tiles-internals. 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 unified diff | Download patch
« no previous file with comments | « components/ntp_tiles/popular_sites_impl.cc ('k') | components/ntp_tiles/pref_names.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ntp_tiles/popular_sites_impl.h" 5 #include "components/ntp_tiles/popular_sites_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 // Second request refetches ZZ_9, which now has data. 451 // Second request refetches ZZ_9, which now has data.
452 RespondWithJSON( 452 RespondWithJSON(
453 "https://www.gstatic.com/chrome/ntp/suggested_sites_ZZ_9.json", 453 "https://www.gstatic.com/chrome/ntp/suggested_sites_ZZ_9.json",
454 {kChromium}); 454 {kChromium});
455 EXPECT_THAT(FetchPopularSites(/*force_download=*/false, &sites), 455 EXPECT_THAT(FetchPopularSites(/*force_download=*/false, &sites),
456 Eq(base::Optional<bool>(true))); 456 Eq(base::Optional<bool>(true)));
457 ASSERT_THAT(sites.size(), Eq(1u)); 457 ASSERT_THAT(sites.size(), Eq(1u));
458 EXPECT_THAT(sites[0].url, URLEq("https://www.chromium.org/")); 458 EXPECT_THAT(sites[0].url, URLEq("https://www.chromium.org/"));
459 } 459 }
460 460
461 TEST_F(PopularSitesTest, ShouldOverrideDirectory) {
462 SetCountryAndVersion("ZZ", "9");
463 prefs_->SetString(prefs::kPopularSitesOverrideDirectory, "foo/bar/");
464 RespondWithJSON("https://www.gstatic.com/foo/bar/suggested_sites_ZZ_9.json",
465 {kWikipedia});
466
467 PopularSites::SitesVector sites;
468 EXPECT_THAT(FetchPopularSites(/*force_download=*/false, &sites),
469 Eq(base::Optional<bool>(true)));
470
471 EXPECT_THAT(sites.size(), Eq(1u));
472 }
473
461 } // namespace 474 } // namespace
462 } // namespace ntp_tiles 475 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « components/ntp_tiles/popular_sites_impl.cc ('k') | components/ntp_tiles/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698