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..865eba368647c9c978434800266db9b7e62573a9 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_; |