Index: third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html |
index b2cc112f17a3ba0bf0972bf2ae6660ae8546b9cd..0b204f0e99f35d88492d2b4837a50817edca134c 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html |
+++ b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html |
@@ -1,30 +1,24 @@ |
<!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 don't appear when the media (<video>) element is |
-focused and the 'controls' attribute is not set. |
-</p> |
-<!-- 'tabindex' makes the video focusable despite it not having controls --> |
-<video tabindex="0" autoplay src="content/test.ogv"></video> |
+<title>Test that video controls don't appear when the media element is focused and the "controls" attribute is not set.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-controls.js"></script> |
+<script src="media-file.js"></script> |
+<!-- "tabindex" makes the video focusable despite it not having controls --> |
+<video tabindex="0"></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"); |
+ video.focus(); |
+ assert_equals(getComputedStyle(controls).opacity, "0"); |
+ }), video); |
+ }); |
- video.focus(); |
- testExpected("getComputedStyle(controls).opacity", 0); |
- |
- endTest(); |
- }, video); |
+ video.src = findMediaFile("video", "content/test"); |
+ video.play(); |
}); |
-</script> |
+</script> |