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

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

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 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/status_change_checker.h
diff --git a/chrome/browser/sync/test/integration/status_change_checker.h b/chrome/browser/sync/test/integration/status_change_checker.h
index b1611cc86b39881da881f2b63ecfe66235879ded..3b40432843dbd69e1abebbeb32232b41ffe88e88 100644
--- a/chrome/browser/sync/test/integration/status_change_checker.h
+++ b/chrome/browser/sync/test/integration/status_change_checker.h
@@ -21,18 +21,26 @@ class ProfileSyncServiceHarness;
// sense to call StartBlockingWait() more than once.
class StatusChangeChecker {
public:
- explicit StatusChangeChecker();
+ StatusChangeChecker();
// Returns a string representing this current StatusChangeChecker, and
// possibly some small part of its state. For example: "AwaitPassphraseError"
// or "AwaitMigrationDone(BOOKMARKS)".
virtual std::string GetDebugMessage() const = 0;
+ // Returns whether the state the checker is currently in is its desired
+ // configuration.
+ virtual bool IsExitConditionSatisfied() = 0;
+
+ // Block if IsExitConditionSatisfied() is currently false until TimedOut()
+ // becomes true. Checkers should call CheckExitCondition upon changes, which
+ // can cause Wait() to immediately return true if IsExitConditionSatisfied(),
+ // and continue to block if not. Returns false if and only if timeout occurs.
+ virtual bool Wait();
+
// Returns true if the blocking wait was exited because of a timeout.
bool TimedOut() const;
- virtual bool IsExitConditionSatisfied() = 0;
-
protected:
virtual ~StatusChangeChecker();

Powered by Google App Engine
This is Rietveld 408576698