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

--HG--
extra : rebase_source : f9d423919e3fe6e34eaff1b4603398e66eaa594e
This commit is contained in:
JW Wang 2018-01-04 11:25:51 +08:00
Родитель a9eabe67be
Коммит 22c8322d40
1 изменённых файлов: 3 добавлений и 7 удалений

Просмотреть файл

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