Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: LayoutTests/media/video-frame-size-change.html

Issue 17395006: Fix LayoutTests that assume canplay, playing, and canplaythrough will only fire once. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix event-attributes expectations. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « LayoutTests/media/video-duration-known-after-eos.html ('k') | LayoutTests/media/video-playbackrate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698