2008-12-10 06:23:23 -08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=467972
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 467972</title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
2008-12-10 06:23:23 -08:00
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=467972">Mozilla Bug 467972</a>
|
|
|
|
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
/** Test for Bug 467972 **/
|
|
|
|
|
|
|
|
|
|
|
|
var gEnded = false;
|
|
|
|
var gSeekStarted = false;
|
|
|
|
var gSeekEnded = false;
|
2008-12-14 19:38:16 -08:00
|
|
|
var gLoadedDataCount = 0;
|
2008-12-10 06:23:23 -08:00
|
|
|
var gLoadedMetaDataCount = 0;
|
|
|
|
|
|
|
|
function get(id) {
|
|
|
|
return document.getElementById(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
function video() {
|
|
|
|
return get('v');
|
|
|
|
}
|
|
|
|
|
|
|
|
function seekStarted() {
|
|
|
|
gSeekStarted = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function seekEnded() {
|
|
|
|
gSeekEnded = true;
|
|
|
|
video().play();
|
|
|
|
}
|
|
|
|
|
2008-12-14 19:38:16 -08:00
|
|
|
function loadedData() {
|
|
|
|
gLoadedDataCount++;
|
2009-02-19 09:23:13 -08:00
|
|
|
ok(gLoadedDataCount <= 1, "No more than 1 onloadeddata events");
|
2008-12-10 06:23:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadedMetaData() {
|
|
|
|
gLoadedMetaDataCount++;
|
|
|
|
ok(gLoadedMetaDataCount <= 1, "No more than 1 onloadedmetadata events");
|
2009-01-28 01:33:37 -08:00
|
|
|
is(video().videoWidth, 320, "width is available");
|
|
|
|
is(video().videoHeight, 240, "height is available");
|
2008-12-10 06:23:23 -08:00
|
|
|
video().play();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function playbackEnded() {
|
|
|
|
if (!gEnded) {
|
|
|
|
video().currentTime = 0;
|
|
|
|
gEnded = true;
|
|
|
|
} else {
|
|
|
|
ok(gSeekEnded, "Should have received seekended");
|
|
|
|
ok(gSeekStarted, "Should have received seekstarted");
|
2008-12-14 19:38:16 -08:00
|
|
|
is(gLoadedDataCount, 1, "Should have 1 onloadeddata event");
|
|
|
|
is(gLoadedMetaDataCount, 1, "Should have 1 onloadedmetadata event");
|
2008-12-10 06:23:23 -08:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
2009-01-05 17:18:40 -08:00
|
|
|
<video id="v"
|
2009-01-16 01:07:26 -08:00
|
|
|
src="320x240.ogv"
|
2009-01-05 17:18:40 -08:00
|
|
|
onloadedmetadata="return loadedMetaData();"
|
|
|
|
onended="playbackEnded();"
|
|
|
|
onloadeddata="return loadedData();"
|
|
|
|
onseeking="seekStarted();"
|
|
|
|
onseeked="seekEnded();"
|
|
|
|
controls></video>
|
2008-12-10 06:23:23 -08:00
|
|
|
</body>
|
|
|
|
</html>
|