OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <textarea id="textarea" style="width: 150px; height: 100px;"></textarea> |
| 5 <div id="resizablediv" style="resize:both; overflow:scroll; width: 100px; height
: 100px;"></div> |
| 6 <script> |
| 7 function doScroll(x, y, deltaY, device) { |
| 8 eventSender.gestureScrollBegin(device, x, y); |
| 9 eventSender.gestureScrollUpdate(device, 0, deltaY); |
| 10 eventSender.gestureScrollEnd(device, 0, 0); |
| 11 } |
| 12 |
| 13 function resize(id, scrollDeltaY, expectedDeltaY, device) { |
| 14 var target = document.getElementById(id); |
| 15 var rect = target.getBoundingClientRect(); |
| 16 var old_height = target.offsetHeight; |
| 17 // Scrolling within the normal resizer area (15 x 15) |
| 18 doScroll(rect.right - 5, rect.bottom - 5, scrollDeltaY, device); |
| 19 assert_equals(target.offsetHeight - old_height, expectedDeltaY); |
| 20 } |
| 21 |
| 22 test(function() { |
| 23 resize("textarea", 20, 20, "touchscreen"); |
| 24 }, 'Touchscreen drag resizes textarea'); |
| 25 |
| 26 test(function() { |
| 27 resize("textarea", 20, 0, "touchpad"); |
| 28 }, 'Touchpad scroll should not resize textarea'); |
| 29 |
| 30 test(function() { |
| 31 resize("resizablediv", 20, 20, "touchscreen"); |
| 32 }, 'Touchscreen drag resizes resizable div'); |
| 33 |
| 34 test(function() { |
| 35 resize("resizablediv", 20, 0, "touchpad"); |
| 36 }, 'Touchpad scroll should not resize resizable div'); |
| 37 </script> |
OLD | NEW |