| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <title>Ensure overflow menu buttons are hidden when resizing.</title> | |
| 3 <style> | |
| 4 #content { | |
| 5 width: 1000px; | |
| 6 height: 1000px; | |
| 7 } | |
| 8 </style> | |
| 9 <script src="../resources/testharness.js"></script> | |
| 10 <script src="../resources/testharnessreport.js"></script> | |
| 11 <script src="media-controls.js"></script> | |
| 12 <script src="media-file.js"></script> | |
| 13 <script src="overflow-menu.js"></script> | |
| 14 | |
| 15 <!--Padding ensures the overflow menu is visible for the tests. --> | |
| 16 <body style="padding-top: 200px; padding-left: 100px"> | |
| 17 <video controls></video> | |
| 18 <script> | |
| 19 async_test(function(t) { | |
| 20 if (window.testRunner) | |
| 21 testRunner.useUnfortunateSynchronousResizeMode(); | |
| 22 | |
| 23 // Set up video | |
| 24 var video = document.querySelector("video"); | |
| 25 video.src = findMediaFile("video", "content/test"); | |
| 26 video.setAttribute("width", "60"); | |
| 27 // Add captions | |
| 28 var track = video.addTextTrack("captions"); | |
| 29 // Pretend we have a cast device | |
| 30 internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true); | |
| 31 | |
| 32 video.onloadeddata = t.step_func(function() { | |
| 33 var overflowList = getOverflowList(video); | |
| 34 var overflowMenu = getOverflowMenuButton(video); | |
| 35 | |
| 36 // Clicking on the overflow menu button should make the overflow list visibl
e | |
| 37 var coords = elementCoordinates(overflowMenu); | |
| 38 clickAtCoordinates(coords[0], coords[1]); | |
| 39 assert_not_equals(getComputedStyle(overflowList).display, "none"); | |
| 40 | |
| 41 // Resizing should hide the overflow list. | |
| 42 window.onresize = t.step_func_done(_ => { | |
| 43 assert_equals(getComputedStyle(overflowList).display, "none"); | |
| 44 }); | |
| 45 window.resizeTo(500, 500); | |
| 46 }); | |
| 47 }); | |
| 48 </script> | |
| 49 </body> | |
| OLD | NEW |