Move Webstore URL concepts to //extensions and out
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / multi_client_status_change_checker.h
blob1d1a29fc0c3572a322aafaf1eb6ad6bd05708a37
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/profile_sync_service_observer.h"
13 #include "chrome/browser/sync/test/integration/status_change_checker.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
21 : public StatusChangeChecker,
22 public ProfileSyncServiceObserver {
23 public:
24 explicit MultiClientStatusChangeChecker(
25 std::vector<ProfileSyncService*> services);
26 virtual ~MultiClientStatusChangeChecker();
28 // Called when waiting times out.
29 void OnTimeout();
31 // Blocks until the exit condition is satisfied or a timeout occurs.
32 void Wait();
34 // ProfileSyncServiceObserver implementation.
35 virtual void OnStateChanged() OVERRIDE;
37 // StatusChangeChecker implementations and stubs.
38 virtual bool IsExitConditionSatisfied() = 0;
39 virtual std::string GetDebugMessage() const = 0;
41 protected:
42 const std::vector<ProfileSyncService*>& services() { return services_; }
44 private:
45 std::vector<ProfileSyncService*> services_;
48 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_H_