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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-controls-captions-on-off.html

Issue 2539023002: Media Controls: Use events to update controls for closed captions. (Closed)
Patch Set: review comments 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>Tests that tracks can be turned on and off through the track selection me nu.</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(function(t) {
10 var captions = ["First", "Second", "Third"];
11 var video = document.querySelector("video");
12
13 video.oncanplaythrough = t.step_func_done(function() {
14 var track1 = video.addTextTrack("captions");
15 var track2 = video.addTextTrack("captions");
16
17 for (var i = 0; i < captions.length; i++) {
18 track1.addCue(new VTTCue(0, 120, captions[i]));
19 track2.addCue(new VTTCue(0, 120, captions[i]));
20 }
21 assert_true(isClosedCaptionsButtonVisible(video));
22
23 // The captions track should be listed in textTracks, but not yet loaded .
24 assert_equals(video.textTracks.length, 2);
25 assert_equals(video.textTracks[0].mode, "hidden");
26 checkCaptionsHidden(video);
27
28 // Captions track should become visible after the track is selected.
29 clickTextTrackAtIndex(video, 0);
30 checkCaptionsVisible(video, captions);
31
32 // Captions should not be visible after they're turned off through the m enu.
33 turnClosedCaptionsOff(video);
34 checkCaptionsHidden(video);
35
36 // Captions track should become visible after the track is selected agai n.
37 clickTextTrackAtIndex(video, 0);
38 checkCaptionsVisible(video, captions);
39 });
40
41 video.src = findMediaFile("video", "content/counting");
42 });
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698