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

Side by Side Diff: components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc

Issue 2663313002: 📰 Merge the has_fetch_more and has_reload actions (Closed)
Patch Set: fix tests pt 2 Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider. h" 5 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider. h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 GURL("http://dummy.com/3")), 167 GURL("http://dummy.com/3")),
168 Property(&ContentSuggestion::url, 168 Property(&ContentSuggestion::url,
169 GURL("http://dummy.com/1")), 169 GURL("http://dummy.com/1")),
170 Property(&ContentSuggestion::url, 170 Property(&ContentSuggestion::url,
171 GURL("http://dummy.com/2"))))); 171 GURL("http://dummy.com/2")))));
172 AddOfflinePageToModel(CreateDummyRecentTab(3, tomorrow)); 172 AddOfflinePageToModel(CreateDummyRecentTab(3, tomorrow));
173 } 173 }
174 174
175 TEST_F(RecentTabSuggestionsProviderTest, ShouldDeliverCorrectCategoryInfo) { 175 TEST_F(RecentTabSuggestionsProviderTest, ShouldDeliverCorrectCategoryInfo) {
176 EXPECT_FALSE( 176 EXPECT_FALSE(
177 provider()->GetCategoryInfo(recent_tabs_category()).has_more_action()); 177 provider()->GetCategoryInfo(recent_tabs_category()).has_fetch_action());
178 EXPECT_FALSE(
179 provider()->GetCategoryInfo(recent_tabs_category()).has_reload_action());
180 EXPECT_FALSE(provider() 178 EXPECT_FALSE(provider()
181 ->GetCategoryInfo(recent_tabs_category()) 179 ->GetCategoryInfo(recent_tabs_category())
182 .has_view_all_action()); 180 .has_view_all_action());
183 } 181 }
184 182
185 // TODO(vitaliii): Break this test into multiple tests. Currently if it fails, 183 // TODO(vitaliii): Break this test into multiple tests. Currently if it fails,
186 // it takes long time to find which part of it actually fails. 184 // it takes long time to find which part of it actually fails.
187 TEST_F(RecentTabSuggestionsProviderTest, ShouldDismiss) { 185 TEST_F(RecentTabSuggestionsProviderTest, ShouldDismiss) {
188 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)).Times(3); 186 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)).Times(3);
189 auto recent_tabs_list = CreateDummyRecentTabs({1, 2, 3}); 187 auto recent_tabs_list = CreateDummyRecentTabs({1, 2, 3});
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 *observer(), 325 *observer(),
328 OnNewSuggestions( 326 OnNewSuggestions(
329 _, recent_tabs_category(), 327 _, recent_tabs_category(),
330 UnorderedElementsAre( 328 UnorderedElementsAre(
331 Property(&ContentSuggestion::url, GURL("http://dummy.com/1")), 329 Property(&ContentSuggestion::url, GURL("http://dummy.com/1")),
332 Property(&ContentSuggestion::url, GURL("http://dummy.com/2"))))); 330 Property(&ContentSuggestion::url, GURL("http://dummy.com/2")))));
333 AddOfflinePageToModel(CreateDummyRecentTab(2)); 331 AddOfflinePageToModel(CreateDummyRecentTab(2));
334 } 332 }
335 333
336 } // namespace ntp_snippets 334 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698