diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/media/mediasource/test/test_RemoveSourceBuffer.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/mediasource/test/test_RemoveSourceBuffer.html')
-rw-r--r-- | dom/media/mediasource/test/test_RemoveSourceBuffer.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_RemoveSourceBuffer.html b/dom/media/mediasource/test/test_RemoveSourceBuffer.html new file mode 100644 index 0000000000..11c6a51deb --- /dev/null +++ b/dom/media/mediasource/test/test_RemoveSourceBuffer.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<html><head> +<meta http-equiv="content-type" content="text/html; charset=windows-1252"> + <title>MSE: check buffered status after removed all source buffer</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"> + +const videoURL = "seek.webm"; + +SimpleTest.waitForExplicitFinish(); + +runWithMSE(async function(ms, el) { + info("- wait for sourceopen -"); + await once(ms, "sourceopen"); + + info("- wait for fetching data -"); + const arrayBuffer = await fetchWithXHR(videoURL); + + info("- create source buffer and append data -"); + const sourceBuffer = ms.addSourceBuffer("video/webm"); + sourceBuffer.appendBuffer(arrayBuffer); + await once(sourceBuffer, "updateend"); + is(ms.sourceBuffers.length, 1, + "the length of source buffers list is 1."); + is(ms.activeSourceBuffers.length, 1, + "the length of active source buffers list is 1."); + ok(ms.duration != 0, "duration is not 0."); + is(el.buffered.length, 1, "buffered range is 1."); + + info("- remove source buffer from media source -"); + ms.removeSourceBuffer(sourceBuffer); + await once(ms.sourceBuffers, "removesourcebuffer"); + is(ms.sourceBuffers.length, 0, "source buffers list is empty."); + is(ms.activeSourceBuffers.length, 0, "active source buffers list is empty."); + ok(ms.duration != 0, "duration is not 0."); + is(el.buffered.length, 0, + "buffered range is empty since we don't have any source buffer."); + + info("- call endOfStream -"); + ms.endOfStream(); + is(ms.duration, 0, "duraton is 0 since we don't have any source buffer."); + SimpleTest.finish(); +}); + +</script> +</pre> +</body> +</html> |