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

Unified Diff: url/url_util_unittest.cc

Issue 23468003: Allow fragments to resolve relatively against any scheme (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: actually seems to work Created 7 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
« no previous file with comments | « url/url_util.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 8b16d796cf1c027e10386318b5d742aa40fb8a67..f4369a9bf1545851093fa410e79315dc9917c1f7 100644
--- a/url/url_util_unittest.cc
+++ b/url/url_util_unittest.cc
@@ -270,6 +270,13 @@ TEST(URLUtilTest, TestResolveRelativeWithNonStandardBase) {
// Resolving should fail if the base URL is authority-based but is
// missing a path component (the '/' at the end).
{"scheme://Authority", "path", false, ""},
+ // Test resolving a fragment (only) against any kind of base-URL.
+ {"about:blank", "#id42", true, "about:blank#id42" },
+ {"about:blank#oldfrag", "#newfrag", true, "about:blank#newfrag" },
+ // An unfortunate side effect of allowing fragments to resolve against
+ // any URL scheme is we might break javascript: URLs by doing so...
+ {"javascript:alert('foo#bar')", "#badfrag", true,
+ "javascript:alert('foo#badfrag" },
mkosiba (inactive) 2013/08/27 20:55:56 out of curiousity - what would KURL do in this cas
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resolve_non_standard_cases); i++) {
« no previous file with comments | « url/url_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698