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

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

Issue 2953253002: [DICE] Enable sync for an account that is already present in the token service. (Closed)
Patch Set: Address code review Created 3 years, 5 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 55ae8d1f99feb15a21179ae1f9e1d73ef72658c4..d4fa2faa5685c7ddd371abeb572815163983e9f7 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
@@ -120,21 +120,19 @@ class UserPolicySigninServiceTest : public testing::Test {
// Policy client registration on Android depends on Token Service having
// a valid login token, while on other platforms, the login refresh token
// is specified directly.
+ UserPolicySigninServiceBase::PolicyRegistrationCallback callback =
+ base::Bind(&UserPolicySigninServiceTest::OnRegisterCompleted,
+ base::Unretained(this));
#if defined(OS_ANDROID)
GetTokenService()->UpdateCredentials(
AccountTrackerService::PickAccountIdForAccount(
profile_.get()->GetPrefs(), kTestGaiaId, kTestUser),
"oauth2_login_refresh_token");
-#endif
- service->RegisterForPolicy(
- kTestUser,
-#if defined(OS_ANDROID)
- kTestGaiaId,
+ service->RegisterForPolicyWithAccountId(kTestUser, kTestGaiaId, callback);
#else
- "mock_oauth_token",
+ service->RegisterForPolicyWithLoginToken(kTestUser, "mock_oauth_token",
+ callback);
#endif
- base::Bind(&UserPolicySigninServiceTest::OnRegisterCompleted,
- base::Unretained(this)));
ASSERT_TRUE(IsRequestActive());
}

Powered by Google App Engine
This is Rietveld 408576698