Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html |
| diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ef80f458a4ba03b37fe1e3973872d53fa621102c |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html |
| @@ -0,0 +1,50 @@ |
| +<!DOCTYPE html> |
| +<title>A single track should not show overflow on caption button-press, instead just toggle.</title> |
|
foolip
2016/12/02 11:29:17
Analogous issues in this file, won't comment on th
mlamouri (slow - plz ping)
2016/12/05 15:17:56
Ack.
|
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../media-controls.js"></script> |
| +<script src="../media-file.js"></script> |
| +<video controls></video> |
| +<script> |
| +async_test(t => { |
| + var captions = ["Caption"]; |
| + var video = document.querySelector("video"); |
| + |
| + video.oncanplaythrough = t.step_func(_ => { |
| + var track1 = video.addTextTrack("captions"); |
| + |
| + for (var i = 0; i < captions.length; i++) { |
| + track1.addCue(new VTTCue(0, 120, captions[i])); |
| + } |
| + |
| + // The controls are updated asynchronously. |
| + setTimeout(t.step_func_done(_ => { |
| + assert_true(isClosedCaptionsButtonVisible(video)); |
| + |
| + // The captions track should be listed in textTracks, but not yet loaded. |
| + assert_equals(video.textTracks.length, 1); |
| + assert_equals(video.textTracks[0].mode, "hidden"); |
| + checkCaptionsHidden(video); |
| + |
| + // Get the menu that displays the list of text tracks. |
| + var captionsList = mediaControlsElement(internals.shadowRoot(video).firstChild, |
| + "-internal-media-controls-text-track-list"); |
| + |
| + clickCaptionButton(video); |
| + assert_equals(getComputedStyle(captionsList).display, "none"); |
| + |
| + // Captions track should become visible after the closed caption button is pressed. |
| + checkCaptionsVisible(video, captions); |
| + |
| + // Click the closed captions button again and make sure the menu does not appear. |
| + clickCaptionButton(video); |
| + assert_equals(getComputedStyle(captionsList).display, "none"); |
| + |
| + // Captions track should become invisible after the closed caption button is pressed. |
| + checkCaptionsHidden(video); |
| + })); |
| + }); |
| + |
| + video.src = findMediaFile("video", "../content/counting"); |
| +}); |
| +</script> |