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

Unified Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2284393002: Add ClearHistory() to ContentSuggestionsService and its providers (Closed)
Patch Set: Marc's comments. 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/content_suggestions_service_unittest.cc
diff --git a/components/ntp_snippets/content_suggestions_service_unittest.cc b/components/ntp_snippets/content_suggestions_service_unittest.cc
index bf3f4a4d321a653b19fc67daf6c7d918b5c16f74..96563c506df2400970354284dab8c01172774764 100644
--- a/components/ntp_snippets/content_suggestions_service_unittest.cc
+++ b/components/ntp_snippets/content_suggestions_service_unittest.cc
@@ -100,6 +100,7 @@ class MockProvider : public ContentSuggestionsProvider {
observer()->OnSuggestionInvalidated(this, category, suggestion_id);
}
+ MOCK_METHOD2(ClearHistory, void(base::Time begin, base::Time end));
MOCK_METHOD1(ClearCachedSuggestions, void(Category category));
MOCK_METHOD2(GetDismissedSuggestionsForDebugging,
void(Category category,
@@ -567,4 +568,12 @@ TEST_F(ContentSuggestionsServiceTest, ShouldPutBookmarksAtEndIfEmpty) {
EXPECT_THAT(service()->GetCategories(), ElementsAre(remote, bookmarks));
}
+TEST_F(ContentSuggestionsServiceTest, ShouldForwardClearHistory) {
+ Category category = FromKnownCategory(KnownCategories::DOWNLOADS);
+ MockProvider* provider = RegisterProvider(category);
+ base::Time begin, end;
Marc Treib 2016/08/30 09:50:18 Initialize these to something sensible?
vitaliii 2016/08/30 11:04:22 Done.
+ EXPECT_CALL(*provider, ClearHistory(begin, end));
+ service()->ClearHistory(begin, end);
+}
+
} // namespace ntp_snippets

Powered by Google App Engine
This is Rietveld 408576698