summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_script_module_frames_relay.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/test/file_script_module_frames_relay.js')
-rw-r--r--dom/base/test/file_script_module_frames_relay.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/dom/base/test/file_script_module_frames_relay.js b/dom/base/test/file_script_module_frames_relay.js
new file mode 100644
index 0000000000..141f202962
--- /dev/null
+++ b/dom/base/test/file_script_module_frames_relay.js
@@ -0,0 +1,22 @@
+function relay(event) {
+ if (event.type != "test_evaluated") {
+ if (!/^watchme/.test(event.target.id)) {
+ return;
+ }
+ }
+
+ const type = `${window.name}_${event.type}`;
+
+ window.parent.dispatchEvent(new window.parent.Event(type));
+}
+
+window.addEventListener("scriptloader_load_source", relay);
+window.addEventListener("scriptloader_load_bytecode", relay);
+window.addEventListener("scriptloader_execute", relay);
+window.addEventListener("scriptloader_evaluate_module", relay);
+window.addEventListener("scriptloader_encode", relay);
+window.addEventListener("scriptloader_no_encode", relay);
+window.addEventListener("scriptloader_bytecode_saved", relay);
+window.addEventListener("scriptloader_bytecode_failed", relay);
+window.addEventListener("scriptloader_fallback", relay);
+window.addEventListener("test_evaluated", relay);