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/test/test_seek_nosrc.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/test/test_seek_nosrc.html')
-rw-r--r-- | dom/media/test/test_seek_nosrc.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/dom/media/test/test_seek_nosrc.html b/dom/media/test/test_seek_nosrc.html new file mode 100644 index 0000000000..56461007bd --- /dev/null +++ b/dom/media/test/test_seek_nosrc.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Media test: seek tests</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> + <script type="text/javascript" src="manifest.js"></script> +</head> +<body> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +SimpleTest.waitForExplicitFinish(); + +var SEEK_TIME = 3.5; +var seekStarted = false; +var seekCompleted = false; +var metadata = false; + +var v = document.createElement('video'); +document.body.appendChild(v); +SimpleTest.registerCleanupFunction(function () { + v.remove(); +}); + +try { + v.currentTime = SEEK_TIME; +} catch (e) { + ok(false, "should not fire '" + e + "' event"); +} +is(v.readyState, v.HAVE_NOTHING, "readyState is HAVE_NOTHING"); +ok(!v.seeking, "can't be seeking prior src defined"); +is(v.currentTime, SEEK_TIME, "currentTime is default playback start position"); +once(v, "seeking", function() { + seekStarted = true; +}); +once(v, "seeked", function() { + seekCompleted = true; +}); +once(v, "loadedmetadata", function() { + metadata = true; + ok(v.seeking, "element is seeking once readyState is HAVE_METADATA"); +}); +once(v, "ended", function() { + ok(seekStarted, "seek should have started"); + ok(seekCompleted, "seek should have completed"); + ok(metadata, "loadedmetadata fired"); + ok(v.currentTime >= SEEK_TIME, "currentTime should be after seek time"); + SimpleTest.finish(); +}); + +v.src = "seek.webm"; +v.play(); + +</script> +</pre> +</body> +</html> |