blob: e3c6b13c09356bc1e355915599883241ee71891b [file] [log] [blame]
<!DOCTYPE html>
<title>Ensure overflow menu buttons are hidden when resizing.</title>
<style>
#content {
width: 1000px;
height: 1000px;
}
</style>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="media-controls.js"></script>
<script src="media-file.js"></script>
<script src="overflow-menu.js"></script>
<!--Padding ensures the overflow menu is visible for the tests. -->
<body style="padding-top: 200px; padding-left: 100px">
<video controls></video>
<script>
async_test(function(t) {
if (window.testRunner)
testRunner.useUnfortunateSynchronousResizeMode();
// Set up video
var video = document.querySelector("video");
video.src = findMediaFile("video", "content/test");
video.setAttribute("width", "60");
// Add captions
var track = video.addTextTrack("captions");
// Pretend we have a cast device
internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true);
video.onloadeddata = t.step_func(function() {
var overflowList = getOverflowList(video);
var overflowMenu = getOverflowMenuButton(video);
// Clicking on the overflow menu button should make the overflow list visible
var coords = elementCoordinates(overflowMenu);
clickAtCoordinates(coords[0], coords[1]);
assert_not_equals(getComputedStyle(overflowList).display, "none");
// Resizing should hide the overflow list.
window.onresize = t.step_func_done(_ => {
assert_equals(getComputedStyle(overflowList).display, "none");
});
window.resizeTo(500, 500);
});
});
</script>
</body>