Chromium Code Reviews| Index: LayoutTests/media/video-not-paused-while-looping.html |
| diff --git a/LayoutTests/media/video-not-paused-while-looping.html b/LayoutTests/media/video-not-paused-while-looping.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cc7830966157d4689d4abae2aa9f173da161b457 |
| --- /dev/null |
| +++ b/LayoutTests/media/video-not-paused-while-looping.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE html> |
| +<title>video is not paused while looping</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="w3c-media-utils.js"></script> |
| +<video controls loop></video> |
| +<p>Test that video should not be in a paused state while looping.</p> |
| +<script> |
| +async_test(function(test) { |
| + 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.
|
| + video.src = 'content/test.mp4'; |
| + |
| + // Verify video is not paused. |
| + function seeking() |
| + { |
| + assert_equals(video.currentTime, 0, 'currentTime'); |
| + assert_equals(video.paused, false, 'paused'); |
| + test.done(); |
| + } |
| + |
| + // Play the video and wait for playback to loop. |
| + function seeked() |
| + { |
| + waitForEventAndRunStep('seeking', video, seeking, test); |
| + video.play(); |
| + } |
| + |
| + // Seek to near the end. |
| + 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.
|
| + waitForEventAndRunStep('seeked', video, seeked, test); |
| + video.currentTime = video.duration - 0.4; |
| + }); |
| +}); |
| +</script> |