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