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

Side by Side Diff: third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html

Issue 2539023002: Media Controls: Use events to update controls for closed captions. (Closed)
Patch Set: ready for review Created 4 years 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
(Empty)
1 <!DOCTYPE html>
2 <title>A single track should not show overflow on caption button-press, instead just toggle.</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 <video controls></video>
8 <script>
9 async_test(t => {
10 var captions = ["Caption"];
11 var video = document.querySelector("video");
12
13 video.oncanplaythrough = t.step_func(_ => {
14 var track1 = video.addTextTrack("captions");
15
16 for (var i = 0; i < captions.length; i++) {
17 track1.addCue(new VTTCue(0, 120, captions[i]));
18 }
19
20 // The controls are updated asynchronously.
21 setTimeout(t.step_func_done(_ => {
22 assert_true(isClosedCaptionsButtonVisible(video));
23
24 // The captions track should be listed in textTracks, but not yet loaded.
25 assert_equals(video.textTracks.length, 1);
26 assert_equals(video.textTracks[0].mode, "hidden");
27 checkCaptionsHidden(video);
28
29 // Get the menu that displays the list of text tracks.
30 var captionsList = mediaControlsElement(internals.shadowRoot(video).firstC hild,
31 "-internal-media-controls-text-track-list");
32
33 clickCaptionButton(video);
34 assert_equals(getComputedStyle(captionsList).display, "none");
35
36 // Captions track should become visible after the closed caption button is pressed.
37 checkCaptionsVisible(video, captions);
38
39 // Click the closed captions button again and make sure the menu does not appear.
40 clickCaptionButton(video);
41 assert_equals(getComputedStyle(captionsList).display, "none");
42
43 // Captions track should become visible after the closed caption button is pressed.
Zhiqiang Zhang (Slow) 2016/12/01 12:20:46 s/visible/invisible
mlamouri (slow - plz ping) 2016/12/01 22:22:54 Done.
44 checkCaptionsHidden(video);
45 }));
46 });
47
48 video.src = findMediaFile("video", "../content/counting");
49 });
50 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698