blob: 358dd51616ea26a297536a931a9c43ec8d061979 [file] [log] [blame]
Tests that forced subtitles are enable automatically.
RUN(internals.settings.setShouldDisplayTrackKind('Captions', false))
RUN(internals.settings.setShouldDisplayTrackKind('Subtitles', true))
RUN(internals.setUserPreferredLanguages(['en']))
RUN(internals.setPrimaryAudioTrackLanguageOverride('fr'))
RUN(internals.setCaptionDisplayMode('ForcedOnly'))
EVENT(canplaythrough)
** Forced tracks should be in .textTracks, but not in the menu
EXPECTED (video.textTracks.length == '11') OK
** Only the 'fr' forced track should be showing
EXPECTED (video.textTracks[0].language == 'en') OK
EXPECTED (video.textTracks[0].kind == 'subtitles') OK
EXPECTED (video.textTracks[0].mode == 'disabled') OK
EXPECTED (video.textTracks[1].language == 'en') OK
EXPECTED (video.textTracks[1].kind == 'forced') OK
EXPECTED (video.textTracks[1].mode == 'disabled') OK
EXPECTED (video.textTracks[2].language == 'fr') OK
EXPECTED (video.textTracks[2].kind == 'subtitles') OK
EXPECTED (video.textTracks[2].mode == 'disabled') OK
EXPECTED (video.textTracks[3].language == 'fr') OK
EXPECTED (video.textTracks[3].kind == 'forced') OK
EXPECTED (video.textTracks[3].mode == 'showing') OK
EXPECTED (video.textTracks[4].language == 'es') OK
EXPECTED (video.textTracks[4].kind == 'subtitles') OK
EXPECTED (video.textTracks[4].mode == 'disabled') OK
EXPECTED (video.textTracks[5].language == 'es') OK
EXPECTED (video.textTracks[5].kind == 'forced') OK
EXPECTED (video.textTracks[5].mode == 'disabled') OK
EXPECTED (video.textTracks[6].language == 'de') OK
EXPECTED (video.textTracks[6].kind == 'subtitles') OK
EXPECTED (video.textTracks[6].mode == 'disabled') OK
EXPECTED (video.textTracks[7].language == 'de') OK
EXPECTED (video.textTracks[7].kind == 'forced') OK
EXPECTED (video.textTracks[7].mode == 'disabled') OK
EXPECTED (video.textTracks[8].language == 'en') OK
EXPECTED (video.textTracks[8].kind == 'captions') OK
EXPECTED (video.textTracks[8].mode == 'disabled') OK
EXPECTED (video.textTracks[9].language == 'es') OK
EXPECTED (video.textTracks[9].kind == 'chapters') OK
EXPECTED (video.textTracks[9].mode == 'hidden') OK
EXPECTED (video.textTracks[10].language == 'en') OK
EXPECTED (video.textTracks[10].kind == 'chapters') OK
EXPECTED (video.textTracks[10].mode == 'hidden') OK
** A cue should become active when current time is within its active range
RUN(video.currentTime = 9.5)
EVENT(seeked)
EVENT(cuechange)
EXPECTED (video.textTracks[3].activeCues.length === 1 == 'true') OK
END OF TEST