bf96da72235aa4a35115f15ca2fb94510e9d7dbe
[WebKit-https.git] / LayoutTests / media / modern-media-controls / time-label / time-label-white-space-nowrap.html
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test-pre.js"></script>
3 <body>
4 <video src="../../content/test.mp4" style="position: absolute; left: 0; top: 0; width: 800px;" controls autoplay></video>
5 <script type="text/javascript">
6
7 window.jsTestIsAsync = true;
8
9 description("Testing that time labels inside media controls have 'white-space: nowrap'.");
10
11 let timeLabel;
12
13 document.querySelector("video").addEventListener("play", (event) => {
14     const media = event.target;
15     media.pause();
16
17     timeLabel = window.internals.shadowRoot(media).querySelector(".time-label");
18     shouldBeEqualToString("timeLabel.ownerDocument.defaultView.getComputedStyle(timeLabel).whiteSpace", "nowrap");
19
20     debug("");
21     media.remove();
22     finishJSTest();
23 });
24
25 </script>
26 <script src="../../../resources/js-test-post.js"></script>
27 </body>