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

Unified Diff: chrome/browser/chromeos/login/users/avatar/user_image_manager_browsertest.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 10 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/users/avatar/user_image_manager_browsertest.cc
diff --git a/chrome/browser/chromeos/login/users/avatar/user_image_manager_browsertest.cc b/chrome/browser/chromeos/login/users/avatar/user_image_manager_browsertest.cc
index 44a3bd795707b262e7427d1e9e543f3d75c6b756..c1991c635d28010f2adae8ff8bcef4bb4b3cdf2f 100644
--- a/chrome/browser/chromeos/login/users/avatar/user_image_manager_browsertest.cc
+++ b/chrome/browser/chromeos/login/users/avatar/user_image_manager_browsertest.cc
@@ -107,9 +107,7 @@ policy::CloudPolicyStore* GetStoreForUser(const user_manager::User* user) {
class UserImageManagerTest : public LoginManagerTest,
public user_manager::UserManager::Observer {
protected:
- UserImageManagerTest()
- : LoginManagerTest(true),
- enterprise_account_id_(AccountId::FromUserEmail(kEnterpriseUser1)) {}
+ UserImageManagerTest() : LoginManagerTest(true) {}
// LoginManagerTest overrides:
void SetUpInProcessBrowserTestFixture() override {
@@ -327,7 +325,10 @@ class UserImageManagerTest : public LoginManagerTest,
const AccountId test_account_id1_ = AccountId::FromUserEmail(kTestUser1);
const AccountId test_account_id2_ = AccountId::FromUserEmail(kTestUser2);
- const AccountId enterprise_account_id_;
+ const AccountId enterprise_account_id_ =
+ AccountId::FromUserEmail(kEnterpriseUser1);
+ const cryptohome::Identification cryptohome_id_ =
+ cryptohome::Identification(enterprise_account_id_);
private:
DISALLOW_COPY_AND_ASSIGN(UserImageManagerTest);
@@ -666,8 +667,7 @@ class UserImageManagerPolicyTest : public UserImageManagerTest,
ASSERT_TRUE(PathService::Get(chromeos::DIR_USER_POLICY_KEYS,
&user_keys_dir));
const std::string sanitized_username =
- chromeos::CryptohomeClient::GetStubSanitizedUsername(
- enterprise_account_id_.GetUserEmail());
+ chromeos::CryptohomeClient::GetStubSanitizedUsername(cryptohome_id_);
const base::FilePath user_key_file =
user_keys_dir.AppendASCII(sanitized_username)
.AppendASCII("policy.pub");
@@ -748,8 +748,8 @@ IN_PROC_BROWSER_TEST_F(UserImageManagerPolicyTest, DISABLED_SetAndClear) {
user_policy_.payload().mutable_useravatarimage()->set_value(
ConstructPolicy(test::kUserAvatarImage2RelativePath));
user_policy_.Build();
- fake_session_manager_client_->set_user_policy(
- enterprise_account_id_.GetUserEmail(), user_policy_.GetBlob());
+ fake_session_manager_client_->set_user_policy(cryptohome_id_,
+ user_policy_.GetBlob());
run_loop_.reset(new base::RunLoop);
store->Load();
run_loop_->Run();
@@ -773,8 +773,8 @@ IN_PROC_BROWSER_TEST_F(UserImageManagerPolicyTest, DISABLED_SetAndClear) {
// image.
user_policy_.payload().Clear();
user_policy_.Build();
- fake_session_manager_client_->set_user_policy(
- enterprise_account_id_.GetUserEmail(), user_policy_.GetBlob());
+ fake_session_manager_client_->set_user_policy(cryptohome_id_,
+ user_policy_.GetBlob());
run_loop_.reset(new base::RunLoop);
store->AddObserver(this);
store->Load();
@@ -855,8 +855,8 @@ IN_PROC_BROWSER_TEST_F(UserImageManagerPolicyTest, PolicyOverridesUser) {
user_policy_.payload().mutable_useravatarimage()->set_value(
ConstructPolicy(test::kUserAvatarImage2RelativePath));
user_policy_.Build();
- fake_session_manager_client_->set_user_policy(
- enterprise_account_id_.GetUserEmail(), user_policy_.GetBlob());
+ fake_session_manager_client_->set_user_policy(cryptohome_id_,
+ user_policy_.GetBlob());
run_loop_.reset(new base::RunLoop);
store->Load();
run_loop_->Run();
@@ -902,8 +902,8 @@ IN_PROC_BROWSER_TEST_F(UserImageManagerPolicyTest, UserDoesNotOverridePolicy) {
user_policy_.payload().mutable_useravatarimage()->set_value(
ConstructPolicy(test::kUserAvatarImage2RelativePath));
user_policy_.Build();
- fake_session_manager_client_->set_user_policy(
- enterprise_account_id_.GetUserEmail(), user_policy_.GetBlob());
+ fake_session_manager_client_->set_user_policy(cryptohome_id_,
+ user_policy_.GetBlob());
run_loop_.reset(new base::RunLoop);
store->Load();
run_loop_->Run();

Powered by Google App Engine
This is Rietveld 408576698