| 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 cues; | 10 var cues; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 consoleWrite("<br>*** Remove a cue added from the WebVTT file.")
; | 80 consoleWrite("<br>*** Remove a cue added from the WebVTT file.")
; |
| 81 run("textCue = cues[2]"); | 81 run("textCue = cues[2]"); |
| 82 run("testTrack.track.removeCue(textCue)"); | 82 run("testTrack.track.removeCue(textCue)"); |
| 83 testExpected("textCue.track", null); | 83 testExpected("textCue.track", null); |
| 84 testExpected("cues[1].startTime", 31); | 84 testExpected("cues[1].startTime", 31); |
| 85 testExpected("cues[2].startTime", 121); | 85 testExpected("cues[2].startTime", 121); |
| 86 | 86 |
| 87 consoleWrite("<br>*** Try to remove the cue again."); | 87 consoleWrite("<br>*** Try to remove the cue again."); |
| 88 testException("testTrack.track.removeCue(textCue)", "DOMExceptio
n.INVALID_STATE_ERR"); | 88 testException("testTrack.track.removeCue(textCue)", "DOMExceptio
n.INVALID_STATE_ERR"); |
| 89 | 89 |
| 90 consoleWrite("<br>*** Add a cue before all the existing cues."); |
| 91 run("testTrack.track.addCue(new TextTrackCue(0, 31, 'I am first'
))"); |
| 92 testExpected("cues[0].startTime", 0); |
| 93 testExpected("cues[0].endTime", 31); |
| 94 testExpected("cues[1].startTime", 0); |
| 95 testExpected("cues[1].endTime", 30.5); |
| 96 testExpected("cues[2].startTime", 31); |
| 90 endTest(); | 97 endTest(); |
| 91 } | 98 } |
| 92 | 99 |
| 93 </script> | 100 </script> |
| 94 </head> | 101 </head> |
| 95 <body> | 102 <body> |
| 96 <p>Tests TextTrackCue's addCue and removeCue</p> | 103 <p>Tests TextTrackCue's addCue and removeCue</p> |
| 97 <video> | 104 <video> |
| 98 <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" kind=
"captions" onload="trackLoaded()" default> | 105 <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" kind=
"captions" onload="trackLoaded()" default> |
| 99 </video> | 106 </video> |
| 100 </body> | 107 </body> |
| 101 </html> | 108 </html> |
| OLD | NEW |