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

Unified Diff: LayoutTests/media/video-controls-captions-load-by-lang.html

Issue 14056005: Added code to enable the first caption track if the user has requested captions and one such track … (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 8 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/video-controls-captions-load-by-lang.html
diff --git a/LayoutTests/media/video-controls-captions-load-by-lang.html b/LayoutTests/media/video-controls-captions-load-by-lang.html
new file mode 100644
index 0000000000000000000000000000000000000000..69343129d00713efd43743957e0aefe7ab303033
--- /dev/null
+++ b/LayoutTests/media/video-controls-captions-load-by-lang.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Test non-default track load according to user language preference.</title>
+ <script src=media-file.js></script>
+ <script src=media-controls.js></script>
+ <script src=video-test.js></script>
+ <script>
+ var track;
+
+ function startTest()
+ {
+ if (!window.eventSender) {
+ consoleWrite("No eventSender found.");
+ failTest();
+ }
+
+ findMediaElement();
+ testClosedCaptionsButtonVisibility(true);
+
+ consoleWrite("");
+ consoleWrite("** The captions track should be listed in textTracks, but disabled. **");
+ testExpected("video.textTracks.length", 2);
+ testExpected("video.textTracks[0].mode", "disabled");
+ testExpected("video.textTracks[1].mode", "disabled");
+
+ consoleWrite("");
+ consoleWrite("** Set the user language preference so that the track will be chosen when the CC button is clicked. **");
+ run("internals.setUserPreferredLanguages(['ar'])");
+ clickCCButton();
+ }
+
+ function loaded()
+ {
+ findMediaElement();
+ waitForEvent('canplaythrough', startTest);
+
+ video.src = findMediaFile('video', 'content/counting');
+ }
+ </script>
+</head>
+<body onload="loaded()">
+ <p>Tests that appropriate language track is loaded, according to user preferences.</p>
+ <video controls>
+ <track src="track/captions-webvtt/captions-fast.vtt" kind="captions">
+ <track src="track/captions-webvtt/captions-fast.vtt" kind="captions" srclang="ar" onload="endTest()">
+ </video>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698