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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.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, 4 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 :past and :future pseudo cla sses.</title> 2 <title>Test that cues are being matched properly by :past and :future pseudo cla sses.</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 <video></video> 7 <video></video>
8 <style> 8 <style>
9 video::cue {color: green} 9 video::cue {color: green}
10 video::cue(:past) {color: lime} 10 video::cue(:past) {color: lime}
(...skipping 14 matching lines...) Expand all
25 video.src = findMediaFile("video", "../content/test"); 25 video.src = findMediaFile("video", "../content/test");
26 26
27 var track = document.createElement("track"); 27 var track = document.createElement("track");
28 track.src = "captions-webvtt/styling-timestamps.vtt"; 28 track.src = "captions-webvtt/styling-timestamps.vtt";
29 track.kind = "captions"; 29 track.kind = "captions";
30 track.default = true; 30 track.default = true;
31 video.appendChild(track); 31 video.appendChild(track);
32 32
33 video.onseeked = t.step_func(function() { 33 video.onseeked = t.step_func(function() {
34 assert_equals(video.currentTime, seekTimes[seekTimeIndex]); 34 assert_equals(video.currentTime, seekTimes[seekTimeIndex]);
35 var cueNode = textTrackDisplayElement(video, "cue").firstElementChild; 35 var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstEleme ntChild;
36 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][0]); 36 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][0]);
37 cueNode = cueNode.nextElementSibling; 37 cueNode = cueNode.nextElementSibling;
38 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][1]); 38 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][1]);
39 cueNode = cueNode.nextElementSibling.firstElementChild.firstChild; 39 cueNode = cueNode.nextElementSibling.firstElementChild.firstChild;
40 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][2]); 40 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][2]);
41 cueNode = cueNode.nextElementSibling; 41 cueNode = cueNode.nextElementSibling;
42 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][3]); 42 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][3]);
43 cueNode = cueNode.parentNode; 43 cueNode = cueNode.parentNode;
44 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][4]); 44 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][4]);
45 45
46 if (++seekTimeIndex == info.length) 46 if (++seekTimeIndex == info.length)
47 t.done(); 47 t.done();
48 else 48 else
49 video.currentTime = seekTimes[seekTimeIndex]; 49 video.currentTime = seekTimes[seekTimeIndex];
50 }); 50 });
51 51
52 video.currentTime = seekTimes[seekTimeIndex]; 52 video.currentTime = seekTimes[seekTimeIndex];
53 }); 53 });
54 </script> 54 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698