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 25 matching lines...) Expand all Loading... | |
36 // the default DISABLED_test_name macro. To disable it from running as an E2E | 36 // the default DISABLED_test_name macro. To disable it from running as an E2E |
37 // test outside Chromium waterfalls you would need to remove the E2E* macro. | 37 // test outside Chromium waterfalls you would need to remove the E2E* macro. |
38 #define MACRO_CONCAT(prefix, test_name) prefix ## _ ## test_name | 38 #define MACRO_CONCAT(prefix, test_name) prefix ## _ ## test_name |
39 #define E2E_ONLY(test_name) MACRO_CONCAT(DISABLED_E2ETest, test_name) | 39 #define E2E_ONLY(test_name) MACRO_CONCAT(DISABLED_E2ETest, test_name) |
40 #define E2E_ENABLED(test_name) MACRO_CONCAT(test_name, E2ETest) | 40 #define E2E_ENABLED(test_name) MACRO_CONCAT(test_name, E2ETest) |
41 | 41 |
42 class ProfileSyncServiceHarness; | 42 class ProfileSyncServiceHarness; |
43 class P2PInvalidationForwarder; | 43 class P2PInvalidationForwarder; |
44 class P2PSyncRefresher; | 44 class P2PSyncRefresher; |
45 | 45 |
46 namespace arc { | |
47 class SyncArcPackageHelper; | |
48 } // namespace arc | |
49 | |
46 namespace base { | 50 namespace base { |
47 class CommandLine; | 51 class CommandLine; |
48 class ScopedTempDir; | 52 class ScopedTempDir; |
49 } // namespace base | 53 } // namespace base |
50 | 54 |
51 namespace browser_sync { | 55 namespace browser_sync { |
52 class ProfileSyncService; | 56 class ProfileSyncService; |
53 } // namespace browser_sync | 57 } // namespace browser_sync |
54 | 58 |
55 namespace fake_server { | 59 namespace fake_server { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 | 119 |
116 ~SyncTest() override; | 120 ~SyncTest() override; |
117 | 121 |
118 // Validates command line parameters and creates a local python test server if | 122 // Validates command line parameters and creates a local python test server if |
119 // specified. | 123 // specified. |
120 void SetUp() override; | 124 void SetUp() override; |
121 | 125 |
122 // Brings down local python test server if one was created. | 126 // Brings down local python test server if one was created. |
123 void TearDown() override; | 127 void TearDown() override; |
124 | 128 |
129 // Sets up arc flags. | |
130 void SetUpOnMainThread() override; | |
131 | |
125 // Sets up command line flags required for sync tests. | 132 // Sets up command line flags required for sync tests. |
126 void SetUpCommandLine(base::CommandLine* cl) override; | 133 void SetUpCommandLine(base::CommandLine* cl) override; |
127 | 134 |
128 // Used to get the number of sync clients used by a test. | 135 // Used to get the number of sync clients used by a test. |
129 int num_clients() { return num_clients_; } | 136 int num_clients() { return num_clients_; } |
130 | 137 |
131 // Returns a pointer to a particular sync profile. Callee owns the object | 138 // Returns a pointer to a particular sync profile. Callee owns the object |
132 // and manages its lifetime. | 139 // and manages its lifetime. |
133 Profile* GetProfile(int index); | 140 Profile* GetProfile(int index); |
134 | 141 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 // Triggers the creation the Synced Bookmarks folder on the server. | 252 // Triggers the creation the Synced Bookmarks folder on the server. |
246 void TriggerCreateSyncedBookmarks(); | 253 void TriggerCreateSyncedBookmarks(); |
247 | 254 |
248 // Returns the FakeServer being used for the test or null if FakeServer is | 255 // Returns the FakeServer being used for the test or null if FakeServer is |
249 // not being used. | 256 // not being used. |
250 fake_server::FakeServer* GetFakeServer() const; | 257 fake_server::FakeServer* GetFakeServer() const; |
251 | 258 |
252 // Triggers a sync for the given |model_types| for the Profile at |index|. | 259 // Triggers a sync for the given |model_types| for the Profile at |index|. |
253 void TriggerSyncForModelTypes(int index, syncer::ModelTypeSet model_types); | 260 void TriggerSyncForModelTypes(int index, syncer::ModelTypeSet model_types); |
254 | 261 |
262 arc::SyncArcPackageHelper* sync_arc_helper() { return sync_arc_helper_; } | |
263 | |
255 protected: | 264 protected: |
256 // Add custom switches needed for running the test. | 265 // Add custom switches needed for running the test. |
257 virtual void AddTestSwitches(base::CommandLine* cl); | 266 virtual void AddTestSwitches(base::CommandLine* cl); |
258 | 267 |
259 // Append the command line switches to enable experimental types that aren't | 268 // Append the command line switches to enable experimental types that aren't |
260 // on by default yet. | 269 // on by default yet. |
261 virtual void AddOptionalTypesToCommandLine(base::CommandLine* cl); | 270 virtual void AddOptionalTypesToCommandLine(base::CommandLine* cl); |
262 | 271 |
263 // BrowserTestBase override. Destroys all the sync clients and sync | 272 // BrowserTestBase override. Destroys all the sync clients and sync |
264 // profiles created by a test. | 273 // profiles created by a test. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 // Fake URLFetcher factory used to mock out GAIA signin. | 475 // Fake URLFetcher factory used to mock out GAIA signin. |
467 std::unique_ptr<net::FakeURLFetcherFactory> fake_factory_; | 476 std::unique_ptr<net::FakeURLFetcherFactory> fake_factory_; |
468 | 477 |
469 // The URLFetcherImplFactory instance used to instantiate |fake_factory_|. | 478 // The URLFetcherImplFactory instance used to instantiate |fake_factory_|. |
470 std::unique_ptr<net::URLFetcherImplFactory> factory_; | 479 std::unique_ptr<net::URLFetcherImplFactory> factory_; |
471 | 480 |
472 // The contents to be written to a profile's Preferences file before the | 481 // The contents to be written to a profile's Preferences file before the |
473 // Profile object is created. If empty, no preexisting file will be written. | 482 // Profile object is created. If empty, no preexisting file will be written. |
474 std::string preexisting_preferences_file_contents_; | 483 std::string preexisting_preferences_file_contents_; |
475 | 484 |
485 // ARC test helper function to install/uninstall arc package, and get package | |
486 // info. | |
487 arc::SyncArcPackageHelper* sync_arc_helper_; | |
skym
2017/03/16 23:27:19
Am I missing something? Why not call arc::SyncArcP
Gang Wu
2017/03/17 19:23:23
Done.
| |
488 | |
476 DISALLOW_COPY_AND_ASSIGN(SyncTest); | 489 DISALLOW_COPY_AND_ASSIGN(SyncTest); |
477 }; | 490 }; |
478 | 491 |
479 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ | 492 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ |
OLD | NEW |