| 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/remote_suggestions_scheduler_impl.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> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 // TODO(jkrcal): Move into its own library to reuse in other unit-tests? | 72 // TODO(jkrcal): Move into its own library to reuse in other unit-tests? |
| 73 class MockRemoteSuggestionsProvider : public RemoteSuggestionsProvider { | 73 class MockRemoteSuggestionsProvider : public RemoteSuggestionsProvider { |
| 74 public: | 74 public: |
| 75 MockRemoteSuggestionsProvider(Observer* observer) | 75 MockRemoteSuggestionsProvider(Observer* observer) |
| 76 : RemoteSuggestionsProvider(observer) {} | 76 : RemoteSuggestionsProvider(observer) {} |
| 77 MOCK_METHOD1(RefetchInTheBackground, | 77 MOCK_METHOD1(RefetchInTheBackground, |
| 78 void(const RemoteSuggestionsProvider::FetchStatusCallback&)); | 78 void(const RemoteSuggestionsProvider::FetchStatusCallback&)); |
| 79 MOCK_CONST_METHOD0(suggestions_fetcher_for_debugging, | 79 MOCK_CONST_METHOD0(suggestions_fetcher_for_debugging, |
| 80 const RemoteSuggestionsFetcher*()); | 80 const RemoteSuggestionsFetcher*()); |
| 81 MOCK_CONST_METHOD1(GetUrlWithFavicon, |
| 82 GURL(const ContentSuggestion::ID& suggestion_id)); |
| 81 MOCK_METHOD1(GetCategoryStatus, CategoryStatus(Category)); | 83 MOCK_METHOD1(GetCategoryStatus, CategoryStatus(Category)); |
| 82 MOCK_METHOD1(GetCategoryInfo, CategoryInfo(Category)); | 84 MOCK_METHOD1(GetCategoryInfo, CategoryInfo(Category)); |
| 83 MOCK_METHOD3(ClearHistory, | 85 MOCK_METHOD3(ClearHistory, |
| 84 void(base::Time begin, | 86 void(base::Time begin, |
| 85 base::Time end, | 87 base::Time end, |
| 86 const base::Callback<bool(const GURL& url)>& filter)); | 88 const base::Callback<bool(const GURL& url)>& filter)); |
| 87 MOCK_METHOD3(Fetch, | 89 MOCK_METHOD3(Fetch, |
| 88 void(const Category&, | 90 void(const Category&, |
| 89 const std::set<std::string>&, | 91 const std::set<std::string>&, |
| 90 const FetchDoneCallback&)); | 92 const FetchDoneCallback&)); |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 for (int x = 0; x < 5; ++x) { | 833 for (int x = 0; x < 5; ++x) { |
| 832 scheduler()->OnPersistentSchedulerWakeUp(); | 834 scheduler()->OnPersistentSchedulerWakeUp(); |
| 833 signal_fetch_done.Run(Status::Success()); | 835 signal_fetch_done.Run(Status::Success()); |
| 834 } | 836 } |
| 835 | 837 |
| 836 // For the 6th time, it is blocked by the scheduling provider. | 838 // For the 6th time, it is blocked by the scheduling provider. |
| 837 scheduler()->OnPersistentSchedulerWakeUp(); | 839 scheduler()->OnPersistentSchedulerWakeUp(); |
| 838 } | 840 } |
| 839 | 841 |
| 840 } // namespace ntp_snippets | 842 } // namespace ntp_snippets |
| OLD | NEW |