blob: 59012dd4cc608159258382b88df27b74b61d80b3 [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
END OF TEST