summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-positioning.html
blob: d14a5768d3af29e9e20a4901c6aebf27f10a4d1d (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
34
35
<!DOCTYPE html>
<title>Cue text position from settings</title>
<script src="track-helpers.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
check_cues_from_track("resources/positioning.vtt", testTrack);
check_cues_from_track("resources/positioning-ltr.vtt", testTrack);

check_cues_from_track("resources/positioning-bad.vtt", function(track) {
    var expected = [
        { position: "auto" },
        { position: "auto" },
        { position: "auto" },
        { position: "auto" },
        { position: "auto" },
        { position: "auto" },
        { position: "auto" },
        { position: "auto" }
    ];

    assert_cues_match(track.cues, expected);
});

function testTrack(track) {
    var expected = [
        { position: 0 },
        { position: 50 },
        { position: "auto" },
        { position: 100 }
    ];

    assert_cues_match(track.cues, expected);
}
</script>