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

Side by Side Diff: LayoutTests/media/track/track-css-matching-user-override-settings.html

Issue 921833003: Expose APIs for text track settings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 9 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
(Empty)
1 <!DOCTYPE html>
2 <script src=../media-file.js></script>
3 <script src=../video-test.js></script>
4 <script src=../media-controls.js></script>
5 <style>
6 video::cue {
7 color: lime;
8 background-color: yellow;
9 text-shadow: 4px 4px #ff0000;
10 font-size: 10px;
11 font-family: serif;
12 font-style: normal;
13 font-variant: normal;
14 }
15 </style>
16 <script>
17
18 function initSettings() {
19 if (window.internals) {
20 internals.settings.setTextTrackTextColor("cyan");
21 internals.settings.setTextTrackBackgroundColor("green");
22 internals.settings.setTextTrackTextShadow("2px 2px #ff0000")
23 internals.settings.setTextTrackTextSize("14px");
24 internals.settings.setTextTrackFontFamily("fantasy");
25 internals.settings.setTextTrackFontStyle("italic");
26 internals.settings.setTextTrackFontVariant("small-caps");
27 }
28 }
29
30 function checkExpected() {
31 cue = textTrackDisplayElement(video, 'cue');
32 testExpected("getComputedStyle(cue).color", "rgb(0, 255, 255)");
33 testExpected("getComputedStyle(cue).backgroundColor", "rgb(0, 128, 0)");
34 testExpected("getComputedStyle(cue).textShadow", "rgb(255, 0, 0) 2px 2px 0px");
35 testExpected("getComputedStyle(cue).fontSize", "14px");
36 testExpected("getComputedStyle(cue).fontFamily", "fantasy");
37 testExpected("getComputedStyle(cue).fontStyle", "italic");
38 testExpected("getComputedStyle(cue).fontVariant", "small-caps");
39 endTest();
40 }
41
42 window.onload = function() {
43 initSettings();
44 consoleWrite("Test that WebVTT objects are being styled correctly based on user settings.");
45 findMediaElement();
46 video.src = findMediaFile('video', '../content/test');
47 waitForEvent('canplaythrough', checkExpected);
48 }
49
50 </script>
51 <video>
52 <track src="captions-webvtt/styling.vtt" kind="captions" default>
53 </video>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698