| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <title>TextTrack.removeCue()</title> | 2 <title>TextTrack.removeCue()</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 setup(function(){ | 7 setup(function(){ |
| 8 window.video = document.createElement('video'); | 8 window.video = document.createElement('video'); |
| 9 document.body.appendChild(video); | 9 document.body.appendChild(video); |
| 10 }, {timeout:5000}); | 10 }, {timeout:5000}); |
| 11 test(function() { | 11 test(function() { |
| 12 var t1 = video.addTextTrack('subtitles'); | 12 var t1 = video.addTextTrack('subtitles'); |
| 13 var t2 = video.addTextTrack('subtitles'); | 13 var t2 = video.addTextTrack('subtitles'); |
| 14 var c1 = new TextTrackCue(0, 1, 'text1'); | 14 var c1 = new VTTCue(0, 1, 'text1'); |
| 15 assert_throws("NOT_FOUND_ERR", function() { | 15 assert_throws("NOT_FOUND_ERR", function() { |
| 16 t1.removeCue(c1); | 16 t1.removeCue(c1); |
| 17 }, 'standalone'); | 17 }, 'standalone'); |
| 18 t1.addCue(c1); | 18 t1.addCue(c1); |
| 19 assert_throws("NOT_FOUND_ERR", function() { | 19 assert_throws("NOT_FOUND_ERR", function() { |
| 20 t2.removeCue(c1); | 20 t2.removeCue(c1); |
| 21 }, 'listed in t1, remove from t2'); | 21 }, 'listed in t1, remove from t2'); |
| 22 t1.removeCue(c1); | 22 t1.removeCue(c1); |
| 23 assert_throws("NOT_FOUND_ERR", function() { | 23 assert_throws("NOT_FOUND_ERR", function() { |
| 24 t1.removeCue(c1); | 24 t1.removeCue(c1); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 assert_throws('NOT_FOUND_ERR', function() { track.track.removeCue(cue);
}, 'standalone, remove from track.track'); | 38 assert_throws('NOT_FOUND_ERR', function() { track.track.removeCue(cue);
}, 'standalone, remove from track.track'); |
| 39 assert_throws('NOT_FOUND_ERR', function() { t1.removeCue(cue); }, 'stand
alone, remove from t1'); | 39 assert_throws('NOT_FOUND_ERR', function() { t1.removeCue(cue); }, 'stand
alone, remove from t1'); |
| 40 t.done(); | 40 t.done(); |
| 41 }); | 41 }); |
| 42 track.src= 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 0
0:00:01.000\ntest\n'); | 42 track.src= 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 0
0:00:01.000\ntest\n'); |
| 43 track.kind = 'subtitles'; | 43 track.kind = 'subtitles'; |
| 44 track.track.mode = 'hidden'; | 44 track.track.mode = 'hidden'; |
| 45 video.appendChild(track); | 45 video.appendChild(track); |
| 46 }); | 46 }); |
| 47 </script> | 47 </script> |
| OLD | NEW |