| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 #include <ostream> | 10 #include <ostream> |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Wait for initial sync cycle to be completed. | 184 // Wait for initial sync cycle to be completed. |
| 185 DCHECK_EQ(wait_state_, WAITING_FOR_INITIAL_SYNC); | 185 DCHECK_EQ(wait_state_, WAITING_FOR_INITIAL_SYNC); |
| 186 if (!AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, | 186 if (!AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, |
| 187 "Waiting for initial sync cycle to complete.")) { | 187 "Waiting for initial sync cycle to complete.")) { |
| 188 LOG(ERROR) << "Initial sync cycle did not complete after " | 188 LOG(ERROR) << "Initial sync cycle did not complete after " |
| 189 << kLiveSyncOperationTimeoutMs / 1000 | 189 << kLiveSyncOperationTimeoutMs / 1000 |
| 190 << " seconds."; | 190 << " seconds."; |
| 191 return false; | 191 return false; |
| 192 } | 192 } |
| 193 | 193 |
| 194 // Make sure that initial sync wasn't blocked by a missing passphrase. |
| 195 if (wait_state_ == SET_PASSPHRASE_FAILED) { |
| 196 LOG(ERROR) << "A passphrase is required for decryption. Sync cannot proceed" |
| 197 " until SetPassphrase is called."; |
| 198 return false; |
| 199 } |
| 200 |
| 194 // Indicate to the browser that sync setup is complete. | 201 // Indicate to the browser that sync setup is complete. |
| 195 service()->SetSyncSetupCompleted(); | 202 service()->SetSyncSetupCompleted(); |
| 196 | 203 |
| 197 return true; | 204 return true; |
| 198 } | 205 } |
| 199 | 206 |
| 200 void ProfileSyncServiceHarness::SignalStateCompleteWithNextState( | 207 void ProfileSyncServiceHarness::SignalStateCompleteWithNextState( |
| 201 WaitState next_state) { | 208 WaitState next_state) { |
| 202 wait_state_ = next_state; | 209 wait_state_ = next_state; |
| 203 SignalStateComplete(); | 210 SignalStateComplete(); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 return true; | 816 return true; |
| 810 } | 817 } |
| 811 | 818 |
| 812 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 819 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
| 813 DictionaryValue value; | 820 DictionaryValue value; |
| 814 sync_ui_util::ConstructAboutInformation(service_, &value); | 821 sync_ui_util::ConstructAboutInformation(service_, &value); |
| 815 std::string service_status; | 822 std::string service_status; |
| 816 base::JSONWriter::Write(&value, true, &service_status); | 823 base::JSONWriter::Write(&value, true, &service_status); |
| 817 return service_status; | 824 return service_status; |
| 818 } | 825 } |
| OLD | NEW |