OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/ui_test_utils.h" | 5 #include "chrome/test/ui_test_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 #endif | 608 #endif |
609 } | 609 } |
610 | 610 |
611 } // anonymous namespace | 611 } // anonymous namespace |
612 | 612 |
613 TestWebSocketServer::TestWebSocketServer(const FilePath& root_directory) { | 613 TestWebSocketServer::TestWebSocketServer(const FilePath& root_directory) { |
614 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); | 614 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); |
615 cmd_line->AppendSwitchWithValue("server", "start"); | 615 cmd_line->AppendSwitchWithValue("server", "start"); |
616 cmd_line->AppendSwitch("chromium"); | 616 cmd_line->AppendSwitch("chromium"); |
617 cmd_line->AppendSwitch("register_cygwin"); | 617 cmd_line->AppendSwitch("register_cygwin"); |
618 cmd_line->AppendSwitchWithValue("root", root_directory.ToWStringHack()); | 618 cmd_line->AppendSwitchPath("root", root_directory); |
619 temp_dir_.CreateUniqueTempDir(); | 619 temp_dir_.CreateUniqueTempDir(); |
620 websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid"); | 620 websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid"); |
621 cmd_line->AppendSwitchWithValue("pidfile", | 621 cmd_line->AppendSwitchPath("pidfile", websocket_pid_file_); |
622 websocket_pid_file_.ToWStringHack()); | |
623 SetPythonPath(); | 622 SetPythonPath(); |
624 base::LaunchApp(*cmd_line.get(), true, false, NULL); | 623 base::LaunchApp(*cmd_line.get(), true, false, NULL); |
625 } | 624 } |
626 | 625 |
627 CommandLine* TestWebSocketServer::CreatePythonCommandLine() { | 626 CommandLine* TestWebSocketServer::CreatePythonCommandLine() { |
628 return new CommandLine(FilePath(FILE_PATH_LITERAL("python"))); | 627 return new CommandLine(FilePath(FILE_PATH_LITERAL("python"))); |
629 } | 628 } |
630 | 629 |
631 void TestWebSocketServer::SetPythonPath() { | 630 void TestWebSocketServer::SetPythonPath() { |
632 FilePath scripts_path; | 631 FilePath scripts_path; |
(...skipping 21 matching lines...) Expand all Loading... |
654 | 653 |
655 CommandLine* cmd_line = CreatePythonCommandLine(); | 654 CommandLine* cmd_line = CreatePythonCommandLine(); |
656 cmd_line->AppendLooseValue(script_path.ToWStringHack()); | 655 cmd_line->AppendLooseValue(script_path.ToWStringHack()); |
657 return cmd_line; | 656 return cmd_line; |
658 } | 657 } |
659 | 658 |
660 TestWebSocketServer::~TestWebSocketServer() { | 659 TestWebSocketServer::~TestWebSocketServer() { |
661 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); | 660 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); |
662 cmd_line->AppendSwitchWithValue("server", "stop"); | 661 cmd_line->AppendSwitchWithValue("server", "stop"); |
663 cmd_line->AppendSwitch("chromium"); | 662 cmd_line->AppendSwitch("chromium"); |
664 cmd_line->AppendSwitchWithValue("pidfile", | 663 cmd_line->AppendSwitchPath("pidfile", websocket_pid_file_); |
665 websocket_pid_file_.ToWStringHack()); | |
666 base::LaunchApp(*cmd_line.get(), true, false, NULL); | 664 base::LaunchApp(*cmd_line.get(), true, false, NULL); |
667 } | 665 } |
668 | 666 |
669 } // namespace ui_test_utils | 667 } // namespace ui_test_utils |
OLD | NEW |