Chromium Code Reviews| 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 COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 // | 35 // |
| 36 // |configure_fail_types|: The set of types that will fail | 36 // |configure_fail_types|: The set of types that will fail |
| 37 // configuration. Once ConfigureSyncer is called, the | 37 // configuration. Once ConfigureSyncer is called, the |
| 38 // |initial_sync_ended_types_| and |progress_marker_types_| will be updated | 38 // |initial_sync_ended_types_| and |progress_marker_types_| will be updated |
| 39 // to include those types that didn't fail. | 39 // to include those types that didn't fail. |
| 40 FakeSyncManager(ModelTypeSet initial_sync_ended_types, | 40 FakeSyncManager(ModelTypeSet initial_sync_ended_types, |
| 41 ModelTypeSet progress_marker_types, | 41 ModelTypeSet progress_marker_types, |
| 42 ModelTypeSet configure_fail_types); | 42 ModelTypeSet configure_fail_types); |
| 43 ~FakeSyncManager() override; | 43 ~FakeSyncManager() override; |
| 44 | 44 |
| 45 // Returns those types that have been cleaned (purged from the directory) | 45 // Returns those types that have been purged from the directory since the last |
| 46 // since the last call to GetAndResetCleanedTypes(), or since startup if never | 46 // call to GetAndResetPurgedTypes(), or since startup if never called. |
| 47 // called. | 47 ModelTypeSet GetAndResetPurgedTypes(); |
| 48 ModelTypeSet GetAndResetCleanedTypes(); | 48 |
| 49 // Returns those types that have been unapplied as part of purging disabled | |
| 50 // types. | |
|
Nicolas Zea
2016/12/17 00:18:55
nit: may as well call out "since the last call to
| |
| 51 ModelTypeSet GetAndResetUnappliedTypes(); | |
| 49 | 52 |
| 50 // Returns those types that have been downloaded since the last call to | 53 // Returns those types that have been downloaded since the last call to |
| 51 // GetAndResetDownloadedTypes(), or since startup if never called. | 54 // GetAndResetDownloadedTypes(), or since startup if never called. |
| 52 ModelTypeSet GetAndResetDownloadedTypes(); | 55 ModelTypeSet GetAndResetDownloadedTypes(); |
| 53 | 56 |
| 54 // Returns those types that have been marked as enabled since the | 57 // Returns those types that have been marked as enabled since the |
| 55 // last call to GetAndResetEnabledTypes(), or since startup if never | 58 // last call to GetAndResetEnabledTypes(), or since startup if never |
| 56 // called. | 59 // called. |
| 57 ModelTypeSet GetAndResetEnabledTypes(); | 60 ModelTypeSet GetAndResetEnabledTypes(); |
| 58 | 61 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 base::ObserverList<SyncManager::Observer> observers_; | 126 base::ObserverList<SyncManager::Observer> observers_; |
| 124 | 127 |
| 125 // Faked directory state. | 128 // Faked directory state. |
| 126 ModelTypeSet initial_sync_ended_types_; | 129 ModelTypeSet initial_sync_ended_types_; |
| 127 ModelTypeSet progress_marker_types_; | 130 ModelTypeSet progress_marker_types_; |
| 128 | 131 |
| 129 // Test specific state. | 132 // Test specific state. |
| 130 // The types that should fail configuration attempts. These types will not | 133 // The types that should fail configuration attempts. These types will not |
| 131 // have their progress markers or initial_sync_ended bits set. | 134 // have their progress markers or initial_sync_ended bits set. |
| 132 ModelTypeSet configure_fail_types_; | 135 ModelTypeSet configure_fail_types_; |
| 133 // The set of types that have been cleaned up. | 136 // The set of types that have been purged. |
| 134 ModelTypeSet cleaned_types_; | 137 ModelTypeSet purged_types_; |
| 138 // Subset of |purged_types_| that were unapplied. | |
| 139 ModelTypeSet unapplied_types_; | |
| 135 // The set of types that have been downloaded. | 140 // The set of types that have been downloaded. |
| 136 ModelTypeSet downloaded_types_; | 141 ModelTypeSet downloaded_types_; |
| 137 // The set of types that have been enabled. | 142 // The set of types that have been enabled. |
| 138 ModelTypeSet enabled_types_; | 143 ModelTypeSet enabled_types_; |
| 139 | 144 |
| 140 // The types for which a refresh was most recently requested. | 145 // The types for which a refresh was most recently requested. |
| 141 ModelTypeSet last_refresh_request_types_; | 146 ModelTypeSet last_refresh_request_types_; |
| 142 | 147 |
| 143 // The most recent configure reason. | 148 // The most recent configure reason. |
| 144 ConfigureReason last_configure_reason_; | 149 ConfigureReason last_configure_reason_; |
| 145 | 150 |
| 146 std::unique_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; | 151 std::unique_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; |
| 147 | 152 |
| 148 TestUserShare test_user_share_; | 153 TestUserShare test_user_share_; |
| 149 | 154 |
| 150 // Number of invalidations received since startup. | 155 // Number of invalidations received since startup. |
| 151 int num_invalidations_received_; | 156 int num_invalidations_received_; |
| 152 | 157 |
| 153 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 158 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
| 154 }; | 159 }; |
| 155 | 160 |
| 156 } // namespace syncer | 161 } // namespace syncer |
| 157 | 162 |
| 158 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ | 163 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ |
| OLD | NEW |