Chromium Code Reviews| 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" | |
| 93 #endif | 94 #endif |
| 94 | 95 |
| 95 using browser_sync::ProfileSyncService; | 96 using browser_sync::ProfileSyncService; |
| 96 using content::BrowserThread; | 97 using content::BrowserThread; |
| 97 | 98 |
| 98 namespace switches { | 99 namespace switches { |
| 99 const char kPasswordFileForTest[] = "password-file-for-test"; | 100 const char kPasswordFileForTest[] = "password-file-for-test"; |
| 100 const char kSyncUserForTest[] = "sync-user-for-test"; | 101 const char kSyncUserForTest[] = "sync-user-for-test"; |
| 101 const char kSyncPasswordForTest[] = "sync-password-for-test"; | 102 const char kSyncPasswordForTest[] = "sync-password-for-test"; |
| 102 const char kSyncServerCommandLine[] = "sync-server-command-line"; | 103 const char kSyncServerCommandLine[] = "sync-server-command-line"; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 | 292 |
| 292 fake_server_.reset(); | 293 fake_server_.reset(); |
| 293 } | 294 } |
| 294 | 295 |
| 295 void SyncTest::SetUpCommandLine(base::CommandLine* cl) { | 296 void SyncTest::SetUpCommandLine(base::CommandLine* cl) { |
| 296 AddTestSwitches(cl); | 297 AddTestSwitches(cl); |
| 297 AddOptionalTypesToCommandLine(cl); | 298 AddOptionalTypesToCommandLine(cl); |
| 298 | 299 |
| 299 #if defined(OS_CHROMEOS) | 300 #if defined(OS_CHROMEOS) |
| 300 cl->AppendSwitch(chromeos::switches::kIgnoreUserProfileMappingForTests); | 301 cl->AppendSwitch(chromeos::switches::kIgnoreUserProfileMappingForTests); |
| 302 arc::SetArcAvailableCommandLineForTesting(cl); | |
|
hidehiko
2017/02/24 18:22:26
Could you define the flag in each test?
As ARC doe
lgcheng
2017/02/25 01:40:38
Done.
| |
| 301 #endif | 303 #endif |
| 302 } | 304 } |
| 303 | 305 |
| 304 void SyncTest::AddTestSwitches(base::CommandLine* cl) { | 306 void SyncTest::AddTestSwitches(base::CommandLine* cl) { |
| 305 // Disable non-essential access of external network resources. | 307 // Disable non-essential access of external network resources. |
| 306 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) | 308 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) |
| 307 cl->AppendSwitch(switches::kDisableBackgroundNetworking); | 309 cl->AppendSwitch(switches::kDisableBackgroundNetworking); |
| 308 | 310 |
| 309 if (!cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) | 311 if (!cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) |
| 310 cl->AppendSwitch(switches::kSyncShortInitialRetryOverride); | 312 cl->AppendSwitch(switches::kSyncShortInitialRetryOverride); |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1132 | 1134 |
| 1133 void SyncTest::TriggerSyncForModelTypes(int index, | 1135 void SyncTest::TriggerSyncForModelTypes(int index, |
| 1134 syncer::ModelTypeSet model_types) { | 1136 syncer::ModelTypeSet model_types) { |
| 1135 GetSyncService(index)->TriggerRefresh(model_types); | 1137 GetSyncService(index)->TriggerRefresh(model_types); |
| 1136 } | 1138 } |
| 1137 | 1139 |
| 1138 void SyncTest::SetPreexistingPreferencesFileContents( | 1140 void SyncTest::SetPreexistingPreferencesFileContents( |
| 1139 const std::string& contents) { | 1141 const std::string& contents) { |
| 1140 preexisting_preferences_file_contents_ = contents; | 1142 preexisting_preferences_file_contents_ = contents; |
| 1141 } | 1143 } |
| OLD | NEW |