OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test that we can display a track list menu and select tracks from the lis
t.</title> | 2 <title>Test that we can display a track list menu and select tracks from the lis
t.</title> |
3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="track/track-helpers.js"></script> | 5 <script src="track/track-helpers.js"></script> |
6 <script src="media-file.js"></script> | 6 <script src="media-file.js"></script> |
7 <script src="media-controls.js"></script> | 7 <script src="media-controls.js"></script> |
8 <video controls> | 8 <video controls> |
9 <track src="track/captions-webvtt/captions.vtt" kind="captions" label="Track
1"> | 9 <track src="track/captions-webvtt/captions.vtt" kind="captions" label="Track
1"> |
10 <track src="track/captions-webvtt/long-word.vtt" kind="captions" label="Trac
k2"> | 10 <track src="track/captions-webvtt/long-word.vtt" kind="captions" label="Trac
k2"> |
(...skipping 17 matching lines...) Expand all Loading... |
28 video.oncanplaythrough = t.step_func_done(function() { | 28 video.oncanplaythrough = t.step_func_done(function() { |
29 assert_true(isClosedCaptionsButtonVisible(video)); | 29 assert_true(isClosedCaptionsButtonVisible(video)); |
30 assert_equals(video.textTracks.length, 2); | 30 assert_equals(video.textTracks.length, 2); |
31 assert_equals(video.textTracks[0].mode, "hidden"); | 31 assert_equals(video.textTracks[0].mode, "hidden"); |
32 assert_equals(video.textTracks[1].mode, "hidden"); | 32 assert_equals(video.textTracks[1].mode, "hidden"); |
33 | 33 |
34 // Select track 0 and verify it is displayed. | 34 // Select track 0 and verify it is displayed. |
35 clickTextTrackAtIndex(video, 0); | 35 clickTextTrackAtIndex(video, 0); |
36 assert_equals(video.textTracks[0].mode, "showing"); | 36 assert_equals(video.textTracks[0].mode, "showing"); |
37 assert_equals(video.textTracks[1].mode, "hidden"); | 37 assert_equals(video.textTracks[1].mode, "hidden"); |
38 assert_equals(textTrackCueElementByIndex(video, 0).innerText, "Lorem
"); | 38 assert_equals(textTrackDisplayElement(video).innerText, "Lorem"); |
39 | 39 |
40 // Select track 1 and verify it is displayed. | 40 // Select track 1 and verify it is displayed. |
41 clickTextTrackAtIndex(video, 1); | 41 clickTextTrackAtIndex(video, 1); |
42 assert_equals(video.textTracks[0].mode, "disabled"); | 42 assert_equals(video.textTracks[0].mode, "disabled"); |
43 assert_equals(video.textTracks[1].mode, "showing"); | 43 assert_equals(video.textTracks[1].mode, "showing"); |
44 assert_equals(textTrackCueElementByIndex(video, 0).innerText, "first
caption"); | 44 assert_equals(textTrackDisplayElement(video).innerText, "first capti
on"); |
45 }); | 45 }); |
46 | 46 |
47 video.src = findMediaFile("video", "content/test"); | 47 video.src = findMediaFile("video", "content/test"); |
48 } | 48 } |
49 }); | 49 }); |
50 </script> | 50 </script> |
OLD | NEW |