| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 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> | |
| 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 } | |
| 26 </style> | |
| 27 </head> | |
| 28 <body> | |
| 29 <p id="description"></p> | |
| 30 <p><a href="http://crbug.com/26723">Bug 26723</a></p> | |
| 31 <div id="test-container"> | |
| 32 <div id="target" onMouseDown="addOverlay();event.preventDefault();">Click me
</div> | |
| 33 </div> | |
| 34 <br/> | |
| 35 <div id="console"></div> | |
| 36 <script> | |
| 37 var CURSOR_UPDATE_DELAY = 50; | |
| 38 | |
| 39 description("Test that mouse cursors are changed correctly after layout."); | |
| 40 | |
| 41 if (!window.eventSender) { | |
| 42 testFailed('This test requires DumpRenderTree'); | |
| 43 } | |
| 44 | |
| 45 if (window.testRunner) { | |
| 46 testRunner.dumpAsText(); | |
| 47 testRunner.waitUntilDone(); | |
| 48 window.jsTestIsAsync = true; | |
| 49 } | |
| 50 | |
| 51 function runTest(prepare, next) { | |
| 52 prepare(); | |
| 53 setTimeout(function() { | |
| 54 debug('Cursor Info: ' + window.internals.getCurrentCursorInfo(document))
; | |
| 55 debug(''); | |
| 56 next(); | |
| 57 }, CURSOR_UPDATE_DELAY); | |
| 58 } | |
| 59 | |
| 60 function testsDone() { | |
| 61 // This text is redundant with the test output - hide it | |
| 62 document.getElementById('test-container').style.display = 'none'; | |
| 63 finishJSTest(); | |
| 64 } | |
| 65 | |
| 66 // Can't do anything useful here without eventSender | |
| 67 if (window.eventSender) { | |
| 68 var target = document.getElementById('target'); | |
| 69 eventSender.dragMode = false; | |
| 70 var tests = [ | |
| 71 function() { | |
| 72 debug('Mouse move'); | |
| 73 eventSender.mouseMoveTo(target.offsetLeft + 3, target.offsetTop + 3)
; | |
| 74 }, function() { | |
| 75 debug('Mouse down'); | |
| 76 eventSender.mouseDown(); | |
| 77 }, function() { | |
| 78 debug('Mouse up'); | |
| 79 eventSender.mouseUp(); | |
| 80 } | |
| 81 ]; | |
| 82 | |
| 83 var i = 0; | |
| 84 function nextTest() { | |
| 85 if (i < tests.length) { | |
| 86 runTest(tests[i++], nextTest); | |
| 87 } else { | |
| 88 testsDone(); | |
| 89 } | |
| 90 } | |
| 91 nextTest(); | |
| 92 } | |
| 93 | |
| 94 </script> | |
| 95 </body> | |
| 96 </html> | |
| OLD | NEW |