blob: 76f0ec13baaf99d56d3b033e4ba12e058f4f2930 [file] [log] [blame]
Test that enabling a track with .webkitClosedCaptionsVisible succeeds when in "automatic" mode.
** Setup
RUN(internals.setCaptionDisplayMode('Automatic'))
RUN(trackElement = document.createElement('track'))
RUN(trackElement.kind = 'captions')
RUN(trackElement.src = 'captions-webvtt/tc004-webvtt-file.vtt')
RUN(video.appendChild(trackElement))
EVENT(canplaythrough)
** Test initial state
EXPECTED (video.textTracks.length == '1') OK
EXPECTED (video.textTracks[0].mode == 'disabled') OK
** Enable cues, allow them to load
RUN(video.webkitClosedCaptionsVisible = true)
EVENT(load)
EXPECTED (track.readyState == '2') OK
RUN(video.currentTime = 0.5)
EVENT(seeked)
** Check to make sure captions are displaying
EXPECTED (video.textTracks[0].cues != 'null') OK
EXPECTED (textTrackDisplayElement(video, 'cue').textContent != 'null') OK
END OF TEST