| Index: net/test/local_test_server.cc
|
| diff --git a/net/test/local_test_server.cc b/net/test/local_test_server.cc
|
| index a1a1bc876817d5245b6e5046c2d31baf72fe0a03..4768f365ec508f849b692eb65c79db229ae33917 100644
|
| --- a/net/test/local_test_server.cc
|
| +++ b/net/test/local_test_server.cc
|
| @@ -94,13 +94,19 @@ bool LocalTestServer::GetTestServerDirectory(FilePath* directory) {
|
| return true;
|
| }
|
|
|
| +bool LocalTestServer::GetTestServerPath(FilePath* testserver_path) const {
|
| + if (!GetTestServerDirectory(testserver_path))
|
| + return false;
|
| + *testserver_path = testserver_path->Append(FILE_PATH_LITERAL(
|
| + "testserver.py"));
|
| + return true;
|
| +}
|
| +
|
| bool LocalTestServer::Start() {
|
| // Get path to Python server script.
|
| FilePath testserver_path;
|
| - if (!GetTestServerDirectory(&testserver_path))
|
| + if (!GetTestServerPath(&testserver_path))
|
| return false;
|
| - testserver_path =
|
| - testserver_path.Append(FILE_PATH_LITERAL("testserver.py"));
|
|
|
| if (!SetPythonPath())
|
| return false;
|
| @@ -159,8 +165,12 @@ bool LocalTestServer::Init(const FilePath& document_root) {
|
| return true;
|
| }
|
|
|
| +bool LocalTestServer::SetPythonPath() const {
|
| + return SetPythonPathStatic();
|
| +}
|
| +
|
| // static
|
| -bool LocalTestServer::SetPythonPath() {
|
| +bool LocalTestServer::SetPythonPathStatic() {
|
| FilePath third_party_dir;
|
| if (!PathService::Get(base::DIR_SOURCE_ROOT, &third_party_dir)) {
|
| LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT";
|
| @@ -255,4 +265,13 @@ bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const {
|
| return true;
|
| }
|
|
|
| +void LocalTestServer::AddPythonArguments(const FilePath& testserver_path,
|
| + CommandLine* command_line) const {
|
| + // Make python stdout and stderr unbuffered, to prevent incomplete stderr on
|
| + // win bots, and also fix mixed up ordering of stdout and stderr.
|
| + command_line->AppendSwitch("-u");
|
| +
|
| + command_line->AppendArgPath(testserver_path);
|
| +}
|
| +
|
| } // namespace net
|
|
|