Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/seeking/seek-to-negative-time.htm - WPT Dashboard Interop Dashboard
<!doctype html>
<title>seek to negative time</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<div id=log></div>
<script>
async_test(function(t) {
var v = document.createElement('video');
v.src = getVideoURI('/media/movie_5');
v.onloadedmetadata = t.step_func(function() {
assert_equals(v.seekable.start(0), 0, 'earliest seekable time');
v.currentTime = -1;
assert_true(v.seeking, 'seeking after setting');
assert_equals(v.currentTime, 0, 'currentTime after setting');
v.onseeked = t.step_func(function(e) {
assert_false(v.seeking, 'seeking in seeked event');
assert_equals(v.currentTime, 0, 'currentTime in seeked event');
t.done();
});
});
});
</script>