| Index: LayoutTests/media/video-controls-captions-on-off.html
|
| diff --git a/LayoutTests/media/video-controls-captions-multiple-clicks.html b/LayoutTests/media/video-controls-captions-on-off.html
|
| similarity index 68%
|
| rename from LayoutTests/media/video-controls-captions-multiple-clicks.html
|
| rename to LayoutTests/media/video-controls-captions-on-off.html
|
| index 30990c95cb9979b945e57a7f0ecd93eee0588fa7..0f90f91b955d36ded996d4aab9f812b1850aca56 100644
|
| --- a/LayoutTests/media/video-controls-captions-multiple-clicks.html
|
| +++ b/LayoutTests/media/video-controls-captions-on-off.html
|
| @@ -2,20 +2,19 @@
|
| <html>
|
| <head>
|
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
| - <title>Test closed caption button toggling.</title>
|
| - <script src=media-file.js></script>
|
| - <script src=media-controls.js></script>
|
| - <script src=video-test.js></script>
|
| + <title>Test closed caption track selection on and off.</title>
|
| + <script src="media-file.js"></script>
|
| + <script src="media-controls.js"></script>
|
| + <script src="video-test.js"></script>
|
| <script>
|
| - var displayElement;
|
| - var track;
|
| var text = ["First", "Second", "Third"];
|
| + var displayElement;
|
|
|
| function addTextTrack()
|
| {
|
| - track = video.addTextTrack('captions');
|
| + var track = video.addTextTrack("captions");
|
|
|
| - for(var i = 0; i < 3; i++) {
|
| + for (var i = 0; i < 3; i++) {
|
| var cue = new VTTCue(0, 120, text[i]);
|
| track.addCue(cue);
|
| }
|
| @@ -25,9 +24,9 @@
|
| {
|
| for (var i = 0; i < 3; i++) {
|
| try {
|
| - displayElement = textTrackDisplayElement(video, 'display', i);
|
| + displayElement = textTrackDisplayElement(video, "display", i);
|
| testExpected("displayElement.innerText", text[i]);
|
| - } catch(e) {
|
| + } catch (e) {
|
| consoleWrite(e);
|
| }
|
| }
|
| @@ -52,18 +51,18 @@
|
| checkCaptionsDisplay();
|
|
|
| consoleWrite("");
|
| - consoleWrite("** Captions track should become visible after button is clicked **");
|
| - clickCCButton();
|
| + consoleWrite("** Captions track should become visible after the track is selected **");
|
| + selectTextTrack(video, 0);
|
| checkCaptionsDisplay();
|
|
|
| consoleWrite("");
|
| - consoleWrite("** Captions should not be visible after button is clicked again **");
|
| - clickCCButton();
|
| + consoleWrite("** Captions should not be visible after they're turned off through the menu **");
|
| + turnClosedCaptionsOff(video);
|
| checkCaptionsDisplay();
|
|
|
| consoleWrite("");
|
| - consoleWrite("** Captions should become visible after button is clicked again **");
|
| - clickCCButton();
|
| + consoleWrite("** Captions track should become visible after the track is selected again **");
|
| + selectTextTrack(video, 0);
|
| checkCaptionsDisplay();
|
|
|
| consoleWrite("");
|
| @@ -73,14 +72,14 @@
|
| function loaded()
|
| {
|
| findMediaElement();
|
| - waitForEvent('canplaythrough', startTest);
|
| + waitForEvent("canplaythrough", startTest);
|
|
|
| - video.src = findMediaFile('video', 'content/counting');
|
| + video.src = findMediaFile("video", "content/counting");
|
| }
|
| </script>
|
| </head>
|
| <body onload="loaded()">
|
| - <p>Tests that multiple toggles of the closed captions button still display captions</p>
|
| + <p>Tests that tracks can be turned on and off through the track selection menu</p>
|
| <video controls></video>
|
| </body>
|
| </html>
|
|
|