content/media/test/test_bug463162.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml"
michael@0 2 xmlns:html="http://www.w3.org/1999/xhtml"
michael@0 3 xmlns:svg="http://www.w3.org/2000/svg">
michael@0 4 <!--
michael@0 5 https://bugzilla.mozilla.org/show_bug.cgi?id=463162
michael@0 6 -->
michael@0 7 <head>
michael@0 8 <title>Test for Bug 463162</title>
michael@0 9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"/>
michael@0 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 12 <script type="text/javascript" src="manifest.js"></script>
michael@0 13 </head>
michael@0 14 <body>
michael@0 15 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463162">Mozilla Bug 463162</a>
michael@0 16
michael@0 17 <script class="testbody" type="text/javascript">
michael@0 18 <![CDATA[
michael@0 19
michael@0 20 var gExpectedResult = {
michael@0 21 'a1' : 'error',
michael@0 22 'a2' : 'loaded',
michael@0 23 'a3' : 'loaded',
michael@0 24 'a4' : 'error',
michael@0 25 };
michael@0 26
michael@0 27 var gResultCount = 0;
michael@0 28
michael@0 29 function onError(event, id) {
michael@0 30 is('error', gExpectedResult[id], 'unexpected error loading ' + id);
michael@0 31 gResultCount++;
michael@0 32 dump('error('+id+') expected ' + gExpectedResult[id] + ' gResultCount=' + gResultCount + '\n');
michael@0 33 if (gResultCount == 4)
michael@0 34 SimpleTest.finish();
michael@0 35 }
michael@0 36
michael@0 37 function onMetaData(id) {
michael@0 38 is('loaded', gExpectedResult[id], 'unexpected loadedmetadata loading ' + id);
michael@0 39 gResultCount++;
michael@0 40 dump('onMetaData('+id+') expected ' + gExpectedResult[id] + ' gResultCount=' + gResultCount + '\n');
michael@0 41 if (gResultCount == 4)
michael@0 42 SimpleTest.finish();
michael@0 43 }
michael@0 44
michael@0 45 ]]>
michael@0 46 </script>
michael@0 47
michael@0 48 <video id="a1" preload="metadata" onloadedmetadata="onMetaData('a1');"><sauce/><source type="bad" src="404" onerror="onError(event, 'a1');"/></video>
michael@0 49 <video id="a2" preload="metadata" onloadedmetadata="onMetaData('a2');"><source onerror="onError(event, 'a2');"/></video>
michael@0 50 <video id="a3" preload="metadata" onloadedmetadata="onMetaData('a3');"><html:source onerror="onError(event, 'a3');"/></video>
michael@0 51 <video id="a4" preload="metadata" onloadedmetadata="onMetaData('a4');"><svg:source/><source onerror="onError(event, 'a4');" type="bad" src="404"/></video>
michael@0 52
michael@0 53 <script class="testbody" type="text/javascript">
michael@0 54 <![CDATA[
michael@0 55
michael@0 56 function setSource(id, res) {
michael@0 57 var v = document.getElementById(id);
michael@0 58 v.firstChild.src = res.name;
michael@0 59 v.firstChild.type = res.type;
michael@0 60 }
michael@0 61
michael@0 62 var t = getPlayableVideo(gSmallTests);
michael@0 63
michael@0 64 setSource('a1', t);
michael@0 65 setSource('a2', t);
michael@0 66 setSource('a3', t);
michael@0 67 setSource('a4', t);
michael@0 68
michael@0 69 SimpleTest.waitForExplicitFinish();
michael@0 70
michael@0 71 ]]>
michael@0 72 </script>
michael@0 73
michael@0 74 <pre id="test">
michael@0 75
michael@0 76 </pre>
michael@0 77 </body>
michael@0 78 </html>

mercurial