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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-css-matching.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 various CSS Selectors.</titl e> 2 <title>Test that cues are being matched properly by various CSS Selectors.</titl e>
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 video::cue(c) {color: purple} 8 video::cue(c) {color: purple}
9 video::cue(v) {color: yellow} 9 video::cue(v) {color: yellow}
10 video::cue(v[voice="Mark"]) {color: red} 10 video::cue(v[voice="Mark"]) {color: red}
(...skipping 22 matching lines...) Expand all
33 video.src = findMediaFile("video", "../content/test"); 33 video.src = findMediaFile("video", "../content/test");
34 34
35 var track = document.createElement("track"); 35 var track = document.createElement("track");
36 track.src = "captions-webvtt/styling.vtt"; 36 track.src = "captions-webvtt/styling.vtt";
37 track.kind = "captions"; 37 track.kind = "captions";
38 track.default = true; 38 track.default = true;
39 video.appendChild(track); 39 video.appendChild(track);
40 40
41 video.onseeked = t.step_func(function() { 41 video.onseeked = t.step_func(function() {
42 assert_equals(video.currentTime, seekTimes[seekTimeIndex]); 42 assert_equals(video.currentTime, seekTimes[seekTimeIndex]);
43 var cueNode = textTrackDisplayElement(video, "cue").firstElementChild; 43 var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstEleme ntChild;
44 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][0]); 44 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][0]);
45 cueNode = cueNode.nextElementSibling; 45 cueNode = cueNode.nextElementSibling;
46 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][1]); 46 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][1]);
47 cueNode = cueNode.nextElementSibling; 47 cueNode = cueNode.nextElementSibling;
48 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][2]); 48 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][2]);
49 49
50 if (++seekTimeIndex == info.length) 50 if (++seekTimeIndex == info.length)
51 t.done(); 51 t.done();
52 else 52 else
53 video.currentTime = seekTimes[seekTimeIndex]; 53 video.currentTime = seekTimes[seekTimeIndex];
54 }); 54 });
55 55
56 video.currentTime = seekTimes[seekTimeIndex]; 56 video.currentTime = seekTimes[seekTimeIndex];
57 }); 57 });
58 </script> 58 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698