Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / set-iframe-src-in-pagehide-crash.html
blob62eae9ffc21917c498ca7ea5739ec55d7bc98502
1 <!DOCTYPE html>
2 <body>
3 <div id=one><iframe></iframe></div>
4 <div id=two></div>
5 <div id=three></div>
6 <script src="../../resources/js-test.js"></script>
7 <script>
8 description("Setting an iframe's src in a pagehide handler should not create a frame (nor a crash)");
9 var div1 = document.getElementById('one');
10 var div2 = document.getElementById('two');
11 var div3 = document.getElementById('three');
12 var subframe = document.querySelector('iframe');
13 subframe.contentWindow.onpagehide = function() {
14 div2.appendChild(div1);
15 subframe.src = 'javascript:void(0)';
16 shouldBeNull("subframe.contentWindow");
18 subframe.remove();
19 div3.appendChild(subframe);
20 subframe.remove();
21 debug("did not crash");
22 </script>