Index: third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html |
index a3d83fc4b68829caa45cb0462cce69f93e7b3f79..239d9b5e284d47278d0ceb905e338fc029871654 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html |
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html |
@@ -1,54 +1,34 @@ |
<!DOCTYPE html> |
-<html> |
-<style> |
-#no-video-media { |
- width: 320px; |
- height: 240px; |
-} |
-</style> |
-<!-- 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-file.js></script> |
-<script src=media-controls.js></script> |
+<title>Test video controls visibility with multimodal input. The controls should remain visible if the last input event was a mouse move over them.</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 loop></video> |
<script> |
-var controls; |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
-function runTest() |
-{ |
- video = document.getElementById("no-video-media"); |
+ video.oncanplaythrough = t.step_func(function() { |
+ assert_true(video.paused); |
- testExpected("video.paused", true); |
- if (!window.testRunner) |
- return; |
+ // Tap (touch input) the play button. |
+ var coords = mediaControlsButtonCoordinates(video, "play-button"); |
+ eventSender.gestureTapDown(coords[0], coords[1]); |
+ eventSender.gestureShowPress(coords[0], coords[1]); |
+ eventSender.gestureTap(coords[0], coords[1]); |
+ assert_false(video.paused); |
- // Tap (touch input) the play button. |
- var coords = mediaControlsButtonCoordinates(video, "play-button"); |
- eventSender.gestureTapDown(coords[0], coords[1]); |
- eventSender.gestureShowPress(coords[0], coords[1]); |
- eventSender.gestureTap(coords[0], coords[1]); |
- testExpected("video.paused", false); |
+ // And then hover the control with the mouse. |
+ eventSender.mouseMoveTo(coords[0], coords[1]); |
- // And then hover the control with the mouse. |
- eventSender.mouseMoveTo(coords[0], coords[1]); |
+ // And the controls should remain visible. |
+ runAfterHideMediaControlsTimerFired(t.step_func_done(function() { |
+ var controls = mediaControlsButton(video, "panel"); |
+ assert_equals(getComputedStyle(controls).opacity, "1"); |
+ }), video); |
+ }); |
- // And the controls should remain visible. |
- runAfterHideMediaControlsTimerFired(function() |
- { |
- controls = mediaControlsButton(video, "panel"); |
- testExpected("getComputedStyle(controls).opacity", 1); |
- endTest(); |
- }, video); |
-} |
-</script> |
-<body> |
- <p>Test video element control visibility with multimodal input. The controls |
- should remain visible if the last input event was a mouse move over them.</p> |
- <p>This test only runs in DRT!</p> |
- |
- <video id="no-video-media" controls loop oncanplaythrough="runTest()"></video> |
- <script> |
- setSrcById("no-video-media", findMediaFile("video", "content/test")); |
- </script> |
-</body> |
-</html> |
+ video.src = findMediaFile("video", "content/test"); |
+}); |
+</script> |