4 <p>This tests beforeunload event in subframes. You should see PASS below:
</p>
8 if (window
.testRunner
) {
9 testRunner
.dumpAsText();
10 testRunner
.dumpChildFramesAsText();
11 testRunner
.waitUntilDone();
14 var log
= document
.getElementById('log');
19 // log's not having any content implies that load event was dispatched for the second time before beforeunload is dispatched.
20 if (!log
.innerHTML
.length
)
21 log
.innerHTML
= 'FAIL: beforeunload event was never dispatched.\n';
22 if (window
.testRunner
)
23 testRunner
.notifyDone();
27 document
.getElementsByTagName('iframe')[0].contentWindow
.location
.href
= 'resources/before-unload-in-subframe-child.html';
31 if (!log
.innerHTML
.length
)
32 log
.innerHTML
= 'PASS\n';
34 log
.innerHTML
= 'FAIL: beforeunload event was dispatched after the second load event.'
35 if (window
.testRunner
)
36 testRunner
.notifyDone();
40 <iframe onload=
"test()" src=
"resources/before-unload-in-subframe-child.html"></iframe>