| <!DOCTYPE html> |
| <title>Test that seeking a paused video past its end sets currentTime to duration and leaves the video paused.</title> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <video></video> |
| <script> |
| async_test(function(t) { |
| var timeupdateEventCount = 0; |
| var video = document.querySelector("video"); |
| assert_true(video.paused); |
| assert_false(video.ended); |
| |
| video.ontimeupdate = t.step_func(function() { |
| if (++timeupdateEventCount != 2) |
| return; |
| |
| // Wait for 2 timeupdate events so we are sure the |
| // media engine is playing the media. |
| video.ontimeupdate = null; |
| // Make sure time is advancing. |
| assert_false(video.paused); |
| assert_greater_than(video.currentTime, 0); |
| video.onpause = t.step_func(function() { |
| assert_true(video.paused); |
| video.onseeked = t.step_func_done(function() { |
| assert_true(video.paused); |
| assert_equals(video.currentTime, video.duration); |
| assert_true(video.ended); |
| }); |
| |
| // Seek past end. |
| video.currentTime = 500; |
| }); |
| |
| video.pause(); |
| }); |
| |
| video.src = "content/test.ogv"; |
| video.play(); |
| }); |
| </script> |