Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: chrome/browser/sync/test/integration/multi_client_status_change_checker.h

Issue 299843007: sync: Refactor StatusChangeChecker hierarchy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo unrelated changes Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "chrome/browser/sync/profile_sync_service_observer.h" 12 #include "chrome/browser/sync/profile_sync_service_observer.h"
13 #include "chrome/browser/sync/test/integration/status_change_checker.h" 13 #include "chrome/browser/sync/test/integration/status_change_checker.h"
14 14
15 class ProfileSyncService; 15 class ProfileSyncService;
16 16
17 // This class provides some common functionality for StatusChangeCheckers that 17 // This class provides some common functionality for StatusChangeCheckers that
18 // observe many ProfileSyncServices. This class is abstract. Its descendants 18 // observe many ProfileSyncServices. This class is abstract. Its descendants
19 // are expected to provide additional functionality. 19 // are expected to provide additional functionality.
20 class MultiClientStatusChangeChecker 20 class MultiClientStatusChangeChecker
21 : public StatusChangeChecker, 21 : public StatusChangeChecker,
22 public ProfileSyncServiceObserver { 22 public ProfileSyncServiceObserver {
23 public: 23 public:
24 explicit MultiClientStatusChangeChecker( 24 explicit MultiClientStatusChangeChecker(
25 std::vector<ProfileSyncService*> services); 25 std::vector<ProfileSyncService*> services);
26 virtual ~MultiClientStatusChangeChecker(); 26 virtual ~MultiClientStatusChangeChecker();
27 27
28 // Timeout length for this operation. Default is 45s.
29 virtual base::TimeDelta GetTimeoutDuration();
30
31 // Called when waiting times out. 28 // Called when waiting times out.
32 void OnTimeout(); 29 void OnTimeout();
33 30
34 // Blocks until the exit condition is satisfied or a timeout occurs. 31 // Blocks until the exit condition is satisfied or a timeout occurs.
35 void Wait(); 32 void Wait();
36 33
37 // ProfileSyncServiceObserver implementation. 34 // ProfileSyncServiceObserver implementation.
38 virtual void OnStateChanged() OVERRIDE; 35 virtual void OnStateChanged() OVERRIDE;
39 36
40 // Returns true if the checker timed out.
41 bool TimedOut();
42
43 // StatusChangeChecker implementations and stubs. 37 // StatusChangeChecker implementations and stubs.
44 virtual bool IsExitConditionSatisfied() = 0; 38 virtual bool IsExitConditionSatisfied() = 0;
45 virtual std::string GetDebugMessage() const = 0; 39 virtual std::string GetDebugMessage() const = 0;
46 40
47 protected: 41 protected:
48 const std::vector<ProfileSyncService*>& services() { return services_; } 42 const std::vector<ProfileSyncService*>& services() { return services_; }
49 43
50 private: 44 private:
51 std::vector<ProfileSyncService*> services_; 45 std::vector<ProfileSyncService*> services_;
52 bool timed_out_;
53 }; 46 };
54 47
55 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECK ER_H_ 48 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_MULTI_CLIENT_STATUS_CHANGE_CHECK ER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698