Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..678b49ba58bde413b051610bfe564d71675215ef |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html |
| @@ -0,0 +1,38 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<div><input type="range" id="slider1"></input></div> |
| +<div><input type="range" id="slider2" style="-webkit-appearance: slider-vertical;"></div> |
| +<div><input type="range" id="slider3" style="touch-action:none;"></div> |
| +<script> |
| +function forceLayoutUpdate() { |
| + document.body.offsetTop; |
| +} |
| + |
| +forceLayoutUpdate(); |
| + |
| +test(() => { |
| + assert_equals(internals.blockingTouchStartOrMoveEventHandlerCount(document), 4); |
| + assert_equals(internals.passiveTouchStartOrMoveEventHandlerCount(document), 3); |
| +}, |
| +'Tests that there are 4 blocking touch handlers in total(each slider has its own blocking touch-action, plus one blocking action defined by the user), and that there are 3 passive touch handlers(each slider has its own handler to deal with the dragging event)'); |
|
tkent
2016/08/17 01:32:00
We should test user-facing behavior instead of int
|
| + |
| +test(() => { |
| + var slider1 = document.getElementById('slider1'); |
| + var slider2 = document.getElementById('slider2'); |
| + var slider3 = document.getElementById('slider3') |
| + var container1 = internals.shadowRoot(slider1).children[0]; |
| + var container2 = internals.shadowRoot(slider2).children[0]; |
| + var container3 = internals.shadowRoot(slider3).children[0]; |
| + assert_equals(getComputedStyle(container1).touchAction, 'pan-y'); |
| + assert_equals(getComputedStyle(container2).touchAction, 'pan-x'); |
| + assert_equals(getComputedStyle(container3).touchAction, 'pan-y'); |
| + assert_equals(getComputedStyle(slider3).touchAction, 'none'); |
| + |
| + slider1.style="-webkit-appearance: slider-vertical;"; |
| + slider2.style=""; |
| + forceLayoutUpdate(); |
| + assert_equals(getComputedStyle(container1).touchAction, 'pan-x'); |
| + assert_equals(getComputedStyle(container2).touchAction, 'pan-y'); |
| +}, "Tests that each range input type has the correct pan-x or pan-y touch-action inside its shadow element: container. This touch-action is under the user-specified touch-action, and will update with the -webkit-appearance."); |
| +</script> |