Bug 1182946: [MSE] P2. Fix webm mediasource test. r=jya
authorJan Gerber <j@mailb.org>
Fri, 07 Aug 2015 18:57:47 +0200
changeset 256984 fcf7077de8febcbdcac5e1d51ae9fc210f84cb44
parent 256983 99774879342838172f0d5603175828ecc1f3e280
child 256985 fb0a38fa1673af07fcf48ec7a856cd163ff41782
push id14559
push userphilringnalda@gmail.com
push dateSun, 09 Aug 2015 23:41:14 +0000
treeherderfx-team@0e269a1f1beb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1182946, 25523, 25223
milestone42.0a1
Bug 1182946: [MSE] P2. Fix webm mediasource test. r=jya End of first media segment is 25523, not 25223
dom/media/mediasource/test/test_BufferingWait.html
dom/media/mediasource/test/test_SeekableAfterEndOfStreamSplit.html
dom/media/mediasource/test/test_SeekableBeforeEndOfStreamSplit.html
--- a/dom/media/mediasource/test/test_BufferingWait.html
+++ b/dom/media/mediasource/test/test_BufferingWait.html
@@ -31,18 +31,18 @@ runWithMSE(function(ms, v) {
           }
         });
       });
     }
 
     fetchWithXHR("seek.webm", function(arrayBuffer) {
       sb.addEventListener('error', (e) => { ok(false, "Got Error: " + e); SimpleTest.finish(); });
       loadSegment.bind(null, sb, new Uint8Array(arrayBuffer, 0, 318))().then(
-      loadSegment.bind(null, sb, new Uint8Array(arrayBuffer, 318, 25223-318))).then(
-      loadSegment.bind(null, sb, new Uint8Array(arrayBuffer, 25223, 46712-25223))).then(
+      loadSegment.bind(null, sb, new Uint8Array(arrayBuffer, 318, 25523-318))).then(
+      loadSegment.bind(null, sb, new Uint8Array(arrayBuffer, 25523, 46712-25523))).then(
       /* Note - Missing |46712, 67833 - 46712| segment here corresponding to (0.8, 1.2] */
       /* Note - Missing |67833, 88966 - 67833| segment here corresponding to (1.2, 1.6]  */
       loadSegment.bind(null, sb, new Uint8Array(arrayBuffer, 88966))).then(function() {
         var promise = waitUntilTime(0.7);
         info("Playing video. It should play for a bit, then fire 'waiting'");
         v.play();
         return promise;
       }).then(function() {
--- a/dom/media/mediasource/test/test_SeekableAfterEndOfStreamSplit.html
+++ b/dom/media/mediasource/test/test_SeekableAfterEndOfStreamSplit.html
@@ -12,22 +12,24 @@
 
 SimpleTest.waitForExplicitFinish();
 
 runWithMSE(function (ms, v) {
   ms.addEventListener("sourceopen", function () {
     var sb = ms.addSourceBuffer("video/webm");
 
     fetchWithXHR("seek.webm", function (arrayBuffer) {
-      sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 25223));
+      // 25523 is the offset of the first media segment's end
+      sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 25523));
       var updateCount = 0;
       sb.addEventListener("updateend", function () {
         updateCount++;
         if (updateCount == 1) {
-          sb.appendBuffer(new Uint8Array(arrayBuffer, 25223));
+          // 25523 is the offset of the first media segment's end
+          sb.appendBuffer(new Uint8Array(arrayBuffer, 25523));
         }
         else if (updateCount == 2) {
           ms.endOfStream();
         }
       });
     });
 
     var target = 2;
--- a/dom/media/mediasource/test/test_SeekableBeforeEndOfStreamSplit.html
+++ b/dom/media/mediasource/test/test_SeekableBeforeEndOfStreamSplit.html
@@ -12,20 +12,20 @@
 
 SimpleTest.waitForExplicitFinish();
 
 runWithMSE(function (ms, v) {
   ms.addEventListener("sourceopen", function () {
     var sb = ms.addSourceBuffer("video/webm");
 
     fetchWithXHR("seek.webm", function (arrayBuffer) {
-      sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 25223));
+      sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 25523));
       sb.addEventListener("updateend", function () {
         sb.removeEventListener('updateend', arguments.callee);
-        sb.appendBuffer(new Uint8Array(arrayBuffer, 25223));
+        sb.appendBuffer(new Uint8Array(arrayBuffer, 25523));
       });
     });
 
     var target = 2;
 
     v.addEventListener("loadedmetadata", function () {
       ok(v.seekable.length, "Resource is seekable");
       ok(v.seekable.length &&