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

Unified Diff: chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc

Issue 964563002: Replace SetAuthenticatedUsername with SetAuthenticatedAccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@priv
Patch Set: rebased Created 5 years, 8 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/policy/cloud/user_policy_signin_service_unittest.cc
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
index 9bd390857d68ad98a1925e764dbeb9a7bf0c045f..00ae9b02157d4f9f6a3f904f466d43ba56c56e94 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
@@ -65,6 +65,7 @@ namespace policy {
namespace {
+const char kTestGaiaId[] = "12345";
const char kTestUser[] = "testuser@test.com";
#if !defined(OS_ANDROID)
@@ -390,7 +391,7 @@ class UserPolicySigninServiceSignedInTest : public UserPolicySigninServiceTest {
// Set the user as signed in.
SigninManagerFactory::GetForProfile(profile_.get())->
- SetAuthenticatedUsername(kTestUser);
+ SetAuthenticatedAccountInfo(kTestGaiaId, kTestUser);
// Let the SigninService know that the profile has been created.
content::NotificationService::current()->Notify(
@@ -463,8 +464,8 @@ TEST_F(UserPolicySigninServiceTest, SignInAfterInit) {
ASSERT_FALSE(manager_->core()->service());
// Now sign in the user.
- SigninManagerFactory::GetForProfile(profile_.get())->SetAuthenticatedUsername(
- kTestUser);
+ SigninManagerFactory::GetForProfile(profile_.get())
+ ->SetAuthenticatedAccountInfo(kTestGaiaId, kTestUser);
// Complete initialization of the store.
mock_store_->NotifyStoreLoaded();
@@ -487,8 +488,8 @@ TEST_F(UserPolicySigninServiceTest, SignInWithNonEnterpriseUser) {
ASSERT_FALSE(manager_->core()->service());
// Now sign in a non-enterprise user (blacklisted gmail.com domain).
- SigninManagerFactory::GetForProfile(profile_.get())->SetAuthenticatedUsername(
- "non_enterprise_user@gmail.com");
+ SigninManagerFactory::GetForProfile(profile_.get())
+ ->SetAuthenticatedAccountInfo("12345", "non_enterprise_user@gmail.com");
Andrew T Wilson (Slow) 2015/04/13 14:32:53 Why is this 12345 and not kTestGaiaId?
Roger Tawa OOO till Jul 10th 2015/04/13 15:44:56 This call does not use kTestUser, so I figured it
// Complete initialization of the store.
mock_store_->NotifyStoreLoaded();
@@ -509,8 +510,8 @@ TEST_F(UserPolicySigninServiceTest, UnregisteredClient) {
ASSERT_FALSE(manager_->core()->service());
// Now sign in the user.
- SigninManagerFactory::GetForProfile(profile_.get())->SetAuthenticatedUsername(
- kTestUser);
+ SigninManagerFactory::GetForProfile(profile_.get())
+ ->SetAuthenticatedAccountInfo(kTestGaiaId, kTestUser);
// Make oauth token available.
GetTokenService()->IssueRefreshTokenForUser(kTestUser,
@@ -537,8 +538,8 @@ TEST_F(UserPolicySigninServiceTest, RegisteredClient) {
ASSERT_FALSE(manager_->core()->service());
// Now sign in the user.
- SigninManagerFactory::GetForProfile(profile_.get())->SetAuthenticatedUsername(
- kTestUser);
+ SigninManagerFactory::GetForProfile(profile_.get())
+ ->SetAuthenticatedAccountInfo(kTestGaiaId, kTestUser);
// Make oauth token available.
GetTokenService()->IssueRefreshTokenForUser(kTestUser,

Powered by Google App Engine
This is Rietveld 408576698