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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.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 the cue is styled when video and style is in the same shadow tr ee.</title> 2 <title>Test that the cue is styled when video and style is in the same shadow tr ee.</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 <div id='host'> 7 <div id='host'>
8 </div> 8 </div>
9 <script> 9 <script>
10 async_test(function(t) { 10 async_test(function(t) {
11 var host = document.getElementById('host'); 11 var host = document.getElementById('host');
12 var shadowRoot = host.createShadowRoot(); 12 var shadowRoot = host.createShadowRoot();
13 shadowRoot.innerHTML = '<style>video::cue(.red, .red2) { color:red } video:: cue(.green) { color:green }</style>' 13 shadowRoot.innerHTML = '<style>video::cue(.red, .red2) { color:red } video:: cue(.green) { color:green }</style>'
14 + '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" ki nd="captions" default></video>'; 14 + '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" ki nd="captions" default></video>';
15 var video = shadowRoot.querySelector('video'); 15 var video = shadowRoot.querySelector('video');
16 video.src = findMediaFile('video', '../content/test'); 16 video.src = findMediaFile('video', '../content/test');
17 video.id = "testvideo"; 17 video.id = "testvideo";
18 video.onseeked = t.step_func_done(function() { 18 video.onseeked = t.step_func_done(function() {
19 var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; 19 var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstEleme ntChild;
20 assert_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)"); 20 assert_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)");
21 cueNode = cueNode.nextElementSibling; 21 cueNode = cueNode.nextElementSibling;
22 assert_equals(getComputedStyle(cueNode).color, "rgb(0, 128, 0)"); 22 assert_equals(getComputedStyle(cueNode).color, "rgb(0, 128, 0)");
23 cueNode = cueNode.nextElementSibling; 23 cueNode = cueNode.nextElementSibling;
24 assert_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)"); 24 assert_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)");
25 }); 25 });
26 video.currentTime = 0.6; 26 video.currentTime = 0.6;
27 }); 27 });
28 </script> 28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698