summaryrefslogtreecommitdiff
path: root/chrome/browser/sync/test/integration/multi_client_status_change_checker.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2014-04-03 12:29:45 +0100
committerBen Murdoch <benm@google.com>2014-04-03 12:29:45 +0100
commite5d81f57cb97b3b6b7fccc9c5610d21eb81db09d (patch)
treef266aab56db899073b21c1edd1d0e00055b9a2cf /chrome/browser/sync/test/integration/multi_client_status_change_checker.h
parent67e8dac6e410a019f58fc452b262a184e8e7fd12 (diff)
downloadchromium_org-e5d81f57cb97b3b6b7fccc9c5610d21eb81db09d.tar.gz
Merge from Chromium at DEPS revision 261286
This commit was generated by merge_to_master.py. Change-Id: Iea9643ce91618057f128e9a5b62c07be152f2b89
Diffstat (limited to 'chrome/browser/sync/test/integration/multi_client_status_change_checker.h')
-rw-r--r--chrome/browser/sync/test/integration/multi_client_status_change_checker.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/chrome/browser/sync/test/integration/multi_client_status_change_checker.h b/chrome/browser/sync/test/integration/multi_client_status_change_checker.h
new file mode 100644
index 0000000000..5566915672
--- /dev/null
+++ b/chrome/browser/sync/test/integration/multi_client_status_change_checker.h
@@ -0,0 +1,55 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_
+#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_
+
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "base/time/time.h"
+#include "chrome/browser/sync/profile_sync_service_observer.h"
+#include "chrome/browser/sync/test/integration/status_change_checker.h"
+
+class ProfileSyncService;
+
+// This class provides some common functionality for StatusChangeCheckers that
+// observe many ProfileSyncServices. This class is abstract. Its descendants
+// are expected to provide additional functionality.
+class MultiClientStatusChangeChecker
+ : public StatusChangeChecker,
+ public ProfileSyncServiceObserver {
+ public:
+ explicit MultiClientStatusChangeChecker(
+ std::vector<ProfileSyncService*> services);
+ virtual ~MultiClientStatusChangeChecker();
+
+ // Timeout length for this operation. Default is 45s.
+ virtual base::TimeDelta GetTimeoutDuration();
+
+ // Called when waiting times out.
+ void OnTimeout();
+
+ // Blocks until the exit condition is satisfied or a timeout occurs.
+ void Wait();
+
+ // ProfileSyncServiceObserver implementation.
+ virtual void OnStateChanged() OVERRIDE;
+
+ // Returns true if the checker timed out.
+ bool TimedOut();
+
+ // StatusChangeChecker implementations and stubs.
+ virtual bool IsExitConditionSatisfied() = 0;
+ virtual std::string GetDebugMessage() const = 0;
+
+ protected:
+ const std::vector<ProfileSyncService*>& services() { return services_; }
+
+ private:
+ std::vector<ProfileSyncService*> services_;
+ bool timed_out_;
+};
+
+#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_