[Mac] some track language tags are not recognized
[WebKit-https.git] / LayoutTests / media / track / track-active-cues.html
1 <!doctype html>
2 <html>
3     <head>
4         <script src=../media-file.js></script>
5         <script src=../video-test.js></script>
6     
7         <script>
8             function clearSrc()
9             {
10                 consoleWrite("<br>** Video and track loaded, one cue should be active **");
11                 testExpected("trackElement.track.activeCues.length", 1);
12
13                 consoleWrite("<br>** Clear video 'src' and force reload **");
14                 run("video.src = ''");
15                 consoleWrite("");
16             }
17
18             function videoError()
19             {
20                 consoleWrite("** 'error' event, no cues should be active **)");
21                 testExpected("event.target", video);
22                 testExpected("video.error", null, "!=");
23                 testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
24                 testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
25                 testExpected("trackElement.track.activeCues.length", 0);
26
27                 consoleWrite("");
28                 endTest();
29             }
30
31             function setup() 
32             {
33                 consoleWrite("");
34
35                 findMediaElement();
36                 trackElement = document.querySelector('track');
37
38                 waitForEventsAndCall([[video, 'canplaythrough'], [trackElement, 'load'], [trackElement, 'cuechange']], clearSrc);
39
40                 video.src = findMediaFile("video", "../content/test");
41             }
42
43             setCaptionDisplayMode('Automatic');
44             
45         </script>
46     </head>
47     <body onload="setup()">
48         <video controls onerror="videoError()">
49             <track src="captions-webvtt/captions-fast.vtt" kind="captions" default>
50         </video>
51
52         <p>Test to ensure that a no text track cues are active after the video is unloaded.</p>
53     
54     </body>
55 </html>