summaryrefslogtreecommitdiffstats
path: root/url/url_canon_unittest.cc
diff options
context:
space:
mode:
authortsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 22:55:31 +0000
committertsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 22:55:31 +0000
commit598c8382c9e0556f16a486d758c61d108b4732e0 (patch)
treec3133ca8061e4eee70d10060d84fb1f04bd6621c /url/url_canon_unittest.cc
parentb887a2620262a8b51be8973cbd366e03e5ddaed9 (diff)
downloadchromium_src-598c8382c9e0556f16a486d758c61d108b4732e0.zip
chromium_src-598c8382c9e0556f16a486d758c61d108b4732e0.tar.gz
chromium_src-598c8382c9e0556f16a486d758c61d108b4732e0.tar.bz2
Make relative file url parsing fail where there is a host:port in the relative URL.
BUG=285720 R=brettw@chromium.org, jar@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223928 Review URL: https://codereview.chromium.org/23464046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url/url_canon_unittest.cc')
-rw-r--r--url/url_canon_unittest.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc
index f6cd3a2..2e93f92 100644
--- a/url/url_canon_unittest.cc
+++ b/url/url_canon_unittest.cc
@@ -2001,6 +2001,11 @@ TEST(URLCanonTest, ResolveRelativeURL) {
// is not file.
{"http://host/a", true, false, "/c:\\foo", true, true, true, "http://host/c:/foo"},
{"http://host/a", true, false, "//c:\\foo", true, true, true, "http://c/foo"},
+ // Ensure that ports aren't allowed for hosts relative to a file url.
+ // Although the result string shows a host:port portion, the call to
+ // resolve the relative URL returns false, indicating parse failure,
+ // which is what is required.
+ {"file:///foo.txt", true, true, "//host:80/bar.txt", true, true, false, "file://host:80/bar.txt"},
// Filesystem URL tests; filesystem URLs are only valid and relative if
// they have no scheme, e.g. "./index.html". There's no valid equivalent
// to http:index.html.