Chromium Code Reviews| 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 >= 20) | |
| 15 return ""; | |
| 16 | |
| 17 url = url.substring(0, queryIndex); | |
| 18 } | |
| 19 | |
| 20 //consoleWrite("Load " + loadCount); | |
|
abarth-chromium
2013/10/01 19:49:19
Please remove commented out code.
acolwell GONE FROM CHROMIUM
2013/10/01 22:02:04
Done.
| |
| 21 return url + "?" + (loadCount + 1); | |
| 22 } | |
| 23 | |
| 24 function reloadPage() | |
| 25 { | |
| 26 var url = getNextURL(); | |
| 27 if (url.length == 0) { | |
| 28 endTest(); | |
| 29 return; | |
| 30 } | |
| 31 location.href = url; | |
| 32 } | |
| 33 | |
| 34 window.setTimeout(reloadPage, Math.random() * 100); | |
|
abarth-chromium
2013/10/01 19:49:19
Please don't call Math.random() in a test. Just p
acolwell GONE FROM CHROMIUM
2013/10/01 22:02:04
Done. This test was based on the ClusterFuzz test
| |
| 35 | |
| 36 function start() | |
| 37 { | |
| 38 iframe = document.createElement("iframe"); | |
| 39 iframe.src = "../../media-resources/resources/frame_size_change.webm "; | |
|
abarth-chromium
2013/10/01 19:49:19
This is new to me, but I assume this works..
acolwell GONE FROM CHROMIUM
2013/10/01 22:02:04
It's how we include stuff from the media/ director
| |
| 40 document.getElementById("store_div").appendChild(iframe); | |
| 41 window.setTimeout(moveIframeBodyIntoDocumentBody, Math.random()*100) ; | |
| 42 } | |
| 43 | |
| 44 function moveIframeBodyIntoDocumentBody() | |
| 45 { | |
| 46 iframeContentDocument = iframe.contentDocument; | |
| 47 iframeDocumentElement = iframeContentDocument.documentElement; | |
| 48 | |
| 49 iframeContentDocument.onreadystatechange = function(e) | |
| 50 { | |
| 51 // Attempts to move the document body back into the iframe docum ent. | |
| 52 iframeDocumentElement.innerHTML = document.documentElement; | |
| 53 } | |
| 54 | |
| 55 // Moves the iframe body into the current document. | |
| 56 document.body.appendChild(iframeContentDocument.firstChild); | |
| 57 } | |
| 58 | |
| 59 </script> | |
| 60 <body onload="start()"> | |
| 61 <p>Tests that moving a <video> in and out of an iframe does not tr igger a crash.</p> | |
| 62 <div id="store_div"></div> | |
| 63 </body> | |
| 64 </html> | |
| OLD | NEW |