Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html

Issue 2301823002: Reordering media controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media-controls
Patch Set: addressed comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test that we can add a track dynamically and it is displayed on the track selection menu.</title> 2 <title>Test that we can add a track dynamically and it is displayed on the track selection menu.</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="../media-file.js"></script> 5 <script src="../media-file.js"></script>
6 <script src="../media-controls.js"></script> 6 <script src="../media-controls.js"></script>
7 <video controls> 7 <!-- Width should be large enough to display closed captions button. -->
8 <video controls style="width: 500px">
8 <track src="captions-webvtt/captions.vtt" kind="captions" label="English" sr clang="en" default> 9 <track src="captions-webvtt/captions.vtt" kind="captions" label="English" sr clang="en" default>
9 </video> 10 </video>
10 <script> 11 <script>
11 async_test(function(t) { 12 async_test(function(t) {
12 var trackCueText = "Bonjour"; 13 var trackCueText = "Bonjour";
13 var video = document.querySelector("video"); 14 var video = document.querySelector("video");
14 15
15 video.oncanplaythrough = t.step_func_done(function() { 16 video.oncanplaythrough = t.step_func_done(function() {
16 var track = video.addTextTrack("captions", "French", "fr"); 17 var track = video.addTextTrack("captions", "French", "fr");
17 track.addCue(new VTTCue(0, 1, trackCueText)); 18 track.addCue(new VTTCue(0, 1, trackCueText));
18 assert_true(isClosedCaptionsButtonVisible(video)); 19 assert_true(isClosedCaptionsButtonVisible(video));
19 assert_equals(video.textTracks.length, 2); 20 assert_equals(video.textTracks.length, 2);
20 assert_equals(video.textTracks[0].mode, "showing"); 21 assert_equals(video.textTracks[0].mode, "showing");
21 assert_equals(video.textTracks[1].mode, "hidden"); 22 assert_equals(video.textTracks[1].mode, "hidden");
22 23
23 // Verify the default track is being displayed. 24 // Verify the default track is being displayed.
24 assert_equals(textTrackDisplayElement(video).innerText, "Lorem"); 25 assert_equals(textTrackDisplayElement(video).innerText, "Lorem");
25 26
26 // Click the newly added track. 27 // Click the newly added track.
27 clickTextTrackAtIndex(video, 1); 28 clickTextTrackAtIndex(video, 1);
28 assert_equals(video.textTracks[1].mode, "showing"); 29 assert_equals(video.textTracks[1].mode, "showing");
29 assert_equals(video.textTracks[0].mode, "disabled"); 30 assert_equals(video.textTracks[0].mode, "disabled");
30 assert_equals(textTrackDisplayElement(video).innerText, trackCueText); 31 assert_equals(textTrackDisplayElement(video).innerText, trackCueText);
31 }); 32 });
32 33
33 video.src = findMediaFile("video", "../content/test"); 34 video.src = findMediaFile("video", "../content/test");
34 }) 35 })
35 </script> 36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698