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

Unified Diff: LayoutTests/media/video-controls-focus-movement-on-hide.html

Issue 297783004: Implement heuristic for showing media controls during playback w/o a mouse (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: IgnoreSelfHover -> IgnoreVideoHover; Tweak comment. Created 6 years, 7 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/video-controls-focus-movement-on-hide.html
diff --git a/LayoutTests/media/video-controls-focus-movement-on-hide.html b/LayoutTests/media/video-controls-focus-movement-on-hide.html
new file mode 100644
index 0000000000000000000000000000000000000000..bd378a350f18923dac64305f28cb49e52fb14563
--- /dev/null
+++ b/LayoutTests/media/video-controls-focus-movement-on-hide.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<title>Test focus movement when controls fade out with a button focused</title>
+<script src=video-test.js></script>
+<script src=media-controls.js></script>
+<p>
+Test that focus moves to the &lt;body>/document when controls fade out with a button focused.
+</p>
+<video controls src="content/test.ogv"></video>
+<script>
+var controls;
+var video = document.querySelector("video");
+
+video.addEventListener("canplay", function()
+{
+ testExpected("document.activeElement", document.body);
+
+ var playButton = mediaControlsButton(video, "play-button");
+ playButton.focus();
+ playButton.click();
+
+ testExpected("document.activeElement", video);
+});
+
+video.addEventListener("timeupdate", function(event)
+{
+ var video = event.target;
+ if (video.currentTime < 4)
acolwell GONE FROM CHROMIUM 2014/05/23 18:26:28 nit: I think we should define a constant in media-
+ return;
+ controls = mediaControlsButton(video, "panel");
+ testExpected("getComputedStyle(controls).opacity", 0);
+
+ testExpected("document.activeElement", document.body);
+
+ consoleWrite("");
+ endTest();
+});
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698