Bug 1427934. P3 - check v.ended before calling callSeekToNextFrame(). r=kaku
authorJW Wang <jwwang@mozilla.com>
Thu, 04 Jan 2018 11:25:51 +0800
changeset 449577 f9d423919e3fe6e34eaff1b4603398e66eaa594e
parent 449576 7dc54aff9e7e3ba29ed7b25e2a5f67e13644e950
child 449578 cdc7b763df3b1db35197597a991ee0248cff9c85
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1427934
milestone59.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 1427934. P3 - check v.ended before calling callSeekToNextFrame(). r=kaku v.ended is set to true before the 'ended' event is fired. Then we can simplify the code by asserting seekToNextFrame() should never be rejected. MozReview-Commit-ID: 5fB2QuboU0I
dom/media/test/test_seekToNextFrame.html
--- a/dom/media/test/test_seekToNextFrame.html
+++ b/dom/media/test/test_seekToNextFrame.html
@@ -31,26 +31,22 @@ function startTest(test, token) {
 
   function callSeekToNextFrame() {
     v.seekToNextFrame().then(
       () => {
         if (!v.seenSeeking) {
           ok(false, v.token + ": Should have already received seeking event.");
         }
         v.seenSeeking = false;
-        if (!v.seenEnded)
+        if (!v.ended) {
           callSeekToNextFrame();
+        }
       },
       () => {
-        // When seek reaches the end, the promise is resolved before 'ended'
-        // is fired. The resolver calls callSeekToNextFrame() to schedule
-        // another seek and then the 'ended' handler calls finish() to shut
-        // down the MediaDecoder which will reject the seek promise. So we don't
-        // raise an error in this case.
-        ok(v.finished, "seekToNextFrame() failed.");
+        ok(false, v.token + ": seekToNextFrame() failed.");
       }
     );
   }
 
   var onLoadedmetadata = function(test, v) { return function() {
     callSeekToNextFrame();
   }}(test, v);