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

Unified Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2284393002: Add ClearHistory() to ContentSuggestionsService and its providers (Closed)
Patch Set: |bookmark_model| can be null in tests. 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 44eea0160dce362f409cea39f87c159584fefe93..842b097dd8e4bba8e9641b40e68f5d72f2a5061f 100644
--- a/components/ntp_snippets/content_suggestions_service_unittest.cc
+++ b/components/ntp_snippets/content_suggestions_service_unittest.cc
@@ -100,6 +100,10 @@ class MockProvider : public ContentSuggestionsProvider {
observer()->OnSuggestionInvalidated(this, category, suggestion_id);
}
+ MOCK_METHOD3(ClearHistory,
+ void(base::Time begin,
+ base::Time end,
+ const base::Callback<bool(const GURL& url)>& filter));
MOCK_METHOD1(ClearCachedSuggestions, void(Category category));
MOCK_METHOD2(GetDismissedSuggestionsForDebugging,
void(Category category,
@@ -565,4 +569,14 @@ 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 = base::Time::FromTimeT(123),
+ end = base::Time::FromTimeT(456);
+ EXPECT_CALL(*provider, ClearHistory(begin, end, _));
+ base::Callback<bool(const GURL& url)> filter;
+ service()->ClearHistory(begin, end, filter);
+}
+
} // namespace ntp_snippets
« 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