04b5f5aa979771dcee0421d6291fab59fefb773a
[WebKit-https.git] / LayoutTests / media / modern-media-controls / compact-media-controls / compact-media-controls-layout.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 <script type="text/javascript">
6
7 description("Testing the <code>CompactMediaControls</code> layout.");
8
9 const mediaControls = new CompactMediaControls;
10
11 debug("With controls at their default size only the play/pause button is showing with a center style.");
12 shouldBe("mediaControls.children", "[mediaControls.playPauseButton]");
13 shouldBe("mediaControls.playPauseButton.style", "Button.Styles.Center");
14 debug("");
15
16 debug("With controls just under the minimum size to show prominent controls only the play/pause button is showing with a small-center style.");
17 mediaControls.width = MaximumSizeToShowSmallProminentControl - 1;
18 mediaControls.height = MaximumSizeToShowSmallProminentControl - 1;
19 shouldBe("mediaControls.children", "[mediaControls.playPauseButton]");
20 shouldBe("mediaControls.playPauseButton.style", "Button.Styles.SmallCenter");
21 debug("");
22
23 debug("With controls just under the minimum size to show any controls there are no children.");
24 mediaControls.width = MinimumSizeToShowAnyControl - 1;
25 mediaControls.height = MinimumSizeToShowAnyControl - 1;
26 shouldBe("mediaControls.children.length", "0");
27 debug("");
28
29 debug("With controls above the minimum size and the error placard set only the invalid placard is shown.");
30 mediaControls.width = MaximumSizeToShowSmallProminentControl;
31 mediaControls.height = MaximumSizeToShowSmallProminentControl;
32 mediaControls.placard = mediaControls.invalidPlacard;
33 shouldBe("mediaControls.children", "[mediaControls.invalidPlacard]");
34 shouldBe("mediaControls.invalidPlacard.width", "mediaControls.width");
35 shouldBe("mediaControls.invalidPlacard.height", "mediaControls.height");
36 debug("");
37
38 </script>
39 <script src="../../../resources/js-test-post.js"></script>
40 </body>