Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / mousedown-inside-dragstart-should-not-cause-crash.html
blobb916a833ee4490bebff5f0a0b0debe0fbef1a200
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p id="description">
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.
8 </p>
9 <div id="container"><span id="target" draggable="true" ondragstart="onDragStart()">drag me</span></div>
10 <script>
12 if (!window.testRunner || !window.eventSender)
13 document.body.innerHTML = 'This test requires eventSender';
14 else {
15 testRunner.dumpAsText();
17 var target = document.getElementById('target');
18 var called = false;
20 function onDragStart() {
21 called = true;
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.';
36 </script>
37 </body>
38 </html>