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

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

Issue 14120003: Move LayoutTests from platform/chromium/... to generic location (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body onload="load()">
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>
6 <video width="320"></video>
7 <video></video>
8
9 <script>
10 if (window.testRunner) {
11 testRunner.waitUntilDone();
12 }
13
14 function load() {
15 var video = document.getElementsByTagName("video")[1];
16 var video_fixed_size = document.getElementsByTagName("video")[0] ;
17 video.src = "resources/frame_size_change.webm";
18 video_fixed_size.src = "resources/frame_size_change.webm";
19
20 var canplayCount = 0;
21 function oncanplay() {
22 if (++canplayCount < 2) {
23 return;
24 }
25
26 // Make sure we render the first frame.
27 if (window.testRunner) {
28 testRunner.display();
29 }
30
31 video.play();
32 video_fixed_size.play();
33 };
34 video.addEventListener('canplay', oncanplay);
35 video_fixed_size.addEventListener('canplay', oncanplay);
36
37 var playingCount = 0;
38 function onplaying() {
39 if (++playingCount < 2) {
40 return;
41 }
42
43 // Make sure both videos play for a bit.
44 function ontimeupdate(e) {
45 if (e.target.currentTime > 1.0) {
46 e.target.pause();
47 }
48 };
49 video.addEventListener('timeupdate', ontimeupdate);
50 video_fixed_size.addEventListener('timeupdate', ontimeupdate );
51 };
52 video.addEventListener('playing', onplaying);
53 video_fixed_size.addEventListener('playing', onplaying);
54
55 var pauseCount = 0;
56 function onpause() {
57 if (++pauseCount < 2) {
58 return;
59 }
60
61 var seekedCount = 0;
62 function onseeked() {
63 if (++seekedCount < 2) {
64 return;
65 }
66
67 if (window.testRunner) {
68 testRunner.notifyDone();
69 }
70 }
71
72 video.addEventListener('seeked', onseeked);
73 video_fixed_size.addEventListener('seeked', onseeked);
74
75 video.currentTime = 1.0;
76 video_fixed_size.currentTime = 0.5;
77 };
78 video.addEventListener('pause', onpause);
79 video_fixed_size.addEventListener('pause', onpause);
80 }
81 </script>
82 </body>
83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698