| 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/test_server.h" | 5 #include "net/test/test_server.h" |
| 6 | 6 |
| 7 #include <poll.h> | 7 #include <poll.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return false; | 86 return false; |
| 87 bytes_read += num_bytes; | 87 bytes_read += num_bytes; |
| 88 } | 88 } |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 | 93 |
| 94 namespace net { | 94 namespace net { |
| 95 | 95 |
| 96 // static |
| 97 FilePath TestServer::GetAbsolutePythonCommandPath() { |
| 98 return FilePath(FILE_PATH_LITERAL("python")); |
| 99 } |
| 100 |
| 96 bool TestServer::LaunchPython(const FilePath& testserver_path) { | 101 bool TestServer::LaunchPython(const FilePath& testserver_path) { |
| 97 CommandLine python_command(FilePath(FILE_PATH_LITERAL("python"))); | 102 CommandLine python_command(GetAbsolutePythonCommandPath()); |
| 98 python_command.AppendArgPath(testserver_path); | 103 python_command.AppendArgPath(testserver_path); |
| 99 if (!AddCommandLineArguments(&python_command)) | 104 if (!AddCommandLineArguments(&python_command)) |
| 100 return false; | 105 return false; |
| 101 | 106 |
| 102 int pipefd[2]; | 107 int pipefd[2]; |
| 103 if (pipe(pipefd) != 0) { | 108 if (pipe(pipefd) != 0) { |
| 104 PLOG(ERROR) << "Could not create pipe."; | 109 PLOG(ERROR) << "Could not create pipe."; |
| 105 return false; | 110 return false; |
| 106 } | 111 } |
| 107 | 112 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 161 |
| 157 if (!ParseServerData(server_data)) { | 162 if (!ParseServerData(server_data)) { |
| 158 LOG(ERROR) << "Could not parse server_data: " << server_data; | 163 LOG(ERROR) << "Could not parse server_data: " << server_data; |
| 159 return false; | 164 return false; |
| 160 } | 165 } |
| 161 | 166 |
| 162 return true; | 167 return true; |
| 163 } | 168 } |
| 164 | 169 |
| 165 } // namespace net | 170 } // namespace net |
| OLD | NEW |