| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <p id="description">Test for dragging operations of <input type=range></p> |
| <div id="console"></div> |
| <style> |
| input::-webkit-slider-thumb { |
| width: 15px; |
| } |
| </style> |
| <input type=range id=range min=0 max=255 style="width:129px;"> |
| <script> |
| function slowDragToRightEdge() { |
| var centerY = input.offsetTop + input.offsetHeight / 2; |
| |
| eventSender.mouseMoveTo(input.offsetLeft + input.offsetWidth / 2, centerY); |
| eventSender.mouseDown(); |
| for (var i = 40; i > 0; i--) { |
| eventSender.mouseMoveTo(input.offsetLeft + input.offsetWidth - i, centerY); |
| } |
| eventSender.mouseUp(); |
| } |
| |
| function slowDragToLeftEdge() { |
| var centerY = input.offsetTop + input.offsetHeight / 2; |
| |
| eventSender.mouseMoveTo(input.offsetLeft + input.offsetWidth / 2, centerY); |
| eventSender.mouseDown(); |
| for (var i = 40; i > 0; i--) { |
| eventSender.mouseMoveTo(input.offsetLeft + i, centerY); |
| } |
| eventSender.mouseUp(); |
| } |
| |
| debug('Dragging to edge should always set the value to min/max.'); |
| var input = document.getElementById('range'); |
| input.focus(); |
| slowDragToLeftEdge(); |
| shouldBeEqualToString('input.value', '0'); |
| slowDragToRightEdge(); |
| shouldBeEqualToString('input.value', '255'); |
| debug(''); |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |
| </html> |