blob: 53b46cc47570a87aa3e5ecbd3884470588a94e8a [file] [log] [blame]
<!DOCTYPE html>
<title>Test that setting currentTime changes the time, and setting invalid values throw exceptions.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
var video = document.querySelector("video");
video.oncanplaythrough = t.step_func_done(function () {
assert_throws(new TypeError, function() { video.currentTime = -Infinity; });
assert_throws(new TypeError, function() { video.currentTime = Infinity; });
assert_throws(new TypeError, function() { video.currentTime = NaN; });
video.currentTime = 1.5;
assert_equals(video.currentTime, 1.5);
video.play();
video.currentTime = 3.1;
assert_equals(video.currentTime, 3.1);
});
video.src = "content/test.ogv";
});
</script>