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

Unified Diff: url/url_util_unittest.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « url/url_canon_relative.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_util_unittest.cc
diff --git a/url/url_util_unittest.cc b/url/url_util_unittest.cc
index 17c1b0f6b254a1f8a55f6f29bb30b4cdbec725d4..73ff93b8a1912c7e712cf411742f9553cbafd0d7 100644
--- a/url/url_util_unittest.cc
+++ b/url/url_util_unittest.cc
@@ -273,6 +273,15 @@ TEST(URLUtilTest, TestResolveRelativeWithNonStandardBase) {
// any URL scheme is we might break javascript: URLs by doing so...
{"javascript:alert('foo#bar')", "#badfrag", true,
"javascript:alert('foo#badfrag" },
+ // In this case, the backslashes will not be canonicalized because it's a
+ // non-standard URL, but they will be treated as a path separators,
+ // giving the base URL here a path of "\".
+ //
+ // The result here is somewhat arbitrary. One could argue it should be
+ // either "aaa://a\" or "aaa://a/" since the path is being replaced with
+ // the "current directory". But in the context of resolving on data URLs,
+ // adding the requested dot doesn't seem wrong either.
+ {"aaa://a\\", "aaa:.", true, "aaa://a\\." }
};
for (size_t i = 0; i < arraysize(resolve_non_standard_cases); i++) {
« no previous file with comments | « url/url_canon_relative.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698