OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test that u, b, i WebVTT objects are being styled correctly.</title> |
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 <video></video> |
| 8 <script> |
| 9 async_test(function(t) { |
| 10 var video = document.querySelector('video'); |
| 11 video.src = findMediaFile('video', '../content/test'); |
| 12 |
| 13 var track = document.createElement('track'); |
| 14 track.src = 'captions-webvtt/styling-default.vtt'; |
| 15 track.kind = 'captions'; |
| 16 track.default = true; |
| 17 video.appendChild(track); |
5 | 18 |
6 <script src=../media-file.js></script> | 19 video.onseeked = t.step_func_done(function() { |
7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 20 var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; |
8 (Please avoid writing new tests using video-test.js) --> | 21 assert_equals(getComputedStyle(cueNode).fontWeight, 'bold'); |
9 <script src=../video-test.js></script> | 22 cueNode = cueNode.nextElementSibling; |
10 <script src=../media-controls.js></script> | 23 assert_equals(getComputedStyle(cueNode).fontStyle, 'italic'); |
11 | 24 cueNode = cueNode.nextElementSibling; |
12 <script> | 25 assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid
rgb(255, 255, 255)'); |
13 | 26 }); |
14 var cueNode; | 27 |
15 | 28 video.currentTime = 0.1; |
16 function seeked() | 29 }); |
17 { | 30 </script> |
18 if (testEnded) | |
19 return; | |
20 | |
21 cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; | |
22 testExpected("getComputedStyle(cueNode).fontWeight", "bold"); | |
23 cueNode = cueNode.nextElementSibling; | |
24 testExpected("getComputedStyle(cueNode).fontStyle", "italic"); | |
25 cueNode = cueNode.nextElementSibling; | |
26 testExpected("getComputedStyle(cueNode).textDecoration", "underline
solid rgb(255, 255, 255)"); | |
27 | |
28 endTest(); | |
29 } | |
30 | |
31 function loaded() | |
32 { | |
33 consoleWrite("Test that u, b, i WebVTT objects are being styled corr
ectly."); | |
34 findMediaElement(); | |
35 video.src = findMediaFile('video', '../content/test'); | |
36 video.id = "testvideo"; | |
37 waitForEvent('seeked', seeked); | |
38 waitForEvent('canplaythrough', function() { video.currentTime = 0.1;
}); | |
39 } | |
40 | |
41 </script> | |
42 </head> | |
43 <body onload="loaded()"> | |
44 <video controls > | |
45 <track src="captions-webvtt/styling-default.vtt" kind="captions" def
ault> | |
46 </video> | |
47 </body> | |
48 </html> | |
OLD | NEW |