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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc

Issue 2686063003: [remote suggestions] Attach the fetch time to RemoteSnippets, ContentSnippets and SnippetArticle (Closed)
Patch Set: Update RemoteSuggestionTest Created 3 years, 10 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/remote/remote_suggestions_fetcher.h" 5 #include "components/ntp_snippets/remote/remote_suggestions_fetcher.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // Not a memleak because OAuth2TokenService takes ownership of the raw 300 // Not a memleak because OAuth2TokenService takes ownership of the raw
301 // pointer (crbug.com/688387). 301 // pointer (crbug.com/688387).
302 fake_token_service_ = base::MakeUnique<FakeProfileOAuth2TokenService>( 302 fake_token_service_ = base::MakeUnique<FakeProfileOAuth2TokenService>(
303 fake_token_service_delegate_); 303 fake_token_service_delegate_);
304 304
305 fetcher_ = base::MakeUnique<RemoteSuggestionsFetcher>( 305 fetcher_ = base::MakeUnique<RemoteSuggestionsFetcher>(
306 utils_.fake_signin_manager(), fake_token_service_.get(), 306 utils_.fake_signin_manager(), fake_token_service_.get(),
307 std::move(request_context_getter), utils_.pref_service(), nullptr, 307 std::move(request_context_getter), utils_.pref_service(), nullptr,
308 base::Bind(&ParseJsonDelayed), kAPIKey, user_classifier_.get()); 308 base::Bind(&ParseJsonDelayed), kAPIKey, user_classifier_.get());
309 309
310 fetcher_->SetTickClockForTesting(mock_task_runner_->GetMockTickClock()); 310 fetcher_->SetClockForTesting(mock_task_runner_->GetMockClock());
311 } 311 }
312 312
313 void SignIn() { utils_.fake_signin_manager()->SignIn(kTestEmail); } 313 void SignIn() { utils_.fake_signin_manager()->SignIn(kTestEmail); }
314 314
315 void IssueRefreshToken() { 315 void IssueRefreshToken() {
316 fake_token_service_delegate_->UpdateCredentials(kTestEmail, "token"); 316 fake_token_service_delegate_->UpdateCredentials(kTestEmail, "token");
317 } 317 }
318 318
319 void IssueOAuth2Token() { 319 void IssueOAuth2Token() {
320 fake_token_service_->IssueAllTokensForAccount(kTestEmail, "access_token", 320 fake_token_service_->IssueAllTokensForAccount(kTestEmail, "access_token",
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 fetched_categories) { 1020 fetched_categories) {
1021 if (fetched_categories) { 1021 if (fetched_categories) {
1022 // Matchers above aren't any more precise than this, so this is sufficient 1022 // Matchers above aren't any more precise than this, so this is sufficient
1023 // for test-failure diagnostics. 1023 // for test-failure diagnostics.
1024 return os << "list with " << fetched_categories->size() << " elements"; 1024 return os << "list with " << fetched_categories->size() << " elements";
1025 } 1025 }
1026 return os << "null"; 1026 return os << "null";
1027 } 1027 }
1028 1028
1029 } // namespace ntp_snippets 1029 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698