| 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> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <sstream> | 12 #include <sstream> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/json/json_writer.h" | 15 #include "base/json/json_writer.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
| 19 #include "base/task.h" | 19 #include "base/task.h" |
| 20 #include "base/tracked.h" | 20 #include "base/tracked.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/sync/internal_api/syncapi_functions.h" |
| 22 #include "chrome/browser/sync/sessions/session_state.h" | 23 #include "chrome/browser/sync/sessions/session_state.h" |
| 23 #include "chrome/browser/sync/signin_manager.h" | 24 #include "chrome/browser/sync/signin_manager.h" |
| 24 #include "chrome/browser/sync/sync_ui_util.h" | 25 #include "chrome/browser/sync/sync_ui_util.h" |
| 25 | 26 |
| 26 using browser_sync::sessions::SyncSessionSnapshot; | 27 using browser_sync::sessions::SyncSessionSnapshot; |
| 27 | 28 |
| 28 // The amount of time for which we wait for a live sync operation to complete. | 29 // The amount of time for which we wait for a live sync operation to complete. |
| 29 static const int kLiveSyncOperationTimeoutMs = 45000; | 30 static const int kLiveSyncOperationTimeoutMs = 45000; |
| 30 | 31 |
| 31 // Simple class to implement a timeout using PostDelayedTask. If it is not | 32 // Simple class to implement a timeout using PostDelayedTask. If it is not |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 return true; | 842 return true; |
| 842 } | 843 } |
| 843 | 844 |
| 844 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 845 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
| 845 DictionaryValue value; | 846 DictionaryValue value; |
| 846 sync_ui_util::ConstructAboutInformation(service_, &value); | 847 sync_ui_util::ConstructAboutInformation(service_, &value); |
| 847 std::string service_status; | 848 std::string service_status; |
| 848 base::JSONWriter::Write(&value, true, &service_status); | 849 base::JSONWriter::Write(&value, true, &service_status); |
| 849 return service_status; | 850 return service_status; |
| 850 } | 851 } |
| OLD | NEW |