gecko-dev/content/media/test/seek8.js

22 строки
422 B
JavaScript

function test_seek8(v, seekTime, is, ok, finish) {
var completed = false;
function startTest() {
v.currentTime = 1000;
}
function seekEnded() {
if (completed)
return false;
ok(Math.abs(v.currentTime - v.duration) < 0.2,
"currentTime " + v.currentTime + " close to " + v.duration);
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeked", seekEnded, false);
}