Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: components/ntp_snippets/fake_content_suggestions_provider_observer.h

Issue 2618243004: Add a unit test for the BookmarkSuggestionsProvider. (Closed)
Patch Set: renamed MockProvider and updated tests comments about expected behavior Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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_FAKE_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_
6 #define COMPONENTS_NTP_SNIPPETS_FAKE_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_
7
8 #include <map>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "components/ntp_snippets/category.h"
13 #include "components/ntp_snippets/content_suggestion.h"
14 #include "components/ntp_snippets/content_suggestions_provider.h"
15
16 namespace ntp_snippets {
17
18 class FakeContentSuggestionsProviderObserver
19 : public ContentSuggestionsProvider::Observer {
20 public:
21 FakeContentSuggestionsProviderObserver();
22 ~FakeContentSuggestionsProviderObserver();
23
24 void OnNewSuggestions(ContentSuggestionsProvider* provider,
25 Category category,
26 std::vector<ContentSuggestion> suggestions) override;
27
28 void OnCategoryStatusChanged(ContentSuggestionsProvider* provider,
29 Category category,
30 CategoryStatus new_status) override;
31
32 void OnSuggestionInvalidated(
33 ContentSuggestionsProvider* provider,
34 const ContentSuggestion::ID& suggestion_id) override;
35
36 const std::map<Category, CategoryStatus, Category::CompareByID>& statuses()
37 const;
38
39 CategoryStatus StatusForCategory(Category category) const;
40
41 const std::vector<ContentSuggestion>& SuggestionsForCategory(
42 Category category);
43
44 private:
45 std::map<Category, CategoryStatus, Category::CompareByID> statuses_;
46 std::map<Category, std::vector<ContentSuggestion>, Category::CompareByID>
47 suggestions_;
48
49 DISALLOW_COPY_AND_ASSIGN(FakeContentSuggestionsProviderObserver);
50 };
51
52 } // namespace ntp_snippets
53
54 #endif // COMPONENTS_NTP_SNIPPETS_FAKE_CONTENT_SUGGESTIONS_PROVIDER_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698