| 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/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 CrosSettings::Get()->SetBoolean(kPolicyMissingMitigationMode, true); | 314 CrosSettings::Get()->SetBoolean(kPolicyMissingMitigationMode, true); |
| 315 | 315 |
| 316 // Initialize login state for this test to verify the login state is changed | 316 // Initialize login state for this test to verify the login state is changed |
| 317 // to SAFE_MODE. | 317 // to SAFE_MODE. |
| 318 LoginState::Initialize(); | 318 LoginState::Initialize(); |
| 319 | 319 |
| 320 EXPECT_EQ(ParallelAuthenticator::CONTINUE, | 320 EXPECT_EQ(ParallelAuthenticator::CONTINUE, |
| 321 SetAndResolveState(auth_.get(), state_.release())); | 321 SetAndResolveState(auth_.get(), state_.release())); |
| 322 EXPECT_TRUE(LoginState::Get()->IsInSafeMode()); | 322 EXPECT_TRUE(LoginState::Get()->IsInSafeMode()); |
| 323 | 323 |
| 324 // Simulate TPM token ready event. The tpm token parameters are not | 324 // Simulate TPM token ready event. |
| 325 // actually used by the DeviceSettingsService, so it is OK to pass arbitrary | 325 DeviceSettingsService::Get()->OnTPMTokenReady(); |
| 326 // values. | |
| 327 DeviceSettingsService::Get()->OnTPMTokenReady("pin", "token_name", 0); | |
| 328 | 326 |
| 329 // Flush all the pending operations. The operations should induce an owner | 327 // Flush all the pending operations. The operations should induce an owner |
| 330 // verification. | 328 // verification. |
| 331 device_settings_test_helper_.Flush(); | 329 device_settings_test_helper_.Flush(); |
| 332 // and test that the mount has succeeded. | 330 // and test that the mount has succeeded. |
| 333 state_.reset(new TestAttemptState(UserContext(username_, | 331 state_.reset(new TestAttemptState(UserContext(username_, |
| 334 password_, | 332 password_, |
| 335 std::string()), | 333 std::string()), |
| 336 "", | 334 "", |
| 337 "", | 335 "", |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 .Times(1) | 607 .Times(1) |
| 610 .RetiresOnSaturation(); | 608 .RetiresOnSaturation(); |
| 611 | 609 |
| 612 auth_->AuthenticateToUnlock(UserContext(username_, | 610 auth_->AuthenticateToUnlock(UserContext(username_, |
| 613 std::string(), | 611 std::string(), |
| 614 std::string())); | 612 std::string())); |
| 615 base::MessageLoop::current()->Run(); | 613 base::MessageLoop::current()->Run(); |
| 616 } | 614 } |
| 617 | 615 |
| 618 } // namespace chromeos | 616 } // namespace chromeos |
| OLD | NEW |