2 <title>Element#requestFullscreen() on the current fullscreen element
</title>
3 <script src=
"/resources/testharness.js"></script>
4 <script src=
"/resources/testharnessreport.js"></script>
5 <script src=
"/resources/testdriver.js"></script>
6 <script src=
"/resources/testdriver-vendor.js"></script>
9 promise_test(async (t
) => {
11 if (document
.fullscreenElement
) return document
.exitFullscreen();
14 // Use the body element as the fullscreen element, because the second
15 // test_driver.bless() call needs to insert a button inside of it, which
16 // can't be clicked if another element is already fullscreen.
17 const target
= document
.body
;
19 // First enter fullscreen.
20 await test_driver
.bless("fullscreen", () => target
.requestFullscreen());
21 assert_equals(document
.fullscreenElement
, target
, "fullscreen element after first request");
23 // Now request fullscreen again, which should be a no-op.
24 await test_driver
.bless("fullscreen", () => target
.requestFullscreen());
25 assert_equals(document
.fullscreenElement
, target
, "fullscreen element after second request");