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