Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: chrome/test/ui_test_utils.cc

Issue 6526040: CommandLine refactoring and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address additional comments, additional refactoring. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/ui_test_utils.cc
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc
index e7c84aa41622b5d23e47d8e25c3f2ae758d02996..0e51123ed1c2970263c914cb22362774d4c72881 100644
--- a/chrome/test/ui_test_utils.cc
+++ b/chrome/test/ui_test_utils.cc
@@ -751,16 +751,18 @@ bool TestWebSocketServer::Start(const FilePath& root_directory) {
if (started_)
return true;
scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine());
- cmd_line->AppendSwitchASCII("server", "start");
- cmd_line->AppendSwitch("chromium");
- cmd_line->AppendSwitch("register_cygwin");
- cmd_line->AppendSwitchPath("root", root_directory);
+ cmd_line->AppendArg("--server=start");
Evan Martin 2011/05/13 16:45:05 I worry that, without a comment, someone will help
msw 2011/05/13 18:54:49 Done.
+ cmd_line->AppendArg("--chromium");
+ cmd_line->AppendArg("--register_cygwin");
+ cmd_line->AppendArgNative(FILE_PATH_LITERAL("--root=") +
+ root_directory.value());
if (!temp_dir_.CreateUniqueTempDir()) {
LOG(ERROR) << "Unable to create a temporary directory.";
return false;
}
websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid");
- cmd_line->AppendSwitchPath("pidfile", websocket_pid_file_);
+ cmd_line->AppendArgNative(FILE_PATH_LITERAL("--pidfile=") +
+ websocket_pid_file_.value());
SetPythonPath();
if (!base::LaunchApp(*cmd_line.get(), true, false, NULL)) {
LOG(ERROR) << "Unable to launch websocket server.";
@@ -807,9 +809,10 @@ TestWebSocketServer::~TestWebSocketServer() {
if (!started_)
return;
scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine());
- cmd_line->AppendSwitchASCII("server", "stop");
- cmd_line->AppendSwitch("chromium");
- cmd_line->AppendSwitchPath("pidfile", websocket_pid_file_);
+ cmd_line->AppendArg("--server=stop");
+ cmd_line->AppendArg("--chromium");
+ cmd_line->AppendArgNative(FILE_PATH_LITERAL("--pidfile=") +
+ websocket_pid_file_.value());
base::LaunchApp(*cmd_line.get(), true, false, NULL);
}

Powered by Google App Engine
This is Rietveld 408576698