| 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/spawned_test_server/local_test_server.h" | 5 #include "net/test/spawned_test_server/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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 } // namespace | 99 } // namespace |
| 100 | 100 |
| 101 namespace net { | 101 namespace net { |
| 102 | 102 |
| 103 bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { | 103 bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { |
| 104 // Log is useful in the event you want to run a nearby script (e.g. a test) in | 104 // Log is useful in the event you want to run a nearby script (e.g. a test) in |
| 105 // the same environment as the TestServer. | 105 // the same environment as the TestServer. |
| 106 VLOG(1) << "LaunchPython called with PYTHONPATH = " << getenv(kPythonPathEnv); | 106 VLOG(1) << "LaunchPython called with PYTHONPATH = " << getenv(kPythonPathEnv); |
| 107 | 107 |
| 108 CommandLine python_command(CommandLine::NO_PROGRAM); | 108 base::CommandLine python_command(base::CommandLine::NO_PROGRAM); |
| 109 if (!GetPythonCommand(&python_command)) | 109 if (!GetPythonCommand(&python_command)) |
| 110 return false; | 110 return false; |
| 111 | 111 |
| 112 python_command.AppendArgPath(testserver_path); | 112 python_command.AppendArgPath(testserver_path); |
| 113 if (!AddCommandLineArguments(&python_command)) | 113 if (!AddCommandLineArguments(&python_command)) |
| 114 return false; | 114 return false; |
| 115 | 115 |
| 116 int pipefd[2]; | 116 int pipefd[2]; |
| 117 if (pipe(pipefd) != 0) { | 117 if (pipe(pipefd) != 0) { |
| 118 PLOG(ERROR) << "Could not create pipe."; | 118 PLOG(ERROR) << "Could not create pipe."; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 if (!ParseServerData(server_data)) { | 171 if (!ParseServerData(server_data)) { |
| 172 LOG(ERROR) << "Could not parse server_data: " << server_data; | 172 LOG(ERROR) << "Could not parse server_data: " << server_data; |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 | 175 |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace net | 179 } // namespace net |
| OLD | NEW |