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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Tell the sync service that setup is in progress so we don't start syncing | 155 // Tell the sync service that setup is in progress so we don't start syncing |
156 // until we've finished configuration. | 156 // until we've finished configuration. |
157 service()->SetSetupInProgress(true); | 157 service()->SetSetupInProgress(true); |
158 | 158 |
159 // Authenticate sync client using GAIA credentials. | 159 // Authenticate sync client using GAIA credentials. |
160 service()->signin()->SetAuthenticatedUsername(username_); | 160 service()->signin()->SetAuthenticatedUsername(username_); |
161 service()->GoogleSigninSucceeded(username_, password_); | 161 service()->GoogleSigninSucceeded(username_, password_); |
162 | 162 |
163 #if defined(ENABLE_MANAGED_USERS) | 163 #if defined(ENABLE_MANAGED_USERS) |
164 std::string account_id = profile_->IsManaged() ? | 164 std::string account_id = profile_->IsSupervised() ? |
165 managed_users::kManagedUserPseudoEmail : username_; | 165 managed_users::kManagedUserPseudoEmail : username_; |
166 #else | 166 #else |
167 std::string account_id = username_; | 167 std::string account_id = username_; |
168 #endif | 168 #endif |
169 DCHECK(!account_id.empty()); | 169 DCHECK(!account_id.empty()); |
170 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> | 170 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> |
171 UpdateCredentials(account_id, GenerateFakeOAuth2RefreshTokenString()); | 171 UpdateCredentials(account_id, GenerateFakeOAuth2RefreshTokenString()); |
172 | 172 |
173 // Wait for the OnBackendInitialized() callback. | 173 // Wait for the OnBackendInitialized() callback. |
174 BackendInitializeChecker checker(service()); | 174 BackendInitializeChecker checker(service()); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 441 |
442 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 442 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
443 scoped_ptr<base::DictionaryValue> value( | 443 scoped_ptr<base::DictionaryValue> value( |
444 sync_ui_util::ConstructAboutInformation(service())); | 444 sync_ui_util::ConstructAboutInformation(service())); |
445 std::string service_status; | 445 std::string service_status; |
446 base::JSONWriter::WriteWithOptions(value.get(), | 446 base::JSONWriter::WriteWithOptions(value.get(), |
447 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 447 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
448 &service_status); | 448 &service_status); |
449 return service_status; | 449 return service_status; |
450 } | 450 } |
OLD | NEW |