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/mediasource/test/test_SeekedEvent_mp4.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/mediasource/test/test_SeekedEvent_mp4.html')
-rw-r--r-- | dom/media/mediasource/test/test_SeekedEvent_mp4.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_SeekedEvent_mp4.html b/dom/media/mediasource/test/test_SeekedEvent_mp4.html new file mode 100644 index 000000000..f80ae86f5 --- /dev/null +++ b/dom/media/mediasource/test/test_SeekedEvent_mp4.html @@ -0,0 +1,75 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>MSE: Check that seeked event is fired prior loadeddata</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="mediasource.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +SimpleTest.waitForExplicitFinish(); + +runWithMSE(function(ms, el) { + el.controls = true; + el._seeked = false; + el._loadeddata = false; + el._playing = false; + el.addEventListener("seeked", function() { + ok(true, "got seeked event"); + is(el._loadeddata, false, "can't have received loadeddata prior seeked"); + is(el._playing, false, "can't be playing prior seeked"); + el._seeked = true; + }); + el.addEventListener("loadeddata", function() { + ok(true, "got loadeddata event"); + is(el._seeked, true, "must have received seeked prior loadeddata"); + is(el._playing, false, "can't be playing prior playing"); + el._loadeddata = true; + }); + el.addEventListener("playing", function() { + ok(true, "got playing"); + is(el._seeked, true, "must have received seeked prior playing"); + is(el._loadeddata, true, "must have received loadeddata prior playing"); + el._playing = true; + }); + once(ms, 'sourceopen').then(function() { + ok(true, "Receive a sourceopen event"); + var videosb = ms.addSourceBuffer("video/mp4"); + is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); + fetchAndLoad(videosb, 'bipbop/bipbop_video', ['init'], '.mp4') + .then(once.bind(null, el, "loadedmetadata")) + .then(function() { + el.play(); + videosb.timestampOffset = 2; + is(el.readyState, el.HAVE_METADATA, "readyState is HAVE_METADATA"); + // Load [2, 3.606). + var promises = []; + promises.push(once(el, "play")); + promises.push(fetchAndLoad(videosb, 'bipbop/bipbop_video', ['1'], '.m4s')); + return Promise.all(promises); + }) + .then(function() { + return fetchAndLoad(videosb, 'bipbop/bipbop_video', ['2'], '.m4s'); + }) + .then(function() { + is(el.readyState, el.HAVE_METADATA, "readyState is HAVE_METADATA"); + el.currentTime = 2; + var promises = []; + promises.push(once(el, "seeked")); + promises.push(once(el, "playing")); + return Promise.all(promises); + }) + .then(function() { + ok(true, "completed seek"); + SimpleTest.finish(); + }); + }); +}); + +</script> +</pre> +</body> +</html> |