Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <meta charset="utf-8"> | |
|
bokan
2016/09/16 15:45:35
No need for this meta
lunalu1
2016/09/16 16:13:38
Done.
| |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharnessreport.js"></script> | |
| 5 <body> | |
|
bokan
2016/09/16 15:45:35
No need for body tags either. See https://www.chro
lunalu1
2016/09/16 16:13:38
Done.
| |
| 6 <textarea id="textarea" style="width: 150px; height: 100px;"></textarea> | |
| 7 <div id="resizablediv" style="resize:both; overflow:scroll; width: 100px; heig ht: 100px;"></div> | |
| 8 <script> | |
| 9 function doScroll(x, y, deltaY, device) { | |
| 10 eventSender.gestureScrollBegin(device, x, y); | |
| 11 eventSender.gestureScrollUpdate(device, 0, deltaY); | |
| 12 eventSender.gestureScrollEnd(device, 0, 0); | |
| 13 } | |
| 14 | |
| 15 function resize(id, deltaY, device) { | |
| 16 var target = document.getElementById(id); | |
| 17 var rect = target.getBoundingClientRect(); | |
| 18 var old_height = target.offsetHeight; | |
| 19 // Scrolling within the normal resizer area (15 x 15) | |
| 20 doScroll(rect.right - 5, rect.bottom - 5, deltaY, device); | |
| 21 | |
| 22 test(function() { | |
|
bokan
2016/09/16 15:45:35
I'd actually make test() wrap each |resize| call b
lunalu1
2016/09/16 16:13:38
Done.
| |
| 23 assert_equals(target.offsetHeight - old_height, deltaY); | |
| 24 }, 'Target:' + id + ', from source: ' + device + ', should be vertically r esized by ' + deltaY); | |
| 25 } | |
| 26 | |
| 27 // When scrolling over the resizer by | |
| 28 // a mouse or a touch pad: expect no resize; | |
| 29 // a touchscree (i.e. tap and drag): expect resize. | |
| 30 resize("textarea", 20, "touchscreen"); | |
| 31 resize("textarea", 0, "touchpad"); | |
|
bokan
2016/09/16 15:45:35
Unless I'm missing something, if deltaY is 0, does
lunalu1
2016/09/16 16:13:38
Done.
| |
| 32 resize("resizablediv", 20, "touchscreen"); | |
| 33 resize("resizablediv", 0, "touchpad"); | |
| 34 </script> | |
| 35 </body> | |
| OLD | NEW |