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

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

Issue 2342553002: Measure usage metrics to prepare for adaptive fetching rates in M55 (Closed)
Patch Set: Created 4 years, 3 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 <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return result; 199 return result;
200 } 200 }
201 201
202 MOCK_METHOD2(OnImageFetched, 202 MOCK_METHOD2(OnImageFetched,
203 void(const std::string& suggestion_id, const gfx::Image&)); 203 void(const std::string& suggestion_id, const gfx::Image&));
204 204
205 protected: 205 protected:
206 void CreateContentSuggestionsService( 206 void CreateContentSuggestionsService(
207 ContentSuggestionsService::State enabled) { 207 ContentSuggestionsService::State enabled) {
208 ASSERT_FALSE(service_); 208 ASSERT_FALSE(service_);
209 service_.reset( 209 service_.reset(new ContentSuggestionsService(enabled,
210 new ContentSuggestionsService(enabled, /*history_service=*/nullptr)); 210 nullptr /* history_service */,
211 nullptr /* pref_service */));
211 } 212 }
212 213
213 ContentSuggestionsService* service() { return service_.get(); } 214 ContentSuggestionsService* service() { return service_.get(); }
214 215
215 private: 216 private:
216 std::unique_ptr<ContentSuggestionsService> service_; 217 std::unique_ptr<ContentSuggestionsService> service_;
217 218
218 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsServiceTest); 219 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsServiceTest);
219 }; 220 };
220 221
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 Category category = FromKnownCategory(KnownCategories::DOWNLOADS); 577 Category category = FromKnownCategory(KnownCategories::DOWNLOADS);
577 MockProvider* provider = RegisterProvider(category); 578 MockProvider* provider = RegisterProvider(category);
578 base::Time begin = base::Time::FromTimeT(123), 579 base::Time begin = base::Time::FromTimeT(123),
579 end = base::Time::FromTimeT(456); 580 end = base::Time::FromTimeT(456);
580 EXPECT_CALL(*provider, ClearHistory(begin, end, _)); 581 EXPECT_CALL(*provider, ClearHistory(begin, end, _));
581 base::Callback<bool(const GURL& url)> filter; 582 base::Callback<bool(const GURL& url)> filter;
582 service()->ClearHistory(begin, end, filter); 583 service()->ClearHistory(begin, end, filter);
583 } 584 }
584 585
585 } // namespace ntp_snippets 586 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.cc ('k') | components/ntp_snippets/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698