| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Returns those types that have been downloaded since the last call to | 48 // Returns those types that have been downloaded since the last call to |
| 49 // GetAndResetDownloadedTypes(), or since startup if never called. | 49 // GetAndResetDownloadedTypes(), or since startup if never called. |
| 50 ModelTypeSet GetAndResetDownloadedTypes(); | 50 ModelTypeSet GetAndResetDownloadedTypes(); |
| 51 | 51 |
| 52 // Returns those types that have been marked as enabled since the | 52 // Returns those types that have been marked as enabled since the |
| 53 // last call to GetAndResetEnabledTypes(), or since startup if never | 53 // last call to GetAndResetEnabledTypes(), or since startup if never |
| 54 // called. | 54 // called. |
| 55 ModelTypeSet GetAndResetEnabledTypes(); | 55 ModelTypeSet GetAndResetEnabledTypes(); |
| 56 | 56 |
| 57 // Returns the types that have most recently received a refresh request. |
| 58 ModelTypeSet GetLastRefreshRequestTypes(); |
| 59 |
| 57 // Posts a method to invalidate the given IDs on the sync thread. | 60 // Posts a method to invalidate the given IDs on the sync thread. |
| 58 void Invalidate(const ObjectIdInvalidationMap& invalidation_map, | 61 void Invalidate(const ObjectIdInvalidationMap& invalidation_map, |
| 59 IncomingInvalidationSource source); | 62 IncomingInvalidationSource source); |
| 60 | 63 |
| 61 // Posts a method to update the invalidator state on the sync thread. | 64 // Posts a method to update the invalidator state on the sync thread. |
| 62 void UpdateInvalidatorState(InvalidatorState state); | 65 void UpdateInvalidatorState(InvalidatorState state); |
| 63 | 66 |
| 64 // Block until the sync thread has finished processing any pending messages. | 67 // Block until the sync thread has finished processing any pending messages. |
| 65 void WaitForSyncThread(); | 68 void WaitForSyncThread(); |
| 66 | 69 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 115 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
| 113 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 116 virtual SyncStatus GetDetailedStatus() const OVERRIDE; |
| 114 virtual void SaveChanges() OVERRIDE; | 117 virtual void SaveChanges() OVERRIDE; |
| 115 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; | 118 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; |
| 116 virtual void ShutdownOnSyncThread() OVERRIDE; | 119 virtual void ShutdownOnSyncThread() OVERRIDE; |
| 117 virtual UserShare* GetUserShare() OVERRIDE; | 120 virtual UserShare* GetUserShare() OVERRIDE; |
| 118 virtual const std::string cache_guid() OVERRIDE; | 121 virtual const std::string cache_guid() OVERRIDE; |
| 119 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 122 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; |
| 120 virtual bool HasUnsyncedItems() OVERRIDE; | 123 virtual bool HasUnsyncedItems() OVERRIDE; |
| 121 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; | 124 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; |
| 125 virtual void RefreshTypes(ModelTypeSet types) OVERRIDE; |
| 122 | 126 |
| 123 private: | 127 private: |
| 124 void InvalidateOnSyncThread( | 128 void InvalidateOnSyncThread( |
| 125 const ObjectIdInvalidationMap& invalidation_map, | 129 const ObjectIdInvalidationMap& invalidation_map, |
| 126 IncomingInvalidationSource source); | 130 IncomingInvalidationSource source); |
| 127 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state); | 131 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state); |
| 128 | 132 |
| 129 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; | 133 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; |
| 130 | 134 |
| 131 ObserverList<SyncManager::Observer> observers_; | 135 ObserverList<SyncManager::Observer> observers_; |
| 132 | 136 |
| 133 // Faked directory state. | 137 // Faked directory state. |
| 134 ModelTypeSet initial_sync_ended_types_; | 138 ModelTypeSet initial_sync_ended_types_; |
| 135 ModelTypeSet progress_marker_types_; | 139 ModelTypeSet progress_marker_types_; |
| 136 | 140 |
| 137 // Test specific state. | 141 // Test specific state. |
| 138 // The types that should fail configuration attempts. These types will not | 142 // The types that should fail configuration attempts. These types will not |
| 139 // have their progress markers or initial_sync_ended bits set. | 143 // have their progress markers or initial_sync_ended bits set. |
| 140 ModelTypeSet configure_fail_types_; | 144 ModelTypeSet configure_fail_types_; |
| 141 // The set of types that have been cleaned up. | 145 // The set of types that have been cleaned up. |
| 142 ModelTypeSet cleaned_types_; | 146 ModelTypeSet cleaned_types_; |
| 143 // The set of types that have been downloaded. | 147 // The set of types that have been downloaded. |
| 144 ModelTypeSet downloaded_types_; | 148 ModelTypeSet downloaded_types_; |
| 145 // The set of types that have been enabled. | 149 // The set of types that have been enabled. |
| 146 ModelTypeSet enabled_types_; | 150 ModelTypeSet enabled_types_; |
| 147 | 151 |
| 148 // Faked invalidator state. | 152 // Faked invalidator state. |
| 149 InvalidatorRegistrar registrar_; | 153 InvalidatorRegistrar registrar_; |
| 150 | 154 |
| 155 // The types for which a refresh was most recently requested. |
| 156 ModelTypeSet last_refresh_request_types_; |
| 157 |
| 151 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; | 158 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; |
| 152 | 159 |
| 153 TestUserShare test_user_share_; | 160 TestUserShare test_user_share_; |
| 154 | 161 |
| 155 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 162 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
| 156 }; | 163 }; |
| 157 | 164 |
| 158 } // namespace syncer | 165 } // namespace syncer |
| 159 | 166 |
| 160 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 167 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| OLD | NEW |