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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-multiple-tracks.html

Issue 1079323002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and lgtm nits Created 4 years, 8 months 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 <script src="../media-file.js"></script>
3 <!-- TODO(srivats): Convert test to testharness.js. crbug.com/588956
4 (Please avoid writing new tests using video-test.js) -->
5 <script src="../video-test.js"></script>
6 <script src="../media-controls.js"></script>
7 <script>
8
9 var trackLanguages = ["en", "ru", "fr", "jp", "de"];
10 var trackCueText = ["English", "Russian", "French", "Japanese", "German"];
11
12 function startTest()
13 {
14 findMediaElement();
15 testClosedCaptionsButtonVisibility(true);
16 consoleWrite("");
17 testExpected("video.textTracks.length", trackLanguages.length);
18 consoleWrite("");
19
20 for (var i = 0; i < trackLanguages.length; i++) {
21 consoleWrite("Select track at index " + i);
22 selectTextTrack(video, i);
23 testExpected("video.textTracks[" + i + "].mode", "showing");
24 testExpected("textTrackDisplayElement(video, 'display').innerText", trackCueText[i]);
25 for (var j = 0; j < trackLanguages.length; j++) {
26 if (j != i)
27 testExpected("video.textTracks[" + j + "].mode", "disabled") ;
28 }
29 consoleWrite("");
30 }
31 endTest();
32 }
33
34 function addTextTracks()
35 {
36 for (var i = 0; i < trackLanguages.length; i++) {
37 var track = video.addTextTrack("captions", trackCueText[i], trackLan guages[i]);
38 track.addCue(new VTTCue(0.0, 1.0, trackCueText[i]));
39 track.mode = "disabled";
40 }
41 startTest();
42 }
43
44 window.onload = function()
45 {
46 consoleWrite("Test that we can add multiple tracks and select between th em from the track selection menu");
47 findMediaElement();
48 video.src = findMediaFile("video", "../content/test");
49 waitForEvent("canplaythrough", addTextTracks);
50 }
51
52 </script>
53 <video controls></video>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698