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

Side by Side Diff: shell/command_line_util_unittest.cc

Issue 1467263002: Fix URL duplication when SetArgsForURL is called mutliple times. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years 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 unified diff | Download patch
« no previous file with comments | « shell/command_line_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "shell/command_line_util.h" 5 #include "shell/command_line_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace shell { 10 namespace shell {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 Context context; 60 Context context;
61 context.SetCommandLineCWD(base::FilePath("/root")); 61 context.SetCommandLineCWD(base::FilePath("/root"));
62 for (auto& expectation : EXPECTATIONS) { 62 for (auto& expectation : EXPECTATIONS) {
63 std::vector<std::string> args; 63 std::vector<std::string> args;
64 GURL result(GetAppURLAndArgs(&context, expectation.args, &args)); 64 GURL result(GetAppURLAndArgs(&context, expectation.args, &args));
65 EXPECT_EQ(bool(expectation.url), result.is_valid()); 65 EXPECT_EQ(bool(expectation.url), result.is_valid());
66 if (expectation.url && result.is_valid()) { 66 if (expectation.url && result.is_valid()) {
67 EXPECT_EQ(GURL(expectation.url), result); 67 EXPECT_EQ(GURL(expectation.url), result);
68 std::vector<std::string> expected_args; 68 std::vector<std::string> expected_args;
69 if (expectation.values) { 69 if (expectation.values) {
70 if (*expectation.values)
71 expected_args.push_back(expectation.url);
72 for (const char** value = expectation.values; *value; ++value) 70 for (const char** value = expectation.values; *value; ++value)
73 expected_args.push_back(*value); 71 expected_args.push_back(*value);
74 } 72 }
75 EXPECT_EQ(expected_args, args); 73 EXPECT_EQ(expected_args, args);
76 } 74 }
77 } 75 }
78 } 76 }
79 77
80 } // namespace 78 } // namespace
81 } // namespace shell 79 } // namespace shell
OLDNEW
« 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