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