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

Unified Diff: LayoutTests/media/controls-cast-overlay-slow-fade.html

Issue 1336133004: Keep overlay cast button visible long enough for user action (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/controls-cast-overlay-slow-fade.html
diff --git a/LayoutTests/media/controls-cast-overlay-slow-fade.html b/LayoutTests/media/controls-cast-overlay-slow-fade.html
new file mode 100644
index 0000000000000000000000000000000000000000..03bad40da543de9c8bc3b03b1d3bed9ba862f935
--- /dev/null
+++ b/LayoutTests/media/controls-cast-overlay-slow-fade.html
@@ -0,0 +1,59 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test that the overlay cast button fades at the right time (neither too soon nor too late).</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="media-file.js"></script>
+ <script src="media-controls.js"></script>
+ <script src="video-test.js"></script>
+ </head>
+ <body>
+ <video loop></video>
+ <script>
+ var controls;
+ var test;
+ // The cast button should be visible for at least the controlsMouseMovementTimeout, and no more
+ // than that plus the fadeout time. Allow 500ms margin at either side.
+ var hideTimeoutLowerBound = controlsMouseMovementTimeoutMs - 500;
+ var hideTimeoutUpperBound = controlsMouseMovementTimeoutMs + controlsFadeOutDurationMs + 500;
+ function overlayCastButton(element)
+ {
+ var controlID = "-internal-media-controls-overlay-cast-button";
+ var button = mediaControlsElement(window.internals.shadowRoot(element).firstChild, controlID);
+ return button;
+ }
+ async_test(function(t)
+ {
+ findMediaElement();
+ video.src = findMediaFile("video", "content/test");
+ video.addEventListener("playing", t.step_func(function()
+ {
+ setTimeout(t.step_func(function()
+ {
+ button = overlayCastButton(video);
+ // Now should have cast button
+ style = window.getComputedStyle(button);
+ visibility = style.getPropertyValue("visibility");
+ display = style.getPropertyValue("display");
+ assert_true(((display != "none")) && (visibility == "visible"),
+ "button should exist, display = \"" + display + '\"');
+ }), hideTimeoutLowerBound);
+ setTimeout(t.step_func(function()
+ {
+ button = overlayCastButton(video);
+ // Cast button shoud be gone
+ style = window.getComputedStyle(button);
+ visibility = style.getPropertyValue("visibility");
+ display = style.getPropertyValue("display");
+ assert_false(((display != "none")) && (visibility == "visible"),
+ "button should not exist, display = \"" + display + '\"');
+ t.done();
+ }), hideTimeoutUpperBound);
+ }));
+ internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true);
+ video.play();
+ });
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698