OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test that setting a non-zero rate causes an async timeupdate event.</titl
e> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <script src=media-file.js></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 5 <script src="media-file.js"></script> |
6 (Please avoid writing new tests using video-test.js) --> | 6 <video></video> |
7 <script src=video-test.js></script> | 7 <script> |
8 <script> | 8 async_test(function(t) { |
9 function init() { | 9 var video = document.querySelector("video"); |
10 findMediaElement(); | |
11 waitForEvent('canplaythrough', receivedCanPlayThrough); | |
12 video.src = findMediaFile("video", "content/test"); | |
13 } | |
14 | 10 |
15 function receivedCanPlayThrough() { | 11 video.onplay = t.step_func(function() { |
16 waitForEvent('play', receivedPlay); | 12 video.ontimeupdate = t.step_func_done(); |
17 video.playbackRate = 0; | 13 video.playbackRate = 1; |
18 video.play(); | 14 }); |
19 } | |
20 | 15 |
21 function receivedPlay() { | 16 video.src = findMediaFile("video", "content/test"); |
22 waitForEventAndEnd('timeupdate'); | 17 video.playbackRate = 0; |
23 video.playbackRate = 1; | 18 video.play(); |
24 } | 19 }); |
25 </script> | 20 </script> |
26 </head> | |
27 <body onload="init()"> | |
28 <video controls></video> | |
29 <p>Test that setting a non-zero rate causes an async timeupdate event.</
p> | |
30 </body> | |
31 </html> | |
OLD | NEW |