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

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

Issue 2790743003: [Content suggestions] Implement fetching publishers' favicons (Closed)
Patch Set: Minor fix Created 3 years, 8 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 void CreateContentSuggestionsService( 147 void CreateContentSuggestionsService(
148 ContentSuggestionsService::State enabled) { 148 ContentSuggestionsService::State enabled) {
149 ASSERT_FALSE(service_); 149 ASSERT_FALSE(service_);
150 150
151 // TODO(jkrcal): Replace by a mock. 151 // TODO(jkrcal): Replace by a mock.
152 auto user_classifier = base::MakeUnique<UserClassifier>( 152 auto user_classifier = base::MakeUnique<UserClassifier>(
153 pref_service_.get(), base::MakeUnique<base::DefaultClock>()); 153 pref_service_.get(), base::MakeUnique<base::DefaultClock>());
154 154
155 service_ = base::MakeUnique<ContentSuggestionsService>( 155 service_ = base::MakeUnique<ContentSuggestionsService>(
156 enabled, /*signin_manager=*/nullptr, /*history_service=*/nullptr, 156 enabled, /*signin_manager=*/nullptr, /*history_service=*/nullptr,
157 pref_service_.get(), std::move(category_ranker_), 157 /*large_icon_service=*/nullptr, pref_service_.get(),
158 std::move(user_classifier), /*scheduler=*/nullptr); 158 std::move(category_ranker_), std::move(user_classifier),
159 /*scheduler=*/nullptr);
159 } 160 }
160 161
161 void ResetService() { 162 void ResetService() {
162 service_->Shutdown(); 163 service_->Shutdown();
163 service_.reset(); 164 service_.reset();
164 CreateContentSuggestionsService(ContentSuggestionsService::State::ENABLED); 165 CreateContentSuggestionsService(ContentSuggestionsService::State::ENABLED);
165 } 166 }
166 167
167 ContentSuggestionsService* service() { return service_.get(); } 168 ContentSuggestionsService* service() { return service_.get(); }
168 169
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 Category category = Category::FromKnownCategory(KnownCategories::BOOKMARKS); 808 Category category = Category::FromKnownCategory(KnownCategories::BOOKMARKS);
808 MockContentSuggestionsProvider* provider = 809 MockContentSuggestionsProvider* provider =
809 MakeRegisteredMockProvider(category); 810 MakeRegisteredMockProvider(category);
810 provider->FireCategoryStatusChangedWithCurrentStatus(category); 811 provider->FireCategoryStatusChangedWithCurrentStatus(category);
811 812
812 EXPECT_CALL(*raw_mock_ranker, OnCategoryDismissed(category)); 813 EXPECT_CALL(*raw_mock_ranker, OnCategoryDismissed(category));
813 service()->DismissCategory(category); 814 service()->DismissCategory(category);
814 } 815 }
815 816
816 } // namespace ntp_snippets 817 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.cc ('k') | ios/chrome/browser/ntp_snippets/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698