OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 | 5 |
6 <script src=../media-file.js></script> | 6 <script src=../media-file.js></script> |
7 <script src=../video-test.js></script> | 7 <script src=../video-test.js></script> |
8 <script> | 8 <script> |
9 | 9 |
10 var trackCount = 0; | 10 var trackCount = 0; |
11 | 11 |
12 function addTrack(type) | 12 function addTrack(type) |
13 { | 13 { |
14 run("video.addTextTrack('" + type + "')"); | 14 run("video.addTextTrack('" + type + "')"); |
15 testExpected("video.textTracks.length", ++trackCount); | 15 testExpected("video.textTracks.length", ++trackCount); |
16 } | 16 } |
17 | 17 |
18 function start() | 18 function start() |
19 { | 19 { |
20 findMediaElement(); | 20 findMediaElement(); |
21 | 21 |
22 consoleWrite("<em>++ Test invalid 'kind'.</em>"); | 22 consoleWrite("<em>++ Test invalid 'kind'.</em>"); |
23 testExpected("video.textTracks.length", 0); | 23 testExpected("video.textTracks.length", 0); |
24 testDOMException("video.addTextTrack('kaptions')", "DOMException
.SYNTAX_ERR"); | 24 testException("video.addTextTrack('kaptions')", '"TypeError: Fai
led to execute \'addTextTrack\' on \'HTMLMediaElement\': parameter 1 (\'kaptions
\') is not a valid enum value."'); |
25 testExpected("video.textTracks.length", 0); | 25 testExpected("video.textTracks.length", 0); |
26 consoleWrite(""); | 26 consoleWrite(""); |
27 | 27 |
28 consoleWrite("<em>++ Test all valid 'kind' keywords.</em>"); | 28 consoleWrite("<em>++ Test all valid 'kind' keywords.</em>"); |
29 addTrack("subtitles"); | 29 addTrack("subtitles"); |
30 addTrack("captions"); | 30 addTrack("captions"); |
31 addTrack("descriptions"); | 31 addTrack("descriptions"); |
32 addTrack("chapters"); | 32 addTrack("chapters"); |
33 addTrack("metadata"); | 33 addTrack("metadata"); |
34 | 34 |
35 consoleWrite(""); | 35 consoleWrite(""); |
36 endTest(); | 36 endTest(); |
37 } | 37 } |
38 | 38 |
39 </script> | 39 </script> |
40 </head> | 40 </head> |
41 <body onload="start()"> | 41 <body onload="start()"> |
42 <p>Tests that the addTextTrack() only accepts known 'kind' values.</p> | 42 <p>Tests that the addTextTrack() only accepts known 'kind' values.</p> |
43 <video> | 43 <video> |
44 </video> | 44 </video> |
45 </body> | 45 </body> |
46 </html> | 46 </html> |
OLD | NEW |