| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Tests that adding a track and changing its mode through JS doesn't crash
the browser.</title> |
| 3 <head> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 | 5 <video> |
| 6 <script src=../media-file.js></script> | 6 <!-- If the src is specified through JS after the body load, the test doesn'
t crash anymore. --> |
| 7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 7 <source src="../content/test.mp4" type="video/mp4"> |
| 8 (Please avoid writing new tests using video-test.js) --> | 8 <source src="../content/test.ogv" type="video/ogg"> |
| 9 <script src=../video-test.js></script> | 9 </video> |
| 10 | 10 <script> |
| 11 <script> | 11 test(function() { |
| 12 function startTest() | 12 var video = document.querySelector('video'); |
| 13 { | 13 var track = video.addTextTrack('captions', 'English', 'en'); |
| 14 findMediaElement(); | 14 track.addCue(new VTTCue(0.0, 10.0, 'wow wow')); |
| 15 | 15 track.mode = 'showing'; |
| 16 consoleWrite("** Add a text track through JS to the video element **
"); | 16 }); |
| 17 var t = video.addTextTrack('captions', 'English', 'en'); | 17 </script> |
| 18 | |
| 19 consoleWrite("** Add cue to the text track **"); | |
| 20 t.addCue(new VTTCue(0.0, 10.0, 'wow wow')); | |
| 21 | |
| 22 consoleWrite("** Set the track mode to showing **"); | |
| 23 t.mode = "showing"; | |
| 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 adding a track and changing its mode through JS doesn't cr
ash the browser.</p> | |
| 36 <video controls> | |
| 37 <!-- If the src is specified through JS after the body load, the tes
t doesn't crash anymore. --> | |
| 38 <source src="../content/test.mp4" type="video/mp4"> | |
| 39 <source src="../content/test.ogv" type="video/ogg"> | |
| 40 </video> | |
| 41 </body> | |
| 42 </html> | |
| OLD | NEW |