OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PROFILE_SYNC_SERVICE_HARNESS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "components/sync/base/model_type.h" | 14 #include "components/sync/base/model_type.h" |
14 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" | 15 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
15 | 16 |
16 class Profile; | 17 class Profile; |
17 | 18 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // from the message queue. Returns true if two sync cycles have completed. | 66 // from the message queue. Returns true if two sync cycles have completed. |
66 // Note: Use this method when exactly one client makes local change(s), and | 67 // Note: Use this method when exactly one client makes local change(s), and |
67 // exactly one client is waiting to receive those changes. | 68 // exactly one client is waiting to receive those changes. |
68 bool AwaitMutualSyncCycleCompletion(ProfileSyncServiceHarness* partner); | 69 bool AwaitMutualSyncCycleCompletion(ProfileSyncServiceHarness* partner); |
69 | 70 |
70 // Blocks the caller until |this| completes its ongoing sync cycle and every | 71 // Blocks the caller until |this| completes its ongoing sync cycle and every |
71 // other client in |partners| have achieved identical download progresses. | 72 // other client in |partners| have achieved identical download progresses. |
72 // Note: Use this method when exactly one client makes local change(s), | 73 // Note: Use this method when exactly one client makes local change(s), |
73 // and more than one client is waiting to receive those changes. | 74 // and more than one client is waiting to receive those changes. |
74 bool AwaitGroupSyncCycleCompletion( | 75 bool AwaitGroupSyncCycleCompletion( |
75 std::vector<ProfileSyncServiceHarness*>& partners); | 76 const std::vector<ProfileSyncServiceHarness*>& partners); |
76 | 77 |
77 // Blocks the caller until every client in |clients| completes its ongoing | 78 // Blocks the caller until every client in |clients| completes its ongoing |
78 // sync cycle and all the clients' progress markers match. Note: Use this | 79 // sync cycle and all the clients' progress markers match. Note: Use this |
79 // method when more than one client makes local change(s), and more than one | 80 // method when more than one client makes local change(s), and more than one |
80 // client is waiting to receive those changes. | 81 // client is waiting to receive those changes. |
81 static bool AwaitQuiescence( | 82 static bool AwaitQuiescence( |
82 std::vector<ProfileSyncServiceHarness*>& clients); | 83 const std::vector<ProfileSyncServiceHarness*>& clients); |
83 | 84 |
84 // Blocks the caller until the sync backend is initialized or some end state | 85 // Blocks the caller until the sync backend is initialized or some end state |
85 // (e.g., auth error) is reached. Returns true if and only if the backend | 86 // (e.g., auth error) is reached. Returns true if and only if the backend |
86 // initialized successfully. See ProfileSyncService's IsBackendInitialized() | 87 // initialized successfully. See ProfileSyncService's IsBackendInitialized() |
87 // method for the definition of backend initialization. | 88 // method for the definition of backend initialization. |
88 bool AwaitBackendInitialization(); | 89 bool AwaitBackendInitialization(); |
89 | 90 |
90 // Blocks the caller until sync setup is complete. Returns true if and only | 91 // Blocks the caller until sync setup is complete. Returns true if and only |
91 // if sync setup completed successfully. See sync_driver::SyncService's | 92 // if sync setup completed successfully. See sync_driver::SyncService's |
92 // IsSyncActive() method for the definition of what successful means here. | 93 // IsSyncActive() method for the definition of what successful means here. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // all refresh tokens used in the tests are different. | 162 // all refresh tokens used in the tests are different. |
162 int oauth2_refesh_token_number_; | 163 int oauth2_refesh_token_number_; |
163 | 164 |
164 // Used for logging. | 165 // Used for logging. |
165 const std::string profile_debug_name_; | 166 const std::string profile_debug_name_; |
166 | 167 |
167 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); | 168 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); |
168 }; | 169 }; |
169 | 170 |
170 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ | 171 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ |
OLD | NEW |