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..c6a657a9d7ab12b90984888c31b3558fc9ec01e3 |
--- /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; |
acolwell GONE FROM CHROMIUM
2014/05/23 18:26:28
I think we should make this a constant in media-co
|
+ |
+document.querySelector("video").addEventListener("timeupdate", function(event) |
+{ |
+ 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("getComputedStyle(controls).opacity", 1); |
+ |
+ consoleWrite(""); |
+ endTest(); |
+ }, fadeinTime); |
+}); |
+ |
+</script> |