| 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 "content/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 return false; | 507 return false; |
| 508 } | 508 } |
| 509 | 509 |
| 510 started_ = true; | 510 started_ = true; |
| 511 return true; | 511 return true; |
| 512 } | 512 } |
| 513 | 513 |
| 514 CommandLine* TestWebSocketServer::CreatePythonCommandLine() { | 514 CommandLine* TestWebSocketServer::CreatePythonCommandLine() { |
| 515 // Note: Python's first argument must be the script; do not append CommandLine | 515 // Note: Python's first argument must be the script; do not append CommandLine |
| 516 // switches, as they would precede the script path and break this CommandLine. | 516 // switches, as they would precede the script path and break this CommandLine. |
| 517 FilePath path; | 517 CommandLine* cmd_line = new CommandLine(CommandLine::NO_PROGRAM); |
| 518 CHECK(GetPythonRunTime(&path)); | 518 // TODO(phajdan.jr): Instead of CHECKing, return a boolean indicating success. |
| 519 return new CommandLine(path); | 519 CHECK(GetPythonCommand(cmd_line)); |
| 520 return cmd_line; |
| 520 } | 521 } |
| 521 | 522 |
| 522 void TestWebSocketServer::SetPythonPath() { | 523 void TestWebSocketServer::SetPythonPath() { |
| 523 FilePath scripts_path; | 524 FilePath scripts_path; |
| 524 PathService::Get(base::DIR_SOURCE_ROOT, &scripts_path); | 525 PathService::Get(base::DIR_SOURCE_ROOT, &scripts_path); |
| 525 | 526 |
| 526 scripts_path = scripts_path | 527 scripts_path = scripts_path |
| 527 .Append(FILE_PATH_LITERAL("third_party")) | 528 .Append(FILE_PATH_LITERAL("third_party")) |
| 528 .Append(FILE_PATH_LITERAL("WebKit")) | 529 .Append(FILE_PATH_LITERAL("WebKit")) |
| 529 .Append(FILE_PATH_LITERAL("Tools")) | 530 .Append(FILE_PATH_LITERAL("Tools")) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 base::LaunchProcess(*cmd_line.get(), options, NULL); | 563 base::LaunchProcess(*cmd_line.get(), options, NULL); |
| 563 | 564 |
| 564 #if defined(OS_POSIX) | 565 #if defined(OS_POSIX) |
| 565 // Just to make sure that the server process terminates certainly. | 566 // Just to make sure that the server process terminates certainly. |
| 566 if (process_group_id_ != base::kNullProcessHandle) | 567 if (process_group_id_ != base::kNullProcessHandle) |
| 567 base::KillProcessGroup(process_group_id_); | 568 base::KillProcessGroup(process_group_id_); |
| 568 #endif | 569 #endif |
| 569 } | 570 } |
| 570 | 571 |
| 571 } // namespace content | 572 } // namespace content |
| OLD | NEW |