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

Unified Diff: LayoutTests/media/media-controls.js

Issue 14056005: Added code to enable the first caption track if the user has requested captions and one such track … (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/media-controls.js
diff --git a/LayoutTests/media/media-controls.js b/LayoutTests/media/media-controls.js
index e0630476439bc8a4c84ac9bb472f0833f4e212ef..7e025750173b5c27ffe87fb901b38c698e867f2e 100644
--- a/LayoutTests/media/media-controls.js
+++ b/LayoutTests/media/media-controls.js
@@ -1,3 +1,5 @@
+var captionsButtonElement;
+var captionsButtonCoordinates;
function mediaControlsElement(first, id)
{
@@ -73,3 +75,28 @@ function textTrackDisplayElement(parentElement, id, cueNumber)
return displayElement;
}
+
+function testClosedCaptionsButtonVisibility(expected)
+{
+ try {
+ captionsButtonElement = mediaControlsElement(internals.shadowRoot(video).firstChild, "-webkit-media-controls-toggle-closed-captions-button");
+ captionsButtonCoordinates = mediaControlsButtonCoordinates(video, "toggle-closed-captions-button");
+ } catch (exception) {
+ consoleWrite("Failed to find a closed captions button or its coordinates: " + exception);
+ if (expected)
+ failTest();
+ return;
+ }
+
+ consoleWrite("");
+ if (expected == true) {
+ consoleWrite("** Caption button should be visible and enabled because we have a captions track.");
+ testExpected("captionsButtonCoordinates[0]", 0, ">");
+ testExpected("captionsButtonCoordinates[1]", 0, ">");
+ testExpected("captionsButtonElement.disabled", false);
+ } else {
+ consoleWrite("** Caption button should not be visible as there are no caption tracks.");
+ testExpected("captionsButtonCoordinates[0]", 0, "<=");
+ testExpected("captionsButtonCoordinates[1]", 0, "<=");
+ }
+}
« no previous file with comments | « no previous file | LayoutTests/media/video-controls-captions.html » ('j') | Source/WebCore/html/HTMLMediaElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698