[Modern Media Controls] UI Library: StatusLabel
[WebKit-https.git] / LayoutTests / media / modern-media-controls / media-controls / media-controls-constructor.html
1 <script src="../../../resources/js-test-pre.js"></script>
2 <script src="../resources/media-controls-loader.js" type="text/javascript"></script>
3 <body>
4 <script type="text/javascript">
5
6 description("Testing the <code>MediaControls</code> constructor.");
7
8 const mediaControls = new MediaControls({ layoutTraits: LayoutTraits.macOS });
9
10 shouldBeEqualToString("mediaControls.element.localName", "div");
11 shouldBeEqualToString("mediaControls.element.className", "media-controls");
12
13 debug("");
14 shouldBe("mediaControls.width", "300");
15 shouldBe("mediaControls.height", "150");
16 shouldBe("mediaControls.layoutTraits", "LayoutTraits.macOS");
17 shouldBeFalse("mediaControls.showsStartButton");
18
19 debug("");
20 shouldBeTrue("mediaControls.startButton instanceof StartButton");
21 shouldBeTrue("mediaControls.playPauseButton instanceof PlayPauseButton");
22 shouldBeTrue("mediaControls.skipBackButton instanceof SkipBackButton");
23 shouldBeTrue("mediaControls.airplayButton instanceof AirplayButton");
24 shouldBeTrue("mediaControls.pipButton instanceof PiPButton");
25 shouldBeTrue("mediaControls.fullscreenButton instanceof FullscreenButton");
26 shouldBeTrue("mediaControls.statusLabel instanceof StatusLabel");
27 shouldBeTrue("mediaControls.timeControl instanceof TimeControl");
28 shouldBeTrue("mediaControls.airplayPlacard instanceof AirplayPlacard");
29 shouldBeTrue("mediaControls.pipPlacard instanceof PiPPlacard");
30
31 debug("");
32 shouldBeTrue("mediaControls.controlsBar instanceof LayoutItem");
33 shouldBeEqualToString("mediaControls.controlsBar.element.localName", "div");
34 shouldBeEqualToString("mediaControls.controlsBar.element.className", "controls-bar");
35
36 debug("");
37 const mediaControlsWithArguments = new MediaControls({ width: 600, height: 300, layoutTraits: LayoutTraits.macOS });
38 shouldBe("mediaControlsWithArguments.width", "600");
39 shouldBe("mediaControlsWithArguments.height", "300");
40
41 debug("");
42
43 </script>
44 <script src="../../../resources/js-test-post.js"></script>
45 </body>