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=../video-test.js></script> | 6 <script src=../video-test.js></script> |
7 <script> | 7 <script> |
8 | 8 |
9 function trackLoaded() | 9 function trackLoaded() |
10 { | 10 { |
11 consoleWrite("Test that cues with negative startTime are not add
ed:"); | 11 consoleWrite("Test that cues with negative startTime are not add
ed:"); |
12 testExpected("testTrack.track.cues.length", 4); | 12 testExpected("testTrack.track.cues.length", 4); |
13 run("textCue = new VTTCue('sausage-cue', -3439332606, 3.4, 'Saus
age?')"); | 13 run("textCue = new VTTCue(-3439332606, 3.4, 'Sausage?')"); |
14 run("testTrack.track.addCue(textCue)"); | 14 run("testTrack.track.addCue(textCue)"); |
15 testExpected("testTrack.track.cues.length", 4); | 15 testExpected("testTrack.track.cues.length", 4); |
16 | 16 |
17 consoleWrite("<br>Test that cues with negative startTime and neg
ative endTime are not added:"); | 17 consoleWrite("<br>Test that cues with negative startTime and neg
ative endTime are not added:"); |
18 testExpected("testTrack.track.cues.length", 4); | 18 testExpected("testTrack.track.cues.length", 4); |
19 run("textCue = new VTTCue('pepperoni-cue', -110, -3.4, 'Pepperon
i?')"); | 19 run("textCue = new VTTCue(-110, -3.4, 'Pepperoni?')"); |
20 run("testTrack.track.addCue(textCue)"); | 20 run("testTrack.track.addCue(textCue)"); |
21 testExpected("testTrack.track.cues.length", 4); | 21 testExpected("testTrack.track.cues.length", 4); |
22 | 22 |
23 consoleWrite("<br>Test that setting startTime and endTime to neg
ative values does not affect the value:"); | 23 consoleWrite("<br>Test that setting startTime and endTime to neg
ative values does not affect the value:"); |
24 testExpected("testTrack.track.cues[3].startTime", 121); | 24 testExpected("testTrack.track.cues[3].startTime", 121); |
25 run("testTrack.track.cues[3].startTime = -5"); | 25 run("testTrack.track.cues[3].startTime = -5"); |
26 testExpected("testTrack.track.cues[3].startTime", 121); | 26 testExpected("testTrack.track.cues[3].startTime", 121); |
27 testExpected("testTrack.track.cues[3].endTime", 361200.5); | 27 testExpected("testTrack.track.cues[3].endTime", 361200.5); |
28 run("testTrack.track.cues[3].endTime = -3439332606"); | 28 run("testTrack.track.cues[3].endTime = -3439332606"); |
29 testExpected("testTrack.track.cues[3].endTime", 361200.5); | 29 testExpected("testTrack.track.cues[3].endTime", 361200.5); |
30 | 30 |
31 endTest(); | 31 endTest(); |
32 } | 32 } |
33 | 33 |
34 </script> | 34 </script> |
35 | 35 |
36 </head> | 36 </head> |
37 <body> | 37 <body> |
38 <p>Tests negative timestamps.</p> | 38 <p>Tests negative timestamps.</p> |
39 <video> | 39 <video> |
40 <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" onloa
d="trackLoaded()" default> | 40 <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" onloa
d="trackLoaded()" default> |
41 </video> | 41 </video> |
42 </body> | 42 </body> |
43 </html> | 43 </html> |
OLD | NEW |