| 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 <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "chrome/browser/sync/test/integration/status_change_checker.h" | 14 #include "chrome/browser/sync/test/integration/status_change_checker.h" |
| 15 #include "components/sync/driver/sync_service_observer.h" | 15 #include "components/sync/driver/sync_service_observer.h" |
| 16 | 16 |
| 17 namespace browser_sync { | 17 namespace browser_sync { |
| 18 class ProfileSyncService; | 18 class ProfileSyncService; |
| 19 } // namespace browser_sync | 19 } // namespace browser_sync |
| 20 | 20 |
| 21 // This class provides some common functionality for StatusChangeCheckers that | 21 // This class provides some common functionality for StatusChangeCheckers that |
| 22 // observe many ProfileSyncServices. This class is abstract. Its descendants | 22 // observe many ProfileSyncServices. This class is abstract. Its descendants |
| 23 // are expected to provide additional functionality. | 23 // are expected to provide additional functionality. |
| 24 class MultiClientStatusChangeChecker : public StatusChangeChecker, | 24 class MultiClientStatusChangeChecker : public StatusChangeChecker, |
| 25 public sync_driver::SyncServiceObserver { | 25 public syncer::SyncServiceObserver { |
| 26 public: | 26 public: |
| 27 explicit MultiClientStatusChangeChecker( | 27 explicit MultiClientStatusChangeChecker( |
| 28 std::vector<browser_sync::ProfileSyncService*> services); | 28 std::vector<browser_sync::ProfileSyncService*> services); |
| 29 ~MultiClientStatusChangeChecker() override; | 29 ~MultiClientStatusChangeChecker() override; |
| 30 | 30 |
| 31 // Called when waiting times out. | 31 // Called when waiting times out. |
| 32 void OnTimeout(); | 32 void OnTimeout(); |
| 33 | 33 |
| 34 // sync_driver::SyncServiceObserver implementation. | 34 // syncer::SyncServiceObserver implementation. |
| 35 void OnStateChanged() override; | 35 void OnStateChanged() override; |
| 36 | 36 |
| 37 // StatusChangeChecker implementations and stubs. | 37 // StatusChangeChecker implementations and stubs. |
| 38 bool IsExitConditionSatisfied() override = 0; | 38 bool IsExitConditionSatisfied() override = 0; |
| 39 std::string GetDebugMessage() const override = 0; | 39 std::string GetDebugMessage() const override = 0; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 const std::vector<browser_sync::ProfileSyncService*>& services() { | 42 const std::vector<browser_sync::ProfileSyncService*>& services() { |
| 43 return services_; | 43 return services_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 std::vector<browser_sync::ProfileSyncService*> services_; | 47 std::vector<browser_sync::ProfileSyncService*> services_; |
| 48 ScopedObserver<browser_sync::ProfileSyncService, | 48 ScopedObserver<browser_sync::ProfileSyncService, |
| 49 MultiClientStatusChangeChecker> | 49 MultiClientStatusChangeChecker> |
| 50 scoped_observer_; | 50 scoped_observer_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECK
ER_H_ | 53 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECK
ER_H_ |
| OLD | NEW |