From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- dom/url/tests/protocol_worker.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dom/url/tests/protocol_worker.js (limited to 'dom/url/tests/protocol_worker.js') diff --git a/dom/url/tests/protocol_worker.js b/dom/url/tests/protocol_worker.js new file mode 100644 index 0000000000..c038254a4c --- /dev/null +++ b/dom/url/tests/protocol_worker.js @@ -0,0 +1,25 @@ +function ok(a, msg) { + postMessage({ type: "status", status: !!a, msg }); +} + +function is(a, b, msg) { + ok(a === b, msg); +} + +function finish() { + postMessage({ type: "finish" }); +} + +let url = new URL("http://example.com"); +is(url.protocol, "http:", "http: expected"); + +url.protocol = "https:"; +is(url.protocol, "https:", "http: -> https:"); + +url.protocol = "ftp:"; +is(url.protocol, "ftp:", "https: -> ftp:"); + +url.protocol = "https:"; +is(url.protocol, "https:", "ftp: -> https:"); + +finish(); -- cgit v1.2.3