| Index: components/ntp_snippets/content_suggestions_service_unittest.cc
|
| diff --git a/components/ntp_snippets/content_suggestions_service_unittest.cc b/components/ntp_snippets/content_suggestions_service_unittest.cc
|
| index 2b0ea890486697de612d858f3b81410ee0eb5b25..e7914ea9da95e83f66123f8728758eea983c19e7 100644
|
| --- a/components/ntp_snippets/content_suggestions_service_unittest.cc
|
| +++ b/components/ntp_snippets/content_suggestions_service_unittest.cc
|
| @@ -18,6 +18,7 @@
|
| #include "components/ntp_snippets/category_info.h"
|
| #include "components/ntp_snippets/category_rankers/constant_category_ranker.h"
|
| #include "components/ntp_snippets/category_rankers/fake_category_ranker.h"
|
| +#include "components/ntp_snippets/category_rankers/mock_category_ranker.h"
|
| #include "components/ntp_snippets/category_status.h"
|
| #include "components/ntp_snippets/content_suggestion.h"
|
| #include "components/ntp_snippets/content_suggestions_provider.h"
|
| @@ -743,4 +744,21 @@ TEST_F(ContentSuggestionsServiceTest, ShouldReturnCategoriesInOrderToDisplay) {
|
| ElementsAre(second_category, first_category));
|
| }
|
|
|
| +TEST_F(ContentSuggestionsServiceTest,
|
| + ShouldForwardDismissedCategoryToCategoryRanker) {
|
| + auto mock_ranker = base::MakeUnique<MockCategoryRanker>();
|
| + MockCategoryRanker* raw_mock_ranker = mock_ranker.get();
|
| + SetCategoryRanker(std::move(mock_ranker));
|
| +
|
| + // The service is recreated to pick up the new ranker.
|
| + ResetService();
|
| +
|
| + Category category = Category::FromKnownCategory(KnownCategories::BOOKMARKS);
|
| + MockProvider* provider = RegisterProvider(category);
|
| + provider->FireCategoryStatusChangedWithCurrentStatus(category);
|
| +
|
| + EXPECT_CALL(*raw_mock_ranker, OnCategoryDismissed(category));
|
| + service()->DismissCategory(category);
|
| +}
|
| +
|
| } // namespace ntp_snippets
|
|
|