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 | 9 |
10 var cues; | 10 var cues; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 testExpected("newCue.startTime", 0.0); | 57 testExpected("newCue.startTime", 0.0); |
58 testExpected("newCue.endTime", 1.0); | 58 testExpected("newCue.endTime", 1.0); |
59 testExpected("newCue.pauseOnExit", false); | 59 testExpected("newCue.pauseOnExit", false); |
60 testExpected("newCue.vertical", ""); | 60 testExpected("newCue.vertical", ""); |
61 testExpected("newCue.snapToLines", true); | 61 testExpected("newCue.snapToLines", true); |
62 testExpected("newCue.line", -1); | 62 testExpected("newCue.line", -1); |
63 testExpected("newCue.position", 50); | 63 testExpected("newCue.position", 50); |
64 testExpected("newCue.size", 100); | 64 testExpected("newCue.size", 100); |
65 testExpected("newCue.align", "middle"); | 65 testExpected("newCue.align", "middle"); |
66 | 66 |
67 consoleWrite("<br>*** Create an old-style cue with an id."); | |
68 run("oldStyleCue = new VTTCue('sausage-cue', 33, 3.4, 'Sausage?'
)"); | |
69 testExpected("oldStyleCue.id", ""); | |
70 testExpected("oldStyleCue.startTime.toString()", "NaN"); | |
71 testExpected("oldStyleCue.endTime", 33); | |
72 consoleWrite("*** Make sure the old-style cue is not inserted be
cause its start time is not a number."); | |
73 testExpected("testTrack.track.cues.length", 5); | |
74 run("testTrack.track.addCue(oldStyleCue)"); | |
75 testExpected("testTrack.track.cues.length", 5); | |
76 | |
77 consoleWrite("<br>*** Remove a cue created with addCue()."); | 67 consoleWrite("<br>*** Remove a cue created with addCue()."); |
78 run("testTrack.track.removeCue(textCue)"); | 68 run("testTrack.track.removeCue(textCue)"); |
79 testExpected("textCue.track", null); | 69 testExpected("textCue.track", null); |
80 testExpected("cues[1].startTime", 31); | 70 testExpected("cues[1].startTime", 31); |
81 testExpected("cues[2].startTime", 61); | 71 testExpected("cues[2].startTime", 61); |
82 | 72 |
83 consoleWrite("<br>*** Remove a cue added from the WebVTT file.")
; | 73 consoleWrite("<br>*** Remove a cue added from the WebVTT file.")
; |
84 run("textCue = cues[2]"); | 74 run("textCue = cues[2]"); |
85 run("testTrack.track.removeCue(textCue)"); | 75 run("testTrack.track.removeCue(textCue)"); |
86 testExpected("textCue.track", null); | 76 testExpected("textCue.track", null); |
(...skipping 15 matching lines...) Expand all Loading... |
102 | 92 |
103 </script> | 93 </script> |
104 </head> | 94 </head> |
105 <body> | 95 <body> |
106 <p>Tests TextTrack's addCue and removeCue</p> | 96 <p>Tests TextTrack's addCue and removeCue</p> |
107 <video> | 97 <video> |
108 <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" kind=
"captions" onload="trackLoaded()" default> | 98 <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" kind=
"captions" onload="trackLoaded()" default> |
109 </video> | 99 </video> |
110 </body> | 100 </body> |
111 </html> | 101 </html> |
OLD | NEW |