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

Side by Side Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2225753003: Revert of Add per-section clearing and dismissed suggestions to snippets-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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/content_suggestions_service.h" 5 #include "components/ntp_snippets/content_suggestions_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 void FireSuggestionsChanged(Category category, std::vector<int> numbers) { 74 void FireSuggestionsChanged(Category category, std::vector<int> numbers) {
75 observer()->OnNewSuggestions(this, category, CreateSuggestions(numbers)); 75 observer()->OnNewSuggestions(this, category, CreateSuggestions(numbers));
76 } 76 }
77 77
78 void FireCategoryStatusChanged(Category category, CategoryStatus new_status) { 78 void FireCategoryStatusChanged(Category category, CategoryStatus new_status) {
79 statuses_[category.id()] = new_status; 79 statuses_[category.id()] = new_status;
80 observer()->OnCategoryStatusChanged(this, category, new_status); 80 observer()->OnCategoryStatusChanged(this, category, new_status);
81 } 81 }
82 82
83 MOCK_METHOD1(ClearCachedSuggestionsForDebugging, void(Category category)); 83 MOCK_METHOD0(ClearCachedSuggestionsForDebugging, void());
84 MOCK_METHOD1(GetDismissedSuggestionsForDebugging, 84 MOCK_METHOD0(ClearDismissedSuggestionsForDebugging, void());
85 std::vector<ContentSuggestion>(Category category));
86 MOCK_METHOD1(ClearDismissedSuggestionsForDebugging, void(Category category));
87 MOCK_METHOD1(DismissSuggestion, void(const std::string& suggestion_id)); 85 MOCK_METHOD1(DismissSuggestion, void(const std::string& suggestion_id));
88 MOCK_METHOD2(FetchSuggestionImage, 86 MOCK_METHOD2(FetchSuggestionImage,
89 void(const std::string& suggestion_id, 87 void(const std::string& suggestion_id,
90 const ImageFetchedCallback& callback)); 88 const ImageFetchedCallback& callback));
91 89
92 private: 90 private:
93 std::vector<Category> provided_categories_; 91 std::vector<Category> provided_categories_;
94 std::map<int, CategoryStatus> statuses_; 92 std::map<int, CategoryStatus> statuses_;
95 }; 93 };
96 94
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 Mock::VerifyAndClearExpectations(&observer); 350 Mock::VerifyAndClearExpectations(&observer);
353 351
354 // Shutdown the service 352 // Shutdown the service
355 EXPECT_CALL(observer, ContentSuggestionsServiceShutdown()); 353 EXPECT_CALL(observer, ContentSuggestionsServiceShutdown());
356 service()->Shutdown(); 354 service()->Shutdown();
357 service()->RemoveObserver(&observer); 355 service()->RemoveObserver(&observer);
358 // The service will receive two Shutdown() calls. 356 // The service will receive two Shutdown() calls.
359 } 357 }
360 358
361 } // namespace ntp_snippets 359 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.cc ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698