blob: b285444f3b02a1b17e86be5b1d6beb575d1528ab [file] [log] [blame]
<!DOCTYPE html>
<title>Tests that video controls are shown after exiting fullscreen.</title>
<script src="../fullscreen/full-screen-test.js"></script>
<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></video>
<script>
async_test(function(t) {
var count = 0;
var video = document.querySelector("video");
video.oncanplaythrough = t.step_func(function() {
var panel = mediaControlsButton(video, "panel");
video.onwebkitfullscreenchange = t.step_func(function() {
switch (count) {
case 0:
runAfterHideMediaControlsTimerFired(function() {
document.webkitExitFullscreen();
}, video);
break;
case 1:
// The controls should be shown after exiting fullscreen.
assert_equals(getComputedStyle(panel).opacity, "1");
t.done();
}
count++;
});
var playButtonCoordinates = mediaControlsButtonCoordinates(video, "play-button");
// Move mouse to the play button and start playing the video.
eventSender.mouseMoveTo(playButtonCoordinates[0], playButtonCoordinates[1]);
eventSender.mouseDown();
eventSender.mouseUp();
// Test that controls are shown when controls attribute is present.
assert_equals(getComputedStyle(panel).opacity, "1");
runWithKeyDown(function() { video.webkitRequestFullscreen(); });
});
video.src = findMediaFile("video", "content/test");
});
</script>