summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fullscreen/api/element-request-fullscreen-dialog.html
blob: ee5e21306a8724a1487270424f1948e96624706f (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
<!DOCTYPE html>
<title>Element#requestFullscreen() for dialog element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<dialog></dialog>
<script>
    promise_test(async (t) => {
        const dialog = document.querySelector("dialog");
        assert_true(dialog instanceof HTMLDialogElement);
        document.onfullscreenchange = t.unreached_func(
            "fullscreenchange event"
        );
        const errorEventPromise = new Promise(
            (resolve) => (document.onfullscreenerror = resolve)
        );
        Promise.all([
            promise_rejects_js(t, TypeError, dialog.requestFullscreen()),
            errorEventPromise,
        ]);
    });
</script>