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

Side by Side Diff: LayoutTests/media/track/opera/interfaces/HTMLElement/HTMLMediaElement/addTextTrack.html

Issue 790633003: Use TextTrackKind enum in HTMLMediaElement.addTextTrack IDL signature (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Nits. Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/media/track/track-addtrack-kind.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <title>HTMLMediaElement.addTextTrack</title> 2 <title>HTMLMediaElement.addTextTrack</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 var video = document.createElement('video'); 7 var video = document.createElement('video');
8 test(function(){ 8 test(function(){
9 assert_throws('SYNTAX_ERR', function(){ 9 assert_throws(new TypeError, function(){
10 video.addTextTrack('foo'); 10 video.addTextTrack('foo');
11 }); 11 });
12 assert_throws('SYNTAX_ERR', function(){ 12 assert_throws(new TypeError, function(){
13 video.addTextTrack(undefined); 13 video.addTextTrack(undefined);
14 }); 14 });
15 assert_throws('SYNTAX_ERR', function(){ 15 assert_throws(new TypeError, function(){
16 video.addTextTrack(null); 16 video.addTextTrack(null);
17 }); 17 });
18 }, document.title + ' bogus first arg'); 18 }, document.title + ' bogus first arg');
19 19
20 test(function(){ 20 test(function(){
21 assert_throws('SYNTAX_ERR', function(){ 21 assert_throws(new TypeError, function(){
22 video.addTextTrack('SUBTITLES'); 22 video.addTextTrack('SUBTITLES');
23 }); 23 });
24 }, document.title + ' uppercase first arg'); 24 }, document.title + ' uppercase first arg');
25 25
26 test(function(){ 26 test(function(){
27 var t = video.addTextTrack('subtitles'); 27 var t = video.addTextTrack('subtitles');
28 assert_equals(t.kind, 'subtitles'); 28 assert_equals(t.kind, 'subtitles');
29 assert_equals(t.label, ''); 29 assert_equals(t.label, '');
30 assert_equals(t.language, ''); 30 assert_equals(t.language, '');
31 assert_equals(t.mode, 'hidden'); 31 assert_equals(t.mode, 'hidden');
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 assert_equals(t.kind, 'metadata'); 64 assert_equals(t.kind, 'metadata');
65 assert_equals(t.label, ''); 65 assert_equals(t.label, '');
66 assert_equals(t.language, ''); 66 assert_equals(t.language, '');
67 assert_equals(t.mode, 'hidden'); 67 assert_equals(t.mode, 'hidden');
68 assert_equals(t.cues.length, 0); 68 assert_equals(t.cues.length, 0);
69 }, document.title + ' metadata first arg'); 69 }, document.title + ' metadata first arg');
70 70
71 test(function(){ 71 test(function(){
72 var t = video.addTextTrack('subtitles', undefined, undefined); 72 var t = video.addTextTrack('subtitles', undefined, undefined);
73 assert_equals(t.kind, 'subtitles'); 73 assert_equals(t.kind, 'subtitles');
74 assert_equals(t.label, 'undefined'); 74 assert_equals(t.label, '');
75 assert_equals(t.language, 'undefined'); 75 assert_equals(t.language, '');
76 assert_equals(t.mode, 'hidden'); 76 assert_equals(t.mode, 'hidden');
77 assert_equals(t.cues.length, 0); 77 assert_equals(t.cues.length, 0);
78 }, document.title + ' undefined second and third arg'); 78 }, document.title + ' undefined second and third arg');
79 79
80 test(function(){ 80 test(function(){
81 var t = video.addTextTrack('subtitles', null, null); 81 var t = video.addTextTrack('subtitles', null, null);
82 assert_equals(t.kind, 'subtitles'); 82 assert_equals(t.kind, 'subtitles');
83 assert_equals(t.label, 'null'); 83 assert_equals(t.label, 'null');
84 assert_equals(t.language, 'null'); 84 assert_equals(t.language, 'null');
85 assert_equals(t.mode, 'hidden'); 85 assert_equals(t.mode, 'hidden');
(...skipping 11 matching lines...) Expand all
97 97
98 test(function(){ 98 test(function(){
99 var t = video.addTextTrack('subtitles', 'foo'); 99 var t = video.addTextTrack('subtitles', 'foo');
100 assert_equals(t.kind, 'subtitles'); 100 assert_equals(t.kind, 'subtitles');
101 assert_equals(t.label, 'foo'); 101 assert_equals(t.label, 'foo');
102 assert_equals(t.language, ''); 102 assert_equals(t.language, '');
103 assert_equals(t.mode, 'hidden'); 103 assert_equals(t.mode, 'hidden');
104 assert_equals(t.cues.length, 0); 104 assert_equals(t.cues.length, 0);
105 }, document.title + ' foo second arg, third arg omitted'); 105 }, document.title + ' foo second arg, third arg omitted');
106 106
107 </script> 107 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/track/track-addtrack-kind.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698