OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/most_visited_sites.h" | 5 #include "components/ntp_tiles/most_visited_sites.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <ostream> | 10 #include <ostream> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 class MockMostVisitedSitesObserver : public MostVisitedSites::Observer { | 188 class MockMostVisitedSitesObserver : public MostVisitedSites::Observer { |
189 public: | 189 public: |
190 MOCK_METHOD1(OnMostVisitedURLsAvailable, void(const NTPTilesVector& tiles)); | 190 MOCK_METHOD1(OnMostVisitedURLsAvailable, void(const NTPTilesVector& tiles)); |
191 MOCK_METHOD1(OnIconMadeAvailable, void(const GURL& site_url)); | 191 MOCK_METHOD1(OnIconMadeAvailable, void(const GURL& site_url)); |
192 }; | 192 }; |
193 | 193 |
194 class MockIconCacher : public IconCacher { | 194 class MockIconCacher : public IconCacher { |
195 public: | 195 public: |
196 MOCK_METHOD2(StartFetch, | 196 MOCK_METHOD2(StartFetch, |
197 void(PopularSites::Site site, | 197 void(PopularSites::Site site, |
198 const base::Callback<void(bool)>& done)); | 198 const base::Callback<void()>& done)); |
199 }; | 199 }; |
200 | 200 |
201 class PopularSitesFactoryForTest { | 201 class PopularSitesFactoryForTest { |
202 public: | 202 public: |
203 PopularSitesFactoryForTest( | 203 PopularSitesFactoryForTest( |
204 bool enabled, | 204 bool enabled, |
205 sync_preferences::TestingPrefServiceSyncable* pref_service) | 205 sync_preferences::TestingPrefServiceSyncable* pref_service) |
206 : prefs_(pref_service), | 206 : prefs_(pref_service), |
207 url_fetcher_factory_(/*default_factory=*/nullptr), | 207 url_fetcher_factory_(/*default_factory=*/nullptr), |
208 url_request_context_(new net::TestURLRequestContextGetter( | 208 url_request_context_(new net::TestURLRequestContextGetter( |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 MatchesTile("Site 4", "https://www.site4.com/", | 875 MatchesTile("Site 4", "https://www.site4.com/", |
876 NTPTileSource::TOP_SITES), | 876 NTPTileSource::TOP_SITES), |
877 MatchesTile("Site 1", "https://www.site1.com/", | 877 MatchesTile("Site 1", "https://www.site1.com/", |
878 NTPTileSource::POPULAR), | 878 NTPTileSource::POPULAR), |
879 MatchesTile("Site 2", "https://www.site2.com/", | 879 MatchesTile("Site 2", "https://www.site2.com/", |
880 NTPTileSource::POPULAR))); | 880 NTPTileSource::POPULAR))); |
881 } | 881 } |
882 | 882 |
883 } // namespace | 883 } // namespace |
884 } // namespace ntp_tiles | 884 } // namespace ntp_tiles |
OLD | NEW |