Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html

Issue 2456993003: Improve caption button behavior for video player. (Closed)
Patch Set: Addresss feedback Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Clicking on the overflow closed captions button shows the closed captions menu.</title> 2 <title>Clicking on the overflow closed captions button shows the closed captions menu.</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 two captions.
19 var track = video.addTextTrack("captions"); 19 video.addTextTrack("captions");
20 video.addTextTrack("captions");
20 21
21 video.onloadeddata = t.step_func_done(function() { 22 video.onloadeddata = t.step_func_done(function() {
22 var overflowList = getOverflowList(video); 23 var overflowList = getOverflowList(video);
23 var overflowMenu = getOverflowMenuButton(video); 24 var overflowMenu = getOverflowMenuButton(video);
24 25
25 // Get the menu that displays the list of text tracks 26 // Get the menu that displays the list of text tracks.
26 var captionsList = mediaControlsElement(internals.shadowRoot(video).firstChil d, "-internal-media-controls-text-track-list"); 27 var captionsList = mediaControlsElement(internals.shadowRoot(video).firstChil d, "-internal-media-controls-text-track-list");
27 28
28 // Initially the list should not be visible 29 // Initially the list should not be visible.
29 assert_equals(getComputedStyle(captionsList).display, "none"); 30 assert_equals(getComputedStyle(captionsList).display, "none");
30 31
31 // Click on the overflow menu button 32 // Click on the overflow menu button.
32 var coords = elementCoordinates(overflowMenu); 33 var coords = elementCoordinates(overflowMenu);
33 clickAtCoordinates(coords[0], coords[1]); 34 clickAtCoordinates(coords[0], coords[1]);
34 35
35 // Click on the closed captions button 36 // Click on the closed captions button.
36 var coords = elementCoordinates(overflowList.children[OverflowMenuButtons.CL OSED_CAPTIONS]); 37 var coords = elementCoordinates(overflowList.children[OverflowMenuButtons.CL OSED_CAPTIONS]);
37 clickAtCoordinates(coords[0], coords[1]); 38 clickAtCoordinates(coords[0], coords[1]);
38 assert_not_equals(getComputedStyle(captionsList).display, "none"); 39 assert_not_equals(getComputedStyle(captionsList).display, "none");
39 }); 40 });
40 }); 41 });
41 </script> 42 </script>
42 </body> 43 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698