blob: e359e1f9856b98104504c4cbdf05a33729987806 [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 : 7,
tests:
[
{
property : "getCueAsHTML().textContent",
values : [
"This cue has an ampersand character: \u0026",
"This cue has a less than character: \u003C",
"This cue has a greater than character: \u003E",
"This cue has a right-to-left mark (RLM): \u200f",
"This cue has a left-to-right mark (LRM): \u200e",
"This cue has a non-breakable space (NBSP): \u00a0",
"This & is parsed to the same as &."
],
},
],
};
testCues(i, expected);
allTestsEnded();
}
function testTrackError(i)
{
findMediaElement();
var expected =
{
length : 2,
tests:
[
{
property : "getCueAsHTML().textContent",
values : ["This cue has a less than ",
"This cue has a greater than > character.\nSince it's not related to a < character,\nit's just interpreted as text."],
},
],
};
testCues(i, expected);
allTestsEnded();
}
</script>
</head>
<body onload="enableAllTextTracks()">
<p>Tests special characters &amp;, &lt;, and &gt; in the cue text.</p>
<video>
<track src="captions-webvtt/tc022-entities.vtt" onload="trackLoaded()">
<track src="captions-webvtt/tc022-entities-wrong.vtt" onload="trackLoaded()">
</video>
</body>
</html>