| OLD | NEW |
| 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 "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" | 5 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, &profile_); | 147 ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, &profile_); |
| 148 | 148 |
| 149 CreateTransformedKey(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, | 149 CreateTransformedKey(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, |
| 150 SystemSaltGetter::ConvertRawSaltToHexString( | 150 SystemSaltGetter::ConvertRawSaltToHexString( |
| 151 FakeCryptohomeClient::GetStubSystemSalt())); | 151 FakeCryptohomeClient::GetStubSystemSalt())); |
| 152 } | 152 } |
| 153 | 153 |
| 154 virtual ~CryptohomeAuthenticatorTest() {} | 154 virtual ~CryptohomeAuthenticatorTest() {} |
| 155 | 155 |
| 156 virtual void SetUp() { | 156 virtual void SetUp() { |
| 157 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kLoginManager); | 157 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 158 switches::kLoginManager); |
| 158 | 159 |
| 159 mock_caller_ = new cryptohome::MockAsyncMethodCaller; | 160 mock_caller_ = new cryptohome::MockAsyncMethodCaller; |
| 160 cryptohome::AsyncMethodCaller::InitializeForTesting(mock_caller_); | 161 cryptohome::AsyncMethodCaller::InitializeForTesting(mock_caller_); |
| 161 mock_homedir_methods_ = new cryptohome::MockHomedirMethods; | 162 mock_homedir_methods_ = new cryptohome::MockHomedirMethods; |
| 162 mock_homedir_methods_->SetUp(true, cryptohome::MOUNT_ERROR_NONE); | 163 mock_homedir_methods_->SetUp(true, cryptohome::MOUNT_ERROR_NONE); |
| 163 cryptohome::HomedirMethods::InitializeForTesting(mock_homedir_methods_); | 164 cryptohome::HomedirMethods::InitializeForTesting(mock_homedir_methods_); |
| 164 | 165 |
| 165 fake_cryptohome_client_ = new FakeCryptohomeClient; | 166 fake_cryptohome_client_ = new FakeCryptohomeClient; |
| 166 chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( | 167 chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( |
| 167 scoped_ptr<CryptohomeClient>(fake_cryptohome_client_)); | 168 scoped_ptr<CryptohomeClient>(fake_cryptohome_client_)); |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 // salt. | 790 // salt. |
| 790 ExpectGetKeyDataExCall( | 791 ExpectGetKeyDataExCall( |
| 791 make_scoped_ptr(new int64(Key::KEY_TYPE_SALTED_SHA256)), | 792 make_scoped_ptr(new int64(Key::KEY_TYPE_SALTED_SHA256)), |
| 792 scoped_ptr<std::string>()); | 793 scoped_ptr<std::string>()); |
| 793 | 794 |
| 794 auth_->AuthenticateToLogin(NULL, user_context_); | 795 auth_->AuthenticateToLogin(NULL, user_context_); |
| 795 base::RunLoop().Run(); | 796 base::RunLoop().Run(); |
| 796 } | 797 } |
| 797 | 798 |
| 798 } // namespace chromeos | 799 } // namespace chromeos |
| OLD | NEW |