summaryrefslogtreecommitdiffstats
path: root/dom/url/tests/file_url.jsm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /dom/url/tests/file_url.jsm
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/url/tests/file_url.jsm')
-rw-r--r--dom/url/tests/file_url.jsm24
1 files changed, 24 insertions, 0 deletions
diff --git a/dom/url/tests/file_url.jsm b/dom/url/tests/file_url.jsm
new file mode 100644
index 0000000000..6be99f2931
--- /dev/null
+++ b/dom/url/tests/file_url.jsm
@@ -0,0 +1,24 @@
+var EXPORTED_SYMBOLS = ["checkFromJSM"];
+
+function checkFromJSM(ok, is) {
+ var url = new URL("http://www.example.com");
+ is(url.href, "http://www.example.com/", "JSM should have URL");
+
+ var url2 = new URL("/foobar", url);
+ is(
+ url2.href,
+ "http://www.example.com/foobar",
+ "JSM 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 JSM");
+
+ URL.revokeObjectURL(url);
+ ok(true, "URL is revoked");
+}