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

Side by Side Diff: components/ntp_snippets/content_suggestions_service_unittest.cc

Issue 2663313002: 📰 Merge the has_fetch_more and has_reload actions (Closed)
Patch Set: rebase 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/content_suggestions_service.h" 5 #include "components/ntp_snippets/content_suggestions_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 Category category = Category::FromKnownCategory(KnownCategories::DOWNLOADS); 426 Category category = Category::FromKnownCategory(KnownCategories::DOWNLOADS);
427 MockContentSuggestionsProvider* provider = 427 MockContentSuggestionsProvider* provider =
428 MakeRegisteredMockProvider(category); 428 MakeRegisteredMockProvider(category);
429 provider->FireCategoryStatusChangedWithCurrentStatus(category); 429 provider->FireCategoryStatusChangedWithCurrentStatus(category);
430 base::Optional<CategoryInfo> result = service()->GetCategoryInfo(category); 430 base::Optional<CategoryInfo> result = service()->GetCategoryInfo(category);
431 ASSERT_TRUE(result.has_value()); 431 ASSERT_TRUE(result.has_value());
432 CategoryInfo expected = provider->GetCategoryInfo(category); 432 CategoryInfo expected = provider->GetCategoryInfo(category);
433 const CategoryInfo& actual = result.value(); 433 const CategoryInfo& actual = result.value();
434 EXPECT_THAT(expected.title(), Eq(actual.title())); 434 EXPECT_THAT(expected.title(), Eq(actual.title()));
435 EXPECT_THAT(expected.card_layout(), Eq(actual.card_layout())); 435 EXPECT_THAT(expected.card_layout(), Eq(actual.card_layout()));
436 EXPECT_THAT(expected.has_more_action(), Eq(actual.has_more_action())); 436 EXPECT_THAT(expected.has_fetch_action(), Eq(actual.has_fetch_action()));
437 EXPECT_THAT(expected.has_reload_action(), Eq(actual.has_reload_action()));
438 EXPECT_THAT(expected.has_view_all_action(), Eq(actual.has_view_all_action())); 437 EXPECT_THAT(expected.has_view_all_action(), Eq(actual.has_view_all_action()));
439 } 438 }
440 439
441 TEST_F(ContentSuggestionsServiceTest, 440 TEST_F(ContentSuggestionsServiceTest,
442 ShouldRegisterNewCategoryOnNewSuggestions) { 441 ShouldRegisterNewCategoryOnNewSuggestions) {
443 Category category = Category::FromKnownCategory(KnownCategories::DOWNLOADS); 442 Category category = Category::FromKnownCategory(KnownCategories::DOWNLOADS);
444 MockContentSuggestionsProvider* provider = 443 MockContentSuggestionsProvider* provider =
445 MakeRegisteredMockProvider(category); 444 MakeRegisteredMockProvider(category);
446 provider->FireCategoryStatusChangedWithCurrentStatus(category); 445 provider->FireCategoryStatusChangedWithCurrentStatus(category);
447 MockServiceObserver observer; 446 MockServiceObserver observer;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 Category category = Category::FromKnownCategory(KnownCategories::BOOKMARKS); 801 Category category = Category::FromKnownCategory(KnownCategories::BOOKMARKS);
803 MockContentSuggestionsProvider* provider = 802 MockContentSuggestionsProvider* provider =
804 MakeRegisteredMockProvider(category); 803 MakeRegisteredMockProvider(category);
805 provider->FireCategoryStatusChangedWithCurrentStatus(category); 804 provider->FireCategoryStatusChangedWithCurrentStatus(category);
806 805
807 EXPECT_CALL(*raw_mock_ranker, OnCategoryDismissed(category)); 806 EXPECT_CALL(*raw_mock_ranker, OnCategoryDismissed(category));
808 service()->DismissCategory(category); 807 service()->DismissCategory(category);
809 } 808 }
810 809
811 } // namespace ntp_snippets 810 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/category_info.cc ('k') | components/ntp_snippets/mock_content_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698