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

Side by Side Diff: LayoutTests/media/media-controls.js

Issue 411833006: Use the mediaControlsButton() helper more in media tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 var captionsButtonElement; 1 var captionsButtonElement;
2 var captionsButtonCoordinates; 2 var captionsButtonCoordinates;
3 3
4 // These reflect the values used to fade in/out the media controls. Should 4 // These reflect the values used to fade in/out the media controls. Should
5 // mirror the values 'fadeInDuration'/'fadeOutDuration' in MediaControlElements. cpp. 5 // mirror the values 'fadeInDuration'/'fadeOutDuration' in MediaControlElements. cpp.
6 const controlsFadeInDurationMs = 100; 6 const controlsFadeInDurationMs = 100;
7 const controlsFadeOutDurationMs = 300; 7 const controlsFadeOutDurationMs = 300;
8 8
9 // The timeout for the hide-after-no-mouse-movement behavior. Defined (and 9 // The timeout for the hide-after-no-mouse-movement behavior. Defined (and
10 // should mirror) the value 'timeWithoutMouseMovementBeforeHidingMediaControls' 10 // should mirror) the value 'timeWithoutMouseMovementBeforeHidingMediaControls'
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (!displayElement) 83 if (!displayElement)
84 throw "There are not " + cueNumber + " text track cues visible"; 84 throw "There are not " + cueNumber + " text track cues visible";
85 } 85 }
86 86
87 return displayElement; 87 return displayElement;
88 } 88 }
89 89
90 function testClosedCaptionsButtonVisibility(expected) 90 function testClosedCaptionsButtonVisibility(expected)
91 { 91 {
92 try { 92 try {
93 captionsButtonElement = mediaControlsElement(internals.shadowRoot(mediaE lement).firstChild, "-webkit-media-controls-toggle-closed-captions-button"); 93 captionsButtonElement = mediaControlsButton(mediaElement, "toggle-closed -captions-button");
94 captionsButtonCoordinates = mediaControlsButtonCoordinates(mediaElement, "toggle-closed-captions-button"); 94 captionsButtonCoordinates = mediaControlsButtonCoordinates(mediaElement, "toggle-closed-captions-button");
95 } catch (exception) { 95 } catch (exception) {
96 consoleWrite("Failed to find a closed captions button or its coordinates : " + exception); 96 consoleWrite("Failed to find a closed captions button or its coordinates : " + exception);
97 if (expected) 97 if (expected)
98 failTest(); 98 failTest();
99 return; 99 return;
100 } 100 }
101 101
102 consoleWrite(""); 102 consoleWrite("");
103 if (expected == true) { 103 if (expected == true) {
(...skipping 24 matching lines...) Expand all
128 // Compute the time it'll take until the controls will be invisible - 128 // Compute the time it'll take until the controls will be invisible -
129 // assuming playback has been started prior to invoking this 129 // assuming playback has been started prior to invoking this
130 // function. Allow 500ms slack. 130 // function. Allow 500ms slack.
131 var hideTimeoutMs = controlsMouseMovementTimeoutMs + controlsFadeOutDuration Ms + 500; 131 var hideTimeoutMs = controlsMouseMovementTimeoutMs + controlsFadeOutDuration Ms + 500;
132 132
133 if (!mediaElement.loop && hideTimeoutMs >= 1000 * (mediaElement.duration - m ediaElement.currentTime)) 133 if (!mediaElement.loop && hideTimeoutMs >= 1000 * (mediaElement.duration - m ediaElement.currentTime))
134 throw "The media will end before the controls have been hidden"; 134 throw "The media will end before the controls have been hidden";
135 135
136 setTimeout(func, hideTimeoutMs); 136 setTimeout(func, hideTimeoutMs);
137 } 137 }
OLDNEW
« no previous file with comments | « LayoutTests/media/media-captions-no-controls-expected.txt ('k') | LayoutTests/media/media-controls-invalid-url.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698