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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html

Issue 1856383002: Convert css cue track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 8 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 <html> 2 <title>Test that the cue is styled when video and style is in the same shadow tr ee.</title>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <script src="../media-file.js"></script> 3 <script src="../media-file.js"></script>
6 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
7 (Please avoid writing new tests using video-test.js) -->
8 <script src="../video-test.js"></script>
9 <script src="../media-controls.js"></script> 4 <script src="../media-controls.js"></script>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <div id='host'>
8 </div>
10 <script> 9 <script>
11 var cueNode; 10 async_test(function(t) {
12 var seekedCount = 0;
13 var step = 0.4;
14 var initialTime = 0.6;
15 var endTime = 3.0
16
17 function seeked()
18 {
19 if (testEnded)
20 return;
21
22 cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
23 testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
24 cueNode = cueNode.nextElementSibling;
25 testExpected("getComputedStyle(cueNode).color", "rgb(0, 128, 0)");
26 cueNode = cueNode.nextElementSibling;
27 testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
28 endTest();
29 }
30
31 function loaded()
32 {
33 consoleWrite("Test that the cue is styled when video and style is in the sam e shadow tree.");
34 var host = document.getElementById('host'); 11 var host = document.getElementById('host');
35 var shadowRoot = host.createShadowRoot(); 12 var shadowRoot = host.createShadowRoot();
36 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>'
37 + '<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>';
38 video = shadowRoot.querySelector('video'); 15 var video = shadowRoot.querySelector('video');
39 video.src = findMediaFile('video', '../content/test'); 16 video.src = findMediaFile('video', '../content/test');
40 video.id = "testvideo"; 17 video.id = "testvideo";
41 waitForEvent('seeked', seeked); 18 video.onseeked = t.step_func_done(function() {
42 waitForEventOnce('canplaythrough', function() { video.currentTime = initialT ime; }); 19 var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
43 } 20 assert_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)");
21 cueNode = cueNode.nextElementSibling;
22 assert_equals(getComputedStyle(cueNode).color, "rgb(0, 128, 0)");
23 cueNode = cueNode.nextElementSibling;
24 assert_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)");
25 });
26 video.currentTime = 0.6;
27 });
44 </script> 28 </script>
45 </head>
46 <body onload="loaded()">
47 <div id='host'>
48 </div>
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698