mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 14:20:14 +02:00
Automatic update from web-platform-testsFetch: reduce boilerplate in api/basic/ -- wpt-commits: 8e66eb476c019bc90ca345faf2c7178dab0c0837 wpt-pr: 10605
30 lines
961 B
JavaScript
30 lines
961 B
JavaScript
// META: script=../resources/utils.js
|
|
|
|
function checkKoUrl(url, desc) {
|
|
if (!desc)
|
|
desc = "Fetching " + url.substring(0, 45) + " is KO"
|
|
promise_test(function(test) {
|
|
var promise = fetch(url);
|
|
return promise_rejects(test, new TypeError(), promise);
|
|
}, desc);
|
|
}
|
|
|
|
var urlWithoutScheme = "://{{host}}:{{ports[http][0]}}/";
|
|
checkKoUrl("aaa" + urlWithoutScheme);
|
|
checkKoUrl("cap" + urlWithoutScheme);
|
|
checkKoUrl("cid" + urlWithoutScheme);
|
|
checkKoUrl("dav" + urlWithoutScheme);
|
|
checkKoUrl("dict" + urlWithoutScheme);
|
|
checkKoUrl("dns" + urlWithoutScheme);
|
|
checkKoUrl("geo" + urlWithoutScheme);
|
|
checkKoUrl("im" + urlWithoutScheme);
|
|
checkKoUrl("imap" + urlWithoutScheme);
|
|
checkKoUrl("ipp" + urlWithoutScheme);
|
|
checkKoUrl("ldap" + urlWithoutScheme);
|
|
checkKoUrl("mailto" + urlWithoutScheme);
|
|
checkKoUrl("nfs" + urlWithoutScheme);
|
|
checkKoUrl("pop" + urlWithoutScheme);
|
|
checkKoUrl("rtsp" + urlWithoutScheme);
|
|
checkKoUrl("snmp" + urlWithoutScheme);
|
|
|
|
done();
|