| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/profile_sync_service_harness.h" | 5 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // Authenticate sync client using GAIA credentials. | 188 // Authenticate sync client using GAIA credentials. |
| 189 service_->signin()->SetAuthenticatedUsername(username_); | 189 service_->signin()->SetAuthenticatedUsername(username_); |
| 190 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 190 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
| 191 username_); | 191 username_); |
| 192 GoogleServiceSigninSuccessDetails details(username_, password_); | 192 GoogleServiceSigninSuccessDetails details(username_, password_); |
| 193 content::NotificationService::current()->Notify( | 193 content::NotificationService::current()->Notify( |
| 194 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, | 194 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, |
| 195 content::Source<Profile>(profile_), | 195 content::Source<Profile>(profile_), |
| 196 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); | 196 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); |
| 197 TokenServiceFactory::GetForProfile(profile_)->IssueAuthTokenForTest( | 197 TokenServiceFactory::GetForProfile(profile_)->IssueAuthTokenForTest( |
| 198 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token"); |
| 199 TokenServiceFactory::GetForProfile(profile_)->IssueAuthTokenForTest( |
| 198 GaiaConstants::kSyncService, "sync_token"); | 200 GaiaConstants::kSyncService, "sync_token"); |
| 199 | 201 |
| 200 // Wait for the OnBackendInitialized() callback. | 202 // Wait for the OnBackendInitialized() callback. |
| 201 if (!AwaitBackendInitialized()) { | 203 if (!AwaitBackendInitialized()) { |
| 202 LOG(ERROR) << "OnBackendInitialized() not seen after " | 204 LOG(ERROR) << "OnBackendInitialized() not seen after " |
| 203 << kLiveSyncOperationTimeoutMs / 1000 | 205 << kLiveSyncOperationTimeoutMs / 1000 |
| 204 << " seconds."; | 206 << " seconds."; |
| 205 return false; | 207 return false; |
| 206 } | 208 } |
| 207 | 209 |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 | 1129 |
| 1128 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 1130 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
| 1129 scoped_ptr<DictionaryValue> value( | 1131 scoped_ptr<DictionaryValue> value( |
| 1130 sync_ui_util::ConstructAboutInformation(service_)); | 1132 sync_ui_util::ConstructAboutInformation(service_)); |
| 1131 std::string service_status; | 1133 std::string service_status; |
| 1132 base::JSONWriter::WriteWithOptions(value.get(), | 1134 base::JSONWriter::WriteWithOptions(value.get(), |
| 1133 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 1135 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 1134 &service_status); | 1136 &service_status); |
| 1135 return service_status; | 1137 return service_status; |
| 1136 } | 1138 } |
| OLD | NEW |