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

Unified Diff: base/process_util_unittest.cc

Issue 3134008: CommandLine: eliminate wstring-accepting AppendLooseValue (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: utf8 Created 10 years, 4 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: base/process_util_unittest.cc
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 8da89b0928400931492741f852325424ccdf500d..6f4ed39da287003b6b2e616b38a965676b8fc05b 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -205,18 +205,16 @@ TEST_F(ProcessUtilTest, GetAppOutput) {
.Append(FILE_PATH_LITERAL("python.exe"));
CommandLine cmd_line(python_runtime);
- cmd_line.AppendLooseValue(L"-c");
- cmd_line.AppendLooseValue(L"\"import sys; sys.stdout.write('" +
- ASCIIToWide(message) + L"');\"");
+ cmd_line.AppendArg("-c");
+ cmd_line.AppendArg("import sys; sys.stdout.write('" + message + "');");
std::string output;
ASSERT_TRUE(base::GetAppOutput(cmd_line, &output));
EXPECT_EQ(message, output);
// Let's make sure stderr is ignored.
CommandLine other_cmd_line(python_runtime);
- other_cmd_line.AppendLooseValue(L"-c");
- other_cmd_line.AppendLooseValue(
- L"\"import sys; sys.stderr.write('Hello!');\"");
+ other_cmd_line.AppendArg("-c");
+ other_cmd_line.AppendArg("import sys; sys.stderr.write('Hello!');");
output.clear();
ASSERT_TRUE(base::GetAppOutput(other_cmd_line, &output));
EXPECT_EQ("", output);

Powered by Google App Engine
This is Rietveld 408576698