summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_script_module_frames_relay.js
blob: 141f202962d54cccdcb55034bb75473b0d05e907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);