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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_context.cc

Issue 2864433003: [ARC] Add browser test of ArcAuthService (Closed)
Patch Set: Response to reviews Created 3 years, 7 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 "chrome/browser/chromeos/arc/arc_auth_context.h" 5 #include "chrome/browser/chromeos/arc/arc_auth_context.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/arc/arc_support_host.h" 10 #include "chrome/browser/chromeos/arc/arc_support_host.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 void ArcAuthContext::OnRefreshTokenTimeout() { 88 void ArcAuthContext::OnRefreshTokenTimeout() {
89 LOG(WARNING) << "Failed to wait for refresh token."; 89 LOG(WARNING) << "Failed to wait for refresh token.";
90 token_service_->RemoveObserver(this); 90 token_service_->RemoveObserver(this);
91 base::ResetAndReturn(&callback_).Run(nullptr); 91 base::ResetAndReturn(&callback_).Run(nullptr);
92 } 92 }
93 93
94 void ArcAuthContext::StartFetchers() { 94 void ArcAuthContext::StartFetchers() {
95 DCHECK(!refresh_token_timeout_.IsRunning()); 95 DCHECK(!refresh_token_timeout_.IsRunning());
96 ResetFetchers(); 96 ResetFetchers();
97
98 if (skip_merge_session_for_testing_) {
99 OnMergeSessionSuccess("");
100 return;
101 }
102
97 ubertoken_fetcher_.reset( 103 ubertoken_fetcher_.reset(
98 new UbertokenFetcher(token_service_, this, GaiaConstants::kChromeOSSource, 104 new UbertokenFetcher(token_service_, this, GaiaConstants::kChromeOSSource,
99 storage_partition_->GetURLRequestContext())); 105 storage_partition_->GetURLRequestContext()));
100 ubertoken_fetcher_->StartFetchingToken(account_id_); 106 ubertoken_fetcher_->StartFetchingToken(account_id_);
101 } 107 }
102 108
103 void ArcAuthContext::OnUbertokenSuccess(const std::string& token) { 109 void ArcAuthContext::OnUbertokenSuccess(const std::string& token) {
104 ResetFetchers(); 110 ResetFetchers();
105 merger_fetcher_.reset( 111 merger_fetcher_.reset(
106 new GaiaAuthFetcher(this, GaiaConstants::kChromeOSSource, 112 new GaiaAuthFetcher(this, GaiaConstants::kChromeOSSource,
(...skipping 20 matching lines...) Expand all
127 ResetFetchers(); 133 ResetFetchers();
128 base::ResetAndReturn(&callback_).Run(nullptr); 134 base::ResetAndReturn(&callback_).Run(nullptr);
129 } 135 }
130 136
131 void ArcAuthContext::ResetFetchers() { 137 void ArcAuthContext::ResetFetchers() {
132 merger_fetcher_.reset(); 138 merger_fetcher_.reset();
133 ubertoken_fetcher_.reset(); 139 ubertoken_fetcher_.reset();
134 } 140 }
135 141
136 } // namespace arc 142 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_context.h ('k') | chrome/browser/chromeos/arc/arc_auth_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698