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

Side by Side Diff: chromeos/login/auth/mock_authenticator.cc

Issue 681593003: Revert of Extract LoginPerformer to chromeos/auth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « chromeos/login/auth/mock_authenticator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromeos/login/auth/mock_authenticator.h" 5 #include "chromeos/login/auth/mock_authenticator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 12
13 MockAuthenticator::MockAuthenticator(AuthStatusConsumer* consumer, 13 MockAuthenticator::MockAuthenticator(AuthStatusConsumer* consumer,
14 const UserContext& expected_user_context) 14 const UserContext& expected_user_context)
15 : Authenticator(consumer), 15 : Authenticator(consumer),
16 expected_user_context_(expected_user_context), 16 expected_user_context_(expected_user_context),
17 message_loop_(base::MessageLoopProxy::current()) { 17 message_loop_(base::MessageLoopProxy::current()) {
18 } 18 }
19 19
20 void MockAuthenticator::CompleteLogin(content::BrowserContext* ignored, 20 void MockAuthenticator::CompleteLogin(Profile* profile,
21 const UserContext& user_context) { 21 const UserContext& user_context) {
22 if (expected_user_context_ != user_context) 22 if (expected_user_context_ != user_context)
23 NOTREACHED(); 23 NOTREACHED();
24 OnAuthSuccess(); 24 OnAuthSuccess();
25 } 25 }
26 26
27 void MockAuthenticator::AuthenticateToLogin(content::BrowserContext* ignored, 27 void MockAuthenticator::AuthenticateToLogin(Profile* profile,
28 const UserContext& user_context) { 28 const UserContext& user_context) {
29 if (user_context == expected_user_context_) { 29 if (user_context == expected_user_context_) {
30 message_loop_->PostTask( 30 message_loop_->PostTask(
31 FROM_HERE, base::Bind(&MockAuthenticator::OnAuthSuccess, this)); 31 FROM_HERE, base::Bind(&MockAuthenticator::OnAuthSuccess, this));
32 return; 32 return;
33 } 33 }
34 GoogleServiceAuthError error( 34 GoogleServiceAuthError error(
35 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); 35 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
36 message_loop_->PostTask( 36 message_loop_->PostTask(
37 FROM_HERE, 37 FROM_HERE,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 void MockAuthenticator::SetExpectedCredentials( 100 void MockAuthenticator::SetExpectedCredentials(
101 const UserContext& user_context) { 101 const UserContext& user_context) {
102 expected_user_context_ = user_context; 102 expected_user_context_ = user_context;
103 } 103 }
104 104
105 MockAuthenticator::~MockAuthenticator() { 105 MockAuthenticator::~MockAuthenticator() {
106 } 106 }
107 107
108 } // namespace chromeos 108 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/login/auth/mock_authenticator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698