summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-unsupported-markup.html
blob: ed3107f89b21f976f1d4f971f4d48b6e5df3ac23 (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
36
37
<!DOCTYPE html>
<title>Unsupported markup is properly ignored</title>
<script src="track-helpers.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var getCueAsHTMLContent = function(cue) {
    return cue.getCueAsHTML().textContent;
};

check_cues_from_track("resources/unsupported-markup.vtt", function(track) {
    var expected = [
        {
            innerHTML: getCueAsHTMLContent,
            expected: "Bear is Coming!!!!!\nAnd what kind of a bear it is - just have look."
        },
        {
            innerHTML: getCueAsHTMLContent,
            expected: "\n  I said Bear is coming!!!!\n  I said Bear is still coming!!!!\n",
        },
        {
            innerHTML: getCueAsHTMLContent,
            expected: "\n  I said Bear is coming now!!!!\n  \n  \n",
        }
    ];

    assert_cues_html_content(track.cues, expected);

    var expected_text = [
        { text: "<h1>Bear is Coming!!!!!</h1>\n<p>And what kind of a bear it is - just have <a href=\"webpage.html\">look</a>.</p>" },
        { text: "<ul>\n  <li>I said Bear is coming!!!!</li>\n  <li>I said Bear is still coming!!!!</li>\n</ul>" },
        { text: "<ol>\n  <li>I said Bear is coming now!!!!</li>\n  <li><img src=\"bear.png\" alt=\"mighty bear\"></li>\n  <li><video src=\"bear_ad.webm\" controls></video></li>\n</ol>" }
    ];

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