Index: LayoutTests/fullscreen/enter-exit-full-screen-hover.html |
diff --git a/LayoutTests/fullscreen/enter-exit-full-screen-hover.html b/LayoutTests/fullscreen/enter-exit-full-screen-hover.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1aa60aabd5f07469beb55a5a9fc2c54bd2fee042 |
--- /dev/null |
+++ b/LayoutTests/fullscreen/enter-exit-full-screen-hover.html |
@@ -0,0 +1,52 @@ |
+<!DOCTYPE html> |
+<script src="../resources/js-test.js"></script> |
+<script src="full-screen-test.js"></script> |
+<script src="../fast/events/touch/resources/touch-hover-active-tests.js"></script> |
+<link rel="stylesheet" href="../fast/events/touch/resources/touch-hover-active-tests.css"> |
+ |
+<button id="enter" class='touch-interactive' onclick="document.body.webkitRequestFullScreen()">Go full screen</button> |
+<button id="exit" class='touch-interactive' onclick="document.webkitCancelFullScreen()">Exit full screen</button> |
+ |
+<script> |
+var enterButton; |
+var exitButton; |
+ |
+function runTest() { |
+ if (!window.eventSender) { |
+ debug('This test requires DRT.'); |
+ return; |
+ } |
+ |
+ enterButton = document.getElementById('enter'); |
+ exitButton = document.getElementById('exit'); |
+ |
+ var enterButtonCenter = elementCenter(enterButton); |
+ |
+ waitForEventOnce(document, 'webkitfullscreenchange', function() { |
+ shouldBeTrue("document.webkitIsFullScreen") |
+ // After entering fullscreen, the button should lose hover |
+ shouldBeDefault("getHoverActiveState(enterButton)") |
+ |
+ waitForEventOnce(document, 'webkitfullscreenchange', function() { |
+ shouldBeFalse("document.webkitIsFullScreen") |
+ // After leaving fullscreen, the button should lose hover |
+ shouldBeDefault("getHoverActiveState(exitButton)") |
+ endTest(); |
+ }); |
+ |
+ var exitButtonCenter = elementCenter(exitButton); |
+ // Hover on and click the "Exit fullscreen" button |
+ eventSender.mouseMoveTo(exitButtonCenter.x, exitButtonCenter.y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ }); |
+ |
+ |
+ // Move mouse over to the "Go fullscreen" button and click |
+ eventSender.mouseMoveTo(enterButtonCenter.x, enterButtonCenter.y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+} |
+ |
+runTest(); |
+</script> |