| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 .WillRepeatedly(Return(false)); | 227 .WillRepeatedly(Return(false)); |
| 228 EXPECT_EQ(policy::EnterpriseInstallAttributes::LOCK_SUCCESS, | 228 EXPECT_EQ(policy::EnterpriseInstallAttributes::LOCK_SUCCESS, |
| 229 connector_->LockDevice(username)); | 229 connector_->LockDevice(username)); |
| 230 loop_.RunAllPending(); | 230 loop_.RunAllPending(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void PrepareProfile(const std::string& username) { | 233 void PrepareProfile(const std::string& username) { |
| 234 MockSessionManagerClient* session_managed_client = | 234 MockSessionManagerClient* session_managed_client = |
| 235 dbus_thread_manager_.mock_session_manager_client(); | 235 dbus_thread_manager_.mock_session_manager_client(); |
| 236 EXPECT_CALL(*session_managed_client, StartSession(_)); | 236 EXPECT_CALL(*session_managed_client, StartSession(_)); |
| 237 | |
| 238 // crypto::Encryptor::SetCounter wants exactly 128 bits, and | |
| 239 // ParallelAuthenticator CHECKs on that. | |
| 240 CryptohomeBlob blob; | |
| 241 for (size_t i = 0; i < 16; ++i) | |
| 242 blob.push_back(i); | |
| 243 EXPECT_CALL(*cryptohome_, GetSystemSalt()) | 237 EXPECT_CALL(*cryptohome_, GetSystemSalt()) |
| 244 .WillRepeatedly(Return(blob)); | 238 .WillRepeatedly(Return(std::string("stub_system_salt"))); |
| 245 EXPECT_CALL(*cryptohome_, AsyncMount(_, _, _, _)) | 239 EXPECT_CALL(*cryptohome_, AsyncMount(_, _, _, _)) |
| 246 .WillRepeatedly(Return(true)); | 240 .WillRepeatedly(Return(true)); |
| 247 | 241 |
| 248 scoped_refptr<Authenticator> authenticator = | 242 scoped_refptr<Authenticator> authenticator = |
| 249 LoginUtils::Get()->CreateAuthenticator(this); | 243 LoginUtils::Get()->CreateAuthenticator(this); |
| 250 authenticator->CompleteLogin(ProfileManager::GetDefaultProfile(), | 244 authenticator->CompleteLogin(ProfileManager::GetDefaultProfile(), |
| 251 username, | 245 username, |
| 252 "password"); | 246 "password"); |
| 253 | 247 |
| 254 GaiaAuthConsumer::ClientLoginResult credentials; | 248 GaiaAuthConsumer::ClientLoginResult credentials; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 450 } |
| 457 | 451 |
| 458 INSTANTIATE_TEST_CASE_P( | 452 INSTANTIATE_TEST_CASE_P( |
| 459 LoginUtilsBlockingLoginTestInstance, | 453 LoginUtilsBlockingLoginTestInstance, |
| 460 LoginUtilsBlockingLoginTest, | 454 LoginUtilsBlockingLoginTest, |
| 461 testing::Values(0, 1, 2, 3, 4, 5)); | 455 testing::Values(0, 1, 2, 3, 4, 5)); |
| 462 | 456 |
| 463 } // namespace | 457 } // namespace |
| 464 | 458 |
| 465 } | 459 } |
| OLD | NEW |