blob: e8f6a19b922a36c7fa62897db170d81763a339f0 [file] [log] [blame]
Test that we are able to trigger the list of captions, and select from the list.
EVENT(canplaythrough)
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
*** Add another text track.
RUN(video.addTextTrack("captions", "Commentary", "ru"))
*** Turning captions on
There should be 6 items in the menu.
EXPECTED (trackListItems.length == '6') OK
EXPECTED (video.textTracks.length == '4') OK
Track 0 should be showing
EXPECTED (video.textTracks[0].mode == 'showing') OK
Track 1 should be disabled
EXPECTED (video.textTracks[1].mode == 'disabled') OK
Track 2 should be disabled
EXPECTED (video.textTracks[2].mode == 'disabled') OK
Track 3 should be disabled
EXPECTED (video.textTracks[3].mode == 'disabled') OK
EXPECTED (textTrackDisplayElement(video, 'display').innerText == 'Lorem') OK
*** Remove a track.
RUN(video.removeChild(document.querySelectorAll("track")[0]))
*** Turning captions off
There should be 5 items in the menu.
EXPECTED (trackListItems.length == '5') OK
EXPECTED (video.textTracks.length == '3') OK
Track 0 should be disabled
EXPECTED (video.textTracks[0].mode == 'disabled') OK
Track 1 should be disabled
EXPECTED (video.textTracks[1].mode == 'disabled') OK
Track 2 should be disabled
EXPECTED (video.textTracks[2].mode == 'disabled') OK
No text track cue with display id '-webkit-media-text-track-display' is currently visible
END OF TEST