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_fragment_play.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_fragment_play.html')
-rw-r--r-- | dom/media/test/test_fragment_play.html | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/dom/media/test/test_fragment_play.html b/dom/media/test/test_fragment_play.html new file mode 100644 index 000000000..cd6e9d141 --- /dev/null +++ b/dom/media/test/test_fragment_play.html @@ -0,0 +1,92 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Media test: seek tests</title> + <script type="text/javascript" src="/MochiKit/packed.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> + <script type="text/javascript" src="fragment_play.js"></script> +</head> +<body> +<pre id="test"> +<script class="testbody" type="text/javascript"> +PARALLEL_TESTS = 1; +var manager = new MediaTestManager; + +// Fragment parameters to try. These tests +// try playing the video. Tests for other fragment +// formats are in test_fragment_noplay.html. +var gFragmentParams = [ + { fragment: "", start: null, end: null }, + { fragment: "#t=,", start: null, end: null }, + { fragment: "#t=3,3", start: null, end: null }, + { fragment: "#t=7,3", start: null, end: null }, + { fragment: "#t=7,15", start: 7, end: null }, + { fragment: "#t=15,20", start: 9.287982, end: null }, + { fragment: "#t=5", start: 5, end: null }, + { fragment: "#t=5.5", start: 5.5, end: null }, + { fragment: "#t=5,", start: null, end: null }, + { fragment: "#t=,5", start: 0, end: 5, todo: "See bugs 682141 and 720248" }, + { fragment: "#t=2.5,5.5", start: 2.5, end: 5.5, todo: "See bugs 682141 and 720248" }, + { fragment: "#t=1,2.5", start: 1, end: 2.5, todo: "See bugs 682141 and 720248" }, + { fragment: "#t=,15", start: 0, end: null } +]; + +function createTestArray() { + var tests = []; + var tmpVid = document.createElement("video"); + + for (var testNum=0; testNum<gFragmentTests.length; testNum++) { + var test = gFragmentTests[testNum]; + if (!tmpVid.canPlayType(test.type)) { + continue; + } + + for (var fragNum=0; fragNum<gFragmentParams.length; fragNum++) { + var p = gFragmentParams[fragNum]; + var t = new Object; + t.name = test.name + p.fragment; + t.type = test.type; + t.duration = test.duration; + t.start = p.start; + t.end = p.end; + t.todo = p.todo; + tests.push(t); + } + } + return tests; +} + +function startTest(test, token) { + if (test.todo) { + todo(false, test.todo); + return; + } + var v = document.createElement('video'); + manager.started(token); + v.preload = "metadata"; + v.src = test.name; + v.token = token; + v.controls = true; + document.body.appendChild(v); + var name = test.name + " fragment test"; + var localIs = function(name) { return function(a, b, msg) { + is(a, b, name + ": " + msg); + }}(name); + var localOk = function(name) { return function(a, msg) { + ok(a, name + ": " + msg); + }}(name); + var localFinish = function(v, manager) { return function() { + removeNodeAndSource(v); + manager.finished(v.token); + }}(v, manager); + window['test_fragment_play'](v, test.start, test.end, localIs, localOk, localFinish); +} + +manager.runTests(createTestArray(), startTest); + +</script> +</pre> +</body> +</html> |