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 "net/test/local_test_server.h" | 5 #include "net/test/local_test_server.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <wincrypt.h> | 8 #include <wincrypt.h> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 bool LocalTestServer::LaunchPython(const FilePath& testserver_path) { | 87 bool LocalTestServer::LaunchPython(const FilePath& testserver_path) { |
88 FilePath python_exe; | 88 FilePath python_exe; |
89 if (!PathService::Get(base::DIR_SOURCE_ROOT, &python_exe)) | 89 if (!PathService::Get(base::DIR_SOURCE_ROOT, &python_exe)) |
90 return false; | 90 return false; |
91 python_exe = python_exe | 91 python_exe = python_exe |
92 .Append(FILE_PATH_LITERAL("third_party")) | 92 .Append(FILE_PATH_LITERAL("third_party")) |
93 .Append(FILE_PATH_LITERAL("python_26")) | 93 .Append(FILE_PATH_LITERAL("python_26")) |
94 .Append(FILE_PATH_LITERAL("python.exe")); | 94 .Append(FILE_PATH_LITERAL("python.exe")); |
95 | 95 |
96 CommandLine python_command(python_exe); | 96 CommandLine python_command(python_exe); |
97 python_command.AppendArgPath(testserver_path); | 97 |
| 98 AddPythonArguments(testserver_path, &python_command); |
| 99 |
98 if (!AddCommandLineArguments(&python_command)) | 100 if (!AddCommandLineArguments(&python_command)) |
99 return false; | 101 return false; |
100 | 102 |
101 HANDLE child_read = NULL; | 103 HANDLE child_read = NULL; |
102 HANDLE child_write = NULL; | 104 HANDLE child_write = NULL; |
103 if (!CreatePipe(&child_read, &child_write, NULL, 0)) { | 105 if (!CreatePipe(&child_read, &child_write, NULL, 0)) { |
104 PLOG(ERROR) << "Failed to create pipe"; | 106 PLOG(ERROR) << "Failed to create pipe"; |
105 return false; | 107 return false; |
106 } | 108 } |
107 child_read_fd_.Set(child_read); | 109 child_read_fd_.Set(child_read); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 171 |
170 if (!ParseServerData(server_data)) { | 172 if (!ParseServerData(server_data)) { |
171 LOG(ERROR) << "Could not parse server_data: " << server_data; | 173 LOG(ERROR) << "Could not parse server_data: " << server_data; |
172 return false; | 174 return false; |
173 } | 175 } |
174 | 176 |
175 return true; | 177 return true; |
176 } | 178 } |
177 | 179 |
178 } // namespace net | 180 } // namespace net |
179 | |
OLD | NEW |