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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/track/track-css-matching-settings.html
diff --git a/LayoutTests/media/track/track-css-matching-settings.html b/LayoutTests/media/track/track-css-matching-settings.html
new file mode 100644
index 0000000000000000000000000000000000000000..7d1917d432b1f33b39f4e8e6ff184675d13ee174
--- /dev/null
+++ b/LayoutTests/media/track/track-css-matching-settings.html
@@ -0,0 +1,68 @@
+<!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.
+<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.
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script src=../media-file.js></script>
+ <script src=../video-test.js></script>
+ <script src=../media-controls.js></script>
+ <script>
+
+ if (window.internals) {
+ 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.
+ internals.settings.setTextTrackBackgroundColor("green");
+ internals.settings.setTextTrackWindowColor("blue");
+ internals.settings.setTextTrackTextShadow("2px 2px #ff0000")
+ internals.settings.setTextTrackTextSize("14px");
+ internals.settings.setTextTrackFontFamily("fantasy");
+ internals.settings.setTextTrackFontStyle("italic");
+ internals.settings.setTextTrackFontVariant("small-caps");
+ }
+
+ 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.
+ {
+ if (window.internals) {
+ internals.settings.setTextTrackTextColor("");
+ internals.settings.setTextTrackBackgroundColor("");
+ internals.settings.setTextTrackWindowColor("");
+ internals.settings.setTextTrackTextShadow("");
+ internals.settings.setTextTrackTextSize("");
+ internals.settings.setTextTrackFontFamily("");
+ internals.settings.setTextTrackFontStyle("");
+ internals.settings.setTextTrackFontVariant("");
+ }
+ }
+
+ function seeked()
+ {
+ if (testEnded)
fs 2015/02/13 13:13:15 This shouldn't be needed.
srivats 2015/02/18 01:46:51 Done.
+ return;
+
+ 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.
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(0, 128, 0)");
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'display')).backgroundColor", "rgb(0, 0, 255)");
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).textShadow", "rgb(255, 0, 0) 2px 2px 0px");
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).fontSize", "14px");
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).fontFamily", "fantasy");
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).fontStyle", "italic");
+ testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).fontVariant", "small-caps");
+ cleanup();
+ endTest();
+ }
+
+ function loaded()
+ {
+ consoleWrite("Test that WebVTT objects are being styled correctly based on settings.");
+ findMediaElement();
+ video.src = findMediaFile('video', '../content/test');
+ 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.
+ waitForEvent('canplaythrough', function() { video.currentTime = 0.5; });
+ }
+
+ </script>
+ </head>
+ <body onload="loaded()">
+ <video controls >
fs 2015/02/13 13:13:15 No need for 'controls'?
srivats 2015/02/18 01:46:51 Done.
+ <track src="captions-webvtt/styling.vtt" kind="captions" default>
+ </video>
+ </body>
+</html>
« 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