Chromium Code Reviews| 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 <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> |