OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <script src="../../media-resources/video-test.js"></script> |
| 4 <script> |
| 5 function getNextURL() |
| 6 { |
| 7 var url = location.href; |
| 8 var queryIndex = url.indexOf("?"); |
| 9 var loadCount = 1; |
| 10 if (queryIndex >= 0) { |
| 11 loadCount = parseInt(url.substring(queryIndex + 1)); |
| 12 |
| 13 // Enforce an arbitrary reload limit that is high enough to trigge
r previosly observed crashes. |
| 14 if (loadCount >= 10) |
| 15 return ""; |
| 16 |
| 17 url = url.substring(0, queryIndex); |
| 18 } |
| 19 |
| 20 return url + "?" + (loadCount + 1); |
| 21 } |
| 22 |
| 23 function reloadPage() |
| 24 { |
| 25 var url = getNextURL(); |
| 26 if (url.length == 0) { |
| 27 endTest(); |
| 28 return; |
| 29 } |
| 30 location.href = url; |
| 31 } |
| 32 |
| 33 function start() |
| 34 { |
| 35 iframe = document.createElement("iframe"); |
| 36 iframe.src = "../../media-resources/resources/frame_size_change.webm
"; |
| 37 document.getElementById("store_div").appendChild(iframe); |
| 38 window.setTimeout(moveIframeBodyIntoDocumentBody, 20); |
| 39 } |
| 40 |
| 41 function moveIframeBodyIntoDocumentBody() |
| 42 { |
| 43 var iframeContentDocument = iframe.contentDocument; |
| 44 var iframeDocumentElement = iframeContentDocument.documentElement; |
| 45 |
| 46 iframeContentDocument.onreadystatechange = function(e) |
| 47 { |
| 48 // Attempts to move the document body back into the iframe docum
ent. |
| 49 iframeDocumentElement.innerHTML = document.documentElement; |
| 50 } |
| 51 |
| 52 // Moves the iframe body into the current document. |
| 53 document.body.appendChild(iframeContentDocument.firstChild); |
| 54 reloadPage(); |
| 55 } |
| 56 |
| 57 </script> |
| 58 <body onload="start()"> |
| 59 <p>Tests that moving a <video> in and out of an iframe does not tr
igger a crash.</p> |
| 60 <div id="store_div"></div> |
| 61 </body> |
| 62 </html> |
OLD | NEW |