Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / unload-reparent-sibling-frame.html
blob4b28d894aa33068d6f96fc9c9e15d62203a6c7fc
1 <!DOCTYPE html>
3 <script src="../../resources/js-test.js"></script>
5 <div id="container">
6 <div id="inside">
7 <iframe id="frame1" name="frame1" srcdoc="frame1"></iframe>
8 <iframe id="frame2" name="frame2" srcdoc="frame2"></iframe>
9 </div>
10 </div>
12 <script>
13 description('Reparented sibling frames from unload handlers should load.');
15 var jsTestIsAsync = true;
16 var count = 2;
17 var container = document.getElementById('container');
18 var inside = document.getElementById('inside');
19 var frame1 = document.getElementById('frame1');
20 var frame2 = document.getElementById('frame2');
22 if (window.testRunner) {
23 testRunner.dumpAsText();
24 testRunner.dumpChildFramesAsText();
27 function runTest()
29 if (--count) return;
30 // Wait until all frame disconnection calls are complete to ensure inDocument
31 // frames remain loaded.
32 setTimeout(function() {
33 shouldNotBe('frame1.contentDocument', 'null');
34 shouldNotBe('frame2.contentDocument', 'null');
35 finishJSTest();
36 }, 0);
39 onload = function() {
40 inside.appendChild(frame1);
41 inside.appendChild(frame2);
43 frame1.contentWindow.onunload = function() {
44 frame1.onload = runTest;
45 frame2.onload = runTest;
46 document.body.appendChild(inside);
49 container.parentNode.removeChild(container);
51 </script>