4 <script src=
"../../resources/js-test.js"></script>
5 <style type=
"text/css">
9 <p id=
"description"></p>
10 <p><a href=
"https://bugs.webkit.org/show_bug.cgi?id=53341">Bug
53341</a></p>
11 <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 - mousemove: pointer(hand), mousedown: progress, mouseup: help.
</div>
15 <div id=
"console"></div>
17 // This appears to be just to accomodate style update (cursor is updated immediately on mouse events).
18 // TODO(rbyers): replace with updateAfterDisplay or requestAnimationFrame
19 var CURSOR_UPDATE_DELAY
= 50;
21 description("Test that mouse cursors are changed correctly on mouse events.");
23 if (!window
.eventSender
) {
24 testFailed('This test requires DumpRenderTree');
27 if (window
.testRunner
) {
28 testRunner
.dumpAsText();
29 testRunner
.waitUntilDone();
30 window
.jsTestIsAsync
= true;
33 function runTest(prepare
, next
) {
35 setTimeout(function() {
36 debug('Cursor Info: ' + window
.internals
.getCurrentCursorInfo());
39 }, CURSOR_UPDATE_DELAY
);
42 function testsDone() {
43 // This text is redundant with the test output - hide it
44 document
.getElementById('test-container').style
.display
= 'none';
48 // Can't do anything useful here without eventSender
49 if (window
.eventSender
) {
50 var target
= document
.getElementById('target');
51 eventSender
.dragMode
= false;
55 eventSender
.mouseMoveTo(target
.offsetLeft
+ 3, target
.offsetTop
+ 3);
58 eventSender
.mouseDown();
60 debug('Mouse hold down, move');
61 eventSender
.mouseMoveTo(target
.offsetLeft
+ 13, target
.offsetTop
+ 3);
64 eventSender
.mouseUp();
70 if (i
< tests
.length
) {
71 runTest(tests
[i
++], nextTest
);