gecko-dev/content/media/test/test_bug463162.xhtml
Chris Pearce a7d0ccd23a Bug 564720 - Refactor media tests to be backend independent were possible. r=roc
--HG--
rename : content/media/test/test_play.html => content/media/test/test_play_events.html
rename : content/media/test/test_progress2.html => content/media/test/test_progress.html
rename : content/media/test/test_onloadedmetadata.html => content/media/test/test_replay_metadata.html
rename : content/media/test/test_wav_trunc_seek.html => content/media/test/test_seek_out_of_range.html
rename : content/media/test/test_bug495319.html => content/media/test/test_timeupdate_small_files.html
rename : content/media/test/test_bug486646.html => content/media/test/test_video_to_canvas.html
2010-05-31 10:02:06 +12:00

82 lines
2.3 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg">
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=463162
-->
<head>
<title>Test for Bug 463162</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"/>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463162">Mozilla Bug 463162</a>
<script class="testbody" type="text/javascript">
<![CDATA[
var gExpectedResult = {
'a1' : 'error',
'a2' : 'loaded',
'a3' : 'loaded',
'a4' : 'error',
};
var gResultCount = 0;
function onError(event, id) {
event.stopPropagation();
is('error', gExpectedResult[id], 'unexpected error loading ' + id);
gResultCount++;
dump('error('+id+') expected ' + gExpectedResult[id] + ' gResultCount=' + gResultCount + '\n');
if (gResultCount == 4)
SimpleTest.finish();
}
function onMetaData(id) {
is('loaded', gExpectedResult[id], 'unexpected loadedmetadata loading ' + id);
gResultCount++;
dump('onMetaData('+id+') expected ' + gExpectedResult[id] + ' gResultCount=' + gResultCount + '\n');
if (gResultCount == 4)
SimpleTest.finish();
}
]]>
</script>
<video id='a1' onerror="onError(event, 'a1');" onloadedmetadata="onMetaData('a1');"><sauce/><source type="bad" src="
404"/></video>
<video id='a2' onerror="onError(event, 'a2');" onloadedmetadata="onMetaData('a2');"><source/></video>
<video id='a3' onerror="onError(event, 'a3');" onloadedmetadata="onMetaData('a3');"><html:source/></video>
<video id='a4' onerror="onError(event, 'a4');" onloadedmetadata="onMetaData('a4');"><svg:source/><source type="bad" src="404"/></video>
<script class="testbody" type="text/javascript">
<![CDATA[
function setSource(id, res) {
var v = document.getElementById(id);
v.firstChild.src = res.name;
v.firstChild.type = res.type;
}
var t = getPlayableVideo(gSmallTests);
setSource('a1', t);
setSource('a2', t);
setSource('a3', t);
setSource('a4', t);
SimpleTest.waitForExplicitFinish();
]]>
</script>
<pre id="test">
</pre>
</body>
</html>