OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 <script language="javascript" type="text/javascript"> |
| 6 function addOverlay() { |
| 7 var testContainer = document.getElementById('test-container'); |
| 8 var overlay = document.createElement('div'); |
| 9 overlay.id='overlay'; |
| 10 testContainer.appendChild(overlay); |
| 11 } |
| 12 </script> |
5 <style type="text/css"> | 13 <style type="text/css"> |
| 14 #target { |
| 15 cursor: default; |
| 16 } |
| 17 #overlay { |
| 18 cursor: wait; |
| 19 width: 200px; |
| 20 height: 200px; |
| 21 background: rgba(255,0,0,0.2); |
| 22 position: absolute; |
| 23 left: 0; |
| 24 top: 0; |
| 25 } |
6 </style> | 26 </style> |
7 </head> | 27 </head> |
8 <body> | 28 <body> |
9 <p id="description"></p> | 29 <p id="description"></p> |
10 <p><a href="https://bugs.webkit.org/show_bug.cgi?id=53341">Bug 53341</a></p> | 30 <p><a href="http://crbug.com/26723">Bug 26723</a></p> |
11 <div id="test-container"> | 31 <div id="test-container"> |
12 <div id="target" onMouseDown="style.cursor='progress';event.preventDefault()
;" onMouseMove="style.cursor='pointer';" onMouseUp="style.cursor='help';" style=
"cursor:pointer;">Play with mouse on this element. Cursors change on events - mo
usemove: pointer(hand), mousedown: progress, mouseup: help.</div> | 32 <div id="target" onMouseDown="addOverlay();event.preventDefault();">Click me
</div> |
13 </div> | 33 </div> |
14 <br/> | 34 <br/> |
15 <div id="console"></div> | 35 <div id="console"></div> |
16 <script> | 36 <script> |
17 var CURSOR_UPDATE_DELAY = 50; | 37 var CURSOR_UPDATE_DELAY = 50; |
18 | 38 |
19 description("Test that mouse cursors are changed correctly on mouse events."); | 39 description("Test that mouse cursors are changed correctly after layout."); |
20 | 40 |
21 if (!window.eventSender) { | 41 if (!window.eventSender) { |
22 testFailed('This test requires DumpRenderTree'); | 42 testFailed('This test requires DumpRenderTree'); |
23 } | 43 } |
24 | 44 |
25 if (window.testRunner) { | 45 if (window.testRunner) { |
26 testRunner.dumpAsText(); | 46 testRunner.dumpAsText(); |
27 testRunner.waitUntilDone(); | 47 testRunner.waitUntilDone(); |
28 window.jsTestIsAsync = true; | 48 window.jsTestIsAsync = true; |
29 } | 49 } |
(...skipping 18 matching lines...) Expand all Loading... |
48 var target = document.getElementById('target'); | 68 var target = document.getElementById('target'); |
49 eventSender.dragMode = false; | 69 eventSender.dragMode = false; |
50 var tests = [ | 70 var tests = [ |
51 function() { | 71 function() { |
52 debug('Mouse move'); | 72 debug('Mouse move'); |
53 eventSender.mouseMoveTo(target.offsetLeft + 3, target.offsetTop + 3)
; | 73 eventSender.mouseMoveTo(target.offsetLeft + 3, target.offsetTop + 3)
; |
54 }, function() { | 74 }, function() { |
55 debug('Mouse down'); | 75 debug('Mouse down'); |
56 eventSender.mouseDown(); | 76 eventSender.mouseDown(); |
57 }, function() { | 77 }, function() { |
58 debug('Mouse hold down, move'); | |
59 eventSender.mouseMoveTo(target.offsetLeft + 13, target.offsetTop + 3
); | |
60 }, function() { | |
61 debug('Mouse up'); | 78 debug('Mouse up'); |
62 eventSender.mouseUp(); | 79 eventSender.mouseUp(); |
63 } | 80 } |
64 ]; | 81 ]; |
65 | 82 |
66 var i = 0; | 83 var i = 0; |
67 function nextTest() { | 84 function nextTest() { |
68 if (i < tests.length) { | 85 if (i < tests.length) { |
69 runTest(tests[i++], nextTest); | 86 runTest(tests[i++], nextTest); |
70 } else { | 87 } else { |
71 testsDone(); | 88 testsDone(); |
72 } | 89 } |
73 } | 90 } |
74 nextTest(); | 91 nextTest(); |
75 } | 92 } |
76 | 93 |
77 </script> | 94 </script> |
78 </body> | 95 </body> |
79 </html> | 96 </html> |
OLD | NEW |