summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fullscreen/api/document-onfullscreenchange.html
blob: 10503c6ccb0eaf9c261937da15f9081853ac1bcc (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
<!DOCTYPE html>
<title>Document#onfullscreenchange</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>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<script>
    promise_test(async (t) => {
        const div = document.querySelector("div");
        assert_equals(
            document.onfullscreenchange,
            null,
            "initial onfullscreenchange"
        );
        const [, event] = await Promise.all([
            trusted_request(div),
            new Promise((r) =>
                document.addEventListener("fullscreenchange", r)
            ),
        ]);
        assert_true(event instanceof Event);
        assert_equals(event.target, div);
    }, "Checks that the fullscreenchange event is fired when entering fullscreen");
</script>