| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 5 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| 6 #define CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 6 #define CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 | 10 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 // Disable outgoing network connections for the given profile. | 130 // Disable outgoing network connections for the given profile. |
| 131 virtual void DisableNetwork(Profile* profile); | 131 virtual void DisableNetwork(Profile* profile); |
| 132 | 132 |
| 133 // Encrypts the datatype |type| for profile |index|. | 133 // Encrypts the datatype |type| for profile |index|. |
| 134 bool EnableEncryption(int index, syncable::ModelType type); | 134 bool EnableEncryption(int index, syncable::ModelType type); |
| 135 | 135 |
| 136 // Checks if the datatype |type| is encrypted for profile |index|. | 136 // Checks if the datatype |type| is encrypted for profile |index|. |
| 137 bool IsEncrypted(int index, syncable::ModelType type); | 137 bool IsEncrypted(int index, syncable::ModelType type); |
| 138 | 138 |
| 139 // Disable notifications for the current test. Must be called | |
| 140 // before the test server is started (i.e., before either of | |
| 141 // SetupSync() or SetupClients() is called). | |
| 142 void DisableNotifications(); | |
| 143 | |
| 144 // Blocks until all sync clients have completed their mutual sync cycles. | 139 // Blocks until all sync clients have completed their mutual sync cycles. |
| 145 // Returns true if a quiescent state was successfully reached. | 140 // Returns true if a quiescent state was successfully reached. |
| 146 bool AwaitQuiescence(); | 141 bool AwaitQuiescence(); |
| 147 | 142 |
| 143 // Returns true if the server being used supports controlling |
| 144 // notifications. |
| 145 bool ServerSupportsNotificationControl(); |
| 146 |
| 147 // Disable notifications on the server. This operation is available |
| 148 // only if ServerSupportsNotificationControl() returned true. |
| 149 void DisableNotifications(); |
| 150 |
| 151 // Trigger a notification to be sent to all clients. This operation |
| 152 // is available only if ServerSupportsNotificationControl() returned |
| 153 // true. |
| 154 void TriggerNotification(const syncable::ModelTypeSet& changed_types); |
| 155 |
| 148 // Returns true if the server being used supports injecting errors. | 156 // Returns true if the server being used supports injecting errors. |
| 149 bool ServerSupportsErrorTriggering(); | 157 bool ServerSupportsErrorTriggering(); |
| 150 | 158 |
| 151 // Triggers a migration for one or more datatypes, and waits | 159 // Triggers a migration for one or more datatypes, and waits |
| 152 // for the server to complete it. This operation is available | 160 // for the server to complete it. This operation is available |
| 153 // only if ServerSupportsErrorTriggering() returned true. | 161 // only if ServerSupportsErrorTriggering() returned true. |
| 154 void TriggerMigrationDoneError(const syncable::ModelTypeSet& model_types); | 162 void TriggerMigrationDoneError(const syncable::ModelTypeSet& model_types); |
| 155 | 163 |
| 156 // Triggers the server to set its birthday to a random value thereby | 164 // Triggers the server to set its birthday to a random value thereby |
| 157 // the server would return a birthday error on next sync. | 165 // the server would return a birthday error on next sync. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 297 |
| 290 // Used to start and stop the local test server. | 298 // Used to start and stop the local test server. |
| 291 base::ProcessHandle test_server_handle_; | 299 base::ProcessHandle test_server_handle_; |
| 292 | 300 |
| 293 // Fake URLFetcher factory used to mock out GAIA signin. | 301 // Fake URLFetcher factory used to mock out GAIA signin. |
| 294 scoped_ptr<FakeURLFetcherFactory> factory_; | 302 scoped_ptr<FakeURLFetcherFactory> factory_; |
| 295 | 303 |
| 296 // URLFetcher factory used to contact sync server. | 304 // URLFetcher factory used to contact sync server. |
| 297 scoped_ptr<URLFetcherFactory> integration_factory_; | 305 scoped_ptr<URLFetcherFactory> integration_factory_; |
| 298 | 306 |
| 299 // Whether or not to use notifications for the current test. | |
| 300 bool enable_notifications_; | |
| 301 | |
| 302 DISALLOW_COPY_AND_ASSIGN(LiveSyncTest); | 307 DISALLOW_COPY_AND_ASSIGN(LiveSyncTest); |
| 303 }; | 308 }; |
| 304 | 309 |
| 305 DISABLE_RUNNABLE_METHOD_REFCOUNT(LiveSyncTest); | 310 DISABLE_RUNNABLE_METHOD_REFCOUNT(LiveSyncTest); |
| 306 | 311 |
| 307 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 312 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| OLD | NEW |