Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html |
| diff --git a/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..08bb47b5ccd477efaf1bd48d801289fa418f2463 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html |
| @@ -0,0 +1,49 @@ |
| +<!DOCTYPE html> |
| +<script src="../media-file.js"></script> |
| +<script src="../video-test.js"></script> |
|
philipj_slow
2016/03/01 09:08:27
In the new tests that use video-test.js, can you a
srivats
2016/03/30 00:46:42
Of course. Added
|
| +<script src="../media-controls.js"></script> |
| +<script> |
| + |
| + var trackCueText = "Bonjour"; |
| + |
| + function selectTrackAdded() |
| + { |
| + findMediaElement(); |
| + testClosedCaptionsButtonVisibility(true); |
| + consoleWrite(""); |
| + testExpected("video.textTracks.length", 2); |
| + testExpected("video.textTracks[0].mode", "showing"); |
| + testExpected("video.textTracks[1].mode", "hidden"); |
| + |
| + consoleWrite(""); |
| + consoleWrite("Verify the default track is being displayed"); |
| + testExpected("textTrackDisplayElement(video, 'display').innerText", "Lorem"); |
| + |
| + consoleWrite(""); |
| + consoleWrite("Select the newly added track"); |
| + selectTextTrack(video, 1); |
| + testExpected("video.textTracks[1].mode", "showing"); |
| + testExpected("video.textTracks[0].mode", "disabled"); |
| + testExpected("textTrackDisplayElement(video, 'display').innerText", trackCueText); |
| + endTest(); |
| + } |
| + |
| + function addTextTrack() |
| + { |
| + track = video.addTextTrack("captions", "French", "fr"); |
| + track.addCue(new VTTCue(0.0, 1.0, trackCueText)); |
| + selectTrackAdded(); |
| + } |
| + |
| + window.onload = function() |
| + { |
| + consoleWrite("Test that we can add a track dynamically and it is displayed on the track selection menu"); |
| + findMediaElement(); |
| + video.src = findMediaFile("video", "../content/test"); |
| + waitForEvent("canplaythrough", addTextTrack); |
| + } |
| + |
| +</script> |
| +<video controls> |
| + <track src="captions-webvtt/captions.vtt" kind="captions" label="English" srclang="en" default> |
| +</video> |