OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 // This is a regresion test for a layout test harness crash that was |
| 3 // covered by https://crbug.com/716085#c10. |
| 4 |
| 5 // The test creates 2 subframes, each cross-origin from the main frame and from |
| 6 // each other. Once all the subframes report (via postMessage("subframe is |
| 7 // loaded"...)) that they are ready, the main frame asks them to nearly |
| 8 // simultaneously call testRunner.notifyDone() (from 2 separate OOPIF processes |
| 9 // under --site-per-process mode). This used to crash the layout tests harness. |
| 10 |
| 11 function addFrame(uri) { |
| 12 var f = document.createElement('iframe'); |
| 13 f.src = uri; |
| 14 document.body.appendChild(f); |
| 15 } |
| 16 |
| 17 var loaded_frames = 0; |
| 18 function onLoad() { |
| 19 if (parent === self) { |
| 20 document.body.innerText = 'Main frame'; |
| 21 testRunner.waitUntilDone(); |
| 22 testRunner.dumpAsText(); |
| 23 testRunner.dumpChildFramesAsText(); |
| 24 |
| 25 window.addEventListener("message", function(event) { |
| 26 loaded_frames = loaded_frames + 1; |
| 27 if (loaded_frames == 2) { // All subframes are ready? |
| 28 for (var i = 0; i < window.frames.length; i++) { |
| 29 window.frames[i].postMessage("notify done", "*"); |
| 30 } |
| 31 } |
| 32 }, false); |
| 33 |
| 34 addFrame("https://localhost:8443/misc/tests-finishing-simultaneously.html"); |
| 35 addFrame("http://localhost:8000/misc/tests-finishing-simultaneously.html"); |
| 36 } else { |
| 37 document.body.innerText = 'Subframe: ' + location.href; |
| 38 window.addEventListener("message", function(event) { |
| 39 testRunner.notifyDone(); |
| 40 }, false); |
| 41 parent.postMessage("subframe is loaded", "*"); |
| 42 } |
| 43 } |
| 44 </script> |
| 45 <body onload="onLoad()"> |
| 46 </body> |
| 47 |
OLD | NEW |