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-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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/track/track-css-reset-user-override-settings.html
diff --git a/LayoutTests/media/track/track-css-reset-user-override-settings.html b/LayoutTests/media/track/track-css-reset-user-override-settings.html
new file mode 100644
index 0000000000000000000000000000000000000000..87427273c37a606c7d4ae10de20e7fcc690928bb
--- /dev/null
+++ b/LayoutTests/media/track/track-css-reset-user-override-settings.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<script src=../media-file.js></script>
+<script src=../video-test.js></script>
+<script src=../media-controls.js></script>
+<style>
+ video::cue {
+ color: lime;
+ background-color: yellow;
+ text-shadow: 4px 4px #ff0000;
+ font-size: 10px;
+ font-family: serif;
+ font-style: normal;
+ font-variant: normal;
+ }
+</style>
+<script>
+
+ function initUserSettings() {
+ if (window.internals) {
+ internals.settings.setTextTrackTextColor("cyan");
+ internals.settings.setTextTrackBackgroundColor("green");
+ internals.settings.setTextTrackTextShadow("2px 2px #ff0000")
+ internals.settings.setTextTrackTextSize("14px");
+ internals.settings.setTextTrackFontFamily("fantasy");
+ internals.settings.setTextTrackFontStyle("italic");
+ internals.settings.setTextTrackFontVariant("small-caps");
+ }
+ }
+
+ function resetUserSettings() {
+ if (window.internals) {
+ internals.settings.setTextTrackTextColor("");
+ internals.settings.setTextTrackBackgroundColor("");
+ internals.settings.setTextTrackTextShadow("")
+ internals.settings.setTextTrackTextSize("");
+ internals.settings.setTextTrackFontFamily("");
+ internals.settings.setTextTrackFontStyle("");
+ internals.settings.setTextTrackFontVariant("");
+ }
+ }
+
+ function checkExpected() {
+ cue = textTrackDisplayElement(video, 'cue');
+ testExpected("getComputedStyle(cue).color", "rgb(0, 255, 0)");
+ testExpected("getComputedStyle(cue).backgroundColor", "rgb(255, 255, 0)");
+ testExpected("getComputedStyle(cue).textShadow", "rgb(255, 0, 0) 4px 4px 0px");
+ testExpected("getComputedStyle(cue).fontSize", "10px");
+ testExpected("getComputedStyle(cue).fontFamily", "serif");
+ testExpected("getComputedStyle(cue).fontStyle", "normal");
+ testExpected("getComputedStyle(cue).fontVariant", "normal");
+ endTest();
+ }
+
+ window.onload = function() {
+ initUserSettings();
+ // reset should make the text tracks use the settings specified in the stylesheet
+ resetUserSettings();
+ 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
+ findMediaElement();
+ video.src = findMediaFile('video', '../content/test');
+ waitForEvent('canplaythrough', checkExpected);
+ }
+
+</script>
+<video>
+ <track src="captions-webvtt/styling.vtt" kind="captions" default>
+</video>

Powered by Google App Engine
This is Rietveld 408576698