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

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: Major refresh after r76339 and r76419. 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 7da9d1e36a31678746a7400efff813cf2b41ff08..4e763033dd45d7ded1f3697bdfd1d94cacbf1453 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -554,9 +554,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");
+ cmd_line->AppendArg("--register_cygwin");
+ cmd_line->AppendArgNative(FILE_PATH_LITERAL("--root=") +
+ root_directory.value());
Evan Martin 2011/05/10 23:48:32 Why not AppendSwitch?
msw 2011/05/11 02:28:12 Same reasoning as SafeBrowsingTestServer::Start().
FilePath layout_tests_dir;
PathService::Get(base::DIR_SOURCE_ROOT, &layout_tests_dir);
@@ -565,18 +566,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?
@@ -592,7 +594,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