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 <script src="../resources/run-after-display.js"></script> |
| 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 { | 15 { |
| 16 var video = document.getElementsByTagName("video")[1]; | 16 var video = document.getElementsByTagName("video")[1]; |
| 17 var video_fixed_size = document.getElementsByTagName("video")[0] ; | 17 var video_fixed_size = document.getElementsByTagName("video")[0] ; |
| 18 video.src = "resources/frame_size_change.webm"; | 18 video.src = "resources/frame_size_change.webm"; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 42 return; | 42 return; |
| 43 } | 43 } |
| 44 | 44 |
| 45 if (expectedResizeCount != 0) { | 45 if (expectedResizeCount != 0) { |
| 46 document.body.appendChild(document.createTextNode('FAIL: missing resize event')); | 46 document.body.appendChild(document.createTextNode('FAIL: missing resize event')); |
| 47 if (window.testRunner) { | 47 if (window.testRunner) { |
| 48 testRunner.notifyDone(); | 48 testRunner.notifyDone(); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Make sure we render the first frame. | 52 runAfterDisplay(function() { |
|
scherkus (not reviewing)
2014/03/19 20:20:35
some notes on this test as I was the one who wrote
enne (OOO)
2014/03/19 20:22:34
The frame size changes happen during painting and
| |
| 53 if (window.testRunner) { | 53 video.play(); |
| 54 testRunner.display(); | 54 video_fixed_size.play(); |
| 55 } | 55 video.removeEventListener('canplay', oncanplay); |
| 56 | 56 video_fixed_size.removeEventListener('canplay', oncanplay ); |
| 57 video.play(); | 57 }); |
| 58 video_fixed_size.play(); | |
| 59 video.removeEventListener('canplay', oncanplay); | |
| 60 video_fixed_size.removeEventListener('canplay', oncanplay); | |
| 61 }; | 58 }; |
| 62 video.addEventListener('canplay', oncanplay); | 59 video.addEventListener('canplay', oncanplay); |
| 63 video_fixed_size.addEventListener('canplay', oncanplay); | 60 video_fixed_size.addEventListener('canplay', oncanplay); |
| 64 | 61 |
| 65 var playingCount = 0; | 62 var playingCount = 0; |
| 66 function onplaying() | 63 function onplaying() |
| 67 { | 64 { |
| 68 if (++playingCount < 2) { | 65 if (++playingCount < 2) { |
| 69 return; | 66 return; |
| 70 } | 67 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 | 106 |
| 110 video.currentTime = 1.0; | 107 video.currentTime = 1.0; |
| 111 video_fixed_size.currentTime = 0.5; | 108 video_fixed_size.currentTime = 0.5; |
| 112 }; | 109 }; |
| 113 video.addEventListener('pause', onpause); | 110 video.addEventListener('pause', onpause); |
| 114 video_fixed_size.addEventListener('pause', onpause); | 111 video_fixed_size.addEventListener('pause', onpause); |
| 115 } | 112 } |
| 116 </script> | 113 </script> |
| 117 </body> | 114 </body> |
| 118 </html> | 115 </html> |
| OLD | NEW |