2009-02-26 03:55:30 -08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Media test: paused</title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2009-02-26 03:55:30 -08:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
2010-05-30 15:02:06 -07:00
|
|
|
<script type="text/javascript" src="manifest.js"></script>
|
2009-02-26 03:55:30 -08:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
2010-05-30 15:02:06 -07:00
|
|
|
var videos = [];
|
|
|
|
|
|
|
|
function ended(evt) {
|
|
|
|
var v = evt.target;
|
|
|
|
is(v.paused, false, v._name + " must not be paused after end");
|
|
|
|
if (AllFinished(videos)) {
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var i=0; i<gPausedAfterEndedTests.length; ++i) {
|
|
|
|
var v = document.createElement('video');
|
|
|
|
var test = gPausedAfterEndedTests[i];
|
|
|
|
if (!v.canPlayType(test.type))
|
|
|
|
continue;
|
|
|
|
v.src = test.name;
|
|
|
|
v._name = test.name;
|
|
|
|
v._finished = false;
|
|
|
|
v.load();
|
|
|
|
is(v.paused, true, v._name + " must be paused at start");
|
|
|
|
|
|
|
|
v.play();
|
|
|
|
is(v.paused, false, v._name + " must not be paused after play");
|
|
|
|
|
|
|
|
v.addEventListener("ended", ended, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (videos.length == 0) {
|
|
|
|
todo(false, "No types supported");
|
|
|
|
} else {
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
}
|
2009-02-26 03:55:30 -08:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|