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

Side by Side Diff: LayoutTests/media/track/track-css-reset-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 and added a test to verify behavior of internal settings 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 initUserSettings() {
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 resetUserSettings() {
31 if (window.internals) {
32 internals.settings.setTextTrackTextColor("");
33 internals.settings.setTextTrackBackgroundColor("");
34 internals.settings.setTextTrackTextShadow("")
35 internals.settings.setTextTrackTextSize("");
36 internals.settings.setTextTrackFontFamily("");
37 internals.settings.setTextTrackFontStyle("");
38 internals.settings.setTextTrackFontVariant("");
39 }
40 }
41
42 function checkExpected() {
43 cue = textTrackDisplayElement(video, 'cue');
44 testExpected("getComputedStyle(cue).color", "rgb(0, 255, 0)");
45 testExpected("getComputedStyle(cue).backgroundColor", "rgb(255, 255, 0)" );
46 testExpected("getComputedStyle(cue).textShadow", "rgb(255, 0, 0) 4px 4px 0px");
47 testExpected("getComputedStyle(cue).fontSize", "10px");
48 testExpected("getComputedStyle(cue).fontFamily", "serif");
49 testExpected("getComputedStyle(cue).fontStyle", "normal");
50 testExpected("getComputedStyle(cue).fontVariant", "normal");
51 endTest();
52 }
53
54 window.onload = function() {
55 initUserSettings();
56 // reset should make the text tracks use the settings specified in the s tylesheet
57 resetUserSettings();
58 consoleWrite("Test that WebVTT objects user override styles when reset, refer to css specified styles.");
philipj_slow 2015/03/26 05:24:36 I don't think this test is needed, because initUse
srivats 2015/03/26 06:37:41 Removed. The initial reasoning to add this was to
59 findMediaElement();
60 video.src = findMediaFile('video', '../content/test');
61 waitForEvent('canplaythrough', checkExpected);
62 }
63
64 </script>
65 <video>
66 <track src="captions-webvtt/styling.vtt" kind="captions" default>
67 </video>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698