Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-event-in-slop-region.html

Issue 2669663002: Move touch slop suppression to TouchEventManager (Closed)
Patch Set: slop regesion Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..82ac5bc6e8b9b6c0dde562de802409cf444f781c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-event-in-slop-region.html
@@ -0,0 +1,79 @@
+<!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");
+ });
+}
+
+function callbackValidMoveCount() {
+ testTouchMove.step(function () {
+ assert_equals(touchMoveCount, 2);
+ assert_equals(pointerMoveCount, 3);
+ });
+ testTouchMove.done();
+}
+
+function testMultiPointerMoveSuppressionInSlopRegion() {
+ if (window.chrome && chrome.gpuBenchmarking) {
+ var pointerActions = [{'source': 'touch'}, {'source': 'touch'}];
tdresser 2017/02/06 21:49:59 Let's just use a single literal here.
lanwei 2017/02/21 18:10:28 Done.
+ var pointerAction1 = pointerActions[0];
+ var pointerAction2 = pointerActions[1];
+ pointerAction1.actions = [];
+ pointerAction2.actions = [];
+ pointerAction1.actions.push(
+ {'name': 'pointerDown', 'x': x, 'y': y });
+ pointerAction1.actions.push(
+ {'name': 'pointerMove', 'x': x, 'y': y + 10 });
+ pointerAction1.actions.push({'name': 'pause' });
+ pointerAction1.actions.push({'name': 'pause' });
+ pointerAction1.actions.push({'name': 'pause' });
+ pointerAction1.actions.push(
+ {'name': 'pointerMove', 'x': x, 'y': y + 6 });
+ pointerAction1.actions.push({'name': 'pointerUp' });
+ pointerAction2.actions.push({'name': 'pause' });
+ pointerAction2.actions.push({'name': 'pause' });
+ pointerAction2.actions.push(
+ {'name': 'pointerDown', 'x': x, 'y': y });
+ pointerAction2.actions.push(
+ {'name': 'pointerMove', 'x': x, 'y': y + 10 });
+ pointerAction2.actions.push({'name': 'pointerUp' });
+ chrome.gpuBenchmarking.pointerActionSequence(pointerActions, callbackValidMoveCount);
+ }
+}
+
+var testTouchMove = async_test('Move in the slop region.');
+box.addEventListener('touchmove', validTouchMoveResult);
+box.addEventListener('pointermove', validPointerMoveResult);
+testMultiPointerMoveSuppressionInSlopRegion();
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698