diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/media/mediasource/test/test_AudioChange_mp4.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/mediasource/test/test_AudioChange_mp4.html')
-rw-r--r-- | dom/media/mediasource/test/test_AudioChange_mp4.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_AudioChange_mp4.html b/dom/media/mediasource/test/test_AudioChange_mp4.html new file mode 100644 index 0000000000..9051af05a1 --- /dev/null +++ b/dom/media/mediasource/test/test_AudioChange_mp4.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>MSE: basic functionality</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="mediasource.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +SimpleTest.waitForExplicitFinish(); + +// This test checks loading a stereo segment, followed by a 5.1 segment plays without error. + +runWithMSE(async (ms, el) => { + el.controls = true; + await once(ms, "sourceopen"); + ok(true, "Receive a sourceopen event"); + logEvents(el); + + const audiosb = ms.addSourceBuffer("audio/mp4"); + el.addEventListener("error", e => { + ok(false, `should not fire ${e.type} event`); + SimpleTest.finish(); + }); + is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); + let p = once(el, "loadedmetadata"); + await fetchAndLoad(audiosb, "aac20-48000-64000-", ["init"], ".mp4"); + await p; + ok(true, "got loadedmetadata event"); + p = Promise.all([once(el, "loadeddata"), once(el, "canplay")]); + await fetchAndLoad(audiosb, "aac20-48000-64000-", ["1"], ".m4s"); + await p; + ok(true, "got canplay event"); + el.play(); + await fetchAndLoad(audiosb, "aac51-48000-128000-", ["init"], ".mp4"); + await fetchAndLoad(audiosb, "aac51-48000-128000-", ["2"], ".m4s"); + ms.endOfStream(); + await once(el, "ended"); + ok(el.currentTime >= 6, "played to the end"); + SimpleTest.finish(); +}); + +</script> +</pre> +</body> +</html> |