<!doctype html>
<!-- DO NOT EDIT! This file and support/timings-omitted-hours.vtt are generated. -->
<!-- See /webvtt/parsing/file-parsing/README.md -->
<meta charset=utf-8>
<title>WebVTT parser test: timings, omitted hours</title>
<link rel="help" href="https://w3c.github.io/webvtt/#collect-a-webvtt-timestamp">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
var t = async_test('timings, omitted hours');
t.step(function(){
    var video = document.createElement('video');
    var track = document.createElement('track');
    assert_true('src' in track, 'track element not supported');
    track.src = 'support/timings-omitted-hours.vtt';
    track['default'] = true;
    track.kind = 'subtitles';
    track.onload = this.step_func(trackLoaded);
    track.onerror = this.step_func(trackError);
    video.appendChild(track);
    document.body.appendChild(video);
});

function trackLoaded(event) {
    var track = event.target;
    var video = track.parentNode;
    var cues = video.textTracks[0].cues;
    {
assert_equals(cues.length, 3);

Array.from(cues).forEach(function(cue, index) {
    assert_equals(cue.text, 'text' + index, 'Failed with cue ' + index);
    assert_equals(cue.startTime, 0, 'Failed with cue ' + index);
    assert_equals(cue.endTime, 1, 'Failed with cue ' + index);
});

    }
    this.done();
}

function trackError(e) {
    assert_unreached('got unexpected error event');
}
</script>
