Index: third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html |
index e6f6cd527cb3530310a45ab88276ab831cc53322..2e7f025c2950082d7d9c94836dc5bb5f2504ad88 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html |
+++ b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html |
@@ -1,34 +1,27 @@ |
<!DOCTYPE html> |
-<html> |
-<title>Test visibiblity of controls when focusing of <video></title> |
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
-<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> |
+<title>Test visibiblity of controls when focusing video.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
+<script src="media-controls.js"></script> |
+<video controls autoplay></video> |
<script> |
-var controls; |
-var video = document.querySelector("video"); |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
-video.addEventListener("playing", function() |
-{ |
- runAfterHideMediaControlsTimerFired(function() |
- { |
- controls = mediaControlsButton(video, "panel"); |
+ video.onplaying = t.step_func(function() { |
+ runAfterHideMediaControlsTimerFired(t.step_func_done(function() { |
+ var controls = mediaControlsButton(video, "panel"); |
+ assert_equals(getComputedStyle(controls).opacity, "0"); |
+ video.focus(); |
+ assert_equals(getComputedStyle(controls).opacity, "1"); |
- testExpected("getComputedStyle(controls).opacity", 0); |
- video.focus(); |
+ // We fade out when focus is lost, so the opacity is still 1 |
+ video.blur(); |
+ assert_equals(getComputedStyle(controls).opacity, "1"); |
+ }), video); |
+ }); |
- testExpected("getComputedStyle(controls).opacity", 1); |
- |
- // We fade out when focus is lost, so the opacity is still 1 |
- video.blur(); |
- testExpected("getComputedStyle(controls).opacity", 1); |
- |
- endTest(); |
- }, video); |
+ video.src = findMediaFile("video", "content/test"); |
}); |
-</script> |
+</script> |