| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 GURL("http://dummy.com/3")), | 170 GURL("http://dummy.com/3")), |
| 171 Property(&ContentSuggestion::url, | 171 Property(&ContentSuggestion::url, |
| 172 GURL("http://dummy.com/1")), | 172 GURL("http://dummy.com/1")), |
| 173 Property(&ContentSuggestion::url, | 173 Property(&ContentSuggestion::url, |
| 174 GURL("http://dummy.com/2"))))); | 174 GURL("http://dummy.com/2"))))); |
| 175 AddOfflinePageToModel(CreateDummyRecentTab(3, tomorrow)); | 175 AddOfflinePageToModel(CreateDummyRecentTab(3, tomorrow)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 TEST_F(RecentTabSuggestionsProviderTest, ShouldDeliverCorrectCategoryInfo) { | 178 TEST_F(RecentTabSuggestionsProviderTest, ShouldDeliverCorrectCategoryInfo) { |
| 179 EXPECT_FALSE( | 179 EXPECT_FALSE( |
| 180 provider()->GetCategoryInfo(recent_tabs_category()).has_more_action()); | 180 provider()->GetCategoryInfo(recent_tabs_category()).has_fetch_action()); |
| 181 EXPECT_FALSE( | |
| 182 provider()->GetCategoryInfo(recent_tabs_category()).has_reload_action()); | |
| 183 EXPECT_FALSE(provider() | 181 EXPECT_FALSE(provider() |
| 184 ->GetCategoryInfo(recent_tabs_category()) | 182 ->GetCategoryInfo(recent_tabs_category()) |
| 185 .has_view_all_action()); | 183 .has_view_all_action()); |
| 186 } | 184 } |
| 187 | 185 |
| 188 // TODO(vitaliii): Break this test into multiple tests. Currently if it fails, | 186 // TODO(vitaliii): Break this test into multiple tests. Currently if it fails, |
| 189 // it takes long time to find which part of it actually fails. | 187 // it takes long time to find which part of it actually fails. |
| 190 TEST_F(RecentTabSuggestionsProviderTest, ShouldDismiss) { | 188 TEST_F(RecentTabSuggestionsProviderTest, ShouldDismiss) { |
| 191 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)).Times(3); | 189 EXPECT_CALL(*observer(), OnNewSuggestions(_, _, _)).Times(3); |
| 192 auto recent_tabs_list = CreateDummyRecentTabs({1, 2, 3}); | 190 auto recent_tabs_list = CreateDummyRecentTabs({1, 2, 3}); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 *observer(), | 328 *observer(), |
| 331 OnNewSuggestions( | 329 OnNewSuggestions( |
| 332 _, recent_tabs_category(), | 330 _, recent_tabs_category(), |
| 333 UnorderedElementsAre( | 331 UnorderedElementsAre( |
| 334 Property(&ContentSuggestion::url, GURL("http://dummy.com/1")), | 332 Property(&ContentSuggestion::url, GURL("http://dummy.com/1")), |
| 335 Property(&ContentSuggestion::url, GURL("http://dummy.com/2"))))); | 333 Property(&ContentSuggestion::url, GURL("http://dummy.com/2"))))); |
| 336 AddOfflinePageToModel(CreateDummyRecentTab(2)); | 334 AddOfflinePageToModel(CreateDummyRecentTab(2)); |
| 337 } | 335 } |
| 338 | 336 |
| 339 } // namespace ntp_snippets | 337 } // namespace ntp_snippets |
| OLD | NEW |