gecko/content/media/test/test_wav_timeupdate2.html

57 lines
1.3 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html>
<head>
<title>Wave Media test: timeupdate after seeking</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var completed = false;
var seeking = false;
function startTest() {
if (completed)
return false;
var v = document.getElementById('v');
v.currentTime = 0.5;
return false;
}
function startSeek() {
if (completed)
return false;
seeking = true;
return false;
}
function timeUpdated() {
if (completed || !seeking)
return false;
var v = document.getElementById('v');
// Check that currentTime is within range in first timeupdate after seeking.
ok(v.currentTime > 0.4 && v.currentTime < 0.6, "currentTime should be around 0.5: " + v.currentTime);
completed = true;
SimpleTest.finish();
return false;
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<audio id='v'
src='r11025_u8_c1.wav'
onloadedmetadata='return startTest();'
onseeking='return startSeek();'
ontimeupdate='return timeUpdated();'></audio>
</body>
</html>