Bug 1345713 - the seek promise might be rejected because the 'ended' event handler shut down the decoder. r=kaku
authorJW Wang <jwwang@mozilla.com>
Thu, 09 Mar 2017 11:20:05 +0800
changeset 346886 c2d92403096ac66f730998f9f02b4623d5be794b
parent 346885 a45b9c12228379e78b8399c7e9d7126ff8ac3ca7
child 346887 b17b5fdb4ae7fb56a771079d683994b9e2444246
push id31480
push usercbook@mozilla.com
push dateFri, 10 Mar 2017 10:37:06 +0000
treeherdermozilla-central@e18d3dd20e8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1345713
milestone55.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 1345713 - the seek promise might be rejected because the 'ended' event handler shut down the decoder. r=kaku MozReview-Commit-ID: JuIXXDOATmu
dom/media/test/test_seekToNextFrame.html
--- a/dom/media/test/test_seekToNextFrame.html
+++ b/dom/media/test/test_seekToNextFrame.html
@@ -33,17 +33,22 @@ function startTest(test, token) {
     v.seekToNextFrame().then(
       () => {
         ok(v.seenSeeking, "Should have already received seeking event.")
         v.seenSeeking = false;
         if (!v.seenEnded)
           callSeekToNextFrame();
       },
       () => {
-        ok(false, "seekToNextFrame() failed.");
+        // 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.");
       }
     );
   }
 
   var onLoadedmetadata = function(test, v) { return function() {
     callSeekToNextFrame();
   }}(test, v);