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

Side by Side 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: Layout tests Created 5 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <div id="target0" style="height: 100px;"></div>
5 <script>
6 async_test(function() {
7 if (!window.eventSender) {
8 this.done();
9 return;
10 }
11 var POINTER_PROPERTIES = [
12 { width: 1.125, height: 1.25, pressure: .1875, tiltX: 0, tiltY: 0, isPrimary : true },
13 { width: 2.125, height: 2.25, pressure: .2500, tiltX: 25, tiltY: 26, isPrima ry: false },
14 { width: 3.125, height: 3.25, pressure: .3125, tiltX: 0, tiltY: 0, isPrimary : false },
15 { width: 4.125, height: 4.25, pressure: .4375, tiltX: 0, tiltY: 0, isPrimary : false }
16 ];
17 var receivedPointerEvents = [];
18 var target0 = document.getElementById("target0");
19 function checkPointerEvent(event) {
20 receivedPointerEvents.push(event);
21 test(function() {
22 assert_between_inclusive(event.pointerId, 0, POINTER_PROPERTIES.length - 1 );
23 var pp = POINTER_PROPERTIES[event.pointerId];
24 for ( var i in pp )
25 assert_equals(event[i], pp[i], "" + i);
26 }, "Pointer event properties for pointer " + event.pointerId + " on " + even t.type);
27 }
28 on_event(target0, "pointerdown", this.step_func(checkPointerEvent));
29 on_event(target0, "pointermove", this.step_func(checkPointerEvent));
30 on_event(target0, "pointerup", this.step_func(checkPointerEvent));
31 on_event(window, "load", this.step_func_done(function() {
32 assert_not_equals(window.PointerEvent, undefined, "window.PointerEvent");
33 var x = target0.offsetLeft + 2;
34 var y = target0.offsetTop + 2;
35
36 for ( var i = 0 ; i < POINTER_PROPERTIES.length ; ++i ) {
37 var pp = POINTER_PROPERTIES[i];
38 eventSender.addTouchPoint(x + i, y + i, pp["width"], pp["height"], pp["pre ssure"], pp["tiltX"], pp["tiltY"], "pen");
39 }
40 eventSender.touchStart();
41
42 for ( var i = 0 ; i < POINTER_PROPERTIES.length ; ++i ) {
43 var pp = POINTER_PROPERTIES[i];
44 eventSender.updateTouchPoint(i, x + i + 20, y + i + 20);
45 }
46
47 eventSender.touchMove();
48 for ( var i = 0 ; i < POINTER_PROPERTIES.length ; ++i )
49 eventSender.releaseTouchPoint(i);
50 eventSender.touchEnd();
51
52 test(function() {
53 assert_array_equals(
54 receivedPointerEvents.map(function(event) { return event.type; }),
55 ["pointerdown", "pointerdown", "pointerdown", "pointerdown",
56 "pointermove", "pointermove", "pointermove", "pointermove",
57 "pointerup", "pointerup", "pointerup", "pointerup"]);
58 }, "Peceived pointer events");
mustaq 2015/07/30 20:18:21 Typo: "Received..."
USE eero AT chromium.org 2015/07/31 09:37:12 Done.
59 }));
60 }, "Pointer property propagation from touches to PointerEvents");
61 </script>
OLDNEW
« 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