OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 | |
4 function log(msg) | 5 function log(msg) |
5 { | 6 { |
6 document.getElementById('console').appendChild(document.createTextNod e(msg + '\n')); | 7 document.getElementById('console').appendChild(document.createTextNod e(msg + '\n')); |
7 } | 8 } |
9 | |
10 function lstSelect_change(s, e) | |
eseidel
2013/12/28 19:57:00
What is "lst"? Is that short for "list"? or "lis
gnana
2014/01/03 07:50:02
Yes. i changed it
| |
11 { | |
12 log("PASSED"); | |
eseidel
2013/12/28 19:57:00
nit: typically tests say "PASS" or "FAIL", but "PA
gnana
2014/01/03 07:50:02
Done.
| |
13 } | |
8 | 14 |
9 function test() | 15 function test() |
10 { | 16 { |
17 var lstSelect = document.getElementById('lstSelect'); | |
18 lstSelect.addEventListener('change', lstSelect_change, false); | |
11 if (window.testRunner) { | 19 if (window.testRunner) { |
12 testRunner.waitUntilDone(); | 20 testRunner.waitUntilDone(); |
13 testRunner.dumpAsText(); | 21 testRunner.dumpAsText(); |
14 setTimeout(autoscrollTestPart1, 0); | 22 setTimeout(autoscrollTestPart1, 0); |
15 } | 23 } |
16 } | 24 } |
17 | 25 |
18 function autoscrollTestPart1() | 26 function autoscrollTestPart1() |
19 { | 27 { |
20 var input = document.getElementById('shortTextField'); | 28 var input = document.getElementById('lstSelect'); |
21 if (window.eventSender) { | 29 if (window.eventSender) { |
22 var x = input.offsetLeft + 7; | 30 var x = input.offsetLeft + 7; |
23 var y = input.offsetTop + 7; | 31 var y = input.offsetTop + 7; |
24 eventSender.dragMode = false; | 32 eventSender.dragMode = false; |
25 eventSender.mouseMoveTo(x, y); | 33 eventSender.mouseMoveTo(x, y); |
26 eventSender.mouseDown(); | 34 eventSender.mouseDown(); |
27 eventSender.mouseMoveTo(x + 20, y); | 35 eventSender.mouseMoveTo(x, y + 20); |
28 eventSender.mouseMoveTo(x + 600, y); | 36 eventSender.mouseMoveTo(x, y + 600); |
29 } | 37 } |
30 setTimeout(autoscrollTestPart2, 100); | 38 setTimeout(autoscrollTestPart2, 100); |
31 } | 39 } |
32 | 40 |
33 function autoscrollTestPart2() | 41 function autoscrollTestPart2() |
34 { | 42 { |
35 if (window.eventSender) | 43 if (window.eventSender) |
36 eventSender.mouseUp(); | 44 eventSender.mouseUp(); |
37 | 45 |
38 var input = document.getElementById('shortTextField'); | 46 var input = document.getElementById('shortTextField'); |
39 if (input.scrollLeft == 0) | 47 |
40 log("FAILED the textfield should have been scrolled"); | |
41 else | |
42 log("PASSED"); | |
43 | |
44 if (window.testRunner) | 48 if (window.testRunner) |
45 testRunner.notifyDone(); | 49 testRunner.notifyDone(); |
46 } | 50 } |
47 </script> | 51 </script> |
48 </head> | 52 </head> |
49 <body onload="test()"> | 53 <body onload="test()"> |
50 <div id="console"> | 54 <div id="console"> |
51 <input id="shortTextField" value="This text should be autoscrollable and if it doesn't then the test failed" size="25"> | 55 <select id="lstSelect" size="5" multiple="multiple"> |
52 https://bugs.webkit.org/show_bug.cgi?id=20201 <br> | 56 <option value="option 1">Option 1</option> |
53 To do the test manually you have to try triggering the autoscroll by star ting the dragging from within the text field and moving to the right. If the aut oscroll occurs the test has PASSED.<br> | 57 <option value="option 2">Option 2</option> |
58 <option value="option 3">Option 3</option> | |
59 <option value="option 4">Option 4</option> | |
60 <option value="option 5">Option 5</option> | |
61 </select> | |
54 </div> | 62 </div> |
55 | |
56 </body> | 63 </body> |
57 </html> | 64 </html> |
58 | 65 |
OLD | NEW |