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/test/base/test_launcher_utils.h" | 5 #include "chrome/test/base/test_launcher_utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
11 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
18 #include "components/os_crypt/os_crypt_switches.h" | 18 #include "components/os_crypt/os_crypt_switches.h" |
19 #include "components/safe_browsing/common/safebrowsing_switches.h" | 19 #include "components/safe_browsing/common/safebrowsing_switches.h" |
20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
21 | 21 |
22 #if defined(USE_AURA) | 22 #if defined(USE_AURA) |
23 #include "ui/wm/core/wm_core_switches.h" | 23 #include "ui/wm/core/wm_core_switches.h" |
24 #endif | 24 #endif |
25 | 25 |
26 namespace test_launcher_utils { | 26 namespace test_launcher_utils { |
27 | 27 |
28 void PrepareBrowserCommandLineForTests(base::CommandLine* command_line) { | 28 void PrepareBrowserCommandLineForTests(base::CommandLine* command_line) { |
29 // Turn off preconnects because they break the brittle python webserver; | |
30 // see http://crbug.com/60035. | |
31 command_line->AppendSwitchASCII(switches::kDisableFeatures, | |
32 "NetworkPrediction"); | |
33 | |
34 // Don't show the first run ui. | 29 // Don't show the first run ui. |
35 command_line->AppendSwitch(switches::kNoFirstRun); | 30 command_line->AppendSwitch(switches::kNoFirstRun); |
36 | 31 |
37 // No default browser check, it would create an info-bar (if we are not the | 32 // No default browser check, it would create an info-bar (if we are not the |
38 // default browser) that could conflicts with some tests expectations. | 33 // default browser) that could conflicts with some tests expectations. |
39 command_line->AppendSwitch(switches::kNoDefaultBrowserCheck); | 34 command_line->AppendSwitch(switches::kNoDefaultBrowserCheck); |
40 | 35 |
41 // Enable info level logging to stderr by default so that we can see when | 36 // Enable info level logging to stderr by default so that we can see when |
42 // bad stuff happens, but honor the flags specified from the command line. | 37 // bad stuff happens, but honor the flags specified from the command line. |
43 if (!command_line->HasSwitch(switches::kEnableLogging)) | 38 if (!command_line->HasSwitch(switches::kEnableLogging)) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // profile. Otherwise the machine's policies could affect tests. | 106 // profile. Otherwise the machine's policies could affect tests. |
112 base::FilePath policy_files = user_data_dir.AppendASCII("policies"); | 107 base::FilePath policy_files = user_data_dir.AppendASCII("policies"); |
113 success = | 108 success = |
114 success && PathService::Override(chrome::DIR_POLICY_FILES, policy_files); | 109 success && PathService::Override(chrome::DIR_POLICY_FILES, policy_files); |
115 #endif | 110 #endif |
116 | 111 |
117 return success; | 112 return success; |
118 } | 113 } |
119 | 114 |
120 } // namespace test_launcher_utils | 115 } // namespace test_launcher_utils |
OLD | NEW |