Bug 1345713 - the seek promise might be rejected because the 'ended' event handler shut down the decoder. r=kaku

MozReview-Commit-ID: JuIXXDOATmu

--HG--
extra : rebase_source : 946d443da920a7a14b23491c956099630f94ad2f
extra : source : 2494048cfbd4f8bb501f025bc119825ffdef20a2
This commit is contained in:
JW Wang 2017-03-09 11:20:05 +08:00
parent 5f0dc8711e
commit 69e03d2bce

View File

@ -38,7 +38,12 @@ function startTest(test, token) {
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.");
}
);
}