summaryrefslogtreecommitdiffstats
path: root/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
diff options
context:
space:
mode:
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>