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

Unified Diff: chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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/policy/cloud_external_data_policy_observer_unittest.cc
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
index 95982a3d9b588144754bf7ce1e2231c7247f46f5..e963d025555cfd4f6d6c9c35ffffd9d2a67b5bea 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
@@ -123,7 +123,7 @@ class CloudExternalDataPolicyObserverTest
void RefreshDeviceLocalAccountPolicy(DeviceLocalAccountPolicyBroker* broker);
- void LogInAsDeviceLocalAccount(const std::string& user_id);
+ void LogInAsDeviceLocalAccount(const AccountId& account_id);
void SetRegularUserAvatarPolicy(const std::string& value);
@@ -320,13 +320,12 @@ void CloudExternalDataPolicyObserverTest::RefreshDeviceLocalAccountPolicy(
}
void CloudExternalDataPolicyObserverTest::LogInAsDeviceLocalAccount(
- const std::string& user_id) {
- user_manager_->AddUser(user_id);
+ const AccountId& account_id) {
+ user_manager_->AddUser(account_id);
device_local_account_policy_provider_.reset(
new DeviceLocalAccountPolicyProvider(
- user_id,
- device_local_account_policy_service_.get(),
+ account_id.GetUserEmail(), device_local_account_policy_service_.get(),
scoped_ptr<PolicyMap>()));
PolicyServiceImpl::Providers providers;
@@ -335,10 +334,11 @@ void CloudExternalDataPolicyObserverTest::LogInAsDeviceLocalAccount(
builder.SetPolicyService(
scoped_ptr<PolicyService>(new PolicyServiceImpl(providers)));
builder.SetPath(chromeos::ProfileHelper::Get()->GetProfilePathByUserIdHash(
- chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting(user_id)));
+ chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting(
+ account_id.GetUserEmail())));
profile_ = builder.Build();
- profile_->set_profile_name(user_id);
+ profile_->set_profile_name(account_id.GetUserEmail());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
@@ -363,7 +363,7 @@ void CloudExternalDataPolicyObserverTest::SetRegularUserAvatarPolicy(
}
void CloudExternalDataPolicyObserverTest::LogInAsRegularUser() {
- user_manager_->AddUser(kRegularUserID);
+ user_manager_->AddUser(AccountId::FromUserEmail(kRegularUserID));
PolicyServiceImpl::Providers providers;
providers.push_back(&user_policy_provider_);
@@ -661,7 +661,7 @@ TEST_F(CloudExternalDataPolicyObserverTest,
CreateObserver();
- LogInAsDeviceLocalAccount(kDeviceLocalAccount);
+ LogInAsDeviceLocalAccount(AccountId::FromUserEmail(kDeviceLocalAccount));
EXPECT_TRUE(set_calls_.empty());
EXPECT_TRUE(cleared_calls_.empty());

Powered by Google App Engine
This is Rietveld 408576698