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_seekable1.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.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/test/test_seekable1.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/dom/media/test/test_seekable1.html b/dom/media/test/test_seekable1.html new file mode 100644 index 0000000000..45c84b35df --- /dev/null +++ b/dom/media/test/test_seekable1.html @@ -0,0 +1,66 @@ +<!DOCTYPE HTML> +<html> +<head> +<title>Test seekable member for media elements</title> +<script type="text/javascript" src="/MochiKit/MochiKit.js"></script> +<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='application/javascript'> + +let manager = new MediaTestManager; + +function finish_test(element) { + if (element.parentNode) + element.remove(); + element.src=""; + manager.finished(element.token); +} + +var tests = [ +// Test using a finite media stream, and a server supporting range requests +{ +setup(element) { + is(element.seekable.length, 0, "seekable.length should be initialy 0."); + element.addEventListener("loadedmetadata", function() { + is(element.seekable.length, 1, "seekable.length should be 1 for a server supporting range requests."); + + is(element.seekable.start(0), 0.0, "The start of the first range should be the initialTime."); + is(element.seekable.end(0), element.duration, "The end of the first range should be the duration.") + finish_test(element); + }); + } +} +]; + +function createTestArray() { + var A = []; + for (var k=0; k < gProgressTests.length; k++) { + var t = {}; + t.setup = tests[0].setup; + t.name = gProgressTests[k].name; + t.type = gProgressTests[k].type; + A.push(t); + } + return A; +} + +function startTest(test, token) { + var elemType = getMajorMimeType(test.type); + var element = document.createElement(elemType); + element.preload = "auto"; + element.src = test.name; + element.token = token; + test.setup(element); + manager.started(token); +} + +manager.runTests(createTestArray(), startTest); + +</script> +</pre> +</body> +</html> |