summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html
blob: 9ce9f21ca34efcbe1b0b4279287fa1245e879d94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<script>
  function getTheListener() {
    return postMessage.bind(this, "respond", "*", undefined)
  }
  document.domain = "{{host}}";
  onmessage = function (e) {
    if (e.data == "sendclick") {
      document.body.click();
    } else {
      parent.postMessage(
        {
          actual: e.origin,
          expected: "{{location[scheme]}}://{{domains[www1]}}:{{ports[http][0]}}",
          reason: "Incumbent should have been the caller of addEventListener()"
        },
        "*")
    };
  }
</script>