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

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

Issue 2116013002: Convert video-controls* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-show-on-focus-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Test visibiblity of controls when focusing video.</title>
3 <title>Test visibiblity of controls when focusing of &lt;video></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-file.js"></script>
6 <script src=video-test.js></script> 6 <script src="media-controls.js"></script>
7 <script src=media-controls.js></script> 7 <video controls autoplay></video>
8 <p>
9 Test that video controls re-appear when the media (&lt;video>) element is focuse d.
10 </p>
11 <video controls autoplay 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("playing", function() 12 video.onplaying = t.step_func(function() {
17 { 13 runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
18 runAfterHideMediaControlsTimerFired(function() 14 var controls = mediaControlsButton(video, "panel");
19 { 15 assert_equals(getComputedStyle(controls).opacity, "0");
20 controls = mediaControlsButton(video, "panel"); 16 video.focus();
17 assert_equals(getComputedStyle(controls).opacity, "1");
21 18
22 testExpected("getComputedStyle(controls).opacity", 0); 19 // We fade out when focus is lost, so the opacity is still 1
23 video.focus(); 20 video.blur();
21 assert_equals(getComputedStyle(controls).opacity, "1");
22 }), video);
23 });
24 24
25 testExpected("getComputedStyle(controls).opacity", 1); 25 video.src = findMediaFile("video", "content/test");
26
27 // We fade out when focus is lost, so the opacity is still 1
28 video.blur();
29 testExpected("getComputedStyle(controls).opacity", 1);
30
31 endTest();
32 }, video);
33 }); 26 });
34 </script> 27 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-show-on-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698