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_QUIESCE_STATUS_CHANGE_CHECKER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_QUIESCE_STATUS_CHANGE_CHECKER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_QUIESCE_STATUS_CHANGE_CHECKER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_QUIESCE_STATUS_CHANGE_CHECKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // precisely the wrong time, we could end up seeing stale snapshot state | 27 // precisely the wrong time, we could end up seeing stale snapshot state |
28 // (crbug.com/95742), which would make us think that the client has finished | 28 // (crbug.com/95742), which would make us think that the client has finished |
29 // syncing when it hasn't. In practice, this race is rare enough that it | 29 // syncing when it hasn't. In practice, this race is rare enough that it |
30 // doesn't cause test failures. | 30 // doesn't cause test failures. |
31 class QuiesceStatusChangeChecker : public StatusChangeChecker { | 31 class QuiesceStatusChangeChecker : public StatusChangeChecker { |
32 public: | 32 public: |
33 explicit QuiesceStatusChangeChecker( | 33 explicit QuiesceStatusChangeChecker( |
34 std::vector<ProfileSyncService*> services); | 34 std::vector<ProfileSyncService*> services); |
35 virtual ~QuiesceStatusChangeChecker(); | 35 virtual ~QuiesceStatusChangeChecker(); |
36 | 36 |
37 // Timeout length for this operation. Default is 45s. | |
38 virtual base::TimeDelta GetTimeoutDuration(); | |
39 | |
40 // Blocks until all clients have quiesced or we time out. | 37 // Blocks until all clients have quiesced or we time out. |
41 void Wait(); | 38 void Wait(); |
42 | 39 |
43 // A callback function for some helper objects. | 40 // A callback function for some helper objects. |
44 void OnServiceStateChanged(ProfileSyncService* service); | 41 void OnServiceStateChanged(ProfileSyncService* service); |
45 | 42 |
46 // A callback for when the time limit is exceeded. | 43 // Implementation of StatusChangeChecker. |
47 void OnTimeout(); | |
48 | |
49 virtual bool IsExitConditionSatisfied() OVERRIDE; | 44 virtual bool IsExitConditionSatisfied() OVERRIDE; |
50 virtual std::string GetDebugMessage() const OVERRIDE; | 45 virtual std::string GetDebugMessage() const OVERRIDE; |
51 | 46 |
52 bool TimedOut() const; | |
53 | |
54 private: | 47 private: |
55 std::vector<ProfileSyncService*> services_; | 48 std::vector<ProfileSyncService*> services_; |
56 ScopedVector<ProgressMarkerWatcher> observers_; | 49 ScopedVector<ProgressMarkerWatcher> observers_; |
57 bool timed_out_; | |
58 | 50 |
59 DISALLOW_COPY_AND_ASSIGN(QuiesceStatusChangeChecker); | 51 DISALLOW_COPY_AND_ASSIGN(QuiesceStatusChangeChecker); |
60 }; | 52 }; |
61 | 53 |
62 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_QUIESCE_STATUS_CHANGE_CHECKER_H_ | 54 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_QUIESCE_STATUS_CHANGE_CHECKER_H_ |
OLD | NEW |