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

Unified Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2421463002: FetchMore functionality backend (Closed)
Patch Set: Strategy pattern to handle differences in fetching procedure. Created 4 years, 2 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 71de5fb68f21cd7c3a1492e51088869397f59642..18b2939115c81b8c6623861be33bcacb0fb29ddd 100644
--- a/components/ntp_snippets/content_suggestions_service_unittest.cc
+++ b/components/ntp_snippets/content_suggestions_service_unittest.cc
@@ -85,6 +85,7 @@ class MockProvider : public ContentSuggestionsProvider {
void(base::Time begin,
base::Time end,
const base::Callback<bool(const GURL& url)>& filter));
+ MOCK_METHOD0(FetchMore, void());
MOCK_METHOD1(ClearCachedSuggestions, void(Category category));
MOCK_METHOD2(GetDismissedSuggestionsForDebugging,
void(Category category,
@@ -606,6 +607,14 @@ TEST_F(ContentSuggestionsServiceTest, ShouldForwardClearHistory) {
service()->ClearHistory(begin, end, filter);
}
+TEST_F(ContentSuggestionsServiceTest, ShouldForwardFetchMore) {
+ Category category = FromKnownCategory(KnownCategories::ARTICLES);
+ MockProvider* provider = RegisterProvider(category);
+ provider->FireCategoryStatusChangedWithCurrentStatus(category);
+ EXPECT_CALL(*provider, FetchMore());
+ service()->FetchMore(category);
+}
+
TEST_F(ContentSuggestionsServiceTest, DismissAndRestoreCategory) {
// Register a category with one suggestion.
Category category = FromKnownCategory(KnownCategories::ARTICLES);

Powered by Google App Engine
This is Rietveld 408576698