| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <meta charset="utf-8"> | |
| 5 <script src="../../resources/js-test.js"></script> | |
| 6 <script> | |
| 7 window.jsTestIsAsync = true; | |
| 8 | |
| 9 function test() { | |
| 10 if (window.eventSender) { | |
| 11 var selectObject = document.getElementById("selectId"); | |
| 12 | |
| 13 var optionHeight = selectObject.offsetHeight / selectObject.size; | |
| 14 var x = selectObject.offsetLeft + selectObject.offsetWidth / 2; | |
| 15 var y = selectObject.offsetTop + optionHeight / 2; | |
| 16 | |
| 17 eventSender.dragMode = false; | |
| 18 eventSender.mouseMoveTo(x, y); | |
| 19 eventSender.mouseDown(); | |
| 20 eventSender.mouseMoveTo(x, y + (optionHeight * 3)); | |
| 21 | |
| 22 setTimeout(testSelection, 100); | |
| 23 } else { | |
| 24 debug("Test manually if options are getting selected by dragging on the
select element."); | |
| 25 } | |
| 26 } | |
| 27 | |
| 28 function testSelection() | |
| 29 { | |
| 30 eventSender.mouseUp(); | |
| 31 | |
| 32 for (var i = 0; i < 4; i++) { | |
| 33 shouldBeTrue("document.getElementById(\"selectId\").options[" + i + "].s
elected"); | |
| 34 } | |
| 35 | |
| 36 finishJSTest(); | |
| 37 } | |
| 38 successfullyParsed = true; | |
| 39 </script> | |
| 40 <title></title> | |
| 41 </head> | |
| 42 <body onload="test()"> | |
| 43 <p>Select multiple option with mouse drag</p> | |
| 44 | |
| 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> | |
| 53 </select> | |
| 54 | |
| 55 <div id="console"></div> | |
| 56 </body> | |
| 57 </html> | |
| OLD | NEW |