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/layout_test_http_server.h" | 5 #include "chrome/test/base/layout_test_http_server.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "content/public/common/content_paths.h" | 12 #include "content/public/common/content_paths.h" |
| 13 #include "net/test/python_utils.h" |
13 | 14 |
14 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
15 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
16 #endif | 17 #endif |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 bool PrepareCommandLine(CommandLine* cmd_line) { | 21 bool PrepareCommandLine(CommandLine* cmd_line) { |
21 FilePath src_path; | 22 FilePath src_path; |
22 if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_path)) | 23 if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_path)) |
23 return false; | 24 return false; |
24 | 25 |
25 cmd_line->SetProgram(FilePath(FILE_PATH_LITERAL("python"))); | 26 FilePath python_runtime; |
| 27 if (!GetPythonRunTime(&python_runtime)) |
| 28 return false; |
| 29 cmd_line->SetProgram(python_runtime); |
26 | 30 |
27 FilePath script_path(src_path); | 31 FilePath script_path(src_path); |
28 script_path = script_path.AppendASCII("third_party"); | 32 script_path = script_path.AppendASCII("third_party"); |
29 script_path = script_path.AppendASCII("WebKit"); | 33 script_path = script_path.AppendASCII("WebKit"); |
30 script_path = script_path.AppendASCII("Tools"); | 34 script_path = script_path.AppendASCII("Tools"); |
31 script_path = script_path.AppendASCII("Scripts"); | 35 script_path = script_path.AppendASCII("Scripts"); |
32 script_path = script_path.AppendASCII("new-run-webkit-httpd"); | 36 script_path = script_path.AppendASCII("new-run-webkit-httpd"); |
33 | 37 |
34 cmd_line->AppendArgPath(script_path); | 38 cmd_line->AppendArgPath(script_path); |
35 return true; | 39 return true; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 running_ = !stopped; | 125 running_ = !stopped; |
122 | 126 |
123 #if defined(OS_WIN) | 127 #if defined(OS_WIN) |
124 // Close the job object handle now. This should clean up | 128 // Close the job object handle now. This should clean up |
125 // any orphaned processes. | 129 // any orphaned processes. |
126 job_handle_.Close(); | 130 job_handle_.Close(); |
127 #endif | 131 #endif |
128 | 132 |
129 return stopped; | 133 return stopped; |
130 } | 134 } |
OLD | NEW |