| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| 5 <title>Test non-default track load according to user language preference.</t
itle> | |
| 6 <script src=media-file.js></script> | |
| 7 <script src=media-controls.js></script> | |
| 8 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | |
| 9 (Please avoid writing new tests using video-test.js) --> | |
| 10 <script src=video-test.js></script> | |
| 11 <script> | |
| 12 var track; | |
| 13 | |
| 14 function startTest() | |
| 15 { | |
| 16 if (!window.eventSender) { | |
| 17 consoleWrite("No eventSender found."); | |
| 18 failTest(); | |
| 19 } | |
| 20 | |
| 21 findMediaElement(); | |
| 22 testClosedCaptionsButtonVisibility(true); | |
| 23 | |
| 24 consoleWrite(""); | |
| 25 consoleWrite("** The captions track should be listed in textTracks,
but disabled. **"); | |
| 26 testExpected("video.textTracks.length", 2); | |
| 27 testExpected("video.textTracks[0].mode", "disabled"); | |
| 28 testExpected("video.textTracks[1].mode", "disabled"); | |
| 29 | |
| 30 consoleWrite(""); | |
| 31 consoleWrite("** Set the user language preference so that the track
will be chosen when the CC button is clicked. **"); | |
| 32 run("internals.setUserPreferredLanguages(['ar'])"); | |
| 33 clickCCButton(); | |
| 34 } | |
| 35 | |
| 36 function loaded() | |
| 37 { | |
| 38 findMediaElement(); | |
| 39 waitForEvent('canplaythrough', startTest); | |
| 40 | |
| 41 video.src = findMediaFile('video', 'content/counting'); | |
| 42 } | |
| 43 </script> | |
| 44 </head> | |
| 45 <body onload="loaded()"> | |
| 46 <p>Tests that appropriate language track is loaded, according to user prefer
ences.</p> | |
| 47 <video controls> | |
| 48 <track src="track/captions-webvtt/captions-fast.vtt" kind="captions"> | |
| 49 <track src="track/captions-webvtt/captions-fast.vtt" kind="captions" src
lang="ar" onload="endTest()"> | |
| 50 </video> | |
| 51 </body> | |
| 52 </html> | |
| OLD | NEW |