| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // specified. | 119 // specified. |
| 120 void SetUp() override; | 120 void SetUp() override; |
| 121 | 121 |
| 122 // Brings down local python test server if one was created. | 122 // Brings down local python test server if one was created. |
| 123 void TearDown() override; | 123 void TearDown() override; |
| 124 | 124 |
| 125 // Sets up command line flags required for sync tests. | 125 // Sets up command line flags required for sync tests. |
| 126 void SetUpCommandLine(base::CommandLine* cl) override; | 126 void SetUpCommandLine(base::CommandLine* cl) override; |
| 127 | 127 |
| 128 // Used to get the number of sync clients used by a test. | 128 // Used to get the number of sync clients used by a test. |
| 129 int num_clients() WARN_UNUSED_RESULT { return num_clients_; } | 129 int num_clients() { return num_clients_; } |
| 130 | 130 |
| 131 // Returns a pointer to a particular sync profile. Callee owns the object | 131 // Returns a pointer to a particular sync profile. Callee owns the object |
| 132 // and manages its lifetime. | 132 // and manages its lifetime. |
| 133 Profile* GetProfile(int index) WARN_UNUSED_RESULT; | 133 Profile* GetProfile(int index); |
| 134 | 134 |
| 135 // Returns a list of all profiles including the verifier if available. Callee | 135 // Returns a list of all profiles including the verifier if available. Callee |
| 136 // owns the objects and manages its lifetime. | 136 // owns the objects and manages its lifetime. |
| 137 std::vector<Profile*> GetAllProfiles(); | 137 std::vector<Profile*> GetAllProfiles(); |
| 138 | 138 |
| 139 // Returns a pointer to a particular browser. Callee owns the object | 139 // Returns a pointer to a particular browser. Callee owns the object |
| 140 // and manages its lifetime. | 140 // and manages its lifetime. |
| 141 Browser* GetBrowser(int index) WARN_UNUSED_RESULT; | 141 Browser* GetBrowser(int index); |
| 142 |
| 143 // Adds a new browser belonging to the profile at |profile_index|, and appends |
| 144 // it to the list of browsers. Creates a copy of the Profile pointer in |
| 145 // position |profile_index| and appends it to the list of profiles. This is |
| 146 // done so that the profile associated with the new browser can be found at |
| 147 // the same index as it. Tests typically use browser indexes and profile |
| 148 // indexes interchangeably; this allows them to do so freely. |
| 149 Browser* AddBrowser(int profile_index); |
| 142 | 150 |
| 143 // Returns a pointer to a particular sync client. Callee owns the object | 151 // Returns a pointer to a particular sync client. Callee owns the object |
| 144 // and manages its lifetime. | 152 // and manages its lifetime. |
| 145 ProfileSyncServiceHarness* GetClient(int index) WARN_UNUSED_RESULT; | 153 ProfileSyncServiceHarness* GetClient(int index); |
| 146 | 154 |
| 147 // Returns a reference to the collection of sync clients. Callee owns the | 155 // Returns a reference to the collection of sync clients. Callee owns the |
| 148 // object and manages its lifetime. | 156 // object and manages its lifetime. |
| 149 std::vector<ProfileSyncServiceHarness*>& clients() WARN_UNUSED_RESULT { | 157 std::vector<ProfileSyncServiceHarness*>& clients() { return clients_.get(); } |
| 150 return clients_.get(); | |
| 151 } | |
| 152 | 158 |
| 153 // Returns a ProfileSyncService at the given index. | 159 // Returns a ProfileSyncService at the given index. |
| 154 browser_sync::ProfileSyncService* GetSyncService(int index); | 160 browser_sync::ProfileSyncService* GetSyncService(int index); |
| 155 | 161 |
| 156 // Returns the set of ProfileSyncServices. | 162 // Returns the set of ProfileSyncServices. |
| 157 std::vector<browser_sync::ProfileSyncService*> GetSyncServices(); | 163 std::vector<browser_sync::ProfileSyncService*> GetSyncServices(); |
| 158 | 164 |
| 159 // Returns a pointer to the sync profile that is used to verify changes to | 165 // Returns a pointer to the sync profile that is used to verify changes to |
| 160 // individual sync profiles. Callee owns the object and manages its lifetime. | 166 // individual sync profiles. Callee owns the object and manages its lifetime. |
| 161 Profile* verifier() WARN_UNUSED_RESULT; | 167 Profile* verifier(); |
| 162 | 168 |
| 163 // Used to determine whether the verifier profile should be updated or not. | 169 // Used to determine whether the verifier profile should be updated or not. |
| 164 bool use_verifier() WARN_UNUSED_RESULT { return use_verifier_; } | 170 bool use_verifier() { return use_verifier_; } |
| 165 | 171 |
| 166 // After calling this method, changes made to a profile will no longer be | 172 // After calling this method, changes made to a profile will no longer be |
| 167 // reflected in the verifier profile. Note: Not all datatypes use this. | 173 // reflected in the verifier profile. Note: Not all datatypes use this. |
| 168 // TODO(rsimha): Hook up all datatypes to this mechanism. | 174 // TODO(rsimha): Hook up all datatypes to this mechanism. |
| 169 void DisableVerifier(); | 175 void DisableVerifier(); |
| 170 | 176 |
| 171 // Initializes sync clients and profiles but does not sync any of them. | 177 // Initializes sync clients and profiles but does not sync any of them. |
| 172 virtual bool SetupClients() WARN_UNUSED_RESULT; | 178 virtual bool SetupClients() WARN_UNUSED_RESULT; |
| 173 | 179 |
| 174 // Initializes sync clients and profiles if required and syncs each of them. | 180 // Initializes sync clients and profiles if required and syncs each of them. |
| (...skipping 283 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 |