OLD | NEW |
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 ElementsAre(Property(&ContentSuggestion::url, | 215 ElementsAre(Property(&ContentSuggestion::url, |
216 GURL("http://dummy.com/3")), | 216 GURL("http://dummy.com/3")), |
217 Property(&ContentSuggestion::url, | 217 Property(&ContentSuggestion::url, |
218 GURL("http://dummy.com/1")), | 218 GURL("http://dummy.com/1")), |
219 Property(&ContentSuggestion::url, | 219 Property(&ContentSuggestion::url, |
220 GURL("http://dummy.com/2"))))); | 220 GURL("http://dummy.com/2"))))); |
221 AddTabAndOfflinePageToModel(CreateDummyRecentTab(3, tomorrow)); | 221 AddTabAndOfflinePageToModel(CreateDummyRecentTab(3, tomorrow)); |
222 } | 222 } |
223 | 223 |
224 TEST_F(RecentTabSuggestionsProviderTest, ShouldDeliverCorrectCategoryInfo) { | 224 TEST_F(RecentTabSuggestionsProviderTest, ShouldDeliverCorrectCategoryInfo) { |
225 EXPECT_FALSE( | 225 EXPECT_EQ( |
226 provider()->GetCategoryInfo(recent_tabs_category()).has_fetch_action()); | 226 ContentSuggestionsAdditionalAction::NONE, |
227 EXPECT_FALSE(provider() | 227 provider()->GetCategoryInfo(recent_tabs_category()).additional_action()); |
228 ->GetCategoryInfo(recent_tabs_category()) | |
229 .has_view_all_action()); | |
230 } | 228 } |
231 | 229 |
232 // TODO(vitaliii): Break this test into multiple tests. Currently if it fails, | 230 // TODO(vitaliii): Break this test into multiple tests. Currently if it fails, |
233 // it takes long time to find which part of it actually fails. | 231 // it takes long time to find which part of it actually fails. |
234 TEST_F(RecentTabSuggestionsProviderTest, ShouldDismiss) { | 232 TEST_F(RecentTabSuggestionsProviderTest, ShouldDismiss) { |
235 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)).Times(3); | 233 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)).Times(3); |
236 auto recent_tabs_list = CreateDummyRecentTabs({1, 2, 3}); | 234 auto recent_tabs_list = CreateDummyRecentTabs({1, 2, 3}); |
237 for (OfflinePageItem& recent_tab : recent_tabs_list) { | 235 for (OfflinePageItem& recent_tab : recent_tabs_list) { |
238 AddTabAndOfflinePageToModel(recent_tab); | 236 AddTabAndOfflinePageToModel(recent_tab); |
239 } | 237 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 Property(&ContentSuggestion::url, GURL("http://dummy.com/2"))))); | 431 Property(&ContentSuggestion::url, GURL("http://dummy.com/2"))))); |
434 | 432 |
435 AddTabAndOfflinePageToModel(CreateDummyRecentTab(1)); | 433 AddTabAndOfflinePageToModel(CreateDummyRecentTab(1)); |
436 AddTabAndOfflinePageToModel(CreateDummyRecentTab(2)); | 434 AddTabAndOfflinePageToModel(CreateDummyRecentTab(2)); |
437 // The provider is not notified about the recent tabs yet. | 435 // The provider is not notified about the recent tabs yet. |
438 task_runner()->RunUntilIdle(); | 436 task_runner()->RunUntilIdle(); |
439 // However, it must return both tabs when the model is loaded. | 437 // However, it must return both tabs when the model is loaded. |
440 } | 438 } |
441 | 439 |
442 } // namespace ntp_snippets | 440 } // namespace ntp_snippets |
OLD | NEW |