| 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_SYNC_TEST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // reflected in the verifier profile. Note: Not all datatypes use this. | 167 // reflected in the verifier profile. Note: Not all datatypes use this. |
| 168 // TODO(rsimha): Hook up all datatypes to this mechanism. | 168 // TODO(rsimha): Hook up all datatypes to this mechanism. |
| 169 void DisableVerifier(); | 169 void DisableVerifier(); |
| 170 | 170 |
| 171 // Initializes sync clients and profiles but does not sync any of them. | 171 // Initializes sync clients and profiles but does not sync any of them. |
| 172 virtual bool SetupClients() WARN_UNUSED_RESULT; | 172 virtual bool SetupClients() WARN_UNUSED_RESULT; |
| 173 | 173 |
| 174 // Initializes sync clients and profiles if required and syncs each of them. | 174 // Initializes sync clients and profiles if required and syncs each of them. |
| 175 virtual bool SetupSync() WARN_UNUSED_RESULT; | 175 virtual bool SetupSync() WARN_UNUSED_RESULT; |
| 176 | 176 |
| 177 // Initialize, and clear data for given client. |
| 178 bool SetupAndClearClient(size_t index); |
| 179 |
| 177 // Sets whether or not the sync clients in this test should respond to | 180 // Sets whether or not the sync clients in this test should respond to |
| 178 // notifications of their own commits. Real sync clients do not do this, but | 181 // notifications of their own commits. Real sync clients do not do this, but |
| 179 // many test assertions require this behavior. | 182 // many test assertions require this behavior. |
| 180 // | 183 // |
| 181 // Default is to return true. Test should override this if they require | 184 // Default is to return true. Test should override this if they require |
| 182 // different behavior. | 185 // different behavior. |
| 183 virtual bool TestUsesSelfNotifications(); | 186 virtual bool TestUsesSelfNotifications(); |
| 184 | 187 |
| 185 // Kicks off encryption for profile |index|. | 188 // Kicks off encryption for profile |index|. |
| 186 bool EnableEncryption(int index); | 189 bool EnableEncryption(int index); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // of test being run and command line args passed in. | 366 // of test being run and command line args passed in. |
| 364 void DecideServerType(); | 367 void DecideServerType(); |
| 365 | 368 |
| 366 // Initializes any custom services needed for the |profile| at |index|. | 369 // Initializes any custom services needed for the |profile| at |index|. |
| 367 void InitializeProfile(int index, Profile* profile); | 370 void InitializeProfile(int index, Profile* profile); |
| 368 | 371 |
| 369 // Sets up the client-side invalidations infrastructure depending on the | 372 // Sets up the client-side invalidations infrastructure depending on the |
| 370 // value of |server_type_|. | 373 // value of |server_type_|. |
| 371 void InitializeInvalidations(int index); | 374 void InitializeInvalidations(int index); |
| 372 | 375 |
| 376 // Clear server data, and restart sync. |
| 377 bool ClearServerData(ProfileSyncServiceHarness* harness); |
| 378 |
| 373 // Python sync test server, started on demand. | 379 // Python sync test server, started on demand. |
| 374 syncer::LocalSyncTestServer sync_server_; | 380 syncer::LocalSyncTestServer sync_server_; |
| 375 | 381 |
| 376 // Helper class to whitelist the notification port. | 382 // Helper class to whitelist the notification port. |
| 377 std::unique_ptr<net::ScopedPortException> xmpp_port_; | 383 std::unique_ptr<net::ScopedPortException> xmpp_port_; |
| 378 | 384 |
| 379 // Used to differentiate between single-client and two-client tests as well | 385 // Used to differentiate between single-client and two-client tests as well |
| 380 // as wher the in-process FakeServer is used. | 386 // as wher the in-process FakeServer is used. |
| 381 TestType test_type_; | 387 TestType test_type_; |
| 382 | 388 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 std::unique_ptr<net::URLFetcherImplFactory> factory_; | 464 std::unique_ptr<net::URLFetcherImplFactory> factory_; |
| 459 | 465 |
| 460 // The contents to be written to a profile's Preferences file before the | 466 // The contents to be written to a profile's Preferences file before the |
| 461 // Profile object is created. If empty, no preexisting file will be written. | 467 // Profile object is created. If empty, no preexisting file will be written. |
| 462 std::string preexisting_preferences_file_contents_; | 468 std::string preexisting_preferences_file_contents_; |
| 463 | 469 |
| 464 DISALLOW_COPY_AND_ASSIGN(SyncTest); | 470 DISALLOW_COPY_AND_ASSIGN(SyncTest); |
| 465 }; | 471 }; |
| 466 | 472 |
| 467 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ | 473 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ |
| OLD | NEW |