blob: a6c78b2e45d76c1f75be53c14f9a385460133e3d [file] [log] [blame]
victor@rosedu.org5d766382013-01-07 19:21:07 +00001<!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.com06a95f42016-08-23 06:44:02 +000018 t.addCue(new VTTCue(0.0, 10.0, 'wow wow'));
victor@rosedu.org5d766382013-01-07 19:21:07 +000019
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>