gecko-dev/content/media/test/test_bug448534.html

62 строки
1.5 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=448534
-->
<head>
<title>Test for Bug 448534</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>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448535">Mozilla Bug 448534</a>
<pre id="test">
<script class="testbody" type="text/javascript">
var v;
var played = false;
var completed = false;
function loaded() {
if (completed)
return false;
v = document.getElementById('v');
v.play();
return false;
}
function started() {
if (completed)
return false;
ok(v, "'v' global should be initialized");
ok(!v.paused, "Video should not be paused while playing");
v.parentNode.removeChild(v);
played = true;
return false;
}
function stopped() {
if (completed)
return false;
completed = true;
ok(v, "'v' global should be initialized");
ok(v.paused, "Video should be paused after removing from the Document");
SimpleTest.finish();
return false;
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<!-- Ogg video obtained from Theora test suite: http://v2v.cc/~j/theora_testsuite/ -->
<video id='v'
src='320x240.ogv'
onloadedmetadata='return loaded();'
onplay='return started();'
onpause='return stopped();'></video>
</body>
</html>