2009-02-19 09:23:13 -08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Wave Media test: timeupdate after seeking</title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2009-02-19 09:23:13 -08:00
|
|
|
<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>
|