| 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 SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Returns those types that have been downloaded since the last call to | 45 // Returns those types that have been downloaded since the last call to |
| 46 // GetAndResetDownloadedTypes(), or since startup if never called. | 46 // GetAndResetDownloadedTypes(), or since startup if never called. |
| 47 ModelTypeSet GetAndResetDownloadedTypes(); | 47 ModelTypeSet GetAndResetDownloadedTypes(); |
| 48 | 48 |
| 49 // Returns those types that have been marked as enabled since the | 49 // Returns those types that have been marked as enabled since the |
| 50 // last call to GetAndResetEnabledTypes(), or since startup if never | 50 // last call to GetAndResetEnabledTypes(), or since startup if never |
| 51 // called. | 51 // called. |
| 52 ModelTypeSet GetAndResetEnabledTypes(); | 52 ModelTypeSet GetAndResetEnabledTypes(); |
| 53 | 53 |
| 54 // Posts a method to invalidate the given IDs on the sync thread. | 54 // Posts a method to invalidate the given IDs on the sync thread. |
| 55 void Invalidate(const ObjectIdPayloadMap& id_payloads, | 55 void Invalidate(const ObjectIdStateMap& id_state_map, |
| 56 IncomingNotificationSource source); | 56 IncomingNotificationSource source); |
| 57 | 57 |
| 58 // Posts a method to enable notifications on the sync thread. | 58 // Posts a method to enable notifications on the sync thread. |
| 59 void EnableNotifications(); | 59 void EnableNotifications(); |
| 60 | 60 |
| 61 // Posts a method to disable notifications on the sync thread. | 61 // Posts a method to disable notifications on the sync thread. |
| 62 void DisableNotifications(NotificationsDisabledReason reason); | 62 void DisableNotifications(NotificationsDisabledReason reason); |
| 63 | 63 |
| 64 // Block until the sync thread has finished processing any pending messages. | 64 // Block until the sync thread has finished processing any pending messages. |
| 65 void WaitForSyncThread(); | 65 void WaitForSyncThread(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 virtual void ShutdownOnSyncThread() OVERRIDE; | 123 virtual void ShutdownOnSyncThread() OVERRIDE; |
| 124 virtual UserShare* GetUserShare() OVERRIDE; | 124 virtual UserShare* GetUserShare() OVERRIDE; |
| 125 virtual void RefreshNigori(const std::string& chrome_version, | 125 virtual void RefreshNigori(const std::string& chrome_version, |
| 126 const base::Closure& done_callback) OVERRIDE; | 126 const base::Closure& done_callback) OVERRIDE; |
| 127 virtual void EnableEncryptEverything() OVERRIDE; | 127 virtual void EnableEncryptEverything() OVERRIDE; |
| 128 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 128 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; |
| 129 virtual bool HasUnsyncedItems() OVERRIDE; | 129 virtual bool HasUnsyncedItems() OVERRIDE; |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 void InvalidateOnSyncThread( | 132 void InvalidateOnSyncThread( |
| 133 const ObjectIdPayloadMap& id_payloads, | 133 const ObjectIdStateMap& id_state_map, |
| 134 IncomingNotificationSource source); | 134 IncomingNotificationSource source); |
| 135 void EnableNotificationsOnSyncThread(); | 135 void EnableNotificationsOnSyncThread(); |
| 136 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason); | 136 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason); |
| 137 | 137 |
| 138 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; | 138 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; |
| 139 | 139 |
| 140 ObserverList<SyncManager::Observer> observers_; | 140 ObserverList<SyncManager::Observer> observers_; |
| 141 | 141 |
| 142 // Faked directory state. | 142 // Faked directory state. |
| 143 ModelTypeSet initial_sync_ended_types_; | 143 ModelTypeSet initial_sync_ended_types_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 156 | 156 |
| 157 // Faked notifier state. | 157 // Faked notifier state. |
| 158 SyncNotifierRegistrar registrar_; | 158 SyncNotifierRegistrar registrar_; |
| 159 | 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 160 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace syncer | 163 } // namespace syncer |
| 164 | 164 |
| 165 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 165 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| OLD | NEW |