[Modern Media Controls] Controls are not visible in fullscreen without the controls...
[WebKit-https.git] / LayoutTests / media / modern-media-controls / controls-visibility-support / controls-visibility-support-fullscreen-on-parent-element.html
1 <script src="../../../resources/js-test-pre.js"></script>
2 <script src="../resources/media-controls-loader.js" type="text/javascript"></script>
3 <script src="../resources/media-controls-utils.js" type="text/javascript"></script>
4 <body>
5 <video src="../../content/test.mp4" autoplay></video>
6 <div id="host"></div>
7 <script type="text/javascript">
8
9 window.jsTestIsAsync = true;
10
11 description("Testing that control are not shown when a parent element is fullscreen and the controls attribute is not present.");
12
13 const container = document.querySelector("div#host");
14 const media = document.querySelector("video");
15 const mediaController = createControls(container, media, null);
16
17 media.addEventListener("play", () => {
18     document.documentElement.addEventListener("webkitfullscreenchange", () => {
19         shouldBe("document.webkitFullscreenElement", "document.documentElement");
20         shouldBeFalse("media.webkitDisplayingFullscreen");
21         shouldBeFalse("mediaController.controls.controlsBar.visible");
22         button.remove();
23         container.remove();
24         media.remove();
25         finishJSTest();
26     });
27
28     const button = document.body.appendChild(document.createElement("button"));
29     button.addEventListener("click", () => document.documentElement.webkitRequestFullscreen());
30     pressOnElement(button);
31 });
32
33 </script>
34 <script src="../../../resources/js-test-post.js"></script>
35 </body>