| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_
H_ | 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_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECKER_
H_ |
| 7 | 7 |
| 8 #include <string> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 12 #include "chrome/browser/sync/test/integration/status_change_checker.h" | 13 #include "chrome/browser/sync/test/integration/status_change_checker.h" |
| 13 #include "components/sync/driver/sync_service_observer.h" | 14 #include "components/sync/driver/sync_service_observer.h" |
| 14 | 15 |
| 15 namespace browser_sync { | 16 namespace browser_sync { |
| 16 class ProfileSyncService; | 17 class ProfileSyncService; |
| 17 } // namespace browser_sync | 18 } // namespace browser_sync |
| 18 | 19 |
| 19 // This class provides some common functionality for StatusChangeCheckers that | 20 // This class provides some common functionality for StatusChangeCheckers that |
| 20 // observe many ProfileSyncServices. This class is abstract. Its descendants | 21 // observe many ProfileSyncServices. This class is abstract. Its descendants |
| 21 // are expected to provide additional functionality. | 22 // are expected to provide additional functionality. |
| 22 class MultiClientStatusChangeChecker : public StatusChangeChecker, | 23 class MultiClientStatusChangeChecker : public StatusChangeChecker, |
| 23 public sync_driver::SyncServiceObserver { | 24 public syncer::SyncServiceObserver { |
| 24 public: | 25 public: |
| 25 explicit MultiClientStatusChangeChecker( | 26 explicit MultiClientStatusChangeChecker( |
| 26 std::vector<browser_sync::ProfileSyncService*> services); | 27 std::vector<browser_sync::ProfileSyncService*> services); |
| 27 ~MultiClientStatusChangeChecker() override; | 28 ~MultiClientStatusChangeChecker() override; |
| 28 | 29 |
| 29 // Called when waiting times out. | 30 // Called when waiting times out. |
| 30 void OnTimeout(); | 31 void OnTimeout(); |
| 31 | 32 |
| 32 // Blocks until the exit condition is satisfied or a timeout occurs. | 33 // Blocks until the exit condition is satisfied or a timeout occurs. |
| 33 void Wait(); | 34 void Wait(); |
| 34 | 35 |
| 35 // sync_driver::SyncServiceObserver implementation. | 36 // syncer::SyncServiceObserver implementation. |
| 36 void OnStateChanged() override; | 37 void OnStateChanged() override; |
| 37 | 38 |
| 38 // StatusChangeChecker implementations and stubs. | 39 // StatusChangeChecker implementations and stubs. |
| 39 bool IsExitConditionSatisfied() override = 0; | 40 bool IsExitConditionSatisfied() override = 0; |
| 40 std::string GetDebugMessage() const override = 0; | 41 std::string GetDebugMessage() const override = 0; |
| 41 | 42 |
| 42 protected: | 43 protected: |
| 43 const std::vector<browser_sync::ProfileSyncService*>& services() { | 44 const std::vector<browser_sync::ProfileSyncService*>& services() { |
| 44 return services_; | 45 return services_; |
| 45 } | 46 } |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 std::vector<browser_sync::ProfileSyncService*> services_; | 49 std::vector<browser_sync::ProfileSyncService*> services_; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECK
ER_H_ | 52 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECK
ER_H_ |
| OLD | NEW |