summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html
blob: 3fb07e4846392242c7cf059f42d80bda40dd2734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<title>pagehide event properties</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t = async_test();

onload = function() {setTimeout(function() {
  var iframe = document.getElementsByTagName("iframe")[0]

  iframe.onload = function() {
                    setTimeout(function() {
                                 iframe.contentWindow.location="001-2.html";
                               }, 100);
                    iframe.onload = t.step_func(function() {t.done()});
                  };

  function do_test(e) {
    assert_equals(e.type, "pagehide");
    assert_equals(e.target, iframe.contentDocument);
    assert_equals(e.currentTarget, iframe.contentWindow);
    assert_false(e.bubbles, "bubbles");
    assert_false(e.cancelable, "cancelable");
    assert_true(e.persisted, "persisted");
  }

  iframe.src = "002-1.html?" + Math.random();

}, 100)};

</script>
<iframe></iframe>