| 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 f7075ab3b56558d66b27a9b9725184a138045059..3812528541935da1ee49fe70fca26ca574904b3a 100644
|
| --- a/chrome/browser/sync/profile_sync_service_harness.h
|
| +++ b/chrome/browser/sync/profile_sync_service_harness.h
|
| @@ -76,9 +76,17 @@ class ProfileSyncServiceHarness
|
| // the wait was successful.
|
| bool AwaitSyncRestart();
|
|
|
| - // Blocks the caller until this harness has completed a single sync cycle
|
| + // Block the caller until this harness has completed a single sync cycle
|
| // since the previous one. Returns true if a sync cycle has completed.
|
| - bool AwaitSyncCycleCompletion(const std::string& reason);
|
| + bool AwaitDataSyncCompletion(const std::string& reason);
|
| +
|
| + // Blocks the caller until this harness has completed as many sync cycles as
|
| + // are required to ensure its progress marker matches the latest available on
|
| + // the server.
|
| + //
|
| + // Note: When other clients are committing changes this will not be reliable.
|
| + // Use one of the sync cycle functions to handle those cases.
|
| + bool AwaitFullSyncCompletion(const std::string& reason);
|
|
|
| // Blocks the caller until sync has been disabled for this client. Returns
|
| // true if sync is disabled.
|
| @@ -189,8 +197,11 @@ class ProfileSyncServiceHarness
|
| // The sync client is waiting for the first sync cycle to complete.
|
| WAITING_FOR_INITIAL_SYNC,
|
|
|
| - // The sync client is waiting for an ongoing sync cycle to complete.
|
| - WAITING_FOR_SYNC_TO_FINISH,
|
| + // The sync client is waiting for data to be synced.
|
| + WAITING_FOR_DATA_SYNC,
|
| +
|
| + // The sync client is waiting for data and progress markers to be synced.
|
| + WAITING_FOR_FULL_SYNC,
|
|
|
| // The sync client anticipates incoming updates leading to a new sync cycle.
|
| WAITING_FOR_UPDATES,
|
| @@ -265,8 +276,20 @@ class ProfileSyncServiceHarness
|
| bool AwaitStatusChangeWithTimeout(int timeout_milliseconds,
|
| const std::string& reason);
|
|
|
| + // A helper for implementing IsDataSynced() and IsFullySynced()
|
| + bool IsDataSyncedImpl(const browser_sync::sessions::SyncSessionSnapshot*);
|
| +
|
| // Returns true if the sync client has no unsynced items.
|
| - bool IsSynced();
|
| + bool IsDataSynced();
|
| +
|
| + // Returns true if the sync client has no unsynced items and its progress
|
| + // markers are believed to be up to date.
|
| + //
|
| + // Although we can't detect when commits from other clients invalidate our
|
| + // local progress markers, we do know when our own commits have invalidated
|
| + // our timestmaps. This check returns true when this client has, to the best
|
| + // of its knowledge, downloaded the latest progress markers.
|
| + bool IsFullySynced();
|
|
|
| // Returns true if there is a backend migration in progress.
|
| bool HasPendingBackendMigration();
|
|
|