| 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 <poll.h> | 7 #include <poll.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return true; | 90 return true; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace | 93 } // namespace |
| 94 | 94 |
| 95 namespace net { | 95 namespace net { |
| 96 | 96 |
| 97 bool LocalTestServer::LaunchPython(const FilePath& testserver_path) { | 97 bool LocalTestServer::LaunchPython(const FilePath& testserver_path) { |
| 98 // Log is useful in the event you want to run a nearby script (e.g. a test) in | 98 // Log is useful in the event you want to run a nearby script (e.g. a test) in |
| 99 // the same environment as the TestServer. | 99 // the same environment as the TestServer. |
| 100 VLOG(1) << "LaunchPython called with PYTHONPATH = " << | 100 VLOG(1) << "LaunchPython called with PYTHONPATH = " << getenv(kPythonPathEnv); |
| 101 getenv(kPythonPathEnv); | 101 |
| 102 CommandLine python_command(FilePath(FILE_PATH_LITERAL("python"))); | 102 CommandLine python_command(CommandLine::NO_PROGRAM); |
| 103 if (!GetPythonCommand(&python_command)) |
| 104 return false; |
| 103 | 105 |
| 104 python_command.AppendArgPath(testserver_path); | 106 python_command.AppendArgPath(testserver_path); |
| 105 if (!AddCommandLineArguments(&python_command)) | 107 if (!AddCommandLineArguments(&python_command)) |
| 106 return false; | 108 return false; |
| 107 | 109 |
| 108 int pipefd[2]; | 110 int pipefd[2]; |
| 109 if (pipe(pipefd) != 0) { | 111 if (pipe(pipefd) != 0) { |
| 110 PLOG(ERROR) << "Could not create pipe."; | 112 PLOG(ERROR) << "Could not create pipe."; |
| 111 return false; | 113 return false; |
| 112 } | 114 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 163 |
| 162 if (!ParseServerData(server_data)) { | 164 if (!ParseServerData(server_data)) { |
| 163 LOG(ERROR) << "Could not parse server_data: " << server_data; | 165 LOG(ERROR) << "Could not parse server_data: " << server_data; |
| 164 return false; | 166 return false; |
| 165 } | 167 } |
| 166 | 168 |
| 167 return true; | 169 return true; |
| 168 } | 170 } |
| 169 | 171 |
| 170 } // namespace net | 172 } // namespace net |
| OLD | NEW |