Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Test that the cue is not styled when video is in a shadow tree and style is in a document.</title> |
| 3 <head> | |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
|
mlamouri (slow - plz ping)
2016/04/06 09:22:58
Why are you removing all that? Having <html>, <hea
Srirama
2016/04/06 10:21:23
Even this was suggested by philipj and as per codi
| |
| 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> | |
| 10 <style> | 7 <style> |
| 11 video::cue(.red, .red2) { color:red } | 8 video::cue(.red, .red2) { color:red } |
| 12 video::cue(.green) { color:green } | 9 video::cue(.green) { color:green } |
| 13 </style> | 10 </style> |
| 11 <div id='host'> | |
| 12 </div> | |
| 14 <script> | 13 <script> |
| 15 var cueNode; | 14 async_test(function(t) { |
| 16 var seekedCount = 0; | |
| 17 var step = 0.4; | |
| 18 var initialTime = 0.6; | |
| 19 var endTime = 3.0 | |
| 20 | |
| 21 function seeked() | |
| 22 { | |
| 23 if (testEnded) | |
| 24 return; | |
| 25 | |
| 26 cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; | |
| 27 testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)", "!="); | |
| 28 cueNode = cueNode.nextElementSibling; | |
| 29 testExpected("getComputedStyle(cueNode).color", "rgb(0, 128, 0)", "!="); | |
| 30 cueNode = cueNode.nextElementSibling; | |
| 31 testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)", "!="); | |
| 32 endTest(); | |
| 33 } | |
| 34 | |
| 35 function loaded() | |
| 36 { | |
| 37 consoleWrite("Test that the cue is not styled when video is in a shadow tree and style is in a document."); | |
| 38 var host = document.getElementById('host'); | 15 var host = document.getElementById('host'); |
| 39 var shadowRoot = host.createShadowRoot(); | 16 var shadowRoot = host.createShadowRoot(); |
| 40 shadowRoot.innerHTML = '<video controls ><track src="captions-webvtt/styling -lifetime.vtt" kind="captions" default></video>'; | 17 shadowRoot.innerHTML = '<video controls ><track src="captions-webvtt/styling -lifetime.vtt" kind="captions" default></video>'; |
| 41 video = shadowRoot.querySelector('video'); | 18 var video = shadowRoot.querySelector('video'); |
| 42 video.src = findMediaFile('video', '../content/test'); | 19 video.src = findMediaFile('video', '../content/test'); |
| 43 video.id = "testvideo"; | 20 video.id = "testvideo"; |
| 44 waitForEvent('seeked', seeked); | 21 video.onseeked = t.step_func_done(function(t) { |
|
mlamouri (slow - plz ping)
2016/04/06 09:22:58
I would prefer step_func() and call t.done() insid
Srirama
2016/04/06 10:21:23
Hmm, philip suggested me to use step_func_done and
philipj_slow
2016/04/06 12:12:55
Yep, but I'm probably unusually devoted to minimal
mlamouri (slow - plz ping)
2016/04/07 13:37:17
Sure.
| |
| 45 waitForEventOnce('canplaythrough', function() { video.currentTime = initialT ime; }); | 22 var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; |
| 46 } | 23 assert_not_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)"); |
|
philipj_slow
2016/04/06 12:17:46
Hmm, the test was already like this, but this look
Srirama
2016/04/07 13:46:18
Done.
| |
| 24 cueNode = cueNode.nextElementSibling; | |
| 25 assert_not_equals(getComputedStyle(cueNode).color, "rgb(0, 128, 0)"); | |
| 26 cueNode = cueNode.nextElementSibling; | |
| 27 assert_not_equals(getComputedStyle(cueNode).color, "rgb(255, 0, 0)"); | |
| 28 }); | |
| 29 video.oncanplaythrough = t.step_func(function(t) { | |
|
philipj_slow
2016/04/06 12:17:46
I think you can not wait for canplaythrough and ju
Srirama
2016/04/07 13:46:18
Done.
| |
| 30 video.currentTime = 0.6; | |
| 31 }); | |
| 32 }); | |
|
mlamouri (slow - plz ping)
2016/04/06 09:22:58
The test name goes here, not in <title>.
ie. "Test
Srirama
2016/04/06 10:21:24
Both are same, and having title instead of descrip
philipj_slow
2016/04/06 12:12:55
Right, when there's just a single test per file, I
mlamouri (slow - plz ping)
2016/04/07 13:37:17
What happens if the test fails? ie. what is printe
philipj_slow
2016/04/07 13:40:32
It's the same as if the title is given as an argum
Srirama
2016/04/07 13:46:18
yes, this is the sample output for your reference.
| |
| 47 </script> | 33 </script> |
| 48 </head> | |
| 49 <body onload="loaded()"> | |
| 50 <div id='host'> | |
| 51 </div> | |
| 52 </body> | |
| 53 </html> | |
| OLD | NEW |