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

Unified Diff: shell/command_line_util_unittest.cc

Issue 1905353002: Use a tokenizer to parse the command line for applications. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « shell/command_line_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/command_line_util_unittest.cc
diff --git a/shell/command_line_util_unittest.cc b/shell/command_line_util_unittest.cc
index 58d76494a01a209edfbb5c97a121d8084956ad67..5fa63ade131228c936cc4a44bfd91ea30c1d1e30 100644
--- a/shell/command_line_util_unittest.cc
+++ b/shell/command_line_util_unittest.cc
@@ -39,6 +39,7 @@ TEST(CommandLineUtil, GetAppURLAndArgs) {
const char* NO_ARGUMENTS[] = {nullptr};
const char* ONE_ARGUMENTS[] = {"1", nullptr};
const char* TWO_ARGUMENTS[] = {"1", "two", nullptr};
+ const char* QUOTED_ARGUMENTS[] = {"'1 two'", nullptr};
static const struct Expectation {
const char* args;
const char* url;
@@ -54,9 +55,9 @@ TEST(CommandLineUtil, GetAppURLAndArgs) {
{"http://example.com 1 ", "http://example.com", ONE_ARGUMENTS},
{"http://example.com 1 ", "http://example.com", ONE_ARGUMENTS},
{"http://example.com 1 two", "http://example.com", TWO_ARGUMENTS},
- {" http://example.com 1 two ",
- "http://example.com",
- TWO_ARGUMENTS}};
+ {" http://example.com 1 two ", "http://example.com", TWO_ARGUMENTS},
+ {"http://example.com '1 two' ", "http://example.com", QUOTED_ARGUMENTS},
+ };
Context context;
context.SetCommandLineCWD(base::FilePath("/root"));
for (auto& expectation : EXPECTATIONS) {
« no previous file with comments | « shell/command_line_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698