summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_DifferentStreamStartTimes.html
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/mediasource/test/test_DifferentStreamStartTimes.html
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.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/mediasource/test/test_DifferentStreamStartTimes.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_DifferentStreamStartTimes.html b/dom/media/mediasource/test/test_DifferentStreamStartTimes.html
new file mode 100644
index 0000000000..197e809e4f
--- /dev/null
+++ b/dom/media/mediasource/test/test_DifferentStreamStartTimes.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>MSE: Mismatched stream start time playback test</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();
+runWithMSE(async (ms, el) => {
+ el.controls = true;
+ el.autoplay = true;
+ for (let i = 0; i <= 0.5; i += 0.1) {
+ const offset = i.toFixed(1);
+
+ info("----------------------");
+ info("Running test for mismatched stream start times with offset of: " + offset);
+ info("----------------------");
+
+ ms = new MediaSource();
+ el.removeAttribute("src");
+ el.src = URL.createObjectURL(ms);
+
+ await once(ms, "sourceopen");
+ logEvents(el);
+ const videosb = ms.addSourceBuffer("video/mp4");
+ ok(true, "Receive a sourceopen event");
+
+ el.addEventListener("error", e => {
+ ok(false, `should not fire ${e.type} event`);
+ SimpleTest.finish();
+ });
+
+ let p = once(el, "loadedmetadata");
+ await fetchAndLoad(videosb, "bipbop/bipbop_offset_" + offset + "-", ["init"], ".mp4");
+ await p;
+ ok(true, "got loadedmetadata event");
+
+ p = Promise.all(["loadeddata", "canplay", "play", "playing"].map(e => once(el, e)));
+ await fetchAndLoad(videosb, "bipbop/bipbop_offset_" + offset + "-", range(1, 2), ".m4s");
+ el.play();
+ await p;
+ }
+ ok(true, "got all required event");
+ SimpleTest.finish();
+});
+</script>
+</pre>
+</body>
+</html>