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=85343">Bug
85343</a></p>
11 <div id=
"test-container">
12 <div id=
"target" style=
"cursor:default">Mouse idle, change cursor should not fire mousemove event
</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 there is no mousemove event fired when changing cursor.");
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 // Can't do anything useful here without eventSender
34 if (window
.eventSender
) {
35 var node
= document
.getElementById('target');
36 debug('TEST CASE: ' + node
.textContent
);
37 eventSender
.mouseMoveTo(node
.offsetLeft
+ 3, node
.offsetTop
+ 3);
38 debug('Cursor Info: ' + window
.internals
.getCurrentCursorInfo());
39 node
.addEventListener('mousemove', function() {
40 testFailed('Mousemove event should not be fired when changing cursor');
43 node
.style
.cursor
= 'help';
44 setTimeout(function() {
45 debug('Cursor Info: ' + window
.internals
.getCurrentCursorInfo());
47 }, CURSOR_UPDATE_DELAY
);
49 // Give some time for the change to resolve. Fake mousemove event that caused bug, is using a timer
50 setTimeout(function() {
51 document
.getElementById('test-container').style
.display
= 'none';