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

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

Issue 148723002: [sync] Eliminate Await*SyncCompletion methods in integration tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/test/integration/profile_sync_service_harness.h
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.h b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
index 81004fcafe32f1c64d8c3c07129cb48fc06a231c..b74234261058e04b24b3040cea0c772f3895ea7b 100644
--- a/chrome/browser/sync/test/integration/profile_sync_service_harness.h
+++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
@@ -75,19 +75,9 @@ class ProfileSyncServiceHarness
// has been initialized. Returns true if the wait was successful.
bool AwaitBackendInitialized();
- // Blocks the caller until this harness has completed a single sync cycle
- // since the previous one. Returns true if a sync cycle has completed.
- bool AwaitDataSyncCompletion();
-
- // 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.
- // If your test involves changes to multiple clients, you should use one of
- // the other Await* functions, such as AwaitMutualSyncCycleComplete. Refer to
- // the documentation of those functions for more details.
- bool AwaitFullSyncCompletion();
+ // Blocks the caller until the client has nothing left to commit and its
+ // progress markers are up to date. Returns true if successful.
+ bool AwaitCommitActivityCompletion();
// Blocks the caller until sync has been disabled for this client. Returns
// true if sync is disabled.
@@ -173,18 +163,6 @@ class ProfileSyncServiceHarness
// Check if |type| is being synced.
bool IsTypePreferred(syncer::ModelType type);
- // Returns true if the sync client has no unsynced items.
- bool IsDataSynced() const;
-
- // 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() const;
-
// Get the number of sync entries this client has. This includes all top
// level or permanent items, and can include recently deleted entries.
size_t GetNumEntries() const;
@@ -196,6 +174,11 @@ class ProfileSyncServiceHarness
// Gets the |auto_start_enabled_| variable from the |service_|.
bool AutoStartEnabled();
+ // Runs the message loop and waits until all in-flight tasks are completed.
+ // Returns true if a steady state was reached within a timeout period, and
+ // false if a timeout was hit.
+ bool AwaitSteadyState();
+
// Runs the UI message loop and waits until the Run() method of |checker|
// returns true, indicating that the status change we are waiting for has
// taken place. Caller retains ownership of |checker|, which must outlive this
@@ -217,9 +200,6 @@ class ProfileSyncServiceHarness
// other client has.
bool MatchesPartnerClient() const;
- // Returns true if there is a backend migration in progress.
- bool HasPendingBackendMigration() const;
-
private:
ProfileSyncServiceHarness(
Profile* profile,
@@ -227,13 +207,17 @@ class ProfileSyncServiceHarness
const std::string& password,
invalidation::P2PInvalidationService* invalidation_service);
+ // Runs the UI message loop. If |quit_when_idle| is true, the loop is quit
+ // soon after in-flight tasks are complete (or a timeout limit is hit).
+ // If |quit_when_idle| is false, the loop is run indefinitely until it is
+ // explicitly quit (or a timeout limit is hit). Returns false if the timeout
+ // limit was hit, and true otherwise.
+ bool RunMessageLoop(bool quit_when_idle);
+
// Quits the current message loop. Called when the status change being waited
// on has occurred, or in the event of a timeout.
void QuitMessageLoop();
- // A helper for implementing IsDataSynced() and IsFullySynced().
- bool IsDataSyncedImpl() const;
-
// Signals that sync setup is complete, and that PSS may begin syncing.
void FinishSyncSetup();
@@ -242,6 +226,14 @@ class ProfileSyncServiceHarness
// found.
std::string GetSerializedProgressMarker(syncer::ModelType model_type) const;
+ // Returns true if a client has nothing left to commit and its progress
+ // markers are up to date.
+ bool IsCommitActivityComplete() const;
+
+ // Returns true if sync setup is complete. Called during first time sync setup
+ // and when sync is re-enabled after having been disabled.
+ bool IsSyncSetupComplete() const;
+
// Gets detailed status from |service_| in pretty-printable form.
std::string GetServiceStatus();

Powered by Google App Engine
This is Rietveld 408576698