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..08fb54878443933dd0e28164c3e070626c6a5e8a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html |
| @@ -0,0 +1,50 @@ |
| +<!DOCTYPE html> |
| +<script src="../media-file.js"></script> |
| +<script src="../video-test.js"></script> |
| +<script src="../media-controls.js"></script> |
| +<script> |
| + |
| + var track; |
| + var trackCueText = "Bonjour"; |
| + |
| + function selectTrackAdded() |
| + { |
| + findMediaElement(); |
| + testClosedCaptionsButtonVisibility(true); |
| + consoleWrite(""); |
| + testExpected("video.textTracks.length", 2); |
| + testExpected("video.textTracks[0].mode", "showing"); |
| + testExpected("track.mode", "hidden"); |
|
fs
2016/02/23 13:16:43
Using the longer expression "video.textTracks[1].m
srivats
2016/02/24 05:20:16
Done.
|
| + |
| + 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("track.mode", "showing"); |
|
fs
2016/02/23 13:16:43
Verify that [0] is now 'disabled' too?
srivats
2016/02/24 05:20:16
Done.
|
| + testExpected("textTrackDisplayElement(video, 'display').innerText", trackCueText); |
| + endTest(); |
| + } |
| + |
| + function addTextTrack() |
| + { |
| + track = video.addTextTrack("captions", "French", "fr"); |
| + track.addCue(new VTTCue(0.0, 1.0, trackCueText)); |
| + track.mode = "hidden"; |
|
fs
2016/02/23 13:16:43
'hidden' is the default in this case.
srivats
2016/02/24 05:20:16
Done.
|
| + 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> |