OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/integration/profile_sync_service_harness.h" | 5 #include "chrome/browser/sync/test/integration/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 <sstream> | 10 #include <sstream> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 LOG(ERROR) << "SetupSync(): service() is null."; | 153 LOG(ERROR) << "SetupSync(): service() is null."; |
154 return false; | 154 return false; |
155 } | 155 } |
156 | 156 |
157 // Tell the sync service that setup is in progress so we don't start syncing | 157 // Tell the sync service that setup is in progress so we don't start syncing |
158 // until we've finished configuration. | 158 // until we've finished configuration. |
159 service()->SetSetupInProgress(true); | 159 service()->SetSetupInProgress(true); |
160 | 160 |
161 // Authenticate sync client using GAIA credentials. | 161 // Authenticate sync client using GAIA credentials. |
162 service()->signin()->SetAuthenticatedUsername(username_); | 162 service()->signin()->SetAuthenticatedUsername(username_); |
163 service()->GoogleSigninSucceeded(username_, password_); | 163 service()->GoogleSigninSucceeded(username_, username_, password_); |
164 | 164 |
165 #if defined(ENABLE_MANAGED_USERS) | 165 #if defined(ENABLE_MANAGED_USERS) |
166 std::string account_id = profile_->IsSupervised() ? | 166 std::string account_id = profile_->IsSupervised() ? |
167 supervised_users::kSupervisedUserPseudoEmail : username_; | 167 supervised_users::kSupervisedUserPseudoEmail : username_; |
168 #else | 168 #else |
169 std::string account_id = username_; | 169 std::string account_id = username_; |
170 #endif | 170 #endif |
171 DCHECK(!account_id.empty()); | 171 DCHECK(!account_id.empty()); |
172 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> | 172 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> |
173 UpdateCredentials(account_id, GenerateFakeOAuth2RefreshTokenString()); | 173 UpdateCredentials(account_id, GenerateFakeOAuth2RefreshTokenString()); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 444 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
445 scoped_ptr<base::DictionaryValue> value( | 445 scoped_ptr<base::DictionaryValue> value( |
446 sync_ui_util::ConstructAboutInformation(service())); | 446 sync_ui_util::ConstructAboutInformation(service())); |
447 std::string service_status; | 447 std::string service_status; |
448 base::JSONWriter::WriteWithOptions(value.get(), | 448 base::JSONWriter::WriteWithOptions(value.get(), |
449 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 449 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
450 &service_status); | 450 &service_status); |
451 return service_status; | 451 return service_status; |
452 } | 452 } |
OLD | NEW |