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

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

Issue 302603003: Cleanup tests related to controls hiding/fading in/out (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweaks. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <title>Test focus movement when controls fade out with a button focused</title> 3 <title>Test focus movement when controls fade out with a button focused</title>
4 <script src=video-test.js></script> 4 <script src=video-test.js></script>
5 <script src=media-controls.js></script> 5 <script src=media-controls.js></script>
6 <p> 6 <p>
7 Test that focus moves to the &lt;body>/document when controls fade out with a bu tton focused. 7 Test that focus moves to the &lt;body>/document when controls fade out with a bu tton focused.
8 </p> 8 </p>
9 <video controls src="content/test.ogv"></video> 9 <video controls src="content/test.ogv"></video>
10 <script> 10 <script>
11 var controls; 11 var controls;
12 var video = document.querySelector("video"); 12 var video = document.querySelector("video");
13 13
14 video.addEventListener("canplay", function() 14 video.addEventListener("canplay", function()
15 { 15 {
16 testExpected("document.activeElement", document.body); 16 testExpected("document.activeElement", document.body);
17 17
18 var playButton = mediaControlsButton(video, "play-button"); 18 var playButton = mediaControlsButton(video, "play-button");
19 playButton.focus(); 19 playButton.focus();
20 playButton.click(); 20 playButton.click();
21 21
22 testExpected("document.activeElement", video); 22 testExpected("document.activeElement", video);
23 });
24 23
25 video.addEventListener("timeupdate", function(event) 24 runAfterControlsHidden(function()
26 { 25 {
27 var video = event.target; 26 controls = mediaControlsButton(video, "panel");
28 if (video.currentTime < 4) 27 testExpected("getComputedStyle(controls).opacity", 0);
29 return;
30 controls = mediaControlsButton(video, "panel");
31 testExpected("getComputedStyle(controls).opacity", 0);
32 28
33 testExpected("document.activeElement", document.body); 29 testExpected("document.activeElement", document.body);
34 30
35 consoleWrite(""); 31 consoleWrite("");
36 endTest(); 32 endTest();
33 }, video);
37 }); 34 });
38 35
39 </script> 36 </script>
OLDNEW
« no previous file with comments | « LayoutTests/media/media-controls.js ('k') | LayoutTests/media/video-controls-hide-on-move-outside-controls.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698