OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>video is not paused while looping</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script src="w3c-media-utils.js"></script> | |
6 <video controls loop></video> | |
7 <p>Test that video should not be in a paused state while looping.</p> | |
8 <script> | |
9 async_test(function(test) { | |
10 var video = document.querySelector('video'); | |
DaleCurtis
2014/09/18 19:44:47
Note two spaces is okay per the style guide, but u
qinmin
2014/09/18 20:40:40
Done.
| |
11 video.src = 'content/test.mp4'; | |
12 | |
13 // Verify video is not paused. | |
14 function seeking() | |
15 { | |
16 assert_equals(video.currentTime, 0, 'currentTime'); | |
17 assert_equals(video.paused, false, 'paused'); | |
18 test.done(); | |
19 } | |
20 | |
21 // Play the video and wait for playback to loop. | |
22 function seeked() | |
23 { | |
24 waitForEventAndRunStep('seeking', video, seeking, test); | |
25 video.play(); | |
26 } | |
27 | |
28 // Seek to near the end. | |
29 video.onloadeddata = test.step_func(function() { | |
DaleCurtis
2014/09/18 19:44:47
Move this above setting .src or you have a race.
DaleCurtis
2014/09/18 19:44:47
Be consistent about {} placement. I prefer this st
qinmin
2014/09/18 20:40:40
Done.
qinmin
2014/09/18 20:40:40
Done.
| |
30 waitForEventAndRunStep('seeked', video, seeked, test); | |
31 video.currentTime = video.duration - 0.4; | |
32 }); | |
33 }); | |
34 </script> | |
OLD | NEW |