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