Chromium Code Reviews| 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/in_process_browser_test.h" | 9 #include "chrome/test/in_process_browser_test.h" |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 // Returns a reference to the collection of sync clients. Callee owns the | 99 // Returns a reference to the collection of sync clients. Callee owns the |
| 100 // object and manages its lifetime. | 100 // object and manages its lifetime. |
| 101 std::vector<ProfileSyncServiceHarness*>& clients() WARN_UNUSED_RESULT { | 101 std::vector<ProfileSyncServiceHarness*>& clients() WARN_UNUSED_RESULT { |
| 102 return clients_.get(); | 102 return clients_.get(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Returns a pointer to the sync profile that is used to verify changes to | 105 // Returns a pointer to the sync profile that is used to verify changes to |
| 106 // individual sync profiles. Callee owns the object and manages its lifetime. | 106 // individual sync profiles. Callee owns the object and manages its lifetime. |
| 107 Profile* verifier() WARN_UNUSED_RESULT; | 107 Profile* verifier() WARN_UNUSED_RESULT; |
| 108 | 108 |
| 109 // Used to determine whether the verifier profile should be updated or not. | |
| 110 bool use_verifier_prefs() WARN_UNUSED_RESULT { return use_verifier_prefs_; } | |
| 111 | |
| 112 // After calling this method, changes made to a profile will no longer be | |
| 113 // reflected in the verifier profile. Note: Not all datatypes use this. | |
| 114 // TODO(rsimha): Hook up all datatypes to this mechanism. | |
| 115 void DisableVerifier(); | |
|
ncarter (slow)
2011/07/06 17:48:52
Best to avoid per-datatype methods in LiveSyncTest
Raghu Simha
2011/07/07 02:14:04
It may not be readily evident yet, but this should
| |
| 116 | |
| 109 // Initializes sync clients and profiles but does not sync any of them. | 117 // Initializes sync clients and profiles but does not sync any of them. |
| 110 virtual bool SetupClients() WARN_UNUSED_RESULT; | 118 virtual bool SetupClients() WARN_UNUSED_RESULT; |
| 111 | 119 |
| 112 // Initializes sync clients and profiles if required and syncs each of them. | 120 // Initializes sync clients and profiles if required and syncs each of them. |
| 113 virtual bool SetupSync() WARN_UNUSED_RESULT; | 121 virtual bool SetupSync() WARN_UNUSED_RESULT; |
| 114 | 122 |
| 115 // Enable outgoing network connections for the given profile. | 123 // Enable outgoing network connections for the given profile. |
| 116 virtual void EnableNetwork(Profile* profile); | 124 virtual void EnableNetwork(Profile* profile); |
| 117 | 125 |
| 118 // Disable outgoing network connections for the given profile. | 126 // Disable outgoing network connections for the given profile. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 // Collection of sync clients used by a test. A sync client is associated with | 233 // Collection of sync clients used by a test. A sync client is associated with |
| 226 // a sync profile, and implements methods that sync the contents of the | 234 // a sync profile, and implements methods that sync the contents of the |
| 227 // profile with the server. | 235 // profile with the server. |
| 228 ScopedVector<ProfileSyncServiceHarness> clients_; | 236 ScopedVector<ProfileSyncServiceHarness> clients_; |
| 229 | 237 |
| 230 // Sync profile against which changes to individual profiles are verified. We | 238 // Sync profile against which changes to individual profiles are verified. We |
| 231 // don't need a corresponding verifier sync client because the contents of the | 239 // don't need a corresponding verifier sync client because the contents of the |
| 232 // verifier profile are strictly local, and are not meant to be synced. | 240 // verifier profile are strictly local, and are not meant to be synced. |
| 233 scoped_ptr<Profile> verifier_; | 241 scoped_ptr<Profile> verifier_; |
| 234 | 242 |
| 243 // Indicates whether changes to a profile should also change the verifier | |
| 244 // profile or not. | |
| 245 bool use_verifier_prefs_; | |
| 246 | |
| 235 // Sync integration tests need to make live DNS requests for access to | 247 // Sync integration tests need to make live DNS requests for access to |
| 236 // GAIA and sync server URLs under google.com. We use a scoped version | 248 // GAIA and sync server URLs under google.com. We use a scoped version |
| 237 // to override the default resolver while the test is active. | 249 // to override the default resolver while the test is active. |
| 238 scoped_ptr<net::ScopedDefaultHostResolverProc> mock_host_resolver_override_; | 250 scoped_ptr<net::ScopedDefaultHostResolverProc> mock_host_resolver_override_; |
| 239 | 251 |
| 240 // Used to start and stop the local test server. | 252 // Used to start and stop the local test server. |
| 241 base::ProcessHandle test_server_handle_; | 253 base::ProcessHandle test_server_handle_; |
| 242 | 254 |
| 243 // Fake URLFetcher factory used to mock out GAIA signin. | 255 // Fake URLFetcher factory used to mock out GAIA signin. |
| 244 scoped_ptr<FakeURLFetcherFactory> factory_; | 256 scoped_ptr<FakeURLFetcherFactory> factory_; |
| 245 | 257 |
| 246 // URLFetcher factory used to contact sync server. | 258 // URLFetcher factory used to contact sync server. |
| 247 scoped_ptr<URLFetcherFactory> integration_factory_; | 259 scoped_ptr<URLFetcherFactory> integration_factory_; |
| 248 | 260 |
| 249 DISALLOW_COPY_AND_ASSIGN(LiveSyncTest); | 261 DISALLOW_COPY_AND_ASSIGN(LiveSyncTest); |
| 250 }; | 262 }; |
| 251 | 263 |
| 252 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 264 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| OLD | NEW |