blob: 239d9b5e284d47278d0ceb905e338fc029871654 [file] [log] [blame]
<!DOCTYPE html>
<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>
async_test(function(t) {
var video = document.querySelector("video");
video.oncanplaythrough = t.step_func(function() {
assert_true(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]);
assert_false(video.paused);
// 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);
});
video.src = findMediaFile("video", "content/test");
});
</script>