| Index: chrome/browser/sync/test/integration/profile_sync_service_harness.cc
|
| diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
|
| index 2f4450be96bf91ee381c37b78d160fe66be7cc11..e739a36ad5d58d61a561ffbfb9a64ffaa2061b54 100644
|
| --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
|
| +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
|
| @@ -37,6 +37,10 @@ using syncer::sessions::SyncSessionSnapshot;
|
|
|
| namespace {
|
|
|
| +std::string GetGaiaIdForUsername(const std::string& username) {
|
| + return "gaia-id-" + username;
|
| +}
|
| +
|
| bool HasAuthError(ProfileSyncService* service) {
|
| return service->GetAuthError().state() ==
|
| GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS ||
|
| @@ -155,6 +159,12 @@ bool ProfileSyncServiceHarness::SetupSync(
|
| // until we've finished configuration.
|
| service()->SetSetupInProgress(true);
|
|
|
| + // Authenticate sync client using GAIA credentials.
|
| + std::string gaia_id = GetGaiaIdForUsername(username_);
|
| + service()->signin()->SetAuthenticatedAccountInfo(gaia_id, username_);
|
| + std::string account_id = service()->signin()->GetAuthenticatedAccountId();
|
| + service()->GoogleSigninSucceeded(account_id, username_, password_);
|
| +
|
| DCHECK(!username_.empty());
|
| if (signin_type_ == SigninType::UI_SIGNIN) {
|
| Browser* browser =
|
| @@ -166,10 +176,10 @@ bool ProfileSyncServiceHarness::SetupSync(
|
| }
|
| } else if (signin_type_ == SigninType::FAKE_SIGNIN) {
|
| // Authenticate sync client using GAIA credentials.
|
| - service()->signin()->SetAuthenticatedUsername(username_);
|
| - service()->GoogleSigninSucceeded(username_, username_, password_);
|
| + service()->signin()->SetAuthenticatedAccountInfo(gaia_id, username_);
|
| + service()->GoogleSigninSucceeded(account_id, username_, password_);
|
| ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->
|
| - UpdateCredentials(username_, GenerateFakeOAuth2RefreshTokenString());
|
| + UpdateCredentials(account_id, GenerateFakeOAuth2RefreshTokenString());
|
| } else {
|
| LOG(ERROR) << "Unsupported profile signin type.";
|
| }
|
|
|