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 CHECK(GetPythonRunTime(cmd_line)); |
Paweł Hajdan Jr.
2012/09/12 10:37:25
nit: Please add a TODO(phajdan.jr) here to convert
Raghu Simha
2012/09/12 18:31:20
Done.
| |
519 return new CommandLine(path); | 519 return cmd_line; |
520 } | 520 } |
521 | 521 |
522 void TestWebSocketServer::SetPythonPath() { | 522 void TestWebSocketServer::SetPythonPath() { |
523 FilePath scripts_path; | 523 FilePath scripts_path; |
524 PathService::Get(base::DIR_SOURCE_ROOT, &scripts_path); | 524 PathService::Get(base::DIR_SOURCE_ROOT, &scripts_path); |
525 | 525 |
526 scripts_path = scripts_path | 526 scripts_path = scripts_path |
527 .Append(FILE_PATH_LITERAL("third_party")) | 527 .Append(FILE_PATH_LITERAL("third_party")) |
528 .Append(FILE_PATH_LITERAL("WebKit")) | 528 .Append(FILE_PATH_LITERAL("WebKit")) |
529 .Append(FILE_PATH_LITERAL("Tools")) | 529 .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); | 562 base::LaunchProcess(*cmd_line.get(), options, NULL); |
563 | 563 |
564 #if defined(OS_POSIX) | 564 #if defined(OS_POSIX) |
565 // Just to make sure that the server process terminates certainly. | 565 // Just to make sure that the server process terminates certainly. |
566 if (process_group_id_ != base::kNullProcessHandle) | 566 if (process_group_id_ != base::kNullProcessHandle) |
567 base::KillProcessGroup(process_group_id_); | 567 base::KillProcessGroup(process_group_id_); |
568 #endif | 568 #endif |
569 } | 569 } |
570 | 570 |
571 } // namespace content | 571 } // namespace content |
OLD | NEW |