| 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 DVLOG(1) << GetClientInfoString("AwaitStatusChangeWithTimeout succeeded"); | 750 DVLOG(1) << GetClientInfoString("AwaitStatusChangeWithTimeout succeeded"); |
| 751 return true; | 751 return true; |
| 752 } else { | 752 } else { |
| 753 DVLOG(0) << GetClientInfoString("AwaitStatusChangeWithTimeout timed out"); | 753 DVLOG(0) << GetClientInfoString("AwaitStatusChangeWithTimeout timed out"); |
| 754 return false; | 754 return false; |
| 755 } | 755 } |
| 756 } | 756 } |
| 757 | 757 |
| 758 ProfileSyncService::Status ProfileSyncServiceHarness::GetStatus() { | 758 ProfileSyncService::Status ProfileSyncServiceHarness::GetStatus() { |
| 759 DCHECK(service() != NULL) << "GetStatus(): service() is NULL."; | 759 DCHECK(service() != NULL) << "GetStatus(): service() is NULL."; |
| 760 return service()->QueryDetailedSyncStatus(); | 760 ProfileSyncService::Status result; |
| 761 service()->QueryDetailedSyncStatus(&result); |
| 762 return result; |
| 761 } | 763 } |
| 762 | 764 |
| 763 // We use this function to share code between IsFullySynced and IsDataSynced | 765 // We use this function to share code between IsFullySynced and IsDataSynced |
| 764 // while ensuring that all conditions are evaluated using on the same snapshot. | 766 // while ensuring that all conditions are evaluated using on the same snapshot. |
| 765 bool ProfileSyncServiceHarness::IsDataSyncedImpl( | 767 bool ProfileSyncServiceHarness::IsDataSyncedImpl( |
| 766 const SyncSessionSnapshot& snap) { | 768 const SyncSessionSnapshot& snap) { |
| 767 return snap.num_simple_conflicts() == 0 && | 769 return snap.num_simple_conflicts() == 0 && |
| 768 ServiceIsPushingChanges() && | 770 ServiceIsPushingChanges() && |
| 769 GetStatus().notifications_enabled && | 771 GetStatus().notifications_enabled && |
| 770 !service()->HasUnsyncedItems() && | 772 !service()->HasUnsyncedItems() && |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 | 1110 |
| 1109 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 1111 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
| 1110 DictionaryValue value; | 1112 DictionaryValue value; |
| 1111 sync_ui_util::ConstructAboutInformation(service_, &value); | 1113 sync_ui_util::ConstructAboutInformation(service_, &value); |
| 1112 std::string service_status; | 1114 std::string service_status; |
| 1113 base::JSONWriter::WriteWithOptions(&value, | 1115 base::JSONWriter::WriteWithOptions(&value, |
| 1114 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 1116 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 1115 &service_status); | 1117 &service_status); |
| 1116 return service_status; | 1118 return service_status; |
| 1117 } | 1119 } |
| OLD | NEW |