OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../resources/js-test.js"></script> | |
3 <script src="full-screen-test.js"></script> | |
4 <script src="resources/touch-hover-active-tests.js"></script> | |
5 <link rel="stylesheet" href="resources/touch-hover-active-tests.css"> | |
6 | |
7 <button id="enter" class='touch-interactive' onclick="document.body.webkitReques tFullScreen()">Go full screen</button> | |
8 <button id="exit" class='touch-interactive' onclick="document.webkitCancelFullSc reen()">Exit full screen</button> | |
9 | |
10 <script> | |
11 var enterButton; | |
12 var exitButton; | |
13 | |
14 function runTest() { | |
15 if (!window.eventSender) { | |
16 debug('This test requires DRT.'); | |
17 return; | |
18 } | |
19 | |
20 if (!eventSender.gestureShowPress || !eventSender.gestureTap || !eventSender .mouseMoveTo) { | |
philipj_slow
2014/09/19 14:31:01
This looks like it was copy-pasted, only mouseMove
xun.sun
2014/09/20 17:39:48
Done.
| |
21 debug('GestureShowPress, GestureTap, or MouseMoveTo is not supported by this platform'); | |
22 return; | |
23 } | |
24 | |
25 enterButton = document.getElementById('enter'); | |
26 exitButton = document.getElementById('exit'); | |
27 | |
28 var center = elementCenter(enterButton); | |
29 | |
30 waitForEventOnce(document, 'webkitfullscreenchange', function() { | |
31 test("document.webkitIsFullScreen==true") | |
philipj_slow
2014/09/19 14:31:02
Please use shouldBe* instead of test:
- te
xun.sun
2014/09/20 17:39:48
Done.
| |
32 // After entering fullscreen, the button should lose hover | |
33 test("getHoverActiveState(enterButton)=='default'") | |
34 | |
35 waitForEventOnce(document, 'webkitfullscreenchange', function() { | |
36 test("document.webkitIsFullScreen==false") | |
37 // After leaving fullscreen, the button should lose hover | |
38 test("getHoverActiveState(exitButton)=='default'") | |
39 endTest(); | |
40 }); | |
41 | |
42 var center_1 = elementCenter(exitButton); | |
philipj_slow
2014/09/19 14:31:02
How about enterButtonCenter and exitButtonCenter i
xun.sun
2014/09/20 17:39:48
Done.
| |
43 // Hover on and click the "Exit fullscreen" button | |
44 eventSender.mouseMoveTo(center_1.x, center_1.y); | |
45 eventSender.mouseDown(); | |
46 eventSender.mouseUp(); | |
47 }); | |
48 | |
49 | |
50 // Move mouse over to the "Go fullscreen" button and click | |
51 eventSender.mouseMoveTo(center.x, center.y); | |
52 eventSender.mouseDown(); | |
53 eventSender.mouseUp(); | |
54 } | |
55 | |
56 runTest(); | |
57 </script> | |
OLD | NEW |