| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 #include "net/base/network_change_notifier.h" | 83 #include "net/base/network_change_notifier.h" |
| 84 #include "net/base/port_util.h" | 84 #include "net/base/port_util.h" |
| 85 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" | 85 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" |
| 86 #include "net/url_request/test_url_fetcher_factory.h" | 86 #include "net/url_request/test_url_fetcher_factory.h" |
| 87 #include "net/url_request/url_fetcher.h" | 87 #include "net/url_request/url_fetcher.h" |
| 88 #include "net/url_request/url_fetcher_delegate.h" | 88 #include "net/url_request/url_fetcher_delegate.h" |
| 89 #include "url/gurl.h" | 89 #include "url/gurl.h" |
| 90 | 90 |
| 91 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
| 92 #include "chromeos/chromeos_switches.h" | 92 #include "chromeos/chromeos_switches.h" |
| 93 #include "components/arc/arc_util.h" | |
| 94 #endif | 93 #endif |
| 95 | 94 |
| 96 using browser_sync::ProfileSyncService; | 95 using browser_sync::ProfileSyncService; |
| 97 using content::BrowserThread; | 96 using content::BrowserThread; |
| 98 | 97 |
| 99 namespace switches { | 98 namespace switches { |
| 100 const char kPasswordFileForTest[] = "password-file-for-test"; | 99 const char kPasswordFileForTest[] = "password-file-for-test"; |
| 101 const char kSyncUserForTest[] = "sync-user-for-test"; | 100 const char kSyncUserForTest[] = "sync-user-for-test"; |
| 102 const char kSyncPasswordForTest[] = "sync-password-for-test"; | 101 const char kSyncPasswordForTest[] = "sync-password-for-test"; |
| 103 const char kSyncServerCommandLine[] = "sync-server-command-line"; | 102 const char kSyncServerCommandLine[] = "sync-server-command-line"; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 291 |
| 293 fake_server_.reset(); | 292 fake_server_.reset(); |
| 294 } | 293 } |
| 295 | 294 |
| 296 void SyncTest::SetUpCommandLine(base::CommandLine* cl) { | 295 void SyncTest::SetUpCommandLine(base::CommandLine* cl) { |
| 297 AddTestSwitches(cl); | 296 AddTestSwitches(cl); |
| 298 AddOptionalTypesToCommandLine(cl); | 297 AddOptionalTypesToCommandLine(cl); |
| 299 | 298 |
| 300 #if defined(OS_CHROMEOS) | 299 #if defined(OS_CHROMEOS) |
| 301 cl->AppendSwitch(chromeos::switches::kIgnoreUserProfileMappingForTests); | 300 cl->AppendSwitch(chromeos::switches::kIgnoreUserProfileMappingForTests); |
| 302 arc::SetArcAvailableCommandLineForTesting(cl); | |
| 303 #endif | 301 #endif |
| 304 } | 302 } |
| 305 | 303 |
| 306 void SyncTest::AddTestSwitches(base::CommandLine* cl) { | 304 void SyncTest::AddTestSwitches(base::CommandLine* cl) { |
| 307 // Disable non-essential access of external network resources. | 305 // Disable non-essential access of external network resources. |
| 308 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) | 306 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) |
| 309 cl->AppendSwitch(switches::kDisableBackgroundNetworking); | 307 cl->AppendSwitch(switches::kDisableBackgroundNetworking); |
| 310 | 308 |
| 311 if (!cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) | 309 if (!cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) |
| 312 cl->AppendSwitch(switches::kSyncShortInitialRetryOverride); | 310 cl->AppendSwitch(switches::kSyncShortInitialRetryOverride); |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 | 1131 |
| 1134 void SyncTest::TriggerSyncForModelTypes(int index, | 1132 void SyncTest::TriggerSyncForModelTypes(int index, |
| 1135 syncer::ModelTypeSet model_types) { | 1133 syncer::ModelTypeSet model_types) { |
| 1136 GetSyncService(index)->TriggerRefresh(model_types); | 1134 GetSyncService(index)->TriggerRefresh(model_types); |
| 1137 } | 1135 } |
| 1138 | 1136 |
| 1139 void SyncTest::SetPreexistingPreferencesFileContents( | 1137 void SyncTest::SetPreexistingPreferencesFileContents( |
| 1140 const std::string& contents) { | 1138 const std::string& contents) { |
| 1141 preexisting_preferences_file_contents_ = contents; | 1139 preexisting_preferences_file_contents_ = contents; |
| 1142 } | 1140 } |
| OLD | NEW |