| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login/test_login_utils.h" | 5 #include "chrome/browser/chromeos/login/test_login_utils.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/login/mock_authenticator.h" | 7 #include "chrome/browser/chromeos/login/mock_authenticator.h" |
| 8 #include "chrome/browser/chromeos/login/user.h" |
| 8 | 9 |
| 9 namespace chromeos { | 10 namespace chromeos { |
| 10 | 11 |
| 11 TestLoginUtils::TestLoginUtils(const std::string& expected_username, | 12 TestLoginUtils::TestLoginUtils(const std::string& expected_username, |
| 12 const std::string& expected_password) | 13 const std::string& expected_password) |
| 13 : expected_username_(expected_username), | 14 : expected_username_(expected_username), |
| 14 expected_password_(expected_password) { | 15 expected_password_(expected_password) { |
| 15 } | 16 } |
| 16 | 17 |
| 17 TestLoginUtils::~TestLoginUtils() {} | 18 TestLoginUtils::~TestLoginUtils() {} |
| 18 | 19 |
| 19 void TestLoginUtils::PrepareProfile( | 20 void TestLoginUtils::PrepareProfile( |
| 20 const std::string& username, | 21 const UserCredentials& credentials, |
| 21 const std::string& display_email, | 22 const std::string& display_email, |
| 22 const std::string& password, | |
| 23 bool using_oauth, | 23 bool using_oauth, |
| 24 bool has_cookies, | 24 bool has_cookies, |
| 25 Delegate* delegate) { | 25 Delegate* delegate) { |
| 26 DCHECK_EQ(expected_username_, username); | 26 DCHECK_EQ(expected_username_, credentials.username); |
| 27 DCHECK_EQ(expected_password_, password); | 27 DCHECK_EQ(expected_password_, credentials.password); |
| 28 // Profile hasn't been loaded. | 28 // Profile hasn't been loaded. |
| 29 delegate->OnProfilePrepared(NULL); | 29 delegate->OnProfilePrepared(NULL); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void TestLoginUtils::DelegateDeleted(Delegate* delegate) { | 32 void TestLoginUtils::DelegateDeleted(Delegate* delegate) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 scoped_refptr<Authenticator> TestLoginUtils::CreateAuthenticator( | 35 scoped_refptr<Authenticator> TestLoginUtils::CreateAuthenticator( |
| 36 LoginStatusConsumer* consumer) { | 36 LoginStatusConsumer* consumer) { |
| 37 return new MockAuthenticator( | 37 return new MockAuthenticator( |
| 38 consumer, expected_username_, expected_password_); | 38 consumer, expected_username_, expected_password_); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void TestLoginUtils::InitRlzDelayed(Profile* user_profile) { | 41 void TestLoginUtils::InitRlzDelayed(Profile* user_profile) { |
| 42 } | 42 } |
| 43 | 43 |
| 44 void TestLoginUtils::StopBackgroundFetchers() { | 44 void TestLoginUtils::StopBackgroundFetchers() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace chromeos | 47 } // namespace chromeos |
| OLD | NEW |