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

Unified Diff: LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js

Issue 750013004: Added experimental tilt and tiltDirection to the Touch interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed WebInputEventConversionTest Created 5 years, 9 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: LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
index a029912b7dc9f2cb6b2dc5f74a00282a5b84e750..789cbb97d03a53f1c5f3739b32abce51d8740186 100644
--- a/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
+++ b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
@@ -40,7 +40,7 @@ function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
shouldBe("lastEvent.pageY", "0");
}
-function verifyTouchPoint(list, point, x, y, id, rx, ry)
+function verifyTouchPoint(list, point, x, y, id, rx, ry, tilt, tiltDir)
{
shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString());
shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString());
@@ -51,6 +51,10 @@ function verifyTouchPoint(list, point, x, y, id, rx, ry)
shouldBe("lastEvent." + list + "[" + point + "].webkitRadiusX", rx.toString());
shouldBe("lastEvent." + list + "[" + point + "].webkitRadiusY", ry.toString());
}
+ if (eventSender.setTouchPointTilt) {
+ shouldBe("lastEvent." + list + "[" + point + "].tilt", tilt.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].tiltDirection", tiltDir.toString());
+ }
}
function verifyTouch(which) {
@@ -59,13 +63,13 @@ function verifyTouch(which) {
verifyTouchEvent("touchstart", 1, 1, 1);
shouldBe("lastEvent.shiftKey", "false");
shouldBeEqualToString("lastEvent.touches[0].target.id", "touchtarget");
- verifyTouchPoint("touches", 0, 10, 10, 0, 10, 10);
- verifyTouchPoint("changedTouches", 0, 10, 10, 0, 10, 10);
- verifyTouchPoint("targetTouches", 0, 10, 10, 0, 10, 10);
+ verifyTouchPoint("touches", 0, 10, 10, 0, 10, 10, 10, 10);
+ verifyTouchPoint("changedTouches", 0, 10, 10, 0, 10, 10, 10, 10);
+ verifyTouchPoint("targetTouches", 0, 10, 10, 0, 10, 10, 10, 10);
break;
case 1:
verifyTouchEvent("touchmove", 1, 1, 1);
- verifyTouchPoint("touches", 0, 50, 50, 0, 12, 12);
+ verifyTouchPoint("touches", 0, 50, 50, 0, 12, 12, 45, 60);
shouldBe("lastEvent.shiftKey", "true");
shouldBe("lastEvent.altKey", "true");
shouldBe("lastEvent.ctrlKey", "false");
@@ -73,7 +77,7 @@ function verifyTouch(which) {
break;
case 2:
verifyTouchEvent("touchend", 0, 1, 0);
- verifyTouchPoint("changedTouches", 0, 50, 50, 0, 12, 12);
+ verifyTouchPoint("changedTouches", 0, 50, 50, 0, 12, 12, 45, 60);
shouldBe("lastEvent.shiftKey", "false");
shouldBe("lastEvent.altKey", "false");
break;
@@ -94,11 +98,16 @@ function singleTouchSequence()
{
eventSender.addTouchPoint(10, 10);
if (eventSender.setTouchPointRadius)
- eventSender.setTouchPointRadius(0, 10, 10, false);
+ eventSender.setTouchPointRadius(0, 10, 10, false);
+ if (eventSender.setTouchPointTilt)
+ eventSender.setTouchPointTilt(0, 10, 10, false);
eventSender.touchStart();
if (eventSender.setTouchPointRadius)
- eventSender.setTouchPointRadius(0, 12, 12, true);
+ eventSender.setTouchPointRadius(0, 12, 12, true);
+ if (eventSender.setTouchPointTilt)
+ eventSender.setTouchPointTilt(0, 45, 60, true);
+
eventSender.updateTouchPoint(0, 50, 50);
eventSender.setTouchModifier("shift", true);
eventSender.setTouchModifier("alt", true);

Powered by Google App Engine
This is Rietveld 408576698