Bug 1345713 - the seek promise might be rejected because the 'ended' event handler shut down the decoder. r?kaku
MozReview-Commit-ID: JuIXXDOATmu
--- 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);