victor@rosedu.org | 5d76638 | 2013-01-07 19:21:07 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 5 | |
| 6 | <script src=../media-file.js></script> |
| 7 | <script src=../video-test.js></script> |
| 8 | |
| 9 | <script> |
| 10 | function startTest() |
| 11 | { |
| 12 | findMediaElement(); |
| 13 | |
| 14 | consoleWrite("** Add a text track through JS to the video element **"); |
| 15 | var t = video.addTextTrack('captions', 'English', 'en'); |
| 16 | |
| 17 | consoleWrite("** Add cue to the text track **"); |
cdumez@apple.com | 06a95f4 | 2016-08-23 06:44:02 +0000 | [diff] [blame] | 18 | t.addCue(new VTTCue(0.0, 10.0, 'wow wow')); |
victor@rosedu.org | 5d76638 | 2013-01-07 19:21:07 +0000 | [diff] [blame] | 19 | |
| 20 | consoleWrite("** Set the track mode to showing **"); |
| 21 | t.mode = "showing"; |
| 22 | |
| 23 | consoleWrite(""); |
| 24 | consoleWrite("No crash. PASS."); |
| 25 | consoleWrite(""); |
| 26 | |
| 27 | endTest(); |
| 28 | } |
| 29 | </script> |
| 30 | </head> |
| 31 | |
| 32 | <body onload="startTest()"> |
| 33 | <p>Tests that adding a track and changing its mode through JS doesn't crash the browser.</p> |
| 34 | <video controls> |
| 35 | <!-- If the src is specified through JS after the body load, the test doesn't crash anymore. --> |
| 36 | <source src="../content/test.mp4" type="video/mp4"> |
| 37 | <source src="../content/test.ogv" type="video/ogg"> |
| 38 | </video> |
| 39 | </body> |
| 40 | </html> |