| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 EXPECT_CALL(*icon_cacher, StartFetchPopularSites(_, _, _)) | 366 EXPECT_CALL(*icon_cacher, StartFetchPopularSites(_, _, _)) |
| 367 .Times(AtLeast(0)); | 367 .Times(AtLeast(0)); |
| 368 } | 368 } |
| 369 | 369 |
| 370 auto home_page_client = base::MakeUnique<FakeHomePageClient>(); | 370 auto home_page_client = base::MakeUnique<FakeHomePageClient>(); |
| 371 home_page_client_ = home_page_client.get(); | 371 home_page_client_ = home_page_client.get(); |
| 372 | 372 |
| 373 most_visited_sites_ = base::MakeUnique<MostVisitedSites>( | 373 most_visited_sites_ = base::MakeUnique<MostVisitedSites>( |
| 374 &pref_service_, mock_top_sites_, &mock_suggestions_service_, | 374 &pref_service_, mock_top_sites_, &mock_suggestions_service_, |
| 375 popular_sites_factory_.New(), std::move(icon_cacher), | 375 popular_sites_factory_.New(), std::move(icon_cacher), |
| 376 /*supervisor=*/nullptr, std::move(home_page_client)); | 376 /*supervisor=*/nullptr); |
| 377 |
| 378 most_visited_sites_->SetHomePageClient(std::move(home_page_client)); |
| 377 } | 379 } |
| 378 | 380 |
| 379 bool IsPopularSitesEnabledViaVariations() const { return GetParam(); } | 381 bool IsPopularSitesEnabledViaVariations() const { return GetParam(); } |
| 380 | 382 |
| 381 bool VerifyAndClearExpectations() { | 383 bool VerifyAndClearExpectations() { |
| 382 base::RunLoop().RunUntilIdle(); | 384 base::RunLoop().RunUntilIdle(); |
| 383 const bool success = | 385 const bool success = |
| 384 Mock::VerifyAndClearExpectations(mock_top_sites_.get()) && | 386 Mock::VerifyAndClearExpectations(mock_top_sites_.get()) && |
| 385 Mock::VerifyAndClearExpectations(&mock_suggestions_service_) && | 387 Mock::VerifyAndClearExpectations(&mock_suggestions_service_) && |
| 386 Mock::VerifyAndClearExpectations(&mock_observer_); | 388 Mock::VerifyAndClearExpectations(&mock_observer_); |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 TileSource::TOP_SITES), | 1171 TileSource::TOP_SITES), |
| 1170 MatchesTile("Site 4", "https://www.site4.com/", | 1172 MatchesTile("Site 4", "https://www.site4.com/", |
| 1171 TileSource::TOP_SITES), | 1173 TileSource::TOP_SITES), |
| 1172 MatchesTile("Site 1", "https://www.site1.com/", TileSource::POPULAR), | 1174 MatchesTile("Site 1", "https://www.site1.com/", TileSource::POPULAR), |
| 1173 MatchesTile("Site 2", "https://www.site2.com/", | 1175 MatchesTile("Site 2", "https://www.site2.com/", |
| 1174 TileSource::POPULAR))); | 1176 TileSource::POPULAR))); |
| 1175 } | 1177 } |
| 1176 | 1178 |
| 1177 } // namespace | 1179 } // namespace |
| 1178 } // namespace ntp_tiles | 1180 } // namespace ntp_tiles |
| OLD | NEW |