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

Unified 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: Fixing a typo. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service_harness.h
diff --git a/chrome/browser/sync/profile_sync_service_harness.h b/chrome/browser/sync/profile_sync_service_harness.h
index 4423e87bd162746f32a19ed35388ce2a32e5b1a2..ba19862c483421ae1cfd8d9bd402bf7e9a0e6d06 100644
--- a/chrome/browser/sync/profile_sync_service_harness.h
+++ b/chrome/browser/sync/profile_sync_service_harness.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_observer.h"
+#include "chrome/browser/sync/retry_verifier.h"
#include "chrome/browser/sync/syncable/model_type.h"
class Profile;
@@ -76,6 +77,9 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// true if sync is disabled.
bool AwaitSyncDisabled(const std::string& reason);
+ // Blocks the caller until exponential back off has been verified to happen.
+ bool AwaitExponentialBackoffVerification();
+
// Blocks the caller until this harness has observed that the sync engine
// has downloaded all the changes seen by the |partner| harness's client.
bool WaitUntilTimestampMatches(
@@ -190,6 +194,16 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// The sync client is waiting for the sync to be disabled for this client.
WAITING_FOR_SYNC_DISABLED,
+ // The client is in the exponential back off mode. Verify that backoffs are
Raghu Simha 2011/08/05 18:04:52 s/The client/The sync client/
lipalani1 2011/08/05 21:33:57 Done.
+ // triggered correctly.
+ WAITING_FOR_EXPONENTIAL_BACKOFF_VERIFICATION,
+
+ // Exponential backoff was triggered correctly.
+ EXPONENTIAL_BACKOFF_VERIFICATION_SUCEEDED,
Raghu Simha 2011/08/05 18:04:52 Get rid of the SUCCEEDED and FAILED states. Other
lipalani1 2011/08/05 21:33:57 Done.
+
+ // Exponential backoff was NOT triggered correctly.
+ EXPONENTIAL_BACKOFF_VERIFICATION_FAILED,
+
// The sync client needs a passphrase in order to decrypt data.
SET_PASSPHRASE_FAILED,
@@ -262,6 +276,9 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// Used for logging.
const std::string profile_debug_name_;
+ // Keep track of the retries for verification.
Raghu Simha 2011/08/05 18:04:52 Perhaps a more descriptive comment like "Keeps tra
lipalani1 2011/08/05 21:33:57 Done.
+ RetryVerifier retry_verifier_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness);
};

Powered by Google App Engine
This is Rietveld 408576698