summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/events/event-global-is-still-set-when-coercing-beforeunload-result.html
blob: a64c8b6b8b6d5fd39ab4f1a4ad1a8bd432fab7c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<meta charset="utf-8">
<title>window.event is still set when 'beforeunload' result is coerced to string</title>
<link rel="help" href="https://dom.spec.whatwg.org/#ref-for-window-current-event%E2%91%A1">
<link rel="help" href="https://webidl.spec.whatwg.org/#call-a-user-objects-operation">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<iframe id="iframe" src="resources/event-global-is-still-set-when-coercing-beforeunload-result-frame.html"></iframe>
<body>
<script>
window.onload = () => {
  async_test(t => {
    iframe.onload = t.step_func_done(() => {
      assert_equals(typeof window.currentEventInToString, "object");
      assert_equals(window.currentEventInToString.type, "beforeunload");
    });

    iframe.contentWindow.location.href = "about:blank";
  });
};
</script>