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

Unified Diff: components/ntp_tiles/most_visited_sites_unittest.cc

Issue 2668943002: provide static popular sites for first run (Closed)
Patch Set: Remove unnecessary rebuild. Fix tests. Created 3 years, 10 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/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 9c166090ffd9ef8ca301cfa2a2ae68e5254f7206..e76893af794a91ffed67f1857f7192e85b4f9822 100644
--- a/components/ntp_tiles/most_visited_sites_unittest.cc
+++ b/components/ntp_tiles/most_visited_sites_unittest.cc
@@ -203,13 +203,13 @@ class PopularSitesFactoryForTest {
bool enabled,
sync_preferences::TestingPrefServiceSyncable* pref_service)
: prefs_(pref_service),
+ enabled_in_variations_(enabled),
url_fetcher_factory_(/*default_factory=*/nullptr),
url_request_context_(new net::TestURLRequestContextGetter(
base::ThreadTaskRunnerHandle::Get())),
worker_pool_owner_(/*max_threads=*/2, "PopularSitesFactoryForTest.") {
- if (enabled) {
- PopularSitesImpl::RegisterProfilePrefs(pref_service->registry());
-
+ PopularSitesImpl::RegisterProfilePrefs(pref_service->registry());
+ if (enabled_in_variations_) {
prefs_->SetString(prefs::kPopularSitesOverrideCountry, "IN");
prefs_->SetString(prefs::kPopularSitesOverrideVersion, "7");
@@ -231,6 +231,9 @@ class PopularSitesFactoryForTest {
}
std::unique_ptr<PopularSites> New() {
+ if (!enabled_in_variations_) {
sfiera 2017/02/10 10:40:03 I don't think this change is correct. I think that
fhorschig 2017/02/13 10:34:13 Undone. The whole file is untouched. The problem w
+ return nullptr;
+ }
return base::MakeUnique<PopularSitesImpl>(
worker_pool_owner_.pool().get(), prefs_,
/*template_url_service=*/nullptr,
@@ -240,6 +243,7 @@ class PopularSitesFactoryForTest {
private:
PrefService* prefs_;
+ bool enabled_in_variations_;
net::FakeURLFetcherFactory url_fetcher_factory_;
scoped_refptr<net::TestURLRequestContextGetter> url_request_context_;
base::SequencedWorkerPoolOwner worker_pool_owner_;

Powered by Google App Engine
This is Rietveld 408576698