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

Unified Diff: chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc

Issue 2513393002: [NTP] Cleanup: offline pages related tests. (Closed)
Patch Set: rebase + treib@ comment. 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: chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc
diff --git a/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc b/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc
index 24f53958c19dfb89cdd7541a95ff041949bcdbc7..37da5ad771f7e2550e2f2b8ad21a2f3f8ca1e76e 100644
--- a/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc
+++ b/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc
@@ -771,17 +771,18 @@ TEST_F(DownloadSuggestionsProviderTest, ShouldPruneOfflinePagesDismissedIDs) {
GetDummySuggestionId(3, /*is_offline_page=*/true));
EXPECT_THAT(GetDismissedSuggestions(), SizeIs(3));
- // Prune on getting all offline pages. Note that the first suggestion is not
- // removed from |offline_pages_model| storage, because otherwise
- // |GetDismissedSuggestions| cannot return it.
+ // Prune on getting all offline pages.
EXPECT_CALL(*observer(),
OnNewSuggestions(_, downloads_category(), IsEmpty()));
- // TODO(vitaliii): Add the first suggestion back, so that
- // GetDismissedSuggestions can return it.
*(offline_pages_model()->mutable_items()) =
CreateDummyOfflinePages({2, 3});
FireOfflinePageModelChanged();
+
+ // The first suggestion is added back to the |offline_pages_model| storage,
+ // because otherwise |GetDismissedSuggestions| cannot return it.
+ *(offline_pages_model()->mutable_items()) =
+ CreateDummyOfflinePages({1, 2, 3});
EXPECT_THAT(GetDismissedSuggestions(), SizeIs(2));
// Prune when offline page is deleted.

Powered by Google App Engine
This is Rietveld 408576698