Chromium Code Reviews| Index: components/ntp_snippets/remote/remote_suggestions_provider.h |
| diff --git a/components/ntp_snippets/remote/remote_suggestions_provider.h b/components/ntp_snippets/remote/remote_suggestions_provider.h |
| index a8081b7ee9ffdadb3b853164edd1d175b786d2c6..1c76a5862a7b95d1aab0cfb49257e2b5d742cd94 100644 |
| --- a/components/ntp_snippets/remote/remote_suggestions_provider.h |
| +++ b/components/ntp_snippets/remote/remote_suggestions_provider.h |
| @@ -151,6 +151,11 @@ class RemoteSuggestionsProvider final |
| return category_contents_.find(category)->second.dismissed; |
| } |
| + // Overrides internal clock for testing purposes. |
| + void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) { |
| + tick_clock_ = std::move(tick_clock); |
|
tschumann
2016/12/08 18:18:51
nit: Couldn't we dependency-inject this into the c
|
| + } |
| + |
| private: |
| friend class RemoteSuggestionsProviderTest; |
| @@ -261,10 +266,13 @@ class RemoteSuggestionsProvider final |
| // Callback for fetch-more requests with the NTPSnippetsFetcher. |
| void OnFetchMoreFinished( |
| const FetchDoneCallback& fetching_callback, |
| + NTPSnippetsFetcher::FetchResult fetch_result, |
| NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories); |
| // Callback for regular fetch requests with the NTPSnippetsFetcher. |
| void OnFetchFinished( |
| + bool interactive_request, |
| + NTPSnippetsFetcher::FetchResult fetch_status, |
| NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories); |
| // Moves all snippets from |to_archive| into the archive of the |content|. |
| @@ -407,6 +415,9 @@ class RemoteSuggestionsProvider final |
| // Request throttler for limiting requests to thumbnail images. |
| RequestThrottler thumbnail_requests_throttler_; |
| + // A clock for getting the time. This allows to inject a tick clock in tests. |
| + std::unique_ptr<base::TickClock> tick_clock_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProvider); |
| }; |