summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html
blob: 0d5b72e0fc50c3b37df4f6628d76d10d66659ef0 (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
<!doctype html>
<title>salvagable state of document after setting unload listener</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t = async_test(undefined, {timeout:2000});

var loaded = false;
var unload_fired = false;
var timeout_fired = false;

function start_test() {
  setTimeout(t.step_func(function() {
                           assert_true(unload_fired);
                           assert_false(timeout_fired);
                           t.done()
                         }), 1000);
}

onload = function() {setTimeout(function() {
  var iframe = document.getElementsByTagName("iframe")[0]
  onload = null;
  iframe.src="007-1.html?" + Math.random();
}, 100)};

</script>
<iframe></iframe>