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

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

Issue 2718453002: ntp_snippets: default to staging API on dev/canary (Closed)
Patch Set: 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter = 295 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter =
296 new net::TestURLRequestContextGetter(mock_task_runner_.get()); 296 new net::TestURLRequestContextGetter(mock_task_runner_.get());
297 297
298 fake_token_service_ = base::MakeUnique<FakeProfileOAuth2TokenService>( 298 fake_token_service_ = base::MakeUnique<FakeProfileOAuth2TokenService>(
299 base::MakeUnique<FakeOAuth2TokenServiceDelegate>( 299 base::MakeUnique<FakeOAuth2TokenServiceDelegate>(
300 request_context_getter.get())); 300 request_context_getter.get()));
301 301
302 fetcher_ = base::MakeUnique<RemoteSuggestionsFetcher>( 302 fetcher_ = base::MakeUnique<RemoteSuggestionsFetcher>(
303 utils_.fake_signin_manager(), fake_token_service_.get(), 303 utils_.fake_signin_manager(), fake_token_service_.get(),
304 std::move(request_context_getter), utils_.pref_service(), nullptr, 304 std::move(request_context_getter), utils_.pref_service(), nullptr,
305 base::Bind(&ParseJsonDelayed), kAPIKey, user_classifier_.get()); 305 base::Bind(&ParseJsonDelayed), GetFetchEndpoint(true), kAPIKey,
jkrcal 2017/02/23 13:25:22 nit: could you please add /*is_stable_or_beta_chan
sfiera 2017/02/23 13:28:47 Done.
306 user_classifier_.get());
306 307
307 fetcher_->SetClockForTesting(mock_task_runner_->GetMockClock()); 308 fetcher_->SetClockForTesting(mock_task_runner_->GetMockClock());
308 } 309 }
309 310
310 void SignIn() { utils_.fake_signin_manager()->SignIn(kTestEmail); } 311 void SignIn() { utils_.fake_signin_manager()->SignIn(kTestEmail); }
311 312
312 void IssueRefreshToken() { 313 void IssueRefreshToken() {
313 fake_token_service_->GetDelegate()->UpdateCredentials(kTestEmail, "token"); 314 fake_token_service_->GetDelegate()->UpdateCredentials(kTestEmail, "token");
314 } 315 }
315 316
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 fetched_categories) { 1017 fetched_categories) {
1017 if (fetched_categories) { 1018 if (fetched_categories) {
1018 // Matchers above aren't any more precise than this, so this is sufficient 1019 // Matchers above aren't any more precise than this, so this is sufficient
1019 // for test-failure diagnostics. 1020 // for test-failure diagnostics.
1020 return os << "list with " << fetched_categories->size() << " elements"; 1021 return os << "list with " << fetched_categories->size() << " elements";
1021 } 1022 }
1022 return os << "null"; 1023 return os << "null";
1023 } 1024 }
1024 1025
1025 } // namespace ntp_snippets 1026 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698