From d6f6f61eedde9738f7dadacdd45fc9596694ff53 Mon Sep 17 00:00:00 2001 From: bechen Date: Mon, 5 Jun 2017 17:24:20 +0800 Subject: [PATCH] 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 --- dom/media/test/test_webvtt_empty_displaystate.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dom/media/test/test_webvtt_empty_displaystate.html b/dom/media/test/test_webvtt_empty_displaystate.html index 42c8008dcc93..3572daafd758 100644 --- a/dom/media/test/test_webvtt_empty_displaystate.html +++ b/dom/media/test/test_webvtt_empty_displaystate.html @@ -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 () {