| <script src="../../../resources/js-test-pre.js"></script> |
| <script src="../resources/media-controls-loader.js" type="text/javascript"></script> |
| <body> |
| <script type="text/javascript"> |
| |
| description("Testing the <code>MediaControls</code> constructor."); |
| |
| const mediaControls = new MediaControls({ layoutTraits: new MacOSLayoutTraits(LayoutTraits.Mode.Inline) }); |
| |
| shouldBeEqualToString("mediaControls.element.localName", "div"); |
| shouldBeEqualToString("mediaControls.element.className", "media-controls"); |
| |
| debug(""); |
| shouldBe("mediaControls.width", "300"); |
| shouldBe("mediaControls.height", "150"); |
| shouldBeType("mediaControls.layoutTraits", "MacOSLayoutTraits"); |
| shouldBeFalse("mediaControls.layoutTraits.isFullscreen"); |
| |
| debug(""); |
| shouldBeType("mediaControls.playPauseButton", "PlayPauseButton"); |
| shouldBeType("mediaControls.airplayButton", "AirplayButton"); |
| shouldBeType("mediaControls.pipButton", "PiPButton"); |
| shouldBeType("mediaControls.fullscreenButton", "FullscreenButton"); |
| shouldBeType("mediaControls.statusLabel", "StatusLabel"); |
| shouldBeType("mediaControls.timeControl", "TimeControl"); |
| shouldBeType("mediaControls.airplayPlacard", "AirplayPlacard"); |
| shouldBeType("mediaControls.invalidPlacard", "InvalidPlacard"); |
| shouldBeType("mediaControls.pipPlacard", "PiPPlacard"); |
| |
| debug(""); |
| shouldBeType("mediaControls.bottomControlsBar", "ControlsBar"); |
| shouldBeEqualToString("mediaControls.bottomControlsBar.element.localName", "div"); |
| shouldBeTrue("mediaControls.bottomControlsBar.element.classList.contains('controls-bar')"); |
| shouldBeTrue("mediaControls.bottomControlsBar.element.classList.contains('bottom')"); |
| |
| debug(""); |
| const mediaControlsWithArguments = new MediaControls({ width: 600, height: 300, layoutTraits: new MacOSLayoutTraits(LayoutTraits.Mode.Inline) }); |
| shouldBe("mediaControlsWithArguments.width", "600"); |
| shouldBe("mediaControlsWithArguments.height", "300"); |
| |
| debug(""); |
| |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |