summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_DifferentStreamStartTimes.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /dom/media/mediasource/test/test_DifferentStreamStartTimes.html
parentInitial commit. (diff)
downloadfirefox-esr-upstream/115.8.0esr.tar.xz
firefox-esr-upstream/115.8.0esr.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/mediasource/test/test_DifferentStreamStartTimes.html')
-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>