2 <script src=
"../../resources/js-test.js"></script>
3 <script src=
"resources/expect-cursor-update.js"></script>
4 <style type=
"text/css">
11 background-color: blue
;
19 background: rgba
(255,0,0,0.2);
25 <p id=
"description"></p>
26 <p><a href=
"http://crbug.com/26723">Bug
26723</a></p>
27 <div id=
"test-container">
28 <div id=
"target"></div>
31 <div id=
"console"></div>
33 description("Test that mouse cursors are changed correctly after layout.");
35 // Ensure the shouldBe calls don't trigger layouts during our testing.
36 setPrintTestResultsLazily();
38 if (window
.testRunner
) {
39 testRunner
.dumpAsText();
40 testRunner
.waitUntilDone();
41 window
.jsTestIsAsync
= true;
45 function addOverlay() {
46 var testContainer
= document
.getElementById('test-container');
47 overlay
= document
.createElement('div');
49 testContainer
.appendChild(overlay
);
52 // Can't do anything useful here without eventSender
53 if (window
.eventSender
) {
54 var target
= document
.getElementById('target');
55 eventSender
.dragMode
= false;
57 var rect
= target
.getBoundingClientRect();
58 eventSender
.mouseMoveTo(rect
.left
+ 3, rect
.top
+ 3);
59 shouldBeEqualToString('window.internals.getCurrentCursorInfo()', 'type=IBeam hotSpot=0,0');
60 debug('Adding overlay element');
62 expectCursorUpdate('type=Wait hotSpot=0,0', function() {
63 debug('Moving overlay element');
64 overlay
.style
.top
= "100px";
65 expectCursorUpdate('type=IBeam hotSpot=0,0', function() {
70 testFailed('This test requires DumpRenderTree. Click to manually update layout.');
71 document
.addEventListener('click', addOverlay
);