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

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

Issue 2120783002: Convert video-controls* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Test that focus moves to "body" when controls fade out with a button focu sed.</title>
3 <title>Test focus movement when controls fade out with a button focused</title> 3 <script src="../resources/testharness.js"></script>
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 4 <script src="../resources/testharnessreport.js"></script>
5 (Please avoid writing new tests using video-test.js) --> 5 <script src="media-controls.js"></script>
6 <script src=video-test.js></script> 6 <script src="media-file.js"></script>
7 <script src=media-controls.js></script> 7 <video controls></video>
8 <p>
9 Test that focus moves to the &lt;body>/document when controls fade out with a bu tton focused.
10 </p>
11 <video controls src="content/test.ogv"></video>
12 <script> 8 <script>
13 var controls; 9 async_test(function(t) {
14 var video = document.querySelector("video"); 10 var video = document.querySelector("video");
15 11
16 video.addEventListener("canplay", function() 12 video.oncanplay = t.step_func(function() {
17 { 13 assert_equals(document.activeElement, document.body);
18 testExpected("document.activeElement", document.body);
19 14
20 var playButton = mediaControlsButton(video, "play-button"); 15 var playButton = mediaControlsButton(video, "play-button");
21 playButton.focus(); 16 playButton.focus();
22 playButton.click(); 17 playButton.click();
23 18
24 testExpected("document.activeElement", video); 19 assert_equals(document.activeElement, video);
25 20
26 runAfterHideMediaControlsTimerFired(function() 21 runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
27 { 22 var controls = mediaControlsButton(video, "panel");
28 controls = mediaControlsButton(video, "panel"); 23 assert_equals(getComputedStyle(controls).opacity, "0");
29 testExpected("getComputedStyle(controls).opacity", 0); 24 assert_equals(document.activeElement, document.body);
25 }), video);
26 });
30 27
31 testExpected("document.activeElement", document.body); 28 video.src = findMediaFile("video", "content/test");
32
33 consoleWrite("");
34 endTest();
35 }, video);
36 }); 29 });
37 30 </script>
38 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698