blob: a4b7a7c28d788b1855baab989d7ad7221d88cd7d [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ ModernMediaControlsEnabled=false ] -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=../trackmenu-test.js></script>
<script src=../video-test.js></script>
<script>
function testTracks()
{
consoleWrite(`<br><i>** Forced tracks should be in .textTracks as well as in the menu`);
testExpected("video.textTracks.length", 11);
consoleWrite("<br><i>** No track should be enabled by default<" + "/i>");
testExpected("video.textTracks[0].language", "en");
testExpected("video.textTracks[0].kind", "subtitles");
testExpected("video.textTracks[0].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[1].language", "en");
testExpected("video.textTracks[1].kind", "forced");
testExpected("video.textTracks[1].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[2].language", "fr");
testExpected("video.textTracks[2].kind", "subtitles");
testExpected("video.textTracks[2].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[3].language", "fr");
testExpected("video.textTracks[3].kind", "forced");
testExpected("video.textTracks[3].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[4].language", "es");
testExpected("video.textTracks[4].kind", "subtitles");
testExpected("video.textTracks[4].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[5].language", "es");
testExpected("video.textTracks[5].kind", "forced");
testExpected("video.textTracks[5].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[6].language", "de");
testExpected("video.textTracks[6].kind", "subtitles");
testExpected("video.textTracks[6].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[7].language", "de");
testExpected("video.textTracks[7].kind", "forced");
testExpected("video.textTracks[7].mode", "disabled");
consoleWrite("");
testExpected("video.textTracks[8].language", "en");
testExpected("video.textTracks[8].kind", "captions");
testExpected("video.textTracks[8].mode", "disabled");
consoleWrite("");
endTest();
}
function setup()
{
findMediaElement();
run("internals.setUserPreferredLanguages(['en'])");
run("internals.setPrimaryAudioTrackLanguageOverride('fr')");
run("internals.setCaptionDisplayMode('manual')");
video.src = '../content/CC+Subtitles.mov';
waitForEvent('canplaythrough', testTracks);
}
</script>
</head>
<body onload="setup()">
<p>Tests 'manual' caption mode.</p>
<video width="640" height="360" controls>
</video>
</body>
</html>