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

Unified Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2466863003: Finalize backend for fetching more NTPSnippets. (Closed)
Patch Set: Known suggestion are now a parameter for Fetch. Created 4 years, 1 month 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 dd14b8bd6b7d398b06ace43278868f1e9ac7a4ba..3e4c37268168f7b1fdab50705266132f897acb83 100644
--- a/components/ntp_snippets/content_suggestions_service_unittest.cc
+++ b/components/ntp_snippets/content_suggestions_service_unittest.cc
@@ -88,7 +88,8 @@ class MockProvider : public ContentSuggestionsProvider {
void(base::Time begin,
base::Time end,
const base::Callback<bool(const GURL& url)>& filter));
- MOCK_METHOD2(FetchMore, void(const Category&, FetchedMoreCallback));
+ MOCK_METHOD3(Fetch,
+ void(const Category&, std::set<std::string>, FetchingCallback));
MOCK_METHOD1(ClearCachedSuggestions, void(Category category));
MOCK_METHOD2(GetDismissedSuggestionsForDebugging,
void(Category category,
@@ -576,13 +577,14 @@ TEST_F(ContentSuggestionsServiceTest, ShouldForwardClearHistory) {
service()->ClearHistory(begin, end, filter);
}
-TEST_F(ContentSuggestionsServiceTest, ShouldForwardFetchMore) {
+TEST_F(ContentSuggestionsServiceTest, ShouldForwardFetch) {
Category category = FromKnownCategory(KnownCategories::ARTICLES);
+ std::set<std::string> known_suggestions;
MockProvider* provider = RegisterProvider(category);
provider->FireCategoryStatusChangedWithCurrentStatus(category);
- EXPECT_CALL(*provider, FetchMore(category, _));
- service()->FetchMore(category,
- ContentSuggestionsService::FetchedMoreCallback());
+ EXPECT_CALL(*provider, Fetch(category, known_suggestions, _));
+ service()->Fetch(category, known_suggestions,
+ ContentSuggestionsService::FetchingCallback());
}
TEST_F(ContentSuggestionsServiceTest, DismissAndRestoreCategory) {

Powered by Google App Engine
This is Rietveld 408576698