mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-27 13:40:37 -10:00
Automatic update from web-platform-testsGeneralize test -- updated urlencoded-parser to use .any.js -- issue 11277: convert url html test to any.js -- Convert URL tests to .any.js format - Convert url/urlsearchparams-append.html to .any.js - Convert url/urlsearchparams-constructor.html to .any.js - Convert url/urlsearchparams-foreach.html to .any.js - Convert url/urlsearchparams-set.html to .any.js - Convert url/urlsearchparams-getall.html to .any.js -- Separate url-searchparams.any.js from url/url-constructor.html -- converted additional urlsearchparams tests to use any.js -- Generalize test. -- Generalized Test -- Relocate specification reference -- wpt-commits: a1c591bbb2c67f708609608d82caf5e9970431f0, 5efc5e92401e8edc5b1cfbdc8679c9817af30413, 1f3019b4ae77f4b98de5d3affc162d0889f645d0, c6dd3dce89c8d1475b1354a03447750c14cd8804, 87dc680b64f89ec6e91fb8763d7b2da9677110c4, a734002040383222111fce80e50e7dc013a5812d, 39c743e4f7877abf16db6ace465089f6c61b2b60, 693caf30f6cf9f8bffbac2f06fbb538989663ab8, e6422d28a641dcb82a419c1f63efb975588960cf wpt-pr: 11492
45 lines
1.6 KiB
HTML
45 lines
1.6 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<div id=log></div>
|
|
<script>
|
|
function bURL(url, base) {
|
|
return new URL(url, base || "about:blank")
|
|
}
|
|
|
|
function runURLTests(urltests) {
|
|
for(var i = 0, l = urltests.length; i < l; i++) {
|
|
var expected = urltests[i]
|
|
if (typeof expected === "string") continue // skip comments
|
|
|
|
test(function() {
|
|
if (expected.failure) {
|
|
assert_throws(new TypeError(), function() {
|
|
bURL(expected.input, expected.base)
|
|
})
|
|
return
|
|
}
|
|
|
|
var url = bURL(expected.input, expected.base)
|
|
assert_equals(url.href, expected.href, "href")
|
|
assert_equals(url.protocol, expected.protocol, "protocol")
|
|
assert_equals(url.username, expected.username, "username")
|
|
assert_equals(url.password, expected.password, "password")
|
|
assert_equals(url.host, expected.host, "host")
|
|
assert_equals(url.hostname, expected.hostname, "hostname")
|
|
assert_equals(url.port, expected.port, "port")
|
|
assert_equals(url.pathname, expected.pathname, "pathname")
|
|
assert_equals(url.search, expected.search, "search")
|
|
if ("searchParams" in expected) {
|
|
assert_true("searchParams" in url)
|
|
assert_equals(url.searchParams.toString(), expected.searchParams, "searchParams")
|
|
}
|
|
assert_equals(url.hash, expected.hash, "hash")
|
|
}, "Parsing: <" + expected.input + "> against <" + expected.base + ">")
|
|
}
|
|
}
|
|
|
|
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runURLTests), "Loading data…");
|
|
</script>
|