blob: b33def2dd173147cd6256d4dfd90b4e77ebaeff4 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=../video-test.js></script>
<script>
function trackLoaded()
{
consoleWrite("Test that cues with negative startTime are not added:");
testExpected("testTrack.track.cues.length", 4);
run("textCue = new VTTCue(-3439332606, 3.4, 'Sausage?')");
run("testTrack.track.addCue(textCue)");
testExpected("testTrack.track.cues.length", 4);
consoleWrite("<br>Test that cues with negative startTime and negative endTime are not added:");
testExpected("testTrack.track.cues.length", 4);
run("textCue = new VTTCue(-110, -3.4, 'Pepperoni?')");
run("testTrack.track.addCue(textCue)");
testExpected("testTrack.track.cues.length", 4);
consoleWrite("<br>Test that setting startTime and endTime to negative values does not affect the value:");
testExpected("testTrack.track.cues[3].startTime", 121);
run("testTrack.track.cues[3].startTime = -5");
testExpected("testTrack.track.cues[3].startTime", 121);
testExpected("testTrack.track.cues[3].endTime", 361200.5);
run("testTrack.track.cues[3].endTime = -3439332606");
testExpected("testTrack.track.cues[3].endTime", 361200.5);
endTest();
}
setCaptionDisplayMode('Automatic');
</script>
</head>
<body>
<p>Tests negative timestamps.</p>
<video>
<track id="testTrack" src="captions-webvtt/tc013-settings.vtt" onload="trackLoaded()" default>
</video>
</body>
</html>