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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.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 cues are being matched properly by the lang attribute and :lang () pseudo class.</title> 2 <title>Test that cues are being matched properly by the lang attribute and :lang () pseudo class.</title>
3 <script src="../media-file.js"></script> 3 <script src="../media-file.js"></script>
4 <script src="../media-controls.js"></script> 4 <script src="../media-controls.js"></script>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <style> 7 <style>
8 ::cue(:lang(ru)) { color: lime; } 8 ::cue(:lang(ru)) { color: lime; }
9 ::cue(lang[lang="en"]) { color: purple; } 9 ::cue(lang[lang="en"]) { color: purple; }
10 ::cue(c[lang="ru"]) { color: red; } /* Shouldn't work, no attribute 'lang' for ' c'. */ 10 ::cue(c[lang="ru"]) { color: red; } /* Shouldn't work, no attribute 'lang' for ' c'. */
11 </style> 11 </style>
12 <video></video> 12 <video></video>
13 <script> 13 <script>
14 async_test(function(t) { 14 async_test(function(t) {
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 17
18 var track = document.createElement('track'); 18 var track = document.createElement('track');
19 track.src = 'captions-webvtt/styling-lang.vtt'; 19 track.src = 'captions-webvtt/styling-lang.vtt';
20 track.kind = 'captions'; 20 track.kind = 'captions';
21 track.default = true; 21 track.default = true;
22 video.appendChild(track); 22 video.appendChild(track);
23 23
24 video.onseeked = t.step_func_done(function() { 24 video.onseeked = t.step_func_done(function() {
25 var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild.fi rstElementChild; 25 var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstEleme ntChild.firstElementChild;
26 assert_equals(getComputedStyle(cueNode).color, 'rgb(128, 0, 128)'); 26 assert_equals(getComputedStyle(cueNode).color, 'rgb(128, 0, 128)');
27 cueNode = cueNode.firstElementChild.firstElementChild; 27 cueNode = cueNode.firstElementChild.firstElementChild;
28 assert_equals(getComputedStyle(cueNode).color, 'rgb(0, 255, 0)'); 28 assert_equals(getComputedStyle(cueNode).color, 'rgb(0, 255, 0)');
29 cueNode = cueNode.firstElementChild.firstElementChild; 29 cueNode = cueNode.firstElementChild.firstElementChild;
30 assert_equals(getComputedStyle(cueNode).color, 'rgb(128, 0, 128)'); 30 assert_equals(getComputedStyle(cueNode).color, 'rgb(128, 0, 128)');
31 }); 31 });
32 32
33 video.currentTime = 0.1; 33 video.currentTime = 0.1;
34 }); 34 });
35 </script> 35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698