Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / multi_client_status_change_checker.h
blob9493c45987c596fcc868922e00758d27865c563a
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_
8 #include <vector>
10 #include "base/compiler_specific.h"
11 #include "base/time/time.h"
12 #include "chrome/browser/sync/test/integration/status_change_checker.h"
13 #include "components/sync_driver/sync_service_observer.h"
15 class ProfileSyncService;
17 // This class provides some common functionality for StatusChangeCheckers that
18 // observe many ProfileSyncServices. This class is abstract. Its descendants
19 // are expected to provide additional functionality.
20 class MultiClientStatusChangeChecker : public StatusChangeChecker,
21 public sync_driver::SyncServiceObserver {
22 public:
23 explicit MultiClientStatusChangeChecker(
24 std::vector<ProfileSyncService*> services);
25 ~MultiClientStatusChangeChecker() override;
27 // Called when waiting times out.
28 void OnTimeout();
30 // Blocks until the exit condition is satisfied or a timeout occurs.
31 void Wait();
33 // sync_driver::SyncServiceObserver implementation.
34 void OnStateChanged() override;
36 // StatusChangeChecker implementations and stubs.
37 bool IsExitConditionSatisfied() override = 0;
38 std::string GetDebugMessage() const override = 0;
40 protected:
41 const std::vector<ProfileSyncService*>& services() { return services_; }
43 private:
44 std::vector<ProfileSyncService*> services_;
47 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_