OLD | NEW |
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 *sites = popular_sites->sites(); | 147 *sites = popular_sites->sites(); |
148 return save_success; | 148 return save_success; |
149 } | 149 } |
150 | 150 |
151 std::unique_ptr<PopularSites> CreatePopularSites( | 151 std::unique_ptr<PopularSites> CreatePopularSites( |
152 net::URLRequestContextGetter* context) { | 152 net::URLRequestContextGetter* context) { |
153 return base::MakeUnique<PopularSitesImpl>( | 153 return base::MakeUnique<PopularSitesImpl>( |
154 worker_pool_owner_.pool().get(), &prefs_, | 154 worker_pool_owner_.pool().get(), &prefs_, |
155 /*template_url_service=*/nullptr, | 155 /*template_url_service=*/nullptr, |
156 /*variations_service=*/nullptr, context, cache_dir_, | 156 /*variations_service=*/nullptr, |
| 157 /*favicon_service=*/nullptr, context, cache_dir_, |
157 base::Bind(JsonUnsafeParser::Parse)); | 158 base::Bind(JsonUnsafeParser::Parse)); |
158 } | 159 } |
159 | 160 |
160 const TestPopularSite kWikipedia; | 161 const TestPopularSite kWikipedia; |
161 const TestPopularSite kYouTube; | 162 const TestPopularSite kYouTube; |
162 const TestPopularSite kChromium; | 163 const TestPopularSite kChromium; |
163 | 164 |
164 base::MessageLoopForUI ui_loop_; | 165 base::MessageLoopForUI ui_loop_; |
165 base::SequencedWorkerPoolOwner worker_pool_owner_; | 166 base::SequencedWorkerPoolOwner worker_pool_owner_; |
166 base::ScopedTempDir scoped_cache_dir_; | 167 base::ScopedTempDir scoped_cache_dir_; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 "https://www.gstatic.com/chrome/ntp/suggested_sites_ZZ_9.json", | 416 "https://www.gstatic.com/chrome/ntp/suggested_sites_ZZ_9.json", |
416 {kChromium}); | 417 {kChromium}); |
417 EXPECT_THAT(FetchPopularSites(/*force_download=*/false, &sites), | 418 EXPECT_THAT(FetchPopularSites(/*force_download=*/false, &sites), |
418 Eq(base::Optional<bool>(true))); | 419 Eq(base::Optional<bool>(true))); |
419 ASSERT_THAT(sites.size(), Eq(1u)); | 420 ASSERT_THAT(sites.size(), Eq(1u)); |
420 EXPECT_THAT(sites[0].url, URLEq("https://www.chromium.org/")); | 421 EXPECT_THAT(sites[0].url, URLEq("https://www.chromium.org/")); |
421 } | 422 } |
422 | 423 |
423 } // namespace | 424 } // namespace |
424 } // namespace ntp_tiles | 425 } // namespace ntp_tiles |
OLD | NEW |