Index: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc |
diff --git a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc |
index 81b85d513cfa4e22d7bc117666c3dbdbfcb9d88b..e33eb0e48a7db1556e16556021944ef1af0eb31c 100644 |
--- a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc |
+++ b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc |
@@ -140,15 +140,20 @@ class CryptohomeAuthenticatorTest : public testing::Test { |
mock_caller_(NULL), |
mock_homedir_methods_(NULL), |
owner_key_util_(new ownership::MockOwnerKeyUtil()) { |
+ // Testing profile must be initialized after user_manager_ + |
+ // user_manager_enabler_, because it will create another UserManager |
+ // instance if UserManager instance has not been registed before. |
+ profile_.reset(new TestingProfile); |
OwnerSettingsServiceChromeOSFactory::GetInstance() |
->SetOwnerKeyUtilForTesting(owner_key_util_); |
user_context_.SetKey(Key("fakepass")); |
user_context_.SetUserIDHash("me_nowhere_com_hash"); |
const user_manager::User* user = |
user_manager_->AddUser(user_context_.GetAccountId()); |
- profile_.set_profile_name(user_context_.GetAccountId().GetUserEmail()); |
+ profile_->set_profile_name(user_context_.GetAccountId().GetUserEmail()); |
- ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, &profile_); |
+ ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, |
+ profile_.get()); |
CreateTransformedKey(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, |
SystemSaltGetter::ConvertRawSaltToHexString( |
@@ -325,9 +330,9 @@ class CryptohomeAuthenticatorTest : public testing::Test { |
ScopedDeviceSettingsTestHelper device_settings_test_helper_; |
ScopedTestCrosSettings test_cros_settings_; |
- TestingProfile profile_; |
- std::unique_ptr<TestingProfileManager> profile_manager_; |
chromeos::FakeChromeUserManager* user_manager_; |
+ std::unique_ptr<TestingProfile> profile_; |
+ std::unique_ptr<TestingProfileManager> profile_manager_; |
ScopedUserManagerEnabler user_manager_enabler_; |
cryptohome::MockAsyncMethodCaller* mock_caller_; |