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

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: Upload before commit. 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 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..1cdeb606391252651dee185dfa84c78275c6d8bd 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;
@@ -33,7 +34,7 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
const std::string& username,
const std::string& password);
- virtual ~ProfileSyncServiceHarness() {}
+ virtual ~ProfileSyncServiceHarness();
// Creates a ProfileSyncServiceHarness object and attaches it to |profile|, a
// profile that is assumed to have been signed into sync in the past. Caller
@@ -76,6 +77,9 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// true if sync is disabled.
bool AwaitSyncDisabled(const std::string& reason);
+ // Blocks the caller until exponential backoff 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,14 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// The sync client is waiting for the sync to be disabled for this client.
WAITING_FOR_SYNC_DISABLED,
+ // The sync client is in the exponential backoff mode. Verify that
+ // backoffs are triggered correctly.
+ WAITING_FOR_EXPONENTIAL_BACKOFF_VERIFICATION,
+
+ // The client verification is complete. We don't care about the state of
+ // the syncer any more.
+ WAITING_FOR_NOTHING,
+
// The sync client needs a passphrase in order to decrypt data.
SET_PASSPHRASE_FAILED,
@@ -262,6 +274,10 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// Used for logging.
const std::string profile_debug_name_;
+ // Keeps track of the number of attempts at exponential backoff and its
+ // related bookkeeping information for verification.
+ browser_sync::RetryVerifier retry_verifier_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness);
};
« no previous file with comments | « chrome/browser/sync/js/js_sync_manager_observer_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698