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 /testing/web-platform/tests/media-source/mediasource-replay.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 'testing/web-platform/tests/media-source/mediasource-replay.html')
-rw-r--r-- | testing/web-platform/tests/media-source/mediasource-replay.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/web-platform/tests/media-source/mediasource-replay.html b/testing/web-platform/tests/media-source/mediasource-replay.html new file mode 100644 index 0000000000..05a8c0a918 --- /dev/null +++ b/testing/web-platform/tests/media-source/mediasource-replay.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<!-- Copyright © 2019 Igalia S.L --> +<html> +<head> + <title>MediaSource replay test case.</title> + <meta name="timeout" content="long"> + <meta charset="utf-8"> + <link rel="author" title="Alicia Boya García" href="mailto:aboya@igalia.com"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="mediasource-util.js"></script> +</head> +<body> +<div id="log"></div> +<script> + mediasource_testafterdataloaded(function (test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) { + mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'")); + + test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer'); + + sourceBuffer.appendBuffer(mediaData); + + test.waitForExpectedEvents(function () { + mediaSource.endOfStream(); + + // Start playing near the end. + mediaElement.currentTime = 6.2; + mediaElement.play(); + test.expectEvent(mediaElement, 'ended', 'mediaElement'); + }); + + test.waitForExpectedEvents(function () { + mediaElement.play(); + assert_equals(mediaElement.currentTime, 0, "currentTime"); + // If currentTime is able to advance, the player did not get stuck and it's a pass. + test.waitForCurrentTimeChange(mediaElement, test.step_func_done()); + }); + }, "Test replaying video after 'ended'"); +</script> +</body> +</html> |