summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fullscreen/api/promises-reject.html
blob: 4385b1646d65128d053c8dcded532997c8ed0557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<title>Promises#reject</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
    promise_test(async (t) => {
        const e = document.createElement("span");
        await promise_rejects_js(
            t,
            TypeError,
            e.requestFullscreen(),
            "Rejects if the element is not connected"
        );
        await promise_rejects_js(
            t,
            TypeError,
            document.exitFullscreen(),
            "Not in fullscreen"
        );
    }, "Rejects if the element is not connected");
</script>