diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 07:29:18 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 07:29:18 +0200 |
commit | ae14556114dcae29f679db7c15f0bc9b707bb89a (patch) | |
tree | b7f02d4463293a5fb0f3823bd48230a142c5a42d /dom/url | |
parent | 8a95c03dcd2a7f2c6d64b6ee917f6cb363e9ca60 (diff) | |
download | UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.gz UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.lz UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.xz UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.zip |
moebius#130: URL parser - fix: don't allow empty host name
https://github.com/MoonchildProductions/moebius/issues/130
Diffstat (limited to 'dom/url')
-rw-r--r-- | dom/url/tests/test_url.html | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/url/tests/test_url.html b/dom/url/tests/test_url.html index d07a752bb..73e75667d 100644 --- a/dom/url/tests/test_url.html +++ b/dom/url/tests/test_url.html @@ -399,6 +399,18 @@ </script> <script> + /** Test for Bug 1275746 **/ + SimpleTest.doesThrow(() => { var url = new URL("http:"); }, "http: is not a valid URL"); + SimpleTest.doesThrow(() => { var url = new URL("http:///"); }, "http: is not a valid URL"); + + var url = new URL("file:"); + is(url.href, "file:///", "Parsing file: should work."); + + url = new URL("file:///"); + is(url.href, "file:///", "Parsing file:/// should work."); + </script> + + <script> var url = new URL("scheme:path/to/file?query#hash"); is(url.href, "scheme:path/to/file?query#hash"); is(url.pathname, "path/to/file"); |