Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Test that Line Height of cue element isn't overridden by author CSS.</tit le> |
|
philipj_slow
2016/04/21 12:48:17
No need to capitalize Line Height
| |
| 3 <head> | 3 <script src="../media-file.js"></script> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../media-controls.js"></script> |
| 5 <script src="../../resources/testharness.js"></script> | |
| 6 <script src="../../resources/testharnessreport.js"></script> | |
| 7 <style> | |
| 8 body { line-height: 108px; } | |
| 9 </style> | |
| 10 <video> | |
| 11 <track src="captions-webvtt/captions-snap-to-lines-set.vtt" kind="captions" default> | |
| 12 </video> | |
| 13 <script> | |
| 14 async_test(function(t) { | |
| 15 var video = document.querySelector('video'); | |
| 16 video.src = findMediaFile('video', '../content/test'); | |
| 5 | 17 |
| 6 <style type="text/css"> | 18 video.onseeked = t.step_func_done(function() { |
| 7 body { | 19 var multiLineCueDisplayElement = textTrackDisplayElement(video, 'display ', 0); |
| 8 line-height: 108px; | 20 assert_equals(getComputedStyle(multiLineCueDisplayElement).lineHeight, ' normal'); |
| 9 } | 21 }); |
| 10 </style> | |
| 11 <script src=../media-file.js></script> | |
| 12 <script src=../media-controls.js></script> | |
| 13 | 22 |
| 14 <script> | 23 video.currentTime = 1.25; |
| 15 var multiLineCueDisplayElement; | 24 }); |
| 16 | 25 </script> |
| 17 function testCueHeight() | |
| 18 { | |
| 19 if (!window.internals) { | |
| 20 failTest(); | |
| 21 return; | |
| 22 } | |
| 23 | |
| 24 var cueContainerElement = textTrackDisplayElement(video); | |
| 25 multiLineCueDisplayElement = textTrackDisplayElement(video, 'display ', 0); | |
| 26 | |
| 27 consoleWrite("<br>** Line height of the cue element should be 'norma l' **"); | |
| 28 testExpected("getComputedStyle(multiLineCueDisplayElement).lineHeigh t", "normal"); | |
| 29 | |
| 30 endTest(); | |
| 31 } | |
| 32 | |
| 33 function loaded() | |
| 34 { | |
| 35 consoleWrite("Line height isn't overriden by other CSS values in the file."); | |
| 36 findMediaElement(); | |
| 37 | |
| 38 testTrack = document.querySelector('track'); | |
| 39 video.src = findMediaFile('video', '../content/test'); | |
| 40 | |
| 41 waitForEvent('seeked', testCueHeight); | |
| 42 waitForEvent('canplaythrough', function() { | |
| 43 video.currentTime = 1.25; | |
| 44 }); | |
| 45 } | |
| 46 | |
| 47 </script> | |
| 48 | |
| 49 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | |
| 50 (Please avoid writing new tests using video-test.js) --> | |
| 51 <script src=../video-test.js></script> | |
| 52 </head> | |
| 53 <body onload="loaded()"> | |
| 54 <video controls> | |
| 55 <track src="captions-webvtt/captions-snap-to-lines-set.vtt" kind="ca ptions" default> | |
| 56 </video> | |
| 57 </body> | |
| 58 </html> | |
| OLD | NEW |