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

Unified Diff: chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc

Issue 1749893002: Fix Smart Lock bugs introduced by change from raw email to AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: 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
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_signin_chromeos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
diff --git a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
index 118c2b2f57d4798184efc698af3f61f48b77c006..73050841931c64527df101e43f8e83faa440acea 100644
--- a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
+++ b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
@@ -45,7 +45,9 @@ namespace {
// IDs for fake users used in tests.
const char kTestUserPrimary[] = "primary_user@nowhere.com";
+const char kPrimaryGaiaId[] = "1111111111";
const char kTestUserSecondary[] = "secondary_user@nowhere.com";
+const char kSecondaryGaiaId[] = "2222222222";
// App manager to be used in EasyUnlockService tests.
// This effectivelly abstracts the extension system from the tests.
@@ -222,7 +224,8 @@ class EasyUnlockServiceTest : public testing::Test {
ON_CALL(*mock_user_manager_, IsCurrentUserNonCryptohomeDataEphemeral())
.WillByDefault(Return(false));
- SetUpProfile(&profile_, AccountId::FromUserEmail(kTestUserPrimary));
+ SetUpProfile(&profile_, AccountId::FromUserEmailGaiaId(
+ kTestUserPrimary, kPrimaryGaiaId));
}
void TearDown() override {
@@ -267,7 +270,8 @@ class EasyUnlockServiceTest : public testing::Test {
void SetUpSecondaryProfile() {
SetUpProfile(&secondary_profile_,
- AccountId::FromUserEmail(kTestUserSecondary));
+ AccountId::FromUserEmailGaiaId(kTestUserSecondary,
+ kSecondaryGaiaId));
}
private:
@@ -287,7 +291,7 @@ class EasyUnlockServiceTest : public testing::Test {
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile->get());
- signin_manager->SetAuthenticatedAccountInfo(account_id.GetUserEmail(),
+ signin_manager->SetAuthenticatedAccountInfo(account_id.GetGaiaId(),
account_id.GetUserEmail());
}
@@ -375,4 +379,14 @@ TEST_F(EasyUnlockServiceTest, NotAllowedForEphemeralAccounts) {
EasyUnlockAppInState(profile_.get(), TestAppManager::STATE_NOT_LOADED));
}
+TEST_F(EasyUnlockServiceTest, GetAccountId) {
+ EXPECT_EQ(AccountId::FromUserEmailGaiaId(kTestUserPrimary, kPrimaryGaiaId),
+ EasyUnlockService::Get(profile_.get())->GetAccountId());
+
+ SetUpSecondaryProfile();
+ EXPECT_EQ(AccountId::FromUserEmailGaiaId(kTestUserSecondary,
+ kSecondaryGaiaId),
+ EasyUnlockService::Get(secondary_profile_.get())->GetAccountId());
+}
+
} // namespace
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_signin_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698