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

Unified Diff: chrome/browser/sync/profile_sync_service_harness.h

Issue 7655055: [Sync] Make BackendMigrator not wait for full sync cycles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup 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 5ec8a444deb00c7ee0e4e9d85378ca9423dc605f..d72f8a1176568516a331c7b744db718555319a98 100644
--- a/chrome/browser/sync/profile_sync_service_harness.h
+++ b/chrome/browser/sync/profile_sync_service_harness.h
@@ -73,15 +73,6 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// since the previous one. Returns true if a sync cycle has completed.
bool AwaitSyncCycleCompletion(const std::string& reason);
- // Blocks the caller until this harness has completed a single sync
- // cycle, even if we're already synced. Returns true if a sync
- // cycle has completed.
- //
- // TODO(akalin): This is only used by some migration tests, pending
- // the fix for http://crbug.com/92928. Remove this once that is
- // fixed.
- bool AwaitNextSyncCycleCompletion(const std::string& reason);
-
// Blocks the caller until the sync has been disabled for this client. Returns
// true if sync is disabled.
bool AwaitSyncDisabled(const std::string& reason);
@@ -89,6 +80,9 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// Blocks the caller until exponential backoff has been verified to happen.
bool AwaitExponentialBackoffVerification();
+ // Blocks until the given set of data types are migrated.
+ bool AwaitMigration(const syncable::ModelTypeSet& expected_migrated_types);
+
// 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(
@@ -213,6 +207,12 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// backoffs are triggered correctly.
WAITING_FOR_EXPONENTIAL_BACKOFF_VERIFICATION,
+ // The sync client is waiting for migration to start.
+ WAITING_FOR_MIGRATION_TO_START,
+
+ // The sync client is waiting for migration to finish.
+ WAITING_FOR_MIGRATION_TO_FINISH,
+
// The client verification is complete. We don't care about the state of
// the syncer any more.
WAITING_FOR_NOTHING,
@@ -238,6 +238,9 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
// Indicates that the operation being waited on is complete.
void SignalStateComplete();
+ // Updates the migration state we're interested in.
+ void UpdateMigrationState();
+
// Finite state machine for controlling state. Returns true only if a state
// change has taken place.
bool RunStateChangeMachine();
@@ -246,10 +249,6 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
bool AwaitStatusChangeWithTimeout(int timeout_milliseconds,
const std::string& reason);
- // Used by AwaitSyncCycleCompletion() and
- // AwaitNextSyncCycleCompletion().
- bool AwaitSyncCycleCompletionHelper(const std::string& reason);
-
// Returns true if the sync client has no unsynced items.
bool IsSynced();
@@ -290,6 +289,14 @@ class ProfileSyncServiceHarness : public ProfileSyncServiceObserver {
std::string username_;
std::string password_;
+ // The current set of data types pending migration. Used by
+ // AwaitMigration().
+ syncable::ModelTypeSet pending_migration_types_;
+
+ // The set of data types that have undergone migration. Used by
+ // AwaitMigration().
+ syncable::ModelTypeSet migrated_types_;
+
// Used for logging.
const std::string profile_debug_name_;

Powered by Google App Engine
This is Rietveld 408576698