diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/media/test/test_seekable1.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/test/test_seekable1.html')
-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 000000000..f63e0a634 --- /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 type="text/javascript" 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;version=1.8'> + +let manager = new MediaTestManager; + +function finish_test(element) { + if (element.parentNode) + element.parentNode.removeChild(element); + element.src=""; + manager.finished(element.token); +} + +var tests = [ +// Test using a finite media stream, and a server supporting range requests +{ +setup : function(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); + }, false); + } +} +]; + +function createTestArray() { + var A = []; + for (var k=0; k < gProgressTests.length; k++) { + var t = new Object(); + 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> |