OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Overflow menu children appear in correct order.</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 children = overflowList.children; |
| 26 |
| 27 // The overflow menu should always have the same number of elements. |
| 28 // Their visibility will change over time based on the size of the video. |
| 29 assert_equals(children.length, 5); |
| 30 |
| 31 // Ensure that all of the buttons are visible in the right order |
| 32 for (var i = 0; i < children.length; i++) { |
| 33 var child = children[i]; |
| 34 var innerButton = child.children[0]; |
| 35 assert_equals(internals.shadowPseudoId(child), "-internal-media-controls-o
verflow-menu-list-item"); |
| 36 assert_equals(internals.shadowPseudoId(innerButton), overflowButtonsCSS[i]
); |
| 37 // Items should be visible |
| 38 assert_not_equals(getComputedStyle(child).display, "none"); |
| 39 // Buttons shouldn't be visible |
| 40 assert_equals(getComputedStyle(innerButton).display, "none"); |
| 41 } |
| 42 }); |
| 43 }); |
| 44 </script> |
| 45 </body> |
OLD | NEW |