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/content_suggestions_service.h" | 5 #include "components/ntp_snippets/content_suggestions_service.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 service()->RegisterProvider(std::move(provider)); | 198 service()->RegisterProvider(std::move(provider)); |
199 return result; | 199 return result; |
200 } | 200 } |
201 | 201 |
202 MOCK_METHOD1(OnImageFetched, void(const gfx::Image&)); | 202 MOCK_METHOD1(OnImageFetched, void(const gfx::Image&)); |
203 | 203 |
204 protected: | 204 protected: |
205 void CreateContentSuggestionsService( | 205 void CreateContentSuggestionsService( |
206 ContentSuggestionsService::State enabled) { | 206 ContentSuggestionsService::State enabled) { |
207 ASSERT_FALSE(service_); | 207 ASSERT_FALSE(service_); |
208 service_.reset( | 208 service_.reset(new ContentSuggestionsService(enabled, |
209 new ContentSuggestionsService(enabled, /*history_service=*/nullptr)); | 209 nullptr /* history_service */, |
| 210 nullptr /* pref_service */)); |
210 } | 211 } |
211 | 212 |
212 ContentSuggestionsService* service() { return service_.get(); } | 213 ContentSuggestionsService* service() { return service_.get(); } |
213 | 214 |
214 private: | 215 private: |
215 std::unique_ptr<ContentSuggestionsService> service_; | 216 std::unique_ptr<ContentSuggestionsService> service_; |
216 | 217 |
217 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsServiceTest); | 218 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsServiceTest); |
218 }; | 219 }; |
219 | 220 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 Category category = FromKnownCategory(KnownCategories::DOWNLOADS); | 575 Category category = FromKnownCategory(KnownCategories::DOWNLOADS); |
575 MockProvider* provider = RegisterProvider(category); | 576 MockProvider* provider = RegisterProvider(category); |
576 base::Time begin = base::Time::FromTimeT(123), | 577 base::Time begin = base::Time::FromTimeT(123), |
577 end = base::Time::FromTimeT(456); | 578 end = base::Time::FromTimeT(456); |
578 EXPECT_CALL(*provider, ClearHistory(begin, end, _)); | 579 EXPECT_CALL(*provider, ClearHistory(begin, end, _)); |
579 base::Callback<bool(const GURL& url)> filter; | 580 base::Callback<bool(const GURL& url)> filter; |
580 service()->ClearHistory(begin, end, filter); | 581 service()->ClearHistory(begin, end, filter); |
581 } | 582 } |
582 | 583 |
583 } // namespace ntp_snippets | 584 } // namespace ntp_snippets |
OLD | NEW |