Index: third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-over-resizer.html |
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-over-resizer.html b/third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-over-resizer.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b440a5d79a0422dfe797e884f4d1996ec838185d |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-over-resizer.html |
@@ -0,0 +1,35 @@ |
+<!DOCTYPE html> |
+<meta charset="utf-8"> |
bokan
2016/09/16 15:45:35
No need for this meta
lunalu1
2016/09/16 16:13:38
Done.
|
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<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.
|
+ <textarea id="textarea" style="width: 150px; height: 100px;"></textarea> |
+ <div id="resizablediv" style="resize:both; overflow:scroll; width: 100px; height: 100px;"></div> |
+ <script> |
+ function doScroll(x, y, deltaY, device) { |
+ eventSender.gestureScrollBegin(device, x, y); |
+ eventSender.gestureScrollUpdate(device, 0, deltaY); |
+ eventSender.gestureScrollEnd(device, 0, 0); |
+ } |
+ |
+ function resize(id, deltaY, device) { |
+ var target = document.getElementById(id); |
+ var rect = target.getBoundingClientRect(); |
+ var old_height = target.offsetHeight; |
+ // Scrolling within the normal resizer area (15 x 15) |
+ doScroll(rect.right - 5, rect.bottom - 5, deltaY, device); |
+ |
+ 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.
|
+ assert_equals(target.offsetHeight - old_height, deltaY); |
+ }, 'Target:' + id + ', from source: ' + device + ', should be vertically resized by ' + deltaY); |
+ } |
+ |
+ // When scrolling over the resizer by |
+ // a mouse or a touch pad: expect no resize; |
+ // a touchscree (i.e. tap and drag): expect resize. |
+ resize("textarea", 20, "touchscreen"); |
+ 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.
|
+ resize("resizablediv", 20, "touchscreen"); |
+ resize("resizablediv", 0, "touchpad"); |
+ </script> |
+</body> |