| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <title>A single track should not show overflow on caption button-press, instead
just toggle.</title> | |
| 3 <script src="../resources/testharness.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 <script src="media-controls.js"></script> | |
| 6 <script src="media-file.js"></script> | |
| 7 <video controls></video> | |
| 8 <script> | |
| 9 async_test(function(t) { | |
| 10 var captions = ["Caption"]; | |
| 11 var video = document.querySelector("video"); | |
| 12 | |
| 13 video.oncanplaythrough = t.step_func_done(function() { | |
| 14 var track1 = video.addTextTrack("captions"); | |
| 15 | |
| 16 for (var i = 0; i < captions.length; i++) { | |
| 17 track1.addCue(new VTTCue(0, 120, captions[i])); | |
| 18 } | |
| 19 assert_true(isClosedCaptionsButtonVisible(video)); | |
| 20 | |
| 21 // The captions track should be listed in textTracks, but not yet loaded
. | |
| 22 assert_equals(video.textTracks.length, 1); | |
| 23 assert_equals(video.textTracks[0].mode, "hidden"); | |
| 24 checkCaptionsHidden(video); | |
| 25 | |
| 26 // Get the menu that displays the list of text tracks. | |
| 27 var captionsList = mediaControlsElement(internals.shadowRoot(video).firs
tChild, | |
| 28 "-internal-media-controls-text-track-list"); | |
| 29 | |
| 30 clickCaptionButton(video); | |
| 31 assert_equals(getComputedStyle(captionsList).display, "none"); | |
| 32 | |
| 33 // Captions track should become visible after the closed caption button
is pressed. | |
| 34 checkCaptionsVisible(video, captions); | |
| 35 | |
| 36 // Click the closed captions button again and make sure the menu does no
t appear. | |
| 37 clickCaptionButton(video); | |
| 38 assert_equals(getComputedStyle(captionsList).display, "none"); | |
| 39 | |
| 40 // Captions track should become visible after the closed caption button
is pressed. | |
| 41 checkCaptionsHidden(video); | |
| 42 }); | |
| 43 | |
| 44 video.src = findMediaFile("video", "content/counting"); | |
| 45 }); | |
| 46 </script> | |
| OLD | NEW |