| 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/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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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), kAPIKey, user_classifier_.get()); |
| 306 | 306 |
| 307 fetcher_->SetTickClockForTesting(mock_task_runner_->GetMockTickClock()); | 307 fetcher_->SetClockForTesting(mock_task_runner_->GetMockClock()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void SignIn() { utils_.fake_signin_manager()->SignIn(kTestEmail); } | 310 void SignIn() { utils_.fake_signin_manager()->SignIn(kTestEmail); } |
| 311 | 311 |
| 312 void IssueRefreshToken() { | 312 void IssueRefreshToken() { |
| 313 fake_token_service_->GetDelegate()->UpdateCredentials(kTestEmail, "token"); | 313 fake_token_service_->GetDelegate()->UpdateCredentials(kTestEmail, "token"); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void IssueOAuth2Token() { | 316 void IssueOAuth2Token() { |
| 317 fake_token_service_->IssueAllTokensForAccount(kTestEmail, "access_token", | 317 fake_token_service_->IssueAllTokensForAccount(kTestEmail, "access_token", |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 fetched_categories) { | 1016 fetched_categories) { |
| 1017 if (fetched_categories) { | 1017 if (fetched_categories) { |
| 1018 // Matchers above aren't any more precise than this, so this is sufficient | 1018 // Matchers above aren't any more precise than this, so this is sufficient |
| 1019 // for test-failure diagnostics. | 1019 // for test-failure diagnostics. |
| 1020 return os << "list with " << fetched_categories->size() << " elements"; | 1020 return os << "list with " << fetched_categories->size() << " elements"; |
| 1021 } | 1021 } |
| 1022 return os << "null"; | 1022 return os << "null"; |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 } // namespace ntp_snippets | 1025 } // namespace ntp_snippets |
| OLD | NEW |