Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc

Issue 2907493002: ChromeOS: Per-user time zone: refactor tests first. (Closed)
Patch Set: Fix debug build Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
« no previous file with comments | « chrome/browser/chromeos/file_manager/path_util_unittest.cc ('k') | chrome/browser/chromeos/login/hwid_checker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698