OLD | NEW |
1 <script src="../../resources/js-test.js"></script> | 1 <script src="../../resources/js-test.js"></script> |
2 <script> | 2 <script> |
| 3 var jsTestIsAsync = true; |
| 4 |
3 function test(iframe) { | 5 function test(iframe) { |
4 iframe.contentWindow.location.href = "resources/does-not-exist.html"; | 6 iframe.contentWindow.location.href = "resources/does-not-exist.html"; |
5 testPassed('if no crash'); | 7 testPassed('if no crash'); |
| 8 finishJSTest(); |
6 } | 9 } |
7 </script> | 10 </script> |
8 <iframe id=testIframe onload="test(this)"></iframe> | 11 <iframe id=testIframe onload="test(this)"></iframe> |
9 <script> | 12 <script> |
10 description('Detaching a frame in beforeunload event handler should not crash.')
; | 13 description('Detaching a frame in beforeunload event handler should not crash.')
; |
11 var testIframe = document.getElementById('testIframe'); | 14 var testIframe = document.getElementById('testIframe'); |
12 testIframe.contentWindow.onbeforeunload = function(event) { | 15 testIframe.contentWindow.onbeforeunload = function(event) { |
13 testIframe.parentNode.removeChild(testIframe); | 16 testIframe.parentNode.removeChild(testIframe); |
14 event.returnValue = 'beforeunload'; | 17 event.returnValue = 'beforeunload'; |
15 } | 18 } |
16 </script> | 19 </script> |
OLD | NEW |