summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
blob: 3aecb4e1eb37246bb043fdf599f0b9ecb03e2005 (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
<!DOCTYPE HTML>
<html>
<head>
    <title>HTML5 Media Elements: An empty src should not crash the player.</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <link rel="author" title="Alicia Boya García" href="mailto:aboya@igalia.com"/>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
    function makeCrashTest(src) {
        async_test((test) => {
            const video = document.createElement("video");
            video.src = src;
            video.controls = true;
            video.addEventListener("error", () => {
                document.body.removeChild(video);
                test.done();
            });
            document.body.appendChild(video);
        }, `src="${src}" does not crash.`);
    }

    makeCrashTest("about:blank");
    makeCrashTest("");
</script>
</body>
</html>