OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <title>TextTrack.kind</title> | 2 <title>TextTrack.kind</title> |
3 <script src=../../../../../resources/testharness.js></script> | 3 <script src=../../../../../resources/testharness.js></script> |
4 <script src=../../../../../resources/testharnessreport.js></script> | 4 <script src=../../../../../resources/testharnessreport.js></script> |
5 <div id=log></div> | 5 <div id=log></div> |
6 <script> | 6 <script> |
7 test(function(){ | 7 test(function(){ |
8 var video = document.createElement('video'); | 8 var video = document.createElement('video'); |
9 var t1 = video.addTextTrack('subtitles'); | 9 var t1 = video.addTextTrack('subtitles'); |
10 var t2 = video.addTextTrack('captions'); | 10 var t2 = video.addTextTrack('captions'); |
11 var t3 = video.addTextTrack('descriptions'); | 11 var t3 = video.addTextTrack('descriptions'); |
12 var t4 = video.addTextTrack('chapters'); | 12 var t4 = video.addTextTrack('chapters'); |
13 var t5 = video.addTextTrack('metadata'); | 13 var t5 = video.addTextTrack('metadata'); |
14 assert_equals(t1.kind, 'subtitles'); | 14 assert_equals(t1.kind, 'subtitles'); |
15 assert_equals(t2.kind, 'captions'); | 15 assert_equals(t2.kind, 'captions'); |
16 assert_equals(t3.kind, 'descriptions'); | 16 assert_equals(t3.kind, 'descriptions'); |
17 assert_equals(t4.kind, 'chapters'); | 17 assert_equals(t4.kind, 'chapters'); |
18 assert_equals(t5.kind, 'metadata'); | 18 assert_equals(t5.kind, 'metadata'); |
19 }, document.title+', addTextTrack'); | 19 }, document.title+', addTextTrack'); |
20 test(function(){ | 20 test(function(){ |
21 var track = document.createElement('track'); | 21 var track = document.createElement('track'); |
22 track.setAttribute('kind', 'CAPTIONS'); | 22 track.setAttribute('kind', 'CAPTIONS'); |
23 var t = track.track; | 23 var t = track.track; |
24 assert_equals(t.kind, 'captions'); | 24 assert_equals(t.kind, 'captions'); |
25 }, document.title+', track element'); | 25 }, document.title+', track element'); |
26 test(function(){ | 26 test(function(){ |
27 var track = document.createElement('track'); | 27 var track = document.createElement('track'); |
28 track.kind = 'captions\u0000'; | 28 track.kind = 'captions\u0000'; |
29 assert_equals(track.track.kind, 'subtitles'); | 29 assert_equals(track.track.kind, 'metadata'); |
30 }, document.title+', \\u0000'); | 30 }, document.title+', \\u0000'); |
31 </script> | 31 </script> |
OLD | NEW |