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

Side by Side Diff: chrome/browser/sync/profile_sync_service_harness.h

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 4 months 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 | Annotate | Revision Log
OLDNEW
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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "chrome/browser/sync/profile_sync_service.h" 13 #include "chrome/browser/sync/profile_sync_service.h"
14 #include "chrome/browser/sync/profile_sync_service_observer.h" 14 #include "chrome/browser/sync/profile_sync_service_observer.h"
15 #include "chrome/browser/sync/retry_verifier.h"
15 #include "chrome/browser/sync/syncable/model_type.h" 16 #include "chrome/browser/sync/syncable/model_type.h"
16 17
17 class Profile; 18 class Profile;
18 19
19 namespace browser_sync { 20 namespace browser_sync {
20 namespace sessions { 21 namespace sessions {
21 struct SyncSessionSnapshot; 22 struct SyncSessionSnapshot;
22 } 23 }
23 } 24 }
24 25
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool AwaitSyncRestart(); 70 bool AwaitSyncRestart();
70 71
71 // Blocks the caller until this harness has completed a single sync cycle 72 // Blocks the caller until this harness has completed a single sync cycle
72 // since the previous one. Returns true if a sync cycle has completed. 73 // since the previous one. Returns true if a sync cycle has completed.
73 bool AwaitSyncCycleCompletion(const std::string& reason); 74 bool AwaitSyncCycleCompletion(const std::string& reason);
74 75
75 // Blocks the caller until the sync has been disabled for this client. Returns 76 // Blocks the caller until the sync has been disabled for this client. Returns
76 // true if sync is disabled. 77 // true if sync is disabled.
77 bool AwaitSyncDisabled(const std::string& reason); 78 bool AwaitSyncDisabled(const std::string& reason);
78 79
80 // Blocks the caller until exponential back off has been verified to happen.
Raghu Simha 2011/08/05 22:45:09 nit: s/back off/backoff/
lipalani1 2011/08/05 23:09:29 Done.
81 bool AwaitExponentialBackoffVerification();
82
79 // Blocks the caller until this harness has observed that the sync engine 83 // Blocks the caller until this harness has observed that the sync engine
80 // has downloaded all the changes seen by the |partner| harness's client. 84 // has downloaded all the changes seen by the |partner| harness's client.
81 bool WaitUntilTimestampMatches( 85 bool WaitUntilTimestampMatches(
82 ProfileSyncServiceHarness* partner, const std::string& reason); 86 ProfileSyncServiceHarness* partner, const std::string& reason);
83 87
84 // Calling this acts as a barrier and blocks the caller until |this| and 88 // Calling this acts as a barrier and blocks the caller until |this| and
85 // |partner| have both completed a sync cycle. When calling this method, 89 // |partner| have both completed a sync cycle. When calling this method,
86 // the |partner| should be the passive responder who responds to the actions 90 // the |partner| should be the passive responder who responds to the actions
87 // of |this|. This method relies upon the synchronization of callbacks 91 // of |this|. This method relies upon the synchronization of callbacks
88 // from the message queue. Returns true if two sync cycles have completed. 92 // from the message queue. Returns true if two sync cycles have completed.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 WAITING_FOR_ENCRYPTION, 187 WAITING_FOR_ENCRYPTION,
184 188
185 // The sync client is waiting for the datatype manager to be configured and 189 // The sync client is waiting for the datatype manager to be configured and
186 // for sync to be fully initialized. Used after a browser restart, where a 190 // for sync to be fully initialized. Used after a browser restart, where a
187 // full sync cycle is not expected to occur. 191 // full sync cycle is not expected to occur.
188 WAITING_FOR_SYNC_CONFIGURATION, 192 WAITING_FOR_SYNC_CONFIGURATION,
189 193
190 // The sync client is waiting for the sync to be disabled for this client. 194 // The sync client is waiting for the sync to be disabled for this client.
191 WAITING_FOR_SYNC_DISABLED, 195 WAITING_FOR_SYNC_DISABLED,
192 196
197 // The sync client is in the exponential back off mode. Verify that
198 // backoffs are triggered correctly.
199 WAITING_FOR_EXPONENTIAL_BACKOFF_VERIFICATION,
200
201 // The client verification is complete. We dont care about the state of
Raghu Simha 2011/08/05 22:45:09 nit: s/dont/don't/
lipalani1 2011/08/05 23:09:29 Done.
202 // the syncer any more.
203 WAITING_FOR_NOTHING,
204
193 // The sync client needs a passphrase in order to decrypt data. 205 // The sync client needs a passphrase in order to decrypt data.
194 SET_PASSPHRASE_FAILED, 206 SET_PASSPHRASE_FAILED,
195 207
196 // The sync client cannot reach the server. 208 // The sync client cannot reach the server.
197 SERVER_UNREACHABLE, 209 SERVER_UNREACHABLE,
198 210
199 // The sync client is fully synced and there are no pending updates. 211 // The sync client is fully synced and there are no pending updates.
200 FULLY_SYNCED, 212 FULLY_SYNCED,
201 213
202 // Syncing is disabled for the client. 214 // Syncing is disabled for the client.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // eventually match. 267 // eventually match.
256 ProfileSyncServiceHarness* timestamp_match_partner_; 268 ProfileSyncServiceHarness* timestamp_match_partner_;
257 269
258 // Credentials used for GAIA authentication. 270 // Credentials used for GAIA authentication.
259 std::string username_; 271 std::string username_;
260 std::string password_; 272 std::string password_;
261 273
262 // Used for logging. 274 // Used for logging.
263 const std::string profile_debug_name_; 275 const std::string profile_debug_name_;
264 276
277 // Keeps track of number of attempts at exponential backoff and its related
Raghu Simha 2011/08/05 22:45:09 nit: s/number/the number/
lipalani1 2011/08/05 23:09:29 Done.
278 // bookkeeping information for verification.
279 RetryVerifier retry_verifier_;
280
265 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); 281 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness);
266 }; 282 };
267 283
268 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_ 284 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_HARNESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698