5 This tests pressing a mouse button down inside a dragstart event.
<br>
6 This happens when a user sets a breakpoint of a dragstart event handler in Inspector,
7 and clicks somewhere on the page while the script is paused at the breakpoint. WebKit should not crash.
9 <div id=
"container"><span id=
"target" draggable=
"true" ondragstart=
"onDragStart()">drag me
</span></div>
12 if (!window
.testRunner
|| !window
.eventSender
)
13 document
.body
.innerHTML
= 'This test requires eventSender';
15 testRunner
.dumpAsText();
17 var target
= document
.getElementById('target');
20 function onDragStart() {
22 eventSender
.mouseUp();
23 eventSender
.mouseDown();
26 eventSender
.mouseMoveTo(target
.offsetLeft
+ target
.offsetWidth
/ 2, target
.offsetTop
+ target
.offsetHeight
/ 2);
27 eventSender
.mouseDown();
28 eventSender
.leapForward(100);
29 eventSender
.mouseMoveTo(500, 500);
30 eventSender
.mouseUp();
32 document
.getElementById('container').textContent
= called
? 'PASS - mouse up and down inside a dragstart did not crash WebKit'
33 : 'FAIL - dragstart was never fired.';