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

Unified Diff: chrome/browser/sync/test/integration/two_client_uss_sync_test.cc

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/two_client_uss_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc b/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
index 977df4b1d367daf7d8308d05cb0729262c51381e..45bcfc6af3e4c808d88727f60f9298b09a092a0b 100644
--- a/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
@@ -91,22 +91,14 @@ class KeyChecker : public StatusChangeChecker,
public TestModelTypeService::Observer {
public:
KeyChecker(TestModelTypeService* service, const std::string& key)
- : service_(service), key_(key) {}
-
- void OnApplySyncChanges() override { CheckExitCondition(); }
-
- bool Wait() {
- if (IsExitConditionSatisfied()) {
- DVLOG(1) << "Wait() -> Exit before waiting: " << GetDebugMessage();
- return true;
- }
-
+ : service_(service), key_(key) {
service_->AddObserver(this);
- StartBlockingWait();
- service_->RemoveObserver(this);
- return !TimedOut();
}
+ ~KeyChecker() override { service_->RemoveObserver(this); }
+
+ void OnApplySyncChanges() override { CheckExitCondition(); }
+
protected:
TestModelTypeService* const service_;
const std::string key_;
@@ -184,11 +176,6 @@ class PrefsNotRunningChecker : public SingleClientStatusChangeChecker {
explicit PrefsNotRunningChecker(browser_sync::ProfileSyncService* service)
: SingleClientStatusChangeChecker(service) {}
- bool Wait() {
- SingleClientStatusChangeChecker::Wait();
- return !TimedOut();
- }
-
bool IsExitConditionSatisfied() override {
return !service()->IsDataTypeControllerRunning(syncer::PREFERENCES);
}

Powered by Google App Engine
This is Rietveld 408576698