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

Unified Diff: LayoutTests/fast/events/pointerevents/touch-pointer-event-properties.html

Issue 1192563002: Pass real tilt information to PointerEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Spelling, passing expected.txt Created 5 years, 5 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/pointerevents/touch-pointer-event-properties.html
diff --git a/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties.html b/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties.html
new file mode 100644
index 0000000000000000000000000000000000000000..0019648021f61dff0fd719ae86a1e07f7b70ae59
--- /dev/null
+++ b/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<h1>Test that pointer properties propagates from touches to PointerEvents</h1>
+<div id="target0" style="height: 100px;"></div>
+<script>
+async_test(function() {
+ if (!window.eventSender) {
+ this.done();
+ return;
+ }
+ var POINTER_PROPERTIES = [
+ { width: 1.125, height: 1.25, pressure: .1875, tiltX: 0, tiltY: 0, isPrimary: true },
+ { width: 2.125, height: 2.25, pressure: .2500, tiltX: 25, tiltY: 26, isPrimary: false },
+ { width: 3.125, height: 3.25, pressure: .3125, tiltX: 0, tiltY: 0, isPrimary: false },
+ { width: 4.125, height: 4.25, pressure: .4375, tiltX: 0, tiltY: 0, isPrimary: false }
+ ];
+ var receivedPointerEvents = [];
+ var target0 = document.getElementById("target0");
+ function checkPointerEvent(event) {
+ receivedPointerEvents.push(event);
+ test(function() {
+ assert_between_inclusive(event.pointerId, 0, POINTER_PROPERTIES.length - 1);
+ var pp = POINTER_PROPERTIES[event.pointerId];
+ for ( var i in pp )
+ assert_equals(event[i], pp[i], "" + i);
+ }, "Pointer event properties for pointer " + event.pointerId + " on " + event.type);
+ }
+ on_event(target0, "pointerdown", this.step_func(checkPointerEvent));
+ on_event(target0, "pointermove", this.step_func(checkPointerEvent));
+ on_event(target0, "pointerup", this.step_func(checkPointerEvent));
+ on_event(window, "load", this.step_func_done(function() {
+ assert_not_equals(window.PointerEvent, undefined, "window.PointerEvent");
+ var x = target0.offsetLeft + 2;
+ var y = target0.offsetTop + 2;
+
+ for ( var i = 0 ; i < POINTER_PROPERTIES.length ; ++i ) {
+ var pp = POINTER_PROPERTIES[i];
+ eventSender.addTouchPoint(x + i, y + i, pp["width"], pp["height"], pp["pressure"], pp["tiltX"], pp["tiltY"], "pen");
+ }
+ eventSender.touchStart();
+
+ for ( var i = 0 ; i < POINTER_PROPERTIES.length ; ++i ) {
+ var pp = POINTER_PROPERTIES[i];
+ eventSender.updateTouchPoint(i, x + i + 20, y + i + 20);
+ }
+
+ eventSender.touchMove();
+ for ( var i = 0 ; i < POINTER_PROPERTIES.length ; ++i )
+ eventSender.releaseTouchPoint(i);
+ eventSender.touchEnd();
+
+ test(function() {
+ assert_array_equals(
+ receivedPointerEvents.map(function(event) { return event.type; }),
+ ["pointerdown", "pointerdown", "pointerdown", "pointerdown",
+ "pointermove", "pointermove", "pointermove", "pointermove",
+ "pointerup", "pointerup", "pointerup", "pointerup"]);
+ }, "Received pointer events");
+ }));
+}, "Pointer property propagation from touches to PointerEvents");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698