| 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_snippets/remote/scheduling_remote_suggestions_provider.
h" | 5 #include "components/ntp_snippets/remote/scheduling_remote_suggestions_provider.
h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 MOCK_METHOD1(DismissSuggestion, void(const ContentSuggestion::ID&)); | 106 MOCK_METHOD1(DismissSuggestion, void(const ContentSuggestion::ID&)); |
| 107 MOCK_METHOD2(FetchSuggestionImage, | 107 MOCK_METHOD2(FetchSuggestionImage, |
| 108 void(const ContentSuggestion::ID&, const ImageFetchedCallback&)); | 108 void(const ContentSuggestion::ID&, const ImageFetchedCallback&)); |
| 109 MOCK_METHOD2(GetDismissedSuggestionsForDebugging, | 109 MOCK_METHOD2(GetDismissedSuggestionsForDebugging, |
| 110 void(Category, const DismissedSuggestionsCallback&)); | 110 void(Category, const DismissedSuggestionsCallback&)); |
| 111 MOCK_METHOD0(OnSignInStateChanged, void()); | 111 MOCK_METHOD0(OnSignInStateChanged, void()); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| 115 | 115 |
| 116 class SchedulingRemoteSuggestionsProviderTest | 116 class SchedulingRemoteSuggestionsProviderTest : public ::testing::Test { |
| 117 : public ::testing::Test { | |
| 118 public: | 117 public: |
| 119 SchedulingRemoteSuggestionsProviderTest() | 118 SchedulingRemoteSuggestionsProviderTest() |
| 120 : // For the test we enabled all trigger types. | 119 : // For the test we enabled all trigger types. |
| 121 default_variation_params_{{"scheduler_trigger_types", | 120 default_variation_params_{{"scheduler_trigger_types", |
| 122 "persistent_scheduler_wake_up,ntp_opened," | 121 "persistent_scheduler_wake_up,ntp_opened," |
| 123 "browser_foregrounded,browser_cold_start"}}, | 122 "browser_foregrounded,browser_cold_start"}}, |
| 124 params_manager_(ntp_snippets::kStudyName, | 123 params_manager_(ntp_snippets::kStudyName, |
| 125 default_variation_params_, | 124 default_variation_params_, |
| 126 {kArticleSuggestionsFeature.name}), | 125 {kArticleSuggestionsFeature.name}), |
| 127 underlying_provider_(nullptr), | 126 underlying_provider_(nullptr), |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 for (int x = 0; x < 5; ++x) { | 760 for (int x = 0; x < 5; ++x) { |
| 762 scheduling_provider_->OnPersistentSchedulerWakeUp(); | 761 scheduling_provider_->OnPersistentSchedulerWakeUp(); |
| 763 signal_fetch_done.Run(Status::Success()); | 762 signal_fetch_done.Run(Status::Success()); |
| 764 } | 763 } |
| 765 | 764 |
| 766 // For the 6th time, it is blocked by the scheduling provider. | 765 // For the 6th time, it is blocked by the scheduling provider. |
| 767 scheduling_provider_->OnPersistentSchedulerWakeUp(); | 766 scheduling_provider_->OnPersistentSchedulerWakeUp(); |
| 768 } | 767 } |
| 769 | 768 |
| 770 } // namespace ntp_snippets | 769 } // namespace ntp_snippets |
| OLD | NEW |