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 if (!AddCommandLineArguments(&python_command)) | 98 if (!AddCommandLineArguments(testserver_path, &python_command)) |
99 return false; | 99 return false; |
100 | 100 |
101 HANDLE child_read = NULL; | 101 HANDLE child_read = NULL; |
102 HANDLE child_write = NULL; | 102 HANDLE child_write = NULL; |
103 if (!CreatePipe(&child_read, &child_write, NULL, 0)) { | 103 if (!CreatePipe(&child_read, &child_write, NULL, 0)) { |
104 PLOG(ERROR) << "Failed to create pipe"; | 104 PLOG(ERROR) << "Failed to create pipe"; |
105 return false; | 105 return false; |
106 } | 106 } |
107 child_read_fd_.Set(child_read); | 107 child_read_fd_.Set(child_read); |
108 child_write_fd_.Set(child_write); | 108 child_write_fd_.Set(child_write); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 if (!ParseServerData(server_data)) { | 170 if (!ParseServerData(server_data)) { |
171 LOG(ERROR) << "Could not parse server_data: " << server_data; | 171 LOG(ERROR) << "Could not parse server_data: " << server_data; |
172 return false; | 172 return false; |
173 } | 173 } |
174 | 174 |
175 return true; | 175 return true; |
176 } | 176 } |
177 | 177 |
178 } // namespace net | 178 } // namespace net |
179 | |
OLD | NEW |