summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/api/basic/scheme-others.js
blob: ce02ec1340a4c57a6e34fffe8f2c5917818a13c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if (this.document === undefined) {
  importScripts("/resources/testharness.js");
  importScripts("../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();