Index: LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html |
diff --git a/LayoutTests/media/video-controls-hide-on-move-outside-controls.html b/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html |
similarity index 66% |
copy from LayoutTests/media/video-controls-hide-on-move-outside-controls.html |
copy to LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html |
index 1e0cff1047982bb2d68428e4e74e9ea03792af11..935660c2c43801ce66361c276998224c9f2793a3 100644 |
--- a/LayoutTests/media/video-controls-hide-on-move-outside-controls.html |
+++ b/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html |
@@ -10,11 +10,21 @@ |
<script src=media-file.js></script> |
<script src=media-controls.js></script> |
<script> |
+ |
var controls; |
+function dispatchActivateEvent(target) { |
+ // Create a DOMActivate event and dispatch it |
+ var event = document.createEvent('UIEvents'); |
+ event.initUIEvent('DOMActivate', true, true, window, 1) |
+ target.dispatchEvent(event); |
+} |
+ |
+ |
function runTest() |
{ |
video = document.getElementById("no-video-media"); |
+ controls = mediaControlsButton(video, "panel"); |
testExpected("video.paused", true); |
if (!window.testRunner) |
@@ -24,26 +34,23 @@ function runTest() |
var playCoords = mediaControlsButtonCoordinates(video, "play-button"); |
var clickX = playCoords[0]; |
var clickY = playCoords[1]; |
- eventSender.mouseMoveTo(clickX, clickY); |
- eventSender.mouseDown(); |
- eventSender.mouseUp(); |
+ eventSender.gestureTap(clickX, clickY); |
+ eventSender.gestureTapDown(clickX, clickY); |
+ dispatchActivateEvent(controls); |
+ |
testExpected("video.paused", false); |
runAfterHideMediaControlsTimerFired(function() |
{ |
- controls = mediaControlsButton(video, "panel"); |
testExpected("getComputedStyle(controls).opacity", 0); |
consoleWrite(""); |
endTest(); |
}, video); |
- |
- // Move the mouse to the upper-left corner of the video. |
- eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4); |
} |
</script> |
<body> |
- <p>Test video element control visibility when mouse is not over element.</p> |
+ <p>Test video control element visibility when play by touch.</p> |
<p>This test only runs in DRT!</p> |
<video id="no-video-media" controls loop oncanplaythrough="runTest()"></video> |