summaryrefslogtreecommitdiffstats
path: root/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html')
-rw-r--r--dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html b/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
new file mode 100644
index 0000000000..a99582f8d3
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test module cancel won't trigger an assert</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="modulepreload" href="./bug_1894631_module_2.mjs" />
+<link rel="modulepreload" href="./bug_1894631_module_3.mjs" />
+<link rel="modulepreload" href="./non_existing.mjs" />
+
+<script src="./bug_1894631_module_1.mjs" type="module" id="module_1"></script>
+<script>
+ var module1_loaded = false;
+ var module1_error = false;
+
+ SimpleTest.waitForExplicitFinish();
+
+ const module1 = document.getElementById("module_1");
+ module1.addEventListener("error", (event) => {
+ info("error event");
+ module1_error = true;
+ });
+
+ function testLoaded() {
+ ok(module1_error, "module_1.mjs should fire an error event");
+ ok(!module1_loaded, "module_1.mjs should not be loaded");
+ SimpleTest.finish();
+ }
+</script>
+
+<body onload='testLoaded()'>
+</body>