Bug 1298307 - Change the cue's startTime/endTime to avoid the videoframe was not created. r=alwu

Because the nsVideoFrame's creation is not synchronous to "append to dom tree", there is a small gap
that the TextTrackManager wants to render cue but no frame. Change the testcase to not hit the period.

MozReview-Commit-ID: 9xhMjRJnoDR
This commit is contained in:
bechen 2017-06-05 17:24:20 +08:00
Родитель a2e96d0054
Коммит d6f6f61eed
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -48,6 +48,10 @@ function runTest() {
checkCueEvents();
}
video.onloadedmetadata = function () {
ok(video.duration > 2, "video.duration should larger than 2");
}
info("--- create the type of track ---");
isnot(window.TextTrack, undefined, "TextTrack should be defined.");
@ -59,7 +63,7 @@ function runTest() {
isnot(window.TextTrackCue, undefined, "TextTrackCue should be defined.");
isnot(window.VTTCue, undefined, "VTTCue should be defined.");
var cue = new VTTCue(0, 1, "Test cue");
var cue = new VTTCue(1, 2, "Test cue");
ok(cue instanceof TextTrackCue, "Cue should be an instanceof TextTrackCue.");
ok(cue instanceof VTTCue, "Cue should be an instanceof VTTCue.");
@ -76,7 +80,7 @@ function runTest() {
if (cueChrome.getActive) {
checkCueDisplayState(cue, true /* has display-state */);
} else {
ok(false, "The cue start time is 0, should be always active!?");
info("This is a missing cue, video.currentTime is "+ video.currentTime);
}
cue.onexit = function () {