Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body onload="load()"> | 3 <body onload="load()"> |
| 4 <p>Test that a video element scales decoded frames to match the initial size | 4 <p>Test that a video element scales decoded frames to match the initial size |
| 5 as opposed to changing the size of the element.</p> | 5 as opposed to changing the size of the element.</p> |
| 6 <video width="320"></video> | 6 <video width="320"></video> |
| 7 <video></video> | 7 <video></video> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 if (window.testRunner) { | 10 if (window.testRunner) { |
| 11 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function load() { | 14 function load() { |
| 15 var video = document.getElementsByTagName("video")[1]; | 15 var video = document.getElementsByTagName("video")[1]; |
| 16 var video_fixed_size = document.getElementsByTagName("video")[0] ; | 16 var video_fixed_size = document.getElementsByTagName("video")[0] ; |
| 17 video.src = "resources/frame_size_change.webm"; | 17 video.src = "resources/frame_size_change.webm"; |
| 18 video_fixed_size.src = "resources/frame_size_change.webm"; | 18 video_fixed_size.src = "resources/frame_size_change.webm"; |
| 19 | 19 |
| 20 // Expect no resize event because the tag's size (the frames' | |
| 21 // "natural size") doesn't change, only the internal resolution | |
| 22 // does. Fail if this expectation is violated. | |
| 23 video.addEventListener('resize', onresize); | |
| 24 video_fixed_size.addEventListener('resize', onresize); | |
| 25 function onresize() { | |
|
acolwell GONE FROM CHROMIUM
2013/12/13 15:58:12
nit: { is supposed to be on the next line. Could y
Ami GONE FROM CHROMIUM
2013/12/13 17:48:43
Done.
| |
| 26 document.body.appendChild(document.createTextNode('FAIL: une xpected resize')); | |
| 27 if (window.testRunner) { | |
| 28 testRunner.notifyDone(); | |
| 29 } | |
| 30 } | |
| 31 | |
| 20 var canplayCount = 0; | 32 var canplayCount = 0; |
| 21 function oncanplay() { | 33 function oncanplay() { |
| 22 if (++canplayCount < 2) { | 34 if (++canplayCount < 2) { |
| 23 return; | 35 return; |
| 24 } | 36 } |
| 25 | 37 |
| 26 // Make sure we render the first frame. | 38 // Make sure we render the first frame. |
| 27 if (window.testRunner) { | 39 if (window.testRunner) { |
| 28 testRunner.display(); | 40 testRunner.display(); |
| 29 } | 41 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 | 91 |
| 80 video.currentTime = 1.0; | 92 video.currentTime = 1.0; |
| 81 video_fixed_size.currentTime = 0.5; | 93 video_fixed_size.currentTime = 0.5; |
| 82 }; | 94 }; |
| 83 video.addEventListener('pause', onpause); | 95 video.addEventListener('pause', onpause); |
| 84 video_fixed_size.addEventListener('pause', onpause); | 96 video_fixed_size.addEventListener('pause', onpause); |
| 85 } | 97 } |
| 86 </script> | 98 </script> |
| 87 </body> | 99 </body> |
| 88 </html> | 100 </html> |
| OLD | NEW |