summaryrefslogtreecommitdiffstats
path: root/dom/media/test/test_bug463162.xhtml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/media/test/test_bug463162.xhtml
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--dom/media/test/test_bug463162.xhtml78
1 files changed, 78 insertions, 0 deletions
diff --git a/dom/media/test/test_bug463162.xhtml b/dom/media/test/test_bug463162.xhtml
new file mode 100644
index 0000000000..a84b3488d1
--- /dev/null
+++ b/dom/media/test/test_bug463162.xhtml
@@ -0,0 +1,78 @@
+<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 src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script src="/tests/SimpleTest/EventUtils.js"></script>
+ <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) {
+ 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" preload="metadata" onloadedmetadata="onMetaData('a1');"><sauce/><source type="bad" src="404" onerror="onError(event, 'a1');"/></video>
+<video id="a2" preload="metadata" onloadedmetadata="onMetaData('a2');"><source onerror="onError(event, 'a2');"/></video>
+<video id="a3" preload="metadata" onloadedmetadata="onMetaData('a3');"><html:source onerror="onError(event, 'a3');"/></video>
+<video id="a4" preload="metadata" onloadedmetadata="onMetaData('a4');"><svg:source/><source onerror="onError(event, 'a4');" 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>