Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ | |
| 6 #define COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "components/ntp_snippets/content_suggestions_provider.h" | |
| 12 #include "testing/gmock/include/gmock/gmock.h" | |
| 13 | |
| 14 namespace ntp_snippets { | |
| 15 | |
| 16 class MockContentSuggestionsProviderObserver | |
| 17 : public ContentSuggestionsProvider::Observer { | |
| 18 public: | |
| 19 MockContentSuggestionsProviderObserver(); | |
| 20 ~MockContentSuggestionsProviderObserver(); | |
| 21 | |
| 22 // Call of this function is redirected to the mock function OnNewSuggestions | |
| 23 // which takes const list of suggestions. MOCK_METHOD cannot be applied here | |
| 24 // directly, since gMock does not support movable-only types such as | |
| 25 // ContentSuggestion. | |
|
tschumann
2016/08/11 15:06:57
please add:
[which takes const list of suggestions
| |
| 26 void OnNewSuggestions(ContentSuggestionsProvider* provider, Category category, | |
| 27 std::vector<ContentSuggestion> suggestions) override; | |
| 28 | |
| 29 MOCK_METHOD3(OnNewSuggestions, | |
| 30 void(ContentSuggestionsProvider* provider, Category category, | |
| 31 const std::list<ContentSuggestion>& suggestions)); | |
| 32 MOCK_METHOD3(OnCategoryStatusChanged, | |
| 33 void(ContentSuggestionsProvider* provider, Category category, | |
| 34 CategoryStatus new_status)); | |
| 35 }; | |
| 36 | |
| 37 } // namespace ntp_snippets | |
| 38 | |
| 39 #endif // COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ | |
| OLD | NEW |