5 <script src=
"../../resources/js-test.js"></script>
7 window
.jsTestIsAsync
= true;
10 if (window
.eventSender
) {
11 var selectObject
= document
.getElementById("selectId");
13 var optionHeight
= selectObject
.offsetHeight
/ selectObject
.size
;
14 var x
= selectObject
.offsetLeft
+ selectObject
.offsetWidth
/ 2;
15 var y
= selectObject
.offsetTop
+ optionHeight
/ 2;
17 eventSender
.dragMode
= false;
18 eventSender
.mouseMoveTo(x
, y
);
19 eventSender
.mouseDown();
20 eventSender
.mouseMoveTo(x
, y
+ (optionHeight
* 3));
22 setTimeout(testSelection
, 100);
24 debug("Test manually if options are getting selected by dragging on the select element.");
28 function testSelection()
30 eventSender
.mouseUp();
32 for (var i
= 0; i
< 4; i
++) {
33 shouldBeTrue("document.getElementById(\"selectId\").options[" + i
+ "].selected");
38 successfullyParsed
= true;
42 <body onload=
"test()">
43 <p>Select multiple option with mouse drag
</p>
45 <select multiple=
"multiple" size=
"4" id=
"selectId">
46 <option value=
"P1">P1
</option>
47 <option value=
"P2">P2
</option>
48 <option value=
"P3">P3
</option>
49 <option value=
"P4">P4
</option>
50 <option value=
"P5">P5
</option>
51 <option value=
"P6">P6
</option>
52 <option value=
"P7">P7
</option>
55 <div id=
"console"></div>