1
0
Fork 0
firefox/dom/url/tests/file_url.sys.mjs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

22 lines
586 B
JavaScript

export function checkFromESM(ok, is) {
var url = new URL("https://www.example.com");
is(url.href, "https://www.example.com/", "ESM should have URL");
var url2 = new URL("/foobar", url);
is(
url2.href,
"https://www.example.com/foobar",
"ESM should have URL - based on another URL"
);
var blob = new Blob(["a"]);
url = URL.createObjectURL(blob);
ok(url, "URL is created!");
var u = new URL(url);
ok(u, "URL created");
is(u.origin, "null", "Url doesn't have an origin if created in a ESM");
URL.revokeObjectURL(url);
ok(true, "URL is revoked");
}