Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: components/sync/engine/fake_sync_manager.h

Issue 2580033002: [Sync] Ensure that CONFIGURE_CLEAN types get unapplied before configuration (Closed)
Patch Set: Adjusted comment Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 since the last call to GetAndResetUnappliedTypes, or since startup if
51 // never called.
52 ModelTypeSet GetAndResetUnappliedTypes();
49 53
50 // Returns those types that have been downloaded since the last call to 54 // Returns those types that have been downloaded since the last call to
51 // GetAndResetDownloadedTypes(), or since startup if never called. 55 // GetAndResetDownloadedTypes(), or since startup if never called.
52 ModelTypeSet GetAndResetDownloadedTypes(); 56 ModelTypeSet GetAndResetDownloadedTypes();
53 57
54 // Returns those types that have been marked as enabled since the 58 // Returns those types that have been marked as enabled since the
55 // last call to GetAndResetEnabledTypes(), or since startup if never 59 // last call to GetAndResetEnabledTypes(), or since startup if never
56 // called. 60 // called.
57 ModelTypeSet GetAndResetEnabledTypes(); 61 ModelTypeSet GetAndResetEnabledTypes();
58 62
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 base::ObserverList<SyncManager::Observer> observers_; 127 base::ObserverList<SyncManager::Observer> observers_;
124 128
125 // Faked directory state. 129 // Faked directory state.
126 ModelTypeSet initial_sync_ended_types_; 130 ModelTypeSet initial_sync_ended_types_;
127 ModelTypeSet progress_marker_types_; 131 ModelTypeSet progress_marker_types_;
128 132
129 // Test specific state. 133 // Test specific state.
130 // The types that should fail configuration attempts. These types will not 134 // The types that should fail configuration attempts. These types will not
131 // have their progress markers or initial_sync_ended bits set. 135 // have their progress markers or initial_sync_ended bits set.
132 ModelTypeSet configure_fail_types_; 136 ModelTypeSet configure_fail_types_;
133 // The set of types that have been cleaned up. 137 // The set of types that have been purged.
134 ModelTypeSet cleaned_types_; 138 ModelTypeSet purged_types_;
139 // Subset of |purged_types_| that were unapplied.
140 ModelTypeSet unapplied_types_;
135 // The set of types that have been downloaded. 141 // The set of types that have been downloaded.
136 ModelTypeSet downloaded_types_; 142 ModelTypeSet downloaded_types_;
137 // The set of types that have been enabled. 143 // The set of types that have been enabled.
138 ModelTypeSet enabled_types_; 144 ModelTypeSet enabled_types_;
139 145
140 // The types for which a refresh was most recently requested. 146 // The types for which a refresh was most recently requested.
141 ModelTypeSet last_refresh_request_types_; 147 ModelTypeSet last_refresh_request_types_;
142 148
143 // The most recent configure reason. 149 // The most recent configure reason.
144 ConfigureReason last_configure_reason_; 150 ConfigureReason last_configure_reason_;
145 151
146 std::unique_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; 152 std::unique_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_;
147 153
148 TestUserShare test_user_share_; 154 TestUserShare test_user_share_;
149 155
150 // Number of invalidations received since startup. 156 // Number of invalidations received since startup.
151 int num_invalidations_received_; 157 int num_invalidations_received_;
152 158
153 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); 159 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager);
154 }; 160 };
155 161
156 } // namespace syncer 162 } // namespace syncer
157 163
158 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_ 164 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_MANAGER_H_
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_impl_unittest.cc ('k') | components/sync/engine/fake_sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698