summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_DrainOnMissingData_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_DrainOnMissingData_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_DrainOnMissingData_mp4.html')
-rw-r--r--dom/media/mediasource/test/test_DrainOnMissingData_mp4.html60
1 files changed, 60 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html b/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html
new file mode 100644
index 000000000..f2284377f
--- /dev/null
+++ b/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=windows-1252">
+ <title>MSE: |waiting| event when source data is missing</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;
+ once(ms, 'sourceopen').then(function() {
+ ok(true, "Receive a sourceopen event");
+ var videosb = ms.addSourceBuffer("video/mp4");
+ fetchAndLoad(videosb, 'bipbop/bipbop_video', ['init'], '.mp4')
+ .then(function() {
+ // Set appendWindowEnd to ensure we only have about 6 frames worth.
+ // We must feed at least 6 frames to pass the MDSM pre-roll.
+ videosb.appendWindowEnd = .4;
+ return fetchAndLoad(videosb, 'bipbop/bipbop_video', ['1'], '.m4s');
+ })
+ .then(function() {
+ info("Invoking play()");
+ var promises = [];
+ promises.push(once(el, 'playing'));
+ el.play();
+ return Promise.all(promises);
+ })
+ .then(function() {
+ info("got playing");
+ return once(el, 'waiting');
+ }).then(function() {
+ info("got waiting");
+ info("Loading more data");
+ // Waiting will be fired on the last frame +- 40ms.
+ isfuzzy(el.currentTime, videosb.buffered.end(0) - 1/30,
+ 0.04, "Got a waiting event at " + el.currentTime);
+ videosb.appendWindowEnd = 1;
+ var p = once(el, 'ended');
+ var loads = fetchAndLoad(videosb, 'bipbop/bipbop_video', [1], '.m4s');
+ loads.then(() => ms.endOfStream());
+ return p;
+ }).then(function() {
+ // These fuzz factors are bigger than they should be. We should investigate
+ // and fix them in bug 1137574.
+ is(el.duration, 0.801666, "Video has correct duration: " + el.duration);
+ is(el.currentTime, el.duration, "Video has correct currentTime.");
+ SimpleTest.finish();
+ });
+ });
+});
+
+</script>
+</pre>
+</body>
+</html>