| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Tests that having empty cues does not crash the browser.</title> |
| 3 <head> | 3 <script src="../media-file.js"></script> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../../resources/testharness.js"></script> |
| 5 | 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <script src=../media-file.js></script> | 6 <script> |
| 7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 7 test(function() { |
| 8 (Please avoid writing new tests using video-test.js) --> | 8 var video = document.createElement("video"); |
| 9 <script src=../video-test.js></script> | 9 video.src = findMediaFile("video", "../content/test"); |
| 10 <script> | 10 video.addTextTrack("captions", "regular captions track", "en"); |
| 11 function startTest() | 11 video.textTracks[0].addCue(new VTTCue(0, 4, "")); |
| 12 { | 12 video.play(); |
| 13 findMediaElement(); | 13 }); |
| 14 video.src = findMediaFile('video', '../content/test'); | 14 </script> |
| 15 | |
| 16 consoleWrite("** Add a text track to the video element **"); | |
| 17 video.addTextTrack("captions", "regular captions track", "en"); | |
| 18 | |
| 19 consoleWrite("** Add an empty cue to the track **"); | |
| 20 video.textTracks[0].addCue(new VTTCue(0.00, 4.00, "")); | |
| 21 | |
| 22 consoleWrite("** Play the video and render the cue **"); | |
| 23 video.play(); | |
| 24 | |
| 25 consoleWrite(""); | |
| 26 consoleWrite("No crash. PASS."); | |
| 27 consoleWrite(""); | |
| 28 | |
| 29 endTest(); | |
| 30 } | |
| 31 </script> | |
| 32 </head> | |
| 33 | |
| 34 <body onload="startTest()"> | |
| 35 <p>Tests that having empty cues does not crash the browser.</p> | |
| 36 <video controls /> | |
| 37 </body> | |
| 38 </html> | |
| OLD | NEW |