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

Unified Diff: chrome/test/ui/ui_test.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/ui_test.cc
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index dbcd00f614873b57a241bc78e6d9975911da7afe..3018a7a6c8ef21741e6905de9c9994d19ab6fabf 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -550,9 +550,10 @@ void UITest::StartHttpServerWithPort(const FilePath& root_directory,
int port) {
scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine());
ASSERT_TRUE(cmd_line.get());
- cmd_line->AppendSwitchASCII("server", "start");
- 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("--register_cygwin");
+ cmd_line->AppendArgNative(FILE_PATH_LITERAL("--root=") +
+ root_directory.value());
FilePath layout_tests_dir;
PathService::Get(base::DIR_SOURCE_ROOT, &layout_tests_dir);
@@ -561,18 +562,19 @@ void UITest::StartHttpServerWithPort(const FilePath& root_directory,
.AppendASCII("data")
.AppendASCII("layout_tests")
.AppendASCII("LayoutTests");
- cmd_line->AppendSwitchPath("layout_tests_dir", layout_tests_dir);
+ cmd_line->AppendArgNative(FILE_PATH_LITERAL("--layout_tests_dir=") +
+ layout_tests_dir.value());
// For Windows 7, if we start the lighttpd server on the foreground mode,
// it will mess up with the command window and cause conhost.exe to crash. To
// work around this, we start the http server on the background mode.
#if defined(OS_WIN)
if (base::win::GetVersion() >= base::win::VERSION_WIN7)
- cmd_line->AppendSwitch("run_background");
+ cmd_line->AppendArg("--run_background");
#endif
if (port)
- cmd_line->AppendSwitchASCII("port", base::IntToString(port));
+ cmd_line->AppendArg("--port=" + base::IntToString(port));
#if defined(OS_WIN)
// TODO(phajdan.jr): is this needed?
@@ -588,7 +590,7 @@ void UITest::StartHttpServerWithPort(const FilePath& root_directory,
void UITest::StopHttpServer() {
scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine());
ASSERT_TRUE(cmd_line.get());
- cmd_line->AppendSwitchASCII("server", "stop");
+ cmd_line->AppendArg("--server=stop");
#if defined(OS_WIN)
// TODO(phajdan.jr): is this needed?

Powered by Google App Engine
This is Rietveld 408576698