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

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

Issue 2669663002: Move touch slop suppression to TouchEventManager (Closed)
Patch Set: slop region 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src='../../../resources/testharness.js'></script>
3 <script src='../../../resources/testharnessreport.js'></script>
4 <style type="text/css">
5 #box {
6 width: 600px;
7 height: 600px;
8 touch-action: none;
9 }
10 </style>
11 <div id="box" ></div>
12
13 <script type="text/javascript">
14
15 var touchMoveCount = 0;
16 var pointerMoveCount = 0;
17 var box = document.getElementById('box');
18 var targetRect = box.getBoundingClientRect();
19 var offset = 50;
20 var x = targetRect.left + offset;
21 var y = targetRect.top + offset;
22
23 function validTouchMoveResult(event) {
24 touchMoveCount++;
25 testTouchMove.step(function () {
26 assert_equals(event.target.id, "box");
27 });
28 }
29
30 function validPointerMoveResult(event) {
31 pointerMoveCount++;
32 testTouchMove.step(function () {
33 assert_equals(event.target.id, "box");
34 assert_equals(event.pointerType, "touch");
35 });
36 }
37
38 var testTouchMove = async_test('Move in the slop region.');
39 box.addEventListener('touchmove', validTouchMoveResult);
40 box.addEventListener('pointermove', validPointerMoveResult);
41 if (window.chrome && chrome.gpuBenchmarking) {
42 chrome.gpuBenchmarking.pointerActionSequence(
43 [{"source": "touch",
44 "actions": [
45 { "name": "pointerDown", "x": x, "y": y },
46 { "name": "pointerMove", "x": x, "y": y + 10 },
47 { "name": "pointerMove", "x": x, "y": y + 20 },
48 { "name": "pointerMove", "x": x, "y": y + 30 },
49 { "name": "pointerUp"}]}], function() {
50 testTouchMove.step(function () {
51 assert_equals(touchMoveCount, 2);
52 assert_equals(pointerMoveCount, 3);
53 });
54 testTouchMove.done();
55 });
56 }
57
58 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698