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

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

Issue 2268923003: Clean up textTrackDisplayElement utility function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 3 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test that we can add multiple tracks and select between them from the tra ck selection menu.</title> 2 <title>Test that we can add multiple tracks and select between them from the tra ck selection 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-file.js"></script> 5 <script src="../media-file.js"></script>
6 <script src="../media-controls.js"></script> 6 <script src="../media-controls.js"></script>
7 <video controls></video> 7 <video controls></video>
8 <script> 8 <script>
9 async_test(function(t) { 9 async_test(function(t) {
10 var video = document.querySelector("video"); 10 var video = document.querySelector("video");
11 var trackLanguages = ["en", "ru", "fr", "jp", "de"]; 11 var trackLanguages = ["en", "ru", "fr", "jp", "de"];
12 var trackCueText = ["English", "Russian", "French", "Japanese", "German"]; 12 var trackCueText = ["English", "Russian", "French", "Japanese", "German"];
13 13
14 video.oncanplaythrough = t.step_func_done(function() { 14 video.oncanplaythrough = t.step_func_done(function() {
15 for (var i = 0; i < trackLanguages.length; i++) { 15 for (var i = 0; i < trackLanguages.length; i++) {
16 var track = video.addTextTrack("captions", trackCueText[i], trackLan guages[i]); 16 var track = video.addTextTrack("captions", trackCueText[i], trackLan guages[i]);
17 track.addCue(new VTTCue(0, 1, trackCueText[i])); 17 track.addCue(new VTTCue(0, 1, trackCueText[i]));
18 track.mode = "disabled"; 18 track.mode = "disabled";
19 } 19 }
20 assert_true(isClosedCaptionsButtonVisible(video)); 20 assert_true(isClosedCaptionsButtonVisible(video));
21 assert_equals(video.textTracks.length, trackLanguages.length); 21 assert_equals(video.textTracks.length, trackLanguages.length);
22 22
23 for (var i = 0; i < trackLanguages.length; i++) { 23 for (var i = 0; i < trackLanguages.length; i++) {
24 clickTextTrackAtIndex(video, i); 24 clickTextTrackAtIndex(video, i);
25 assert_equals(video.textTracks[i].mode, "showing"); 25 assert_equals(video.textTracks[i].mode, "showing");
26 assert_equals(textTrackCueDisplayElement(video).innerText, trackCueT ext[i]); 26 assert_equals(textTrackDisplayElement(video).innerText, trackCueText [i]);
27 for (var j = 0; j < trackLanguages.length; j++) { 27 for (var j = 0; j < trackLanguages.length; j++) {
28 if (j != i) 28 if (j != i)
29 assert_equals(video.textTracks[j].mode, "disabled"); 29 assert_equals(video.textTracks[j].mode, "disabled");
30 } 30 }
31 } 31 }
32 }); 32 });
33 33
34 video.src = findMediaFile("video", "../content/test"); 34 video.src = findMediaFile("video", "../content/test");
35 }); 35 });
36 </script> 36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698