2 <script src=
"../resources/js-test.js"></script>
3 <script src=
"full-screen-test.js"></script>
4 <script src=
"../fast/events/touch/resources/touch-hover-active-tests.js"></script>
5 <link rel=
"stylesheet" href=
"../fast/events/touch/resources/touch-hover-active-tests.css">
7 <button id=
"enter" class='touch-interactive'
onclick=
"document.body.webkitRequestFullScreen()">Go full screen
</button>
8 <button id=
"exit" class='touch-interactive'
onclick=
"document.webkitCancelFullScreen()">Exit full screen
</button>
15 if (!window
.eventSender
) {
16 debug('This test requires DRT.');
20 enterButton
= document
.getElementById('enter');
21 exitButton
= document
.getElementById('exit');
23 var enterButtonCenter
= elementCenter(enterButton
);
25 waitForEventOnce(document
, 'webkitfullscreenchange', function() {
26 shouldBeTrue("document.webkitIsFullScreen")
27 // After entering fullscreen, the button should lose hover
28 shouldBeDefault("getHoverActiveState(enterButton)")
30 waitForEventOnce(document
, 'webkitfullscreenchange', function() {
31 shouldBeFalse("document.webkitIsFullScreen")
32 // After leaving fullscreen, the button should lose hover
33 shouldBeDefault("getHoverActiveState(exitButton)")
37 var exitButtonCenter
= elementCenter(exitButton
);
38 // Hover on and click the "Exit fullscreen" button
39 eventSender
.mouseMoveTo(exitButtonCenter
.x
, exitButtonCenter
.y
);
40 eventSender
.mouseDown();
41 eventSender
.mouseUp();
45 // Move mouse over to the "Go fullscreen" button and click
46 eventSender
.mouseMoveTo(enterButtonCenter
.x
, enterButtonCenter
.y
);
47 eventSender
.mouseDown();
48 eventSender
.mouseUp();