OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Tests that cues are properly removed from the active cue list when their
track changes mode to disabled.</title> |
3 <head> | 3 <script src="../media-file.js"></script> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <video> |
| 7 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default > |
| 8 </video> |
| 9 <script> |
| 10 async_test(function(t) { |
| 11 var video = document.querySelector("video"); |
| 12 var testTrack = document.querySelector("track"); |
5 | 13 |
6 <script src=../media-file.js></script> | 14 video.src = findMediaFile("video", "../content/counting"); |
7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 15 video.oncanplaythrough = t.step_func(startTest); |
8 (Please avoid writing new tests using video-test.js) --> | 16 video.onseeked = t.step_func_done(seeked); |
9 <script src=../video-test.js></script> | |
10 <script> | |
11 var testTrack; | |
12 | 17 |
13 function seeked() | 18 function startTest() { |
14 { | 19 // Set the mode of the text track to showing. |
15 consoleWrite("** Set the mode of the text track to hidden, then
showing again. **"); | 20 testTrack.track.mode = "showing"; |
16 testTrack.track.mode = "hidden"; | 21 // Seek to a time with a caption. |
17 testTrack.track.mode = "showing"; | 22 video.currentTime = 1.5; |
| 23 } |
18 | 24 |
19 consoleWrite("** Set the mode of the text track to disabled. **"
); | 25 function seeked() { |
20 testTrack.track.mode = "disabled"; | 26 // Set the mode of the text track to hidden, then showing again. |
| 27 testTrack.track.mode = "hidden"; |
| 28 testTrack.track.mode = "showing"; |
21 | 29 |
22 consoleWrite(""); | 30 // Set the mode of the text track to disabled. |
23 consoleWrite("No crash. PASS."); | 31 testTrack.track.mode = "disabled"; |
24 consoleWrite(""); | 32 // No crash, PASS. |
25 | 33 } |
26 endTest(); | 34 }); |
27 } | 35 </script> |
28 | |
29 function startTest() | |
30 { | |
31 consoleWrite("** Set the mode of the text track to showing. **")
; | |
32 testTrack.track.mode = "showing"; | |
33 consoleWrite("** Seek to a time with a caption. **"); | |
34 video.currentTime = 1.5; | |
35 } | |
36 | |
37 function loaded() | |
38 { | |
39 findMediaElement(); | |
40 testTrack = document.querySelector('track'); | |
41 | |
42 video.src = findMediaFile('video', '../content/counting'); | |
43 waitForEvent('seeked', seeked); | |
44 waitForEvent('canplaythrough', startTest); | |
45 } | |
46 | |
47 </script> | |
48 </head> | |
49 <body onload="loaded()"> | |
50 <video controls > | |
51 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" defau
lt > | |
52 </video> | |
53 <p>Tests that cues are properly removed from the active cue list when thei
r track changes mode to disabled.</p> | |
54 </body> | |
55 </html> | |
OLD | NEW |