OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Clicking on the overflow mute button mutes the video.</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 |
| 19 video.onloadeddata = t.step_func_done(function() { |
| 20 var overflowList = getOverflowList(video); |
| 21 var overflowMenu = getOverflowMenuButton(video); |
| 22 |
| 23 // Video is unmuted to begin with. |
| 24 assert_false(video.muted); |
| 25 |
| 26 // Click on the overflow menu button |
| 27 var coords = elementCoordinates(overflowMenu); |
| 28 clickAtCoordinates(coords[0], coords[1]); |
| 29 |
| 30 // Click on mute button |
| 31 var coords = elementCoordinates(overflowList.children[OverflowMenuButtons.MU
TE]); |
| 32 clickAtCoordinates(coords[0], coords[1]); |
| 33 assert_true(video.muted); |
| 34 }); |
| 35 }); |
| 36 </script> |
| 37 </body> |
OLD | NEW |