summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_SeekNoData_mp4.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/mediasource/test/test_SeekNoData_mp4.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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_SeekNoData_mp4.html')
-rw-r--r--dom/media/mediasource/test/test_SeekNoData_mp4.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_SeekNoData_mp4.html b/dom/media/mediasource/test/test_SeekNoData_mp4.html
new file mode 100644
index 000000000..efebff954
--- /dev/null
+++ b/dom/media/mediasource/test/test_SeekNoData_mp4.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>MSE: basic functionality</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();
+
+// Avoid making trouble for people who fix rounding bugs.
+function fuzzyEquals(a, b) {
+ return Math.abs(a - b) < 0.01;
+}
+
+runWithMSE(function(ms, el) {
+ el.controls = true;
+ once(ms, 'sourceopen').then(function() {
+ ok(true, "Receive a sourceopen event");
+ var audiosb = ms.addSourceBuffer("audio/mp4");
+ var videosb = ms.addSourceBuffer("video/mp4");
+ el.addEventListener("error", function(e) {
+ ok(false, "should not fire '" + e + "' event");
+ });
+ is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING");
+ try {
+ el.currentTime = 3;
+ } catch (e) {
+ ok(false, "should not throw '" + e + "' exception");
+ }
+ is(el.currentTime, 3, "currentTime is default playback start position");
+ is(el.seeking, false, "seek not started with HAVE_NOTHING");
+ fetchAndLoad(audiosb, 'bipbop/bipbop_audio', ['init'], '.mp4')
+ .then(fetchAndLoad.bind(null, videosb, 'bipbop/bipbop_video', ['init'], '.mp4'))
+ .then(once.bind(null, el, 'loadedmetadata'))
+ .then(function() {
+ var p = once(el, 'seeking');
+ el.play();
+ el.currentTime = 5;
+ is(el.readyState, el.HAVE_METADATA, "readyState is HAVE_METADATA");
+ is(el.seeking, true, "seek not started with HAVE_METADATA");
+ is(el.currentTime, 5, "currentTime is seek position");
+ return p;
+ })
+ .then(function() {
+ ok(true, "Got seeking event");
+ var promises = [];
+ promises.push(once(el, 'seeked'));
+ promises.push(fetchAndLoad(audiosb, 'bipbop/bipbop_audio', range(5, 9), '.m4s'));
+ promises.push(fetchAndLoad(videosb, 'bipbop/bipbop_video', range(6, 10), '.m4s'));
+ return Promise.all(promises);
+ })
+ .then(function() {
+ ok(true, "Got seeked event");
+ ok(el.currentTime >= 5, "Time >= 5");
+ once(el, 'ended').then(SimpleTest.finish.bind(SimpleTest));
+ ms.endOfStream();
+ });
+ });
+});
+
+</script>
+</pre>
+</body>
+</html>