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 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 8 (Please avoid writing new tests using video-test.js) --> |
7 <script src=../video-test.js></script> | 9 <script src=../video-test.js></script> |
8 <script src=../media-controls.js></script> | 10 <script src=../media-controls.js></script> |
9 | 11 |
10 <script> | 12 <script> |
11 | 13 |
12 var testTrack; | 14 var testTrack; |
13 var seekedCount = 0; | 15 var seekedCount = 0; |
14 var info = [ | 16 var info = [ |
15 0.5, "", | 17 0.5, "", |
16 1.5, "Lorem ipsum dolor sit amet,", | 18 1.5, "Lorem ipsum dolor sit amet,", |
17 2.5, "", | 19 2.5, "", |
18 3.3, "consectetuer adipiscing elit,", | 20 3.3, "consectetuer adipiscing elit,", |
19 0.6, "", | 21 0.6, "", |
20 5.9, "sed diam nonummy nibh euismod tincidunt", | 22 5.9, "sed diam nonummy nibh euismod tincidunt", |
21 4.4, "", | 23 4.4, "", |
22 7.9, "ut laoreet dolore magna aliquam erat volutpat." | 24 7.9, "ut laoreet dolore magna aliquam erat volutpat." |
23 ]; | 25 ]; |
24 | 26 |
25 function seeked() | 27 function seeked() |
26 { | 28 { |
27 var time = info[seekedCount]; | 29 var time = info[seekedCount]; |
28 var cueText = info[seekedCount + 1]; | 30 var cueText = info[seekedCount + 1]; |
29 seekedCount += 2; | 31 seekedCount += 2; |
30 | 32 |
31 testExpected("video.currentTime.toFixed(1)", time.toFixed(1)); | 33 testExpected("video.currentTime.toFixed(1)", time.toFixed(1)); |
32 if (cueText.length) | 34 if (cueText.length) |
(...skipping 11 matching lines...) Expand all Loading... |
44 } | 46 } |
45 | 47 |
46 function loaded() | 48 function loaded() |
47 { | 49 { |
48 findMediaElement(); | 50 findMediaElement(); |
49 testTrack = document.querySelector('track'); | 51 testTrack = document.querySelector('track'); |
50 video.src = findMediaFile('video', '../content/counting'); | 52 video.src = findMediaFile('video', '../content/counting'); |
51 waitForEvent('seeked', seeked); | 53 waitForEvent('seeked', seeked); |
52 waitForEventOnce('canplaythrough', function() { video.currentTime =
.5; }); | 54 waitForEventOnce('canplaythrough', function() { video.currentTime =
.5; }); |
53 } | 55 } |
54 | 56 |
55 </script> | 57 </script> |
56 </head> | 58 </head> |
57 <body onload="loaded()"> | 59 <body onload="loaded()"> |
58 <video controls > | 60 <video controls > |
59 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" defau
lt> | 61 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" defau
lt> |
60 </video> | 62 </video> |
61 <p>Test that cues are rendered and removed.</p> | 63 <p>Test that cues are rendered and removed.</p> |
62 </body> | 64 </body> |
63 </html> | 65 </html> |
OLD | NEW |