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(new ContentSuggestionsService(enabled)); | 208 service_.reset( |
| 209 new ContentSuggestionsService(enabled, /*history_service=*/nullptr)); |
209 } | 210 } |
210 | 211 |
211 ContentSuggestionsService* service() { return service_.get(); } | 212 ContentSuggestionsService* service() { return service_.get(); } |
212 | 213 |
213 private: | 214 private: |
214 std::unique_ptr<ContentSuggestionsService> service_; | 215 std::unique_ptr<ContentSuggestionsService> service_; |
215 | 216 |
216 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsServiceTest); | 217 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsServiceTest); |
217 }; | 218 }; |
218 | 219 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 Category category = FromKnownCategory(KnownCategories::DOWNLOADS); | 574 Category category = FromKnownCategory(KnownCategories::DOWNLOADS); |
574 MockProvider* provider = RegisterProvider(category); | 575 MockProvider* provider = RegisterProvider(category); |
575 base::Time begin = base::Time::FromTimeT(123), | 576 base::Time begin = base::Time::FromTimeT(123), |
576 end = base::Time::FromTimeT(456); | 577 end = base::Time::FromTimeT(456); |
577 EXPECT_CALL(*provider, ClearHistory(begin, end, _)); | 578 EXPECT_CALL(*provider, ClearHistory(begin, end, _)); |
578 base::Callback<bool(const GURL& url)> filter; | 579 base::Callback<bool(const GURL& url)> filter; |
579 service()->ClearHistory(begin, end, filter); | 580 service()->ClearHistory(begin, end, filter); |
580 } | 581 } |
581 | 582 |
582 } // namespace ntp_snippets | 583 } // namespace ntp_snippets |
OLD | NEW |