Bug 1298043 - Cherry-pick rev 9f514918f33580ea6c4f9d765aca0f8d6476eec0 from bug 1293613 to hopefully fix timeouts in mediasource-play-then-seek-back.html. a=test-only
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 11 Aug 2016 15:17:34 +1000
changeset 350075 6ea5133aab19860080b3d8b2221c2d5b5c17a465
parent 350074 99c0c53f5ea3ca670d75e420d165de97e60d6db1
child 350076 fde69933d9cc084bd7bcc70d7304b8ca032b67d8
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1298043, 1293613
milestone50.0a2
Bug 1298043 - Cherry-pick rev 9f514918f33580ea6c4f9d765aca0f8d6476eec0 from bug 1293613 to hopefully fix timeouts in mediasource-play-then-seek-back.html. a=test-only
testing/web-platform/tests/media-source/mediasource-util.js
--- a/testing/web-platform/tests/media-source/mediasource-util.js
+++ b/testing/web-platform/tests/media-source/mediasource-util.js
@@ -295,17 +295,20 @@
         mediaElement.addEventListener(eventName, onEvent);
 
         var i = startingIndex;
         var onAppendDone = function() {
             if (eventFired)
                 return;
 
             i++;
-            MediaSourceUtil.append(test, sourceBuffer, MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[i]), onAppendDone);
+            if (i < segmentInfo.media.length)
+            {
+                MediaSourceUtil.append(test, sourceBuffer, MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[i]), onAppendDone);
+            }
         };
         MediaSourceUtil.append(test, sourceBuffer, MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[i]), onAppendDone);
 
     };
 
     function addExtraTestMethods(test)
     {
         test.eventExpectations_ = new EventExpectationsManager(test);