| 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 #ifndef COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // Call of this function is redirected to the mock function OnNewSuggestions | 22 // Call of this function is redirected to the mock function OnNewSuggestions |
| 23 // which takes const list of suggestions. We do this trick so that the | 23 // which takes const list of suggestions. We do this trick so that the |
| 24 // MOCK_METHOD behaves the same way in tests as the actual method and we can | 24 // MOCK_METHOD behaves the same way in tests as the actual method and we can |
| 25 // keep this gMock issue limited to the mock class. MOCK_METHOD cannot be | 25 // keep this gMock issue limited to the mock class. MOCK_METHOD cannot be |
| 26 // applied here directly, since gMock does not support movable-only types | 26 // applied here directly, since gMock does not support movable-only types |
| 27 // such as ContentSuggestion. | 27 // such as ContentSuggestion. |
| 28 void OnNewSuggestions(ContentSuggestionsProvider* provider, | 28 void OnNewSuggestions(ContentSuggestionsProvider* provider, |
| 29 Category category, | 29 Category category, |
| 30 std::vector<ContentSuggestion> suggestions) override; | 30 std::vector<ContentSuggestion> suggestions) override; |
| 31 void OnNewSuggestionBatch(ContentSuggestionsProvider* provider, |
| 32 SuggestionBatch suggestion_batch) override; |
| 31 | 33 |
| 32 MOCK_METHOD3(OnNewSuggestions, | 34 MOCK_METHOD3(OnNewSuggestions, |
| 33 void(ContentSuggestionsProvider* provider, | 35 void(ContentSuggestionsProvider* provider, |
| 34 Category category, | 36 Category category, |
| 35 const std::list<ContentSuggestion>& suggestions)); | 37 const std::list<ContentSuggestion>& suggestions)); |
| 38 MOCK_METHOD2(OnNewSuggestionBatch, |
| 39 void(ContentSuggestionsProvider* provider, |
| 40 const std::map<Category, |
| 41 std::list<ContentSuggestion>, |
| 42 Category::CompareByID>& suggestion_batch)); |
| 36 MOCK_METHOD3(OnCategoryStatusChanged, | 43 MOCK_METHOD3(OnCategoryStatusChanged, |
| 37 void(ContentSuggestionsProvider* provider, | 44 void(ContentSuggestionsProvider* provider, |
| 38 Category category, | 45 Category category, |
| 39 CategoryStatus new_status)); | 46 CategoryStatus new_status)); |
| 40 MOCK_METHOD2(OnSuggestionInvalidated, | 47 MOCK_METHOD2(OnSuggestionInvalidated, |
| 41 void(ContentSuggestionsProvider* provider, | 48 void(ContentSuggestionsProvider* provider, |
| 42 const ContentSuggestion::ID& suggestion_id)); | 49 const ContentSuggestion::ID& suggestion_id)); |
| 43 }; | 50 }; |
| 44 | 51 |
| 45 } // namespace ntp_snippets | 52 } // namespace ntp_snippets |
| 46 | 53 |
| 47 #endif // COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ | 54 #endif // COMPONENTS_NTP_SNIPPETS_MOCK_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_ |
| OLD | NEW |