2011-09-29 21:13:15 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=686942
|
|
|
|
-->
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 448534</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="manifest.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2013-01-23 11:24:41 -08:00
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=686942">Mozilla Bug 686942</a>
|
2011-09-29 21:13:15 -07:00
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
2013-02-25 18:39:21 -08:00
|
|
|
if (navigator.platform.indexOf("Win") == 0) {
|
|
|
|
SimpleTest.expectAssertions(0, 1);
|
|
|
|
}
|
|
|
|
|
2011-09-29 21:13:15 -07:00
|
|
|
var manager = new MediaTestManager;
|
|
|
|
|
|
|
|
function onloaded(event) {
|
|
|
|
var v = event.target;
|
|
|
|
v.currentTime = v.duration;
|
2012-08-14 21:41:24 -07:00
|
|
|
return;
|
2011-09-29 21:13:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function checkNotPlaying(v) {
|
|
|
|
ok(v.currentTime == 0, "Should not be playing after seek to end and back to beginning");
|
|
|
|
v._finished = true;
|
|
|
|
manager.finished(v.token);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onseeked(event) {
|
|
|
|
var v = event.target;
|
|
|
|
setTimeout(function() { checkNotPlaying(v); }, 500);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onended(event) {
|
|
|
|
var v = event.target;
|
|
|
|
if (v._finished)
|
2012-08-14 21:41:24 -07:00
|
|
|
return;
|
2011-09-29 21:13:15 -07:00
|
|
|
v.addEventListener("seeked", onseeked, false);
|
|
|
|
v.currentTime = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function startTest(test, token) {
|
|
|
|
var v = document.createElement('video');
|
|
|
|
v.token = token;
|
|
|
|
manager.started(token);
|
|
|
|
v.src = test.name;
|
|
|
|
v._played = false;
|
|
|
|
v._finished = false;
|
|
|
|
v.addEventListener("loadedmetadata", onloaded, false);
|
|
|
|
v.addEventListener("ended", onended, false);
|
|
|
|
|
|
|
|
document.body.appendChild(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
manager.runTests(gSmallTests, startTest);
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|