OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src='../../../resources/testharness.js'></script> | 2 <script src='../../../resources/testharness.js'></script> |
3 <script src='../../../resources/testharnessreport.js'></script> | 3 <script src='../../../resources/testharnessreport.js'></script> |
4 <style type="text/css"> | 4 <style type="text/css"> |
5 #box { | 5 #box { |
6 width: 600px; | 6 width: 600px; |
7 height: 600px; | 7 height: 600px; |
8 touch-action: none; | 8 touch-action: none; |
9 } | 9 } |
10 </style> | 10 </style> |
(...skipping 20 matching lines...) Expand all Loading... |
31 pointerMoveCount++; | 31 pointerMoveCount++; |
32 testTouchMove.step(function () { | 32 testTouchMove.step(function () { |
33 assert_equals(event.target.id, "box"); | 33 assert_equals(event.target.id, "box"); |
34 assert_equals(event.pointerType, "touch"); | 34 assert_equals(event.pointerType, "touch"); |
35 }); | 35 }); |
36 } | 36 } |
37 | 37 |
38 function callbackValidMoveCount() { | 38 function callbackValidMoveCount() { |
39 testTouchMove.step(function () { | 39 testTouchMove.step(function () { |
40 assert_equals(touchMoveCount, 3); | 40 assert_equals(touchMoveCount, 3); |
41 assert_equals(pointerMoveCount, 5); | 41 assert_equals(pointerMoveCount, 7); |
42 }); | 42 }); |
43 testTouchMove.done(); | 43 testTouchMove.done(); |
44 } | 44 } |
45 | 45 |
46 function testTouchMoveSuppressionInSlopRegion() { | 46 function testTouchMoveSuppressionInSlopRegion() { |
47 if (window.chrome && chrome.gpuBenchmarking) { | 47 if (window.chrome && chrome.gpuBenchmarking) { |
48 var pointerActions = | 48 var pointerActions = |
49 [{source: "touch", | 49 [{source: "touch", |
50 actions: [ | 50 actions: [ |
51 { name: "pointerDown", x: x, y: y }, | 51 { name: "pointerDown", x: x, y: y }, |
| 52 { name: "pointerMove", x: x, y: y + 1 }, |
52 { name: "pointerMove", x: x, y: y + 10 }, | 53 { name: "pointerMove", x: x, y: y + 10 }, |
53 { name: "pointerMove", x: x, y: y + 20 }, | 54 { name: "pointerMove", x: x, y: y + 20 }, |
54 { name: "pointerMove", x: x, y: y + 10 }, | 55 { name: "pointerMove", x: x, y: y + 10 }, |
55 { name: "pointerUp" }, | 56 { name: "pointerUp" }, |
56 { name: "pointerDown", x: x, y: y }, | 57 { name: "pointerDown", x: x, y: y }, |
| 58 { name: "pointerMove", x: x, y: y + 1 }, |
57 { name: "pointerMove", x: x, y: y + 10 }, | 59 { name: "pointerMove", x: x, y: y + 10 }, |
58 { name: "pointerMove", x: x, y: y + 20 }]}]; | 60 { name: "pointerMove", x: x, y: y + 20 }]}]; |
59 chrome.gpuBenchmarking.pointerActionSequence(pointerActions, callbackVal
idMoveCount); | 61 chrome.gpuBenchmarking.pointerActionSequence(pointerActions, callbackVal
idMoveCount); |
60 } | 62 } |
61 } | 63 } |
62 | 64 |
63 var testTouchMove = async_test('Tests that TouchMoves are suppressed if within t
he slop suppression region.'); | 65 var testTouchMove = async_test('Tests that TouchMoves are suppressed if within t
he slop suppression region.'); |
64 box.addEventListener('touchmove', validTouchMoveResult); | 66 box.addEventListener('touchmove', validTouchMoveResult); |
65 box.addEventListener('pointermove', validPointerMoveResult); | 67 box.addEventListener('pointermove', validPointerMoveResult); |
66 testTouchMoveSuppressionInSlopRegion(); | 68 testTouchMoveSuppressionInSlopRegion(); |
67 | 69 |
68 </script> | 70 </script> |
OLD | NEW |