| 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) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 return; | 23 return; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // Make sure we render the first frame. | 26 // Make sure we render the first frame. |
| 27 if (window.testRunner) { | 27 if (window.testRunner) { |
| 28 testRunner.display(); | 28 testRunner.display(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 video.play(); | 31 video.play(); |
| 32 video_fixed_size.play(); | 32 video_fixed_size.play(); |
| 33 video.removeEventListener('canplay', oncanplay); |
| 34 video_fixed_size.removeEventListener('canplay', oncanplay); |
| 33 }; | 35 }; |
| 34 video.addEventListener('canplay', oncanplay); | 36 video.addEventListener('canplay', oncanplay); |
| 35 video_fixed_size.addEventListener('canplay', oncanplay); | 37 video_fixed_size.addEventListener('canplay', oncanplay); |
| 36 | 38 |
| 37 var playingCount = 0; | 39 var playingCount = 0; |
| 38 function onplaying() { | 40 function onplaying() { |
| 39 if (++playingCount < 2) { | 41 if (++playingCount < 2) { |
| 40 return; | 42 return; |
| 41 } | 43 } |
| 42 | 44 |
| 45 video.removeEventListener('playing', onplaying); |
| 46 video_fixed_size.removeEventListener('playing', onplaying); |
| 47 |
| 43 // Make sure both videos play for a bit. | 48 // Make sure both videos play for a bit. |
| 44 function ontimeupdate(e) { | 49 function ontimeupdate(e) { |
| 45 if (e.target.currentTime > 1.0) { | 50 if (e.target.currentTime > 1.0) { |
| 46 e.target.pause(); | 51 e.target.pause(); |
| 47 } | 52 } |
| 48 }; | 53 }; |
| 49 video.addEventListener('timeupdate', ontimeupdate); | 54 video.addEventListener('timeupdate', ontimeupdate); |
| 50 video_fixed_size.addEventListener('timeupdate', ontimeupdate
); | 55 video_fixed_size.addEventListener('timeupdate', ontimeupdate
); |
| 51 }; | 56 }; |
| 52 video.addEventListener('playing', onplaying); | 57 video.addEventListener('playing', onplaying); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 74 | 79 |
| 75 video.currentTime = 1.0; | 80 video.currentTime = 1.0; |
| 76 video_fixed_size.currentTime = 0.5; | 81 video_fixed_size.currentTime = 0.5; |
| 77 }; | 82 }; |
| 78 video.addEventListener('pause', onpause); | 83 video.addEventListener('pause', onpause); |
| 79 video_fixed_size.addEventListener('pause', onpause); | 84 video_fixed_size.addEventListener('pause', onpause); |
| 80 } | 85 } |
| 81 </script> | 86 </script> |
| 82 </body> | 87 </body> |
| 83 </html> | 88 </html> |
| OLD | NEW |