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_snippets/remote/remote_suggestions_provider_impl.h" | 5 #include "components/ntp_snippets/remote/remote_suggestions_provider_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 MOCK_METHOD0(OnNTPOpened, void()); | 392 MOCK_METHOD0(OnNTPOpened, void()); |
393 MOCK_METHOD0(OnPersistentSchedulerWakeUp, void()); | 393 MOCK_METHOD0(OnPersistentSchedulerWakeUp, void()); |
394 MOCK_METHOD0(RescheduleFetching, void()); | 394 MOCK_METHOD0(RescheduleFetching, void()); |
395 }; | 395 }; |
396 | 396 |
397 } // namespace | 397 } // namespace |
398 | 398 |
399 class RemoteSuggestionsProviderImplTest : public ::testing::Test { | 399 class RemoteSuggestionsProviderImplTest : public ::testing::Test { |
400 public: | 400 public: |
401 RemoteSuggestionsProviderImplTest() | 401 RemoteSuggestionsProviderImplTest() |
402 : params_manager_(ntp_snippets::kStudyName, | 402 : params_manager_(ntp_snippets::kArticleSuggestionsFeature.name, |
403 {{"content_suggestions_backend", | 403 {{"content_suggestions_backend", |
404 kTestContentSuggestionsServerEndpoint}}, | 404 kTestContentSuggestionsServerEndpoint}}, |
405 {ntp_snippets::kArticleSuggestionsFeature.name}), | 405 {ntp_snippets::kArticleSuggestionsFeature.name}), |
406 fake_url_fetcher_factory_( | 406 fake_url_fetcher_factory_( |
407 /*default_factory=*/&failing_url_fetcher_factory_), | 407 /*default_factory=*/&failing_url_fetcher_factory_), |
408 test_url_(kTestContentSuggestionsServerWithAPIKey), | 408 test_url_(kTestContentSuggestionsServerWithAPIKey), |
409 category_ranker_(base::MakeUnique<ConstantCategoryRanker>()), | 409 category_ranker_(base::MakeUnique<ConstantCategoryRanker>()), |
410 user_classifier_(/*pref_service=*/nullptr, | 410 user_classifier_(/*pref_service=*/nullptr, |
411 base::MakeUnique<base::DefaultClock>()), | 411 base::MakeUnique<base::DefaultClock>()), |
412 suggestions_fetcher_(nullptr), | 412 suggestions_fetcher_(nullptr), |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 WaitForSuggestionsProviderInitialization(service.get(), | 1812 WaitForSuggestionsProviderInitialization(service.get(), |
1813 /*set_empty_response=*/true); | 1813 /*set_empty_response=*/true); |
1814 | 1814 |
1815 // The scheduler should be notified of clearing the history. | 1815 // The scheduler should be notified of clearing the history. |
1816 EXPECT_CALL(*scheduler(), OnSuggestionsCleared()); | 1816 EXPECT_CALL(*scheduler(), OnSuggestionsCleared()); |
1817 service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_OUT, | 1817 service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_OUT, |
1818 RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN); | 1818 RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN); |
1819 } | 1819 } |
1820 | 1820 |
1821 } // namespace ntp_snippets | 1821 } // namespace ntp_snippets |
OLD | NEW |