| 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/remote_suggestions_scheduler_impl.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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 MOCK_METHOD1(DismissSuggestion, void(const ContentSuggestion::ID&)); | 107 MOCK_METHOD1(DismissSuggestion, void(const ContentSuggestion::ID&)); |
| 108 MOCK_METHOD2(FetchSuggestionImage, | 108 MOCK_METHOD2(FetchSuggestionImage, |
| 109 void(const ContentSuggestion::ID&, const ImageFetchedCallback&)); | 109 void(const ContentSuggestion::ID&, const ImageFetchedCallback&)); |
| 110 MOCK_METHOD2(GetDismissedSuggestionsForDebugging, | 110 MOCK_METHOD2(GetDismissedSuggestionsForDebugging, |
| 111 void(Category, const DismissedSuggestionsCallback&)); | 111 void(Category, const DismissedSuggestionsCallback&)); |
| 112 MOCK_METHOD0(OnSignInStateChanged, void()); | 112 MOCK_METHOD0(OnSignInStateChanged, void()); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace | 115 } // namespace |
| 116 | 116 |
| 117 class SchedulingRemoteSuggestionsProviderTest | 117 class SchedulingRemoteSuggestionsProviderTest : public ::testing::Test { |
| 118 : public ::testing::Test { | |
| 119 public: | 118 public: |
| 120 SchedulingRemoteSuggestionsProviderTest() | 119 SchedulingRemoteSuggestionsProviderTest() |
| 121 : // For the test we enabled all trigger types. | 120 : // For the test we enabled all trigger types. |
| 122 default_variation_params_{{"scheduler_trigger_types", | 121 default_variation_params_{{"scheduler_trigger_types", |
| 123 "persistent_scheduler_wake_up,ntp_opened," | 122 "persistent_scheduler_wake_up,ntp_opened," |
| 124 "browser_foregrounded,browser_cold_start"}}, | 123 "browser_foregrounded,browser_cold_start"}}, |
| 125 params_manager_(ntp_snippets::kStudyName, | 124 params_manager_(ntp_snippets::kStudyName, |
| 126 default_variation_params_, | 125 default_variation_params_, |
| 127 {kArticleSuggestionsFeature.name}), | 126 {kArticleSuggestionsFeature.name}), |
| 128 underlying_provider_(nullptr), | 127 underlying_provider_(nullptr), |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 for (int x = 0; x < 5; ++x) { | 826 for (int x = 0; x < 5; ++x) { |
| 828 scheduling_provider_->OnPersistentSchedulerWakeUp(); | 827 scheduling_provider_->OnPersistentSchedulerWakeUp(); |
| 829 signal_fetch_done.Run(Status::Success()); | 828 signal_fetch_done.Run(Status::Success()); |
| 830 } | 829 } |
| 831 | 830 |
| 832 // For the 6th time, it is blocked by the scheduling provider. | 831 // For the 6th time, it is blocked by the scheduling provider. |
| 833 scheduling_provider_->OnPersistentSchedulerWakeUp(); | 832 scheduling_provider_->OnPersistentSchedulerWakeUp(); |
| 834 } | 833 } |
| 835 | 834 |
| 836 } // namespace ntp_snippets | 835 } // namespace ntp_snippets |
| OLD | NEW |