summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webvtt/parsing/file-parsing/support/timings-negative.test
blob: 2cded0092993eaf8fc650b13195f68ac5de5f06e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
timings, negative
<link rel="help" href="https://w3c.github.io/webvtt/#collect-a-webvtt-timestamp">

assert_equals(cues.length, 4);

[
    [0, 0],
    [1, 0.999],
    [60, 59.999],
    [3600, 3599.999],
].forEach(function(pair, index) {
    var startTime = pair[0];
    var endTime = pair[1];

    assert_equals(cues[index].text, 'text' + index, 'Failed with cue ' + index);
    assert_equals(cues[index].startTime, startTime, 'Failed with cue ' + index);
    assert_equals(cues[index].endTime, endTime, 'Failed with cue ' + index);
});

===
WEBVTT

00:00:00.000 --> 00:00:00.000
text0

00:00:01.000 --> 00:00:00.999
text1

00:01:00.000 --> 00:00:59.999
text2

01:00:00.000 --> 00:59:59.999
text3