Bug 1211652: Add sourcebuffer.mode = sequence mochitest. r=gerald
☠☠ backed out by 005264192a61 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 06 Oct 2015 11:59:47 +1100
changeset 266442 8ba8e24a84d3766b0c5442b1f0a08b94ea63d15e
parent 266441 649b90ba93630a3b541adb93397617314a9a6679
child 266443 654970da23e4e25583286996bb755e17cb08fda7
push id66190
push userjyavenard@mozilla.com
push dateWed, 07 Oct 2015 05:41:42 +0000
treeherdermozilla-inbound@51b1b076a386 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1211652
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1211652: Add sourcebuffer.mode = sequence mochitest. r=gerald
dom/media/mediasource/test/mochitest.ini
dom/media/mediasource/test/test_Sequence_mp4.html
--- a/dom/media/mediasource/test/mochitest.ini
+++ b/dom/media/mediasource/test/mochitest.ini
@@ -73,16 +73,18 @@ skip-if = ((os == "win" && os_version ==
 skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
 [test_SeekableBeforeEndOfStreamSplit.html]
 [test_SeekableBeforeEndOfStreamSplit_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
 [test_SeekNoData_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
 [test_SeekTwice_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
+[test_Sequence_mp4.html]
+skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
 [test_SetModeThrows.html]
 [test_SplitAppendDelay.html]
 [test_SplitAppendDelay_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
 [test_SplitAppend.html]
 [test_SplitAppend_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+
 [test_TimestampOffset_mp4.html]
new file mode 100644
--- /dev/null
+++ b/dom/media/mediasource/test/test_Sequence_mp4.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=windows-1252">
+  <title>MSE: Don't get stuck buffering for too long when we have frames to show</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();
+
+var receivedSourceOpen = false;
+runWithMSE(function(ms, v) {
+  ms.addEventListener("sourceopen", function() {
+    ok(true, "Receive a sourceopen event");
+    ok(!receivedSourceOpen, "Should only receive one sourceopen for this test");
+    receivedSourceOpen = true;
+    var sb = ms.addSourceBuffer("video/mp4");
+    ok(sb, "Create a SourceBuffer");
+    sb.addEventListener('error', (e) => { ok(false, "Got Error: " + e); SimpleTest.finish(); });
+    sb.mode = 'sequence';
+
+    fetchAndLoad(sb, 'bipbop/bipbop', ['init'], '.mp4')
+    .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop', ['2'], '.m4s'))
+    .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop', ['5'], '.m4s'))
+    .then(function() {
+        is(v.buffered.length, 1, "Continuous buffered range");
+        is(v.buffered.start(0), 0, "Buffered range starts at 0");
+        ok(sb.timestampOffset < 0, "SourceBuffer.timestampOffset set to allow continuous range");
+        SimpleTest.finish();
+      });
+  });
+});
+</script>
+</pre>
+</body>
+</html>