blob: ba591e07a0445caa0e05f470311b9eddc98c9eb5 [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 numberOfTrackTests = 2;
function trackLoaded()
{
numberOfTracksLoaded++;
if (numberOfTracksLoaded == numberOfTrackTests) {
testTrack(0);
testTrackError(1);
}
}
function testTrack(i)
{
findMediaElement();
var expected =
{
length : 5,
tests:
[
{
property : "align",
values : ["start", "start", "center", "end", "center"],
},
{
property : "position",
values : [10, 'auto', 80.3, 30, 60],
precision : 2,
},
{
property : "line",
values : [0, 0, 80.08, 5, -3],
precision : 2,
},
{
property : "snapToLines",
values : [false, true, false, true, true],
},
],
};
testCues(i, expected);
allTestsEnded();
}
function testTrackError(i)
{
findMediaElement();
var expected =
{
length : 3,
tests:
[
{
property : "align",
values : ["center", "end", "center"],
},
{
property : "position",
values : ['auto', 0, 60],
},
{
property : "line",
values : ['auto', 'auto', -3],
},
{
property : "snapToLines",
values : [true, true, true],
},
],
};
testCues(i, expected);
allTestsEnded();
}
</script>
</head>
<body onload="enableAllTextTracks()">
<p>Tests cue alignment, line and text position from settings.</p>
<video>
<track src="captions-webvtt/tc018-align-text-line-position.vtt" onload="trackLoaded()">
<track src="captions-webvtt/tc018-align-text-line-position-bad.vtt" onload="trackLoaded()">
</video>
</body>
</html>