Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / url / tests / protocol_worker.js
blob81e761ee0ef389b64d7f7a58ce94a443a938ea7e
1 /* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
3 function ok(a, msg) {
4   postMessage({ type: "status", status: !!a, msg });
7 function is(a, b, msg) {
8   ok(a === b, msg);
11 function finish() {
12   postMessage({ type: "finish" });
15 let url = new URL("http://example.com");
16 is(url.protocol, "http:", "http: expected");
18 url.protocol = "https:";
19 is(url.protocol, "https:", "http: -> https:");
21 url.protocol = "ftp:";
22 is(url.protocol, "ftp:", "https: -> ftp:");
24 url.protocol = "https:";
25 is(url.protocol, "https:", "ftp: -> https:");
27 finish();