Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / crash-removed-iframe.html
blob54fac055b0e57d80186670f6c5c38fd7bc1cb999
1 <html>
2 <head>
3 <title>Crash doing open on destroyed window</title>
4 <script>
5 function testCrash1() {
6 var ifr = document.createElement('iframe');
7 ifr.onload = function() {
8 var win = ifr.contentWindow;
9 ifr.parentNode.removeChild(ifr);
10 win.open('pantz', '_top');
12 document.body.appendChild(ifr);
15 // Test with a deconnected iframe.
16 function testCrash2() {
17 var ifr = document.createElement('iframe');
18 ifr.onload = function() {
19 var win = ifr.contentWindow;
20 ifr.parentNode.removeChild(ifr);
21 win.open('pantz', ifr);
23 document.body.appendChild(ifr);
26 // Test with a new iframe.
27 function testCrash3() {
28 var ifr = document.createElement('iframe');
29 var ifr2 = document.createElement('iframe');
30 ifr.onload = function() {
31 var win = ifr.contentWindow;
32 ifr.parentNode.removeChild(ifr);
33 win.open('pantz', ifr2);
35 document.body.appendChild(ifr);
38 function testCrash() {
39 if (window.testRunner)
40 testRunner.dumpAsText();
42 testCrash1();
43 testCrash2();
44 testCrash3();
46 </script>
47 </head>
48 <body onload="testCrash()">
49 <p> Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=19588">19588</a>: CRASH doing open() on destroyed window</p>
50 <p> If this page does not crash the test has passed. </p>
51 </body>
52 </html>