Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / mouse-cursor-no-mousemove.html
blob46b482b66b39d0d06b04bf2f1140dc4ba6d617e4
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <style type="text/css">
6 </style>
7 </head>
8 <body>
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>
13 </div>
14 <br/>
15 <div id="console"></div>
16 <script>
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');
41 finishJSTest();
42 });
43 node.style.cursor = 'help';
44 setTimeout(function() {
45 debug('Cursor Info: ' + window.internals.getCurrentCursorInfo());
46 debug('');
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';
52 finishJSTest();
53 }, 150);
56 </script>
57 </body>
58 </html>