Index: LayoutTests/media/video-controls-show-on-focus.html |
diff --git a/LayoutTests/media/video-controls-show-on-focus.html b/LayoutTests/media/video-controls-show-on-focus.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d205e193db27b6a794cdbf91819e05393a603537 |
--- /dev/null |
+++ b/LayoutTests/media/video-controls-show-on-focus.html |
@@ -0,0 +1,35 @@ |
+<!DOCTYPE html> |
+<html> |
+<title>Test visibiblity of controls when focusing of <video></title> |
+<script src=video-test.js></script> |
+<script src=media-controls.js></script> |
+<p> |
+Test that video controls re-appear when the media (<video>) element is focused. |
+</p> |
+<video controls autoplay src="content/test.ogv"></video> |
+<script> |
+var controls; |
+var waitingForFade = false; |
+var fadeinTime = 300; |
+ |
+document.querySelector("video").addEventListener("timeupdate", function(event) { |
philipj_slow
2014/05/23 13:22:43
The { should go on a new line after function in te
fs
2014/05/23 14:39:30
I thought these were off the hook since they're "a
|
+ var video = event.target; |
+ if (video.currentTime < 4 || waitingForFade) |
+ return; |
+ controls = mediaControlsButton(video, "panel"); |
+ |
+ testExpected("getComputedStyle(controls).opacity", 0); |
+ |
+ video.focus(); |
+ |
+ waitingForFade = true; |
+ setTimeout(function() { |
+ testExpected("waitingForFade", true); |
philipj_slow
2014/05/23 13:22:43
This looks a bit on the paranoid side :)
fs
2014/05/23 14:39:30
Dropped.
|
+ testExpected("getComputedStyle(controls).opacity", 1); |
+ |
+ consoleWrite(""); |
+ endTest(); |
+ }, fadeinTime); |
+}); |
+ |
+</script> |