OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <body> | |
3 <script src="../../../resources/js-test.js"></script> | |
4 <select id="listBoxInput" size="5" multiple="multiple"> | |
5 <option value="option 1">Option 1</option> | |
6 <option value="option 2">Option 2</option> | |
7 <option value="option 3">Option 3</option> | |
8 <option value="option 4">Option 4</option> | |
9 <option value="option 5">Option 5</option> | |
10 </select> | |
11 <script> | |
12 description('should dispatch change event when mouse is released outside.'); | |
13 jsTestIsAsync = true; | |
14 var input = document.getElementById('listBoxInput'); | |
tkent
2014/01/06 23:33:21
Using a variable name |input| is not reasonable fo
gnana
2014/01/07 08:35:19
I misunderstood it previously. Corrected now.
Done
| |
15 input.onchange = function() { | |
16 testPassed('A change event was dispatched.'); | |
17 } | |
18 | |
19 window.onload = function() | |
20 { | |
21 if (!window.eventSender) | |
22 debug('Select listbox using mouse and release the mouse pointer outside the listbox. The test passes if "A change event was dispatched." is printed.'); | |
23 else | |
24 setTimeout(autoscrollTestPart1, 0); | |
tkent
2014/01/06 23:33:21
Do we need this setTimeout()?
gnana
2014/01/07 08:35:19
This timeout was not necessary. removed
Done.
| |
25 } | |
26 | |
27 function autoscrollTestPart1() | |
28 { | |
29 var input = document.getElementById('listBoxInput'); | |
30 var x = input.offsetLeft + 7; | |
31 var y = input.offsetTop + 7; | |
32 eventSender.dragMode = false; | |
33 eventSender.mouseMoveTo(x, y); | |
34 eventSender.mouseDown(); | |
35 eventSender.mouseMoveTo(x, y + 20); | |
36 eventSender.mouseMoveTo(x, y + 600); | |
37 setTimeout(autoscrollTestPart2, 100); | |
tkent
2014/01/06 23:33:21
How did you choose '100'?
gnana
2014/01/07 08:35:19
This timeout was not necessary. removed
Done.
| |
38 } | |
39 | |
40 function autoscrollTestPart2() | |
41 { | |
42 eventSender.mouseUp(); | |
43 setTimeout(autoscrollTestPart3, 100); | |
tkent
2014/01/06 23:33:21
Do we need this setTimeout()?
gnana
2014/01/07 08:35:19
Before running horizontal test we need to give a d
| |
44 } | |
45 | |
46 function autoscrollTestPart3() | |
47 { | |
48 var input = document.getElementById('listBoxInput'); | |
49 var x = input.offsetLeft + 7; | |
50 var y = input.offsetTop + 7; | |
51 eventSender.dragMode = false; | |
52 eventSender.mouseMoveTo(x, y); | |
53 eventSender.mouseDown(); | |
54 eventSender.mouseMoveTo(x + 20, y); | |
55 eventSender.mouseMoveTo(x + 600, y); | |
56 setTimeout(autoscrollTestPart4, 100); | |
tkent
2014/01/06 23:33:21
How did you choose '100'?
gnana
2014/01/07 08:35:19
This timeout was not necessary so removed.
| |
57 } | |
58 | |
59 function autoscrollTestPart4() | |
60 { | |
61 eventSender.mouseUp(); | |
62 finishJSTest(); | |
63 } | |
64 </script> | |
65 </body> | |
66 </html> | |
OLD | NEW |