2 <script src=
"../../resources/js-test.js"></script>
3 <div draggable=
"true" id=
"dragger">Drag me
</div>
6 description('Tests correct behavior of event.dataTransfer.setData with wrong number of arguments');
10 var dragger
= document
.getElementById('dragger');
11 dragger
.addEventListener('dragstart', function(e
) {
13 shouldThrow('event.dataTransfer.setData()', '"TypeError: Failed to execute \'setData\' on \'DataTransfer\': 2 arguments required, but only 0 present."');
14 shouldThrow('event.dataTransfer.setData("Text")', '"TypeError: Failed to execute \'setData\' on \'DataTransfer\': 2 arguments required, but only 1 present."');
17 if (window
.eventSender
) {
18 var rect
= dragger
.getBoundingClientRect();
19 var x
= rect
.left
+ rect
.width
/ 2;
20 var y
= rect
.top
+ rect
.height
/ 2;
21 eventSender
.mouseMoveTo(x
, y
);
22 eventSender
.mouseDown();
23 eventSender
.leapForward(400);
24 eventSender
.mouseMoveTo(x
+ 100, y
);
25 eventSender
.mouseUp();