OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PROFILE_SYNC_SERVICE_HARNESS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 | 73 |
74 // Blocks the caller until the datatype manager is configured and sync has | 74 // Blocks the caller until the datatype manager is configured and sync has |
75 // been initialized (for example, after a browser restart). Returns true if | 75 // been initialized (for example, after a browser restart). Returns true if |
76 // the wait was successful. | 76 // the wait was successful. |
77 bool AwaitSyncRestart(); | 77 bool AwaitSyncRestart(); |
78 | 78 |
79 // Blocks the caller until this harness has completed a single sync cycle | 79 // Blocks the caller until this harness has completed a single sync cycle |
80 // since the previous one. Returns true if a sync cycle has completed. | 80 // since the previous one. Returns true if a sync cycle has completed. |
81 bool AwaitSyncCycleCompletion(const std::string& reason); | 81 bool AwaitSyncCycleCompletion(const std::string& reason); |
82 | 82 |
83 // Blocks the caller until the sync has been disabled for this client. Returns | 83 // Blocks the caller until sync has been disabled for this client. Returns |
84 // true if sync is disabled. | 84 // true if sync is disabled. |
85 bool AwaitSyncDisabled(const std::string& reason); | 85 bool AwaitSyncDisabled(const std::string& reason); |
86 | 86 |
87 // Blocks the caller until exponential backoff has been verified to happen. | 87 // Blocks the caller until exponential backoff has been verified to happen. |
88 bool AwaitExponentialBackoffVerification(); | 88 bool AwaitExponentialBackoffVerification(); |
89 | 89 |
90 // Blocks the caller until the syncer receives an actionable error. | |
91 // Returns true if the ync client received an actionable error. | |
Raghu Simha
2011/09/22 21:57:41
Not done yet!
s/ync/sync/
| |
92 bool AwaitActionableError(); | |
93 | |
90 // Blocks until the given set of data types are migrated. | 94 // Blocks until the given set of data types are migrated. |
91 bool AwaitMigration(const syncable::ModelTypeSet& expected_migrated_types); | 95 bool AwaitMigration(const syncable::ModelTypeSet& expected_migrated_types); |
92 | 96 |
93 // Blocks the caller until this harness has observed that the sync engine | 97 // Blocks the caller until this harness has observed that the sync engine |
94 // has downloaded all the changes seen by the |partner| harness's client. | 98 // has downloaded all the changes seen by the |partner| harness's client. |
95 bool WaitUntilTimestampMatches( | 99 bool WaitUntilTimestampMatches( |
96 ProfileSyncServiceHarness* partner, const std::string& reason); | 100 ProfileSyncServiceHarness* partner, const std::string& reason); |
97 | 101 |
98 // Calling this acts as a barrier and blocks the caller until |this| and | 102 // Calling this acts as a barrier and blocks the caller until |this| and |
99 // |partner| have both completed a sync cycle. When calling this method, | 103 // |partner| have both completed a sync cycle. When calling this method, |
(...skipping 18 matching lines...) Expand all Loading... | |
118 static bool AwaitQuiescence( | 122 static bool AwaitQuiescence( |
119 std::vector<ProfileSyncServiceHarness*>& clients); | 123 std::vector<ProfileSyncServiceHarness*>& clients); |
120 | 124 |
121 // Blocks the caller until |service_| indicates that a passphrase is required. | 125 // Blocks the caller until |service_| indicates that a passphrase is required. |
122 bool AwaitPassphraseRequired(); | 126 bool AwaitPassphraseRequired(); |
123 | 127 |
124 // Blocks the caller until |service_| indicates that the passphrase set by | 128 // Blocks the caller until |service_| indicates that the passphrase set by |
125 // calling SetPassphrase has been accepted. | 129 // calling SetPassphrase has been accepted. |
126 bool AwaitPassphraseAccepted(); | 130 bool AwaitPassphraseAccepted(); |
127 | 131 |
128 // Returns the ProfileSyncService member of the the sync client. | 132 // Returns the ProfileSyncService member of the sync client. |
129 ProfileSyncService* service() { return service_; } | 133 ProfileSyncService* service() { return service_; } |
130 | 134 |
131 // Returns the status of the ProfileSyncService member of the the sync client. | 135 // Returns the status of the ProfileSyncService member of the sync client. |
132 ProfileSyncService::Status GetStatus(); | 136 ProfileSyncService::Status GetStatus(); |
133 | 137 |
134 // See ProfileSyncService::ShouldPushChanges(). | 138 // See ProfileSyncService::ShouldPushChanges(). |
135 bool ServiceIsPushingChanges() { return service_->ShouldPushChanges(); } | 139 bool ServiceIsPushingChanges() { return service_->ShouldPushChanges(); } |
136 | 140 |
137 // Enables sync for a particular sync datatype. Returns true on success. | 141 // Enables sync for a particular sync datatype. Returns true on success. |
138 bool EnableSyncForDatatype(syncable::ModelType datatype); | 142 bool EnableSyncForDatatype(syncable::ModelType datatype); |
139 | 143 |
140 // Disables sync for a particular sync datatype. Returns true on success. | 144 // Disables sync for a particular sync datatype. Returns true on success. |
141 bool DisableSyncForDatatype(syncable::ModelType datatype); | 145 bool DisableSyncForDatatype(syncable::ModelType datatype); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 WAITING_FOR_PASSPHRASE_ACCEPTED, | 204 WAITING_FOR_PASSPHRASE_ACCEPTED, |
201 | 205 |
202 // The sync client anticipates encryption of new datatypes. | 206 // The sync client anticipates encryption of new datatypes. |
203 WAITING_FOR_ENCRYPTION, | 207 WAITING_FOR_ENCRYPTION, |
204 | 208 |
205 // The sync client is waiting for the datatype manager to be configured and | 209 // The sync client is waiting for the datatype manager to be configured and |
206 // for sync to be fully initialized. Used after a browser restart, where a | 210 // for sync to be fully initialized. Used after a browser restart, where a |
207 // full sync cycle is not expected to occur. | 211 // full sync cycle is not expected to occur. |
208 WAITING_FOR_SYNC_CONFIGURATION, | 212 WAITING_FOR_SYNC_CONFIGURATION, |
209 | 213 |
210 // The sync client is waiting for the sync to be disabled for this client. | 214 // The sync client is waiting for sync to be disabled for this client. |
211 WAITING_FOR_SYNC_DISABLED, | 215 WAITING_FOR_SYNC_DISABLED, |
212 | 216 |
213 // The sync client is in the exponential backoff mode. Verify that | 217 // The sync client is in the exponential backoff mode. Verify that |
214 // backoffs are triggered correctly. | 218 // backoffs are triggered correctly. |
215 WAITING_FOR_EXPONENTIAL_BACKOFF_VERIFICATION, | 219 WAITING_FOR_EXPONENTIAL_BACKOFF_VERIFICATION, |
216 | 220 |
217 // The sync client is waiting for migration to start. | 221 // The sync client is waiting for migration to start. |
218 WAITING_FOR_MIGRATION_TO_START, | 222 WAITING_FOR_MIGRATION_TO_START, |
219 | 223 |
220 // The sync client is waiting for migration to finish. | 224 // The sync client is waiting for migration to finish. |
221 WAITING_FOR_MIGRATION_TO_FINISH, | 225 WAITING_FOR_MIGRATION_TO_FINISH, |
222 | 226 |
227 // The sync client is waiting for an actionable error from the server. | |
228 WAITING_FOR_ACTIONABLE_ERROR, | |
229 | |
223 // The client verification is complete. We don't care about the state of | 230 // The client verification is complete. We don't care about the state of |
224 // the syncer any more. | 231 // the syncer any more. |
225 WAITING_FOR_NOTHING, | 232 WAITING_FOR_NOTHING, |
226 | 233 |
227 // The sync client needs a passphrase in order to decrypt data. | 234 // The sync client needs a passphrase in order to decrypt data. |
228 SET_PASSPHRASE_FAILED, | 235 SET_PASSPHRASE_FAILED, |
229 | 236 |
230 // The sync client cannot reach the server. | 237 // The sync client cannot reach the server. |
231 SERVER_UNREACHABLE, | 238 SERVER_UNREACHABLE, |
232 | 239 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 const std::string profile_debug_name_; | 320 const std::string profile_debug_name_; |
314 | 321 |
315 // Keeps track of the number of attempts at exponential backoff and its | 322 // Keeps track of the number of attempts at exponential backoff and its |
316 // related bookkeeping information for verification. | 323 // related bookkeeping information for verification. |
317 browser_sync::RetryVerifier retry_verifier_; | 324 browser_sync::RetryVerifier retry_verifier_; |
318 | 325 |
319 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); | 326 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); |
320 }; | 327 }; |
321 | 328 |
322 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_ | 329 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_ |
OLD | NEW |