Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-event-in-slop-region.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-event-in-slop-region.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-event-in-slop-region.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..879744c854aa28a1a192e1c74675e2b65828d5ad |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-event-in-slop-region.html |
| @@ -0,0 +1,67 @@ |
| +<!DOCTYPE html> |
| +<script src='../../../resources/testharness.js'></script> |
| +<script src='../../../resources/testharnessreport.js'></script> |
| +<style type="text/css"> |
| +#box { |
| + width: 600px; |
| + height: 600px; |
| + touch-action: none; |
| +} |
| +</style> |
| +<div id="box" ></div> |
| + |
| +<script type="text/javascript"> |
| + |
| +var touchMoveCount = 0; |
| +var pointerMoveCount = 0; |
| +var box = document.getElementById('box'); |
| +var targetRect = box.getBoundingClientRect(); |
| +var offset = 50; |
| +var x = targetRect.left + offset; |
| +var y = targetRect.top + offset; |
| + |
| +function validTouchMoveResult(event) { |
| + touchMoveCount++; |
| + testTouchMove.step(function () { |
| + assert_equals(event.target.id, "box"); |
| + }); |
| +} |
| + |
| +function validPointerMoveResult(event) { |
| + pointerMoveCount++; |
| + testTouchMove.step(function () { |
| + assert_equals(event.target.id, "box"); |
| + assert_equals(event.pointerType, "touch"); |
| + }); |
| +} |
| + |
| +var testTouchMove = async_test('Move in the slop region.'); |
| + box.addEventListener('touchmove', validTouchMoveResult); |
| + box.addEventListener('pointermove', validPointerMoveResult); |
| + if (window.chrome && chrome.gpuBenchmarking) { |
|
tdresser
2017/02/02 21:30:54
Aren't we trying to use the JS wrapper of this mos
lanwei
2017/02/03 21:39:33
Done.
|
| + chrome.gpuBenchmarking.pointerActionSequence( |
| + [{"source": "touch", |
| + "actions": [ |
| + { "name": "pointerDown", "x": x, "y": y }, |
| + { "name": "pointerMove", "x": x, "y": y + 10 }, |
| + { "name": "pause" }, |
| + { "name": "pause" }, |
| + { "name": "pause" }, |
| + { "name": "pointerMove", "x": x, "y": y + 6 }, |
| + { "name": "pointerUp" }]}, |
| + {"source": "touch", |
| + "actions": [ |
| + { "name": "pause" }, |
| + { "name": "pause" }, |
| + { "name": "pointerDown", "x": x, "y": y }, |
| + { "name": "pointerMove", "x": x, "y": y + 10 }, |
| + { "name": "pointerUp"}]}], function() { |
| + testTouchMove.step(function () { |
| + assert_equals(touchMoveCount, 2); |
| + assert_equals(pointerMoveCount, 3); |
| + }); |
| + testTouchMove.done(); |
| + }); |
| + } |
| + |
| +</script> |