| 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 function removeActiveCue() | 9 function removeActiveCue() |
| 10 { | 10 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 function startTest() | 24 function startTest() |
| 25 { | 25 { |
| 26 findMediaElement(); | 26 findMediaElement(); |
| 27 video.src = findMediaFile('video', '../content/test'); | 27 video.src = findMediaFile('video', '../content/test'); |
| 28 | 28 |
| 29 consoleWrite("** Add a text track to the video element **"); | 29 consoleWrite("** Add a text track to the video element **"); |
| 30 video.addTextTrack("captions", "regular captions track", "en"); | 30 video.addTextTrack("captions", "regular captions track", "en"); |
| 31 | 31 |
| 32 consoleWrite("** Add a cue to the track with enter event listener. *
*"); | 32 consoleWrite("** Add a cue to the track with enter event listener. *
*"); |
| 33 var cue = new TextTrackCue(0.00, 4.00, "Random"); | 33 var cue = new VTTCue(0.00, 4.00, "Random"); |
| 34 cue.addEventListener("enter", removeActiveCue); | 34 cue.addEventListener("enter", removeActiveCue); |
| 35 video.textTracks[0].addCue(cue); | 35 video.textTracks[0].addCue(cue); |
| 36 | 36 |
| 37 consoleWrite(""); | 37 consoleWrite(""); |
| 38 consoleWrite("** Play the video and remove cue when it becomes activ
e. **"); | 38 consoleWrite("** Play the video and remove cue when it becomes activ
e. **"); |
| 39 run("video.play()"); | 39 run("video.play()"); |
| 40 | 40 |
| 41 video.textTracks[0].mode = "showing"; | 41 video.textTracks[0].mode = "showing"; |
| 42 } | 42 } |
| 43 </script> | 43 </script> |
| 44 </head> | 44 </head> |
| 45 | 45 |
| 46 <body onload="startTest()"> | 46 <body onload="startTest()"> |
| 47 <p>Tests that removing an active cue does not crash the browser.</p> | 47 <p>Tests that removing an active cue does not crash the browser.</p> |
| 48 <video controls /> | 48 <video controls /> |
| 49 </body> | 49 </body> |
| 50 </html> | 50 </html> |
| OLD | NEW |