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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class ProfileSyncService; | 25 class ProfileSyncService; |
26 class ProfileSyncServiceHarness; | 26 class ProfileSyncServiceHarness; |
27 class P2PInvalidationForwarder; | 27 class P2PInvalidationForwarder; |
28 | 28 |
29 namespace base { | 29 namespace base { |
30 class CommandLine; | 30 class CommandLine; |
31 } | 31 } |
32 | 32 |
33 namespace fake_server { | 33 namespace fake_server { |
34 class FakeServer; | 34 class FakeServer; |
| 35 class FakeServerInvalidationService; |
35 } | 36 } |
36 | 37 |
37 namespace net { | 38 namespace net { |
38 class FakeURLFetcherFactory; | 39 class FakeURLFetcherFactory; |
39 class ProxyConfig; | 40 class ProxyConfig; |
40 class ScopedDefaultHostResolverProc; | 41 class ScopedDefaultHostResolverProc; |
41 class URLFetcherImplFactory; | 42 class URLFetcherImplFactory; |
42 class URLRequestContextGetter; | 43 class URLRequestContextGetter; |
43 } | 44 } |
44 | 45 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 357 |
357 // Helper method used to clear any fake responses that might have been set for | 358 // Helper method used to clear any fake responses that might have been set for |
358 // various gaia URLs, cancel any outstanding URL requests, and return to using | 359 // various gaia URLs, cancel any outstanding URL requests, and return to using |
359 // the default URLFetcher creation mechanism. | 360 // the default URLFetcher creation mechanism. |
360 void ClearMockGaiaResponses(); | 361 void ClearMockGaiaResponses(); |
361 | 362 |
362 // Decide which sync server implementation to run against based on the type | 363 // Decide which sync server implementation to run against based on the type |
363 // of test being run and command line args passed in. | 364 // of test being run and command line args passed in. |
364 void DecideServerType(); | 365 void DecideServerType(); |
365 | 366 |
| 367 // Sets up the client-side invalidations infrastructure depending on the |
| 368 // value of |server_type_|. |
| 369 void InitializeInvalidations(int index); |
| 370 |
366 // Python sync test server, started on demand. | 371 // Python sync test server, started on demand. |
367 syncer::LocalSyncTestServer sync_server_; | 372 syncer::LocalSyncTestServer sync_server_; |
368 | 373 |
369 // Helper class to whitelist the notification port. | 374 // Helper class to whitelist the notification port. |
370 scoped_ptr<net::ScopedPortException> xmpp_port_; | 375 scoped_ptr<net::ScopedPortException> xmpp_port_; |
371 | 376 |
372 // Used to differentiate between single-client, two-client, multi-client and | 377 // Used to differentiate between single-client, two-client, multi-client and |
373 // many-client tests. | 378 // many-client tests. |
374 TestType test_type_; | 379 TestType test_type_; |
375 | 380 |
(...skipping 16 matching lines...) Expand all Loading... |
392 | 397 |
393 // Collection of sync clients used by a test. A sync client is associated with | 398 // Collection of sync clients used by a test. A sync client is associated with |
394 // a sync profile, and implements methods that sync the contents of the | 399 // a sync profile, and implements methods that sync the contents of the |
395 // profile with the server. | 400 // profile with the server. |
396 ScopedVector<ProfileSyncServiceHarness> clients_; | 401 ScopedVector<ProfileSyncServiceHarness> clients_; |
397 | 402 |
398 // A set of objects to listen for commit activity and broadcast notifications | 403 // A set of objects to listen for commit activity and broadcast notifications |
399 // of this activity to its peer sync clients. | 404 // of this activity to its peer sync clients. |
400 ScopedVector<P2PInvalidationForwarder> invalidation_forwarders_; | 405 ScopedVector<P2PInvalidationForwarder> invalidation_forwarders_; |
401 | 406 |
| 407 // Collection of pointers to FakeServerInvalidation objects for each profile. |
| 408 std::vector<fake_server::FakeServerInvalidationService*> |
| 409 fake_server_invalidation_services_; |
| 410 |
402 // Sync profile against which changes to individual profiles are verified. We | 411 // Sync profile against which changes to individual profiles are verified. We |
403 // don't need a corresponding verifier sync client because the contents of the | 412 // don't need a corresponding verifier sync client because the contents of the |
404 // verifier profile are strictly local, and are not meant to be synced. | 413 // verifier profile are strictly local, and are not meant to be synced. |
405 Profile* verifier_; | 414 Profile* verifier_; |
406 | 415 |
407 // Indicates whether changes to a profile should also change the verifier | 416 // Indicates whether changes to a profile should also change the verifier |
408 // profile or not. | 417 // profile or not. |
409 bool use_verifier_; | 418 bool use_verifier_; |
410 | 419 |
411 // Indicates whether or not notifications were explicitly enabled/disabled. | 420 // Indicates whether or not notifications were explicitly enabled/disabled. |
(...skipping 11 matching lines...) Expand all Loading... |
423 // Fake URLFetcher factory used to mock out GAIA signin. | 432 // Fake URLFetcher factory used to mock out GAIA signin. |
424 scoped_ptr<net::FakeURLFetcherFactory> fake_factory_; | 433 scoped_ptr<net::FakeURLFetcherFactory> fake_factory_; |
425 | 434 |
426 // The URLFetcherImplFactory instance used to instantiate |fake_factory_|. | 435 // The URLFetcherImplFactory instance used to instantiate |fake_factory_|. |
427 scoped_ptr<net::URLFetcherImplFactory> factory_; | 436 scoped_ptr<net::URLFetcherImplFactory> factory_; |
428 | 437 |
429 DISALLOW_COPY_AND_ASSIGN(SyncTest); | 438 DISALLOW_COPY_AND_ASSIGN(SyncTest); |
430 }; | 439 }; |
431 | 440 |
432 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ | 441 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ |
OLD | NEW |