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

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

Issue 921833003: Expose APIs for text track settings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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>
fs 2015/02/13 13:13:15 Maybe get "user" and "override" in the filename (a
srivats 2015/02/18 01:46:51 Done.
2 <html>
fs 2015/02/13 13:13:15 I realize you probably just copied the structure f
srivats 2015/02/18 01:46:50 Done.
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <script src=../media-file.js></script>
6 <script src=../video-test.js></script>
7 <script src=../media-controls.js></script>
8 <script>
9
10 if (window.internals) {
11 internals.settings.setTextTrackTextColor("cyan");
fs 2015/02/13 13:13:15 I think you should also test this with a styleshee
srivats 2015/02/18 01:46:51 Done.
12 internals.settings.setTextTrackBackgroundColor("green");
13 internals.settings.setTextTrackWindowColor("blue");
14 internals.settings.setTextTrackTextShadow("2px 2px #ff0000")
15 internals.settings.setTextTrackTextSize("14px");
16 internals.settings.setTextTrackFontFamily("fantasy");
17 internals.settings.setTextTrackFontStyle("italic");
18 internals.settings.setTextTrackFontVariant("small-caps");
19 }
20
21 function cleanup()
fs 2015/02/13 13:13:15 I believe the test framework does this for you.
srivats 2015/02/18 01:46:51 Done.
22 {
23 if (window.internals) {
24 internals.settings.setTextTrackTextColor("");
25 internals.settings.setTextTrackBackgroundColor("");
26 internals.settings.setTextTrackWindowColor("");
27 internals.settings.setTextTrackTextShadow("");
28 internals.settings.setTextTrackTextSize("");
29 internals.settings.setTextTrackFontFamily("");
30 internals.settings.setTextTrackFontStyle("");
31 internals.settings.setTextTrackFontVariant("");
32 }
33 }
34
35 function seeked()
36 {
37 if (testEnded)
fs 2015/02/13 13:13:15 This shouldn't be needed.
srivats 2015/02/18 01:46:51 Done.
38 return;
39
40 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).color", "rgb(0, 255, 255)");
fs 2015/02/13 13:13:14 This would be more readable as: cue = textTrackDi
srivats 2015/02/18 01:46:50 Done.
41 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).backgroundColor", "rgb(0, 128, 0)");
42 testExpected("getComputedStyle(textTrackDisplayElement(video, 'displ ay')).backgroundColor", "rgb(0, 0, 255)");
43 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).textShadow", "rgb(255, 0, 0) 2px 2px 0px");
44 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).fontSize", "14px");
45 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).fontFamily", "fantasy");
46 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).fontStyle", "italic");
47 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue') ).fontVariant", "small-caps");
48 cleanup();
49 endTest();
50 }
51
52 function loaded()
53 {
54 consoleWrite("Test that WebVTT objects are being styled correctly ba sed on settings.");
55 findMediaElement();
56 video.src = findMediaFile('video', '../content/test');
57 waitForEvent('seeked', seeked);
fs 2015/02/13 13:13:15 The referenced VTT file has a cue active at 0s, so
srivats 2015/02/18 01:46:51 Done.
58 waitForEvent('canplaythrough', function() { video.currentTime = 0.5; });
59 }
60
61 </script>
62 </head>
63 <body onload="loaded()">
64 <video controls >
fs 2015/02/13 13:13:15 No need for 'controls'?
srivats 2015/02/18 01:46:51 Done.
65 <track src="captions-webvtt/styling.vtt" kind="captions" default>
66 </video>
67 </body>
68 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/track/track-css-matching-settings-expected.txt » ('j') | Source/core/frame/Settings.in » ('J')

Powered by Google App Engine
This is Rietveld 408576698