2009-05-18 15:47:08 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=493187
|
|
|
|
-->
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Bug 493187 - enter HAVE_FUTURE_DATA when seeking within buffered data even if new data isn't arriving</title>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
<script type="text/javascript" src="use_large_cache.js"></script>
|
2010-05-30 15:02:06 -07:00
|
|
|
<script type="text/javascript" src="manifest.js"></script>
|
2009-05-18 15:47:08 -07:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=493187">Mozilla Bug 493187</a>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
2013-02-27 17:58:48 -08:00
|
|
|
SimpleTest.expectAssertions(0, 2);
|
2013-02-27 10:37:19 -08:00
|
|
|
|
2010-08-26 19:11:46 -07:00
|
|
|
var manager = new MediaTestManager;
|
2010-05-30 15:02:06 -07:00
|
|
|
|
|
|
|
function start(e) {
|
|
|
|
e.target.currentTime = e.target.duration / 4;
|
2009-05-18 15:47:08 -07:00
|
|
|
}
|
|
|
|
|
2010-05-30 15:02:06 -07:00
|
|
|
function startSeeking(e) {
|
|
|
|
e.target._seeked = true;
|
2009-05-18 15:47:08 -07:00
|
|
|
}
|
|
|
|
|
2010-05-30 15:02:06 -07:00
|
|
|
function canPlayThrough(e) {
|
|
|
|
var v = e.target;
|
|
|
|
if (v._seeked && !v._finished) {
|
|
|
|
ok(true, "Got canplaythrough after seek for " + v._name);
|
|
|
|
v._finished = true;
|
2010-08-26 19:11:46 -07:00
|
|
|
v.parentNode.removeChild(v);
|
2011-07-11 20:39:37 -07:00
|
|
|
v.src = "";
|
2010-08-26 19:11:46 -07:00
|
|
|
manager.finished(v.token);
|
2009-05-18 15:47:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-26 19:11:46 -07:00
|
|
|
function startTest(test, token) {
|
2010-05-30 15:02:06 -07:00
|
|
|
// TODO: Bug 568402, there's a bug in the WAV backend where we sometimes
|
|
|
|
// don't send canplaythrough events after seeking. Once that is fixed,
|
|
|
|
// we should remove this guard below so that we run this test for audio.
|
2013-01-23 11:24:41 -08:00
|
|
|
var type = getMajorMimeType(test.type);
|
|
|
|
if (type != "video")
|
2010-08-26 19:11:46 -07:00
|
|
|
return;
|
2010-05-30 15:02:06 -07:00
|
|
|
|
|
|
|
var v = document.createElement('video');
|
2010-08-26 19:11:46 -07:00
|
|
|
v.token = token;
|
|
|
|
manager.started(token);
|
|
|
|
|
2010-05-30 15:02:06 -07:00
|
|
|
v.src = test.name;
|
|
|
|
v._name = test.name;
|
|
|
|
v._seeked = false;
|
|
|
|
v._finished = false;
|
2010-08-19 15:50:37 -07:00
|
|
|
v.preload = "auto";
|
2010-05-30 15:02:06 -07:00
|
|
|
v.addEventListener("loadedmetadata", start, false);
|
|
|
|
v.addEventListener("canplaythrough", canPlayThrough, false);
|
|
|
|
v.addEventListener("seeking", startSeeking, false);
|
|
|
|
document.body.appendChild(v);
|
|
|
|
}
|
|
|
|
|
2010-08-26 19:11:46 -07:00
|
|
|
manager.runTests(gSeekTests, startTest);
|
2010-05-30 15:02:06 -07:00
|
|
|
|
2009-05-18 15:47:08 -07:00
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|