blob: 38cd87b6b10ea444b2de03200c6819378af8f287 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<body>
<script type="text/javascript">
description("Testing <code>IOSInlineMediaControls</code> and dropping controls.");
window.jsTestIsAsync = true;
const mediaControls = new IOSInlineMediaControls({ width: 680, height: 300 });
mediaControls.shouldUseSingleBarLayout = true;
mediaControls.maximumRightContainerButtonCountOverride = 100; // A finite value larger than anything likely.
// Trigger a layout so that `maximumRightContainerButtonCountOverride` takes effect.
mediaControls.needsLayout = true;
scheduler.flushScheduledLayoutCallbacks();
const droppableControls = [
mediaControls.fullscreenButton,
mediaControls.airplayButton,
mediaControls.muteButton,
mediaControls.skipBackButton,
mediaControls.skipForwardButton,
mediaControls.pipButton,
mediaControls.tracksButton,
];
function ready()
{
return droppableControls.concat(mediaControls.playPauseButton).every(button => button.width > 0);
}
shouldBecomeEqual("ready()", "true", () => {
document.body.appendChild(mediaControls.element);
debug("");
while (droppableControls.length) {
for (let i = droppableControls.length - 1; i >= 0; --i) {
if (!droppableControls[i].visible) {
debug(`${droppableControls[i].constructor.name} was dropped at ${mediaControls.width + 1}.`);
droppableControls.splice(i, 1);
}
}
mediaControls.width--;
}
mediaControls.element.remove();
debug("");
finishJSTest();
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>