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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc

Issue 2751093003: Unifies the additional actions for Categories (Closed)
Patch Set: Fix compilation on Android (hopefully) Created 3 years, 9 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/remote/remote_suggestions_fetcher_unittest.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
index 1b1ec9c0b031951f28fb97dc9b56cc82352cafbf..68243166726c6e051055dfdf1c6d6eb6339bfc2d 100644
--- a/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
@@ -119,12 +119,8 @@ MATCHER_P(IsSingleArticle, url, "is a list with the single article %(url)s") {
}
MATCHER(IsCategoryInfoForArticles, "") {
- if (!arg.has_fetch_action()) {
- *result_listener << "missing expected has_fetc_action";
- return false;
- }
- if (arg.has_view_all_action()) {
- *result_listener << "unexpected has_view_all_action";
+ if (arg.additional_action() != ContentSuggestionsAdditionalAction::FETCH) {
+ *result_listener << "missing expected FETCH action";
return false;
}
if (!arg.show_if_empty()) {
@@ -674,8 +670,8 @@ TEST_F(RemoteSuggestionsSignedOutFetcherTest, ServerCategories) {
} else if (category.category == Category::FromRemoteCategory(2)) {
ASSERT_THAT(articles.size(), Eq(1u));
EXPECT_THAT(articles[0]->url().spec(), Eq("http://localhost/foo2"));
- EXPECT_THAT(category.info.has_fetch_action(), Eq(true));
- EXPECT_THAT(category.info.has_view_all_action(), Eq(false));
+ EXPECT_THAT(category.info.additional_action(),
+ Eq(ContentSuggestionsAdditionalAction::FETCH));
EXPECT_THAT(category.info.show_if_empty(), Eq(false));
} else {
FAIL() << "unknown category ID " << category.category.id();
@@ -726,7 +722,8 @@ TEST_F(RemoteSuggestionsSignedOutFetcherTest,
ASSERT_TRUE(fetched_categories);
ASSERT_THAT(fetched_categories->size(), Eq(1u));
- EXPECT_THAT(fetched_categories->front().info.has_fetch_action(), Eq(false));
+ EXPECT_THAT(fetched_categories->front().info.additional_action(),
+ Eq(ContentSuggestionsAdditionalAction::NONE));
EXPECT_THAT(fetched_categories->front().info.title(),
Eq(base::UTF8ToUTF16("Articles for Me")));
}

Powered by Google App Engine
This is Rietveld 408576698