Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-header-comment.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Optional comment area under the "WEBVTT" file header is properly ignored and also, default settings and styling are currently ignored (treated as faulty cues)</title>
<script src="track-helpers.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<video>
<track src="resources/default-styles.vtt">
<track src="resources/metadata-area.vtt">
</video>
<script>
async_test(function(t) {
var video = document.querySelector("video");
var trackElements = document.querySelectorAll("track");
for (var i = 0; i < video.textTracks.length; i++)
trackElements[i].onload = t.step_func(trackLoaded);
enableAllTextTracks(video.textTracks);
var numberOfTracksLoaded = 0;
function trackLoaded() {
numberOfTracksLoaded++;
if (numberOfTracksLoaded != 2)
return;
testTrack(0);
testTrack(1);
t.done();
}
function testTrack(index) {
var expected = [
{
id : "1",
startTime : 0,
endTime : 30.5,
text : "Bear is Coming!!!!!"
},
{
id : "2",
startTime : 31,
endTime : 1200.5,
text : "I said Bear is coming!!!!"
}
];
assert_cues_equal(video.textTracks[index].cues, expected);
}
});
</script>