mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
moebius#130: URL parser - fix: don't allow empty host name
https://github.com/MoonchildProductions/moebius/issues/130
This commit is contained in:
parent
aa1df43166
commit
196fddddb6
14 changed files with 51 additions and 72 deletions
|
|
@ -154,13 +154,14 @@ function checkInputURL()
|
|||
sendString("ttp://mozilla.org");
|
||||
checkValidApplies(element);
|
||||
|
||||
for (var i=0; i<13; ++i) {
|
||||
for (var i=0; i<10; ++i) {
|
||||
synthesizeKey("VK_BACK_SPACE", {});
|
||||
checkValidApplies(element);
|
||||
}
|
||||
|
||||
synthesizeKey("VK_BACK_SPACE", {});
|
||||
for (var i=0; i<4; ++i) {
|
||||
// "http://" is now invalid
|
||||
for (var i=0; i<7; ++i) {
|
||||
checkInvalidApplies(element);
|
||||
synthesizeKey("VK_BACK_SPACE", {});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -398,6 +398,18 @@
|
|||
is(url.href, "scheme://tmp\\test");
|
||||
</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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue