blob: 58afe6108bfeb7a220c2429ab09bae3d5e9e3dd7 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=../media-file.js></script>
<script src=../video-test.js></script>
<script>
var trackCount = 0;
function addTrack(type)
{
run("video.addTextTrack('" + type + "')");
testExpected("video.textTracks.length", ++trackCount);
}
function start()
{
findMediaElement();
consoleWrite("<em>++ Test invalid 'kind'.</em>");
testExpected("video.textTracks.length", 0);
testException("video.addTextTrack('kaptions')", "'TypeError: Type error'");
testExpected("video.textTracks.length", 0);
consoleWrite("");
consoleWrite("<em>++ Test all valid 'kind' keywords.</em>");
addTrack("subtitles");
addTrack("captions");
addTrack("descriptions");
addTrack("chapters");
addTrack("metadata");
consoleWrite("");
endTest();
}
</script>
</head>
<body onload="start()">
<p>Tests that the addTextTrack() only accepts known 'kind' values.</p>
<video>
</video>
</body>
</html>