OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 // Blocked videos can be reloaded, so neither onloadeddata nor onerror is called
. |
| 6 // Only check here that onloadeddata is never called when video is blocked. |
| 7 |
| 8 if (window.testRunner) { |
| 9 testRunner.dumpAsText(); |
| 10 testRunner.dumpPermissionClientCallbacks(); |
| 11 } |
| 12 |
| 13 function log(a) |
| 14 { |
| 15 document.getElementById("results").innerHTML += a + "<br>"; |
| 16 } |
| 17 |
| 18 function loaded() |
| 19 { |
| 20 log("PASS: first video loaded"); |
| 21 if (window.testRunner && testRunner.setMediaAllowed) |
| 22 testRunner.setMediaAllowed(false); |
| 23 else |
| 24 log("This test requires testRunner.setMediaAllowed, so it be can't run i
n a browser."); |
| 25 |
| 26 // Load a video not in cache. |
| 27 var video = document.createElement('video'); |
| 28 video.onloadeddata = function () { log("FAIL: not cached video loaded"); } |
| 29 video.src = "../media/content/test.ogv?nocache"; |
| 30 document.getElementById("video").appendChild(video); |
| 31 |
| 32 // Load a video from cache. |
| 33 var videoFromCache = document.createElement('video'); |
| 34 videoFromCache.onloadeddata = function () { log("FAIL: video from cache load
ed"); } |
| 35 videoFromCache.src = "../media/content/test.ogv"; |
| 36 document.getElementById("video").appendChild(videoFromCache); |
| 37 |
| 38 // Add an iframe with a video. |
| 39 var iframe = document.createElement('iframe'); |
| 40 iframe.src = "resources/video.html"; |
| 41 document.getElementById("video").appendChild(iframe); |
| 42 } |
| 43 </script> |
| 44 </head> |
| 45 <body> |
| 46 <video src="../media/content/test.ogv" onloadeddata="loaded()"></video> |
| 47 <div id="video"></div> |
| 48 <div id="results"></div> |
| 49 </body> |
| 50 </html> |
OLD | NEW |