| 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 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/sync/glue/data_type_manager_impl.h" | 14 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
| 15 #include "chrome/browser/sync/invalidations/invalidator_storage.h" |
| 15 #include "chrome/browser/sync/profile_sync_service.h" | 16 #include "chrome/browser/sync/profile_sync_service.h" |
| 17 #include "chrome/browser/sync/sync_prefs.h" |
| 16 #include "chrome/test/base/profile_mock.h" | 18 #include "chrome/test/base/profile_mock.h" |
| 17 #include "sync/test/engine/test_id_factory.h" | 19 #include "sync/test/engine/test_id_factory.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 19 | 21 |
| 20 class Profile; | 22 class Profile; |
| 21 class Task; | 23 class Task; |
| 22 class TestProfileSyncService; | 24 class TestProfileSyncService; |
| 23 | 25 |
| 24 ACTION(ReturnNewDataTypeManager) { | 26 ACTION(ReturnNewDataTypeManager) { |
| 25 return new browser_sync::DataTypeManagerImpl(arg0, arg1); | 27 return new browser_sync::DataTypeManagerImpl(arg0, arg1); |
| 26 } | 28 } |
| 27 | 29 |
| 28 namespace browser_sync { | 30 namespace browser_sync { |
| 29 | 31 |
| 30 class SyncBackendHostForProfileSyncTest : public SyncBackendHost { | 32 class SyncBackendHostForProfileSyncTest : public SyncBackendHost { |
| 31 public: | 33 public: |
| 32 // |synchronous_init| causes initialization to block until the syncapi has | 34 // |synchronous_init| causes initialization to block until the syncapi has |
| 33 // completed setting itself up and called us back. | 35 // completed setting itself up and called us back. |
| 34 SyncBackendHostForProfileSyncTest( | 36 SyncBackendHostForProfileSyncTest( |
| 35 Profile* profile, | 37 Profile* profile, |
| 36 const base::WeakPtr<SyncPrefs>& sync_prefs, | 38 const base::WeakPtr<SyncPrefs>& sync_prefs, |
| 39 const base::WeakPtr<InvalidatorStorage>& invalidator_storage, |
| 37 bool set_initial_sync_ended_on_init, | 40 bool set_initial_sync_ended_on_init, |
| 38 bool synchronous_init, | 41 bool synchronous_init, |
| 39 bool fail_initial_download, | 42 bool fail_initial_download, |
| 40 bool use_real_database); | 43 bool use_real_database); |
| 41 virtual ~SyncBackendHostForProfileSyncTest(); | 44 virtual ~SyncBackendHostForProfileSyncTest(); |
| 42 | 45 |
| 43 MOCK_METHOD1(RequestNudge, void(const tracked_objects::Location&)); | 46 MOCK_METHOD1(RequestNudge, void(const tracked_objects::Location&)); |
| 44 | 47 |
| 45 // Called when a nudge comes in. | 48 // Called when a nudge comes in. |
| 46 void SimulateSyncCycleCompletedInitialSyncEnded( | 49 void SimulateSyncCycleCompletedInitialSyncEnded( |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 base::Closure callback_; | 121 base::Closure callback_; |
| 119 bool set_initial_sync_ended_on_init_; | 122 bool set_initial_sync_ended_on_init_; |
| 120 | 123 |
| 121 bool fail_initial_download_; | 124 bool fail_initial_download_; |
| 122 bool use_real_database_; | 125 bool use_real_database_; |
| 123 }; | 126 }; |
| 124 | 127 |
| 125 | 128 |
| 126 | 129 |
| 127 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 130 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |