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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties.html

Issue 1426643008: Cleaning up PointerIdManager and add id re-mapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix EXPECT_EQ compilation error on Android Created 5 years 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
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 <h1>Test that pointer properties propagates from touches to PointerEvents</h1> 4 <h1>Test that pointer properties propagates from touches to PointerEvents</h1>
5 <div id="target0" style="height: 100px;"></div> 5 <div id="target0" style="height: 100px;"></div>
6 <script> 6 <script>
7 async_test(function() { 7 async_test(function() {
8 if (!window.eventSender) { 8 if (!window.eventSender) {
9 this.done(); 9 this.done();
10 return; 10 return;
11 } 11 }
12 var POINTER_PROPERTIES = [ 12 var POINTER_PROPERTIES = [
13 { width: 1.125, height: 1.25, pressure: .1875, tiltX: 0, tiltY: 0, pointerTy pe: "mouse", isPrimary: true }, 13 { width: 1.125, height: 1.25, pressure: .1875, tiltX: 0, tiltY: 0, pointerTy pe: "mouse", isPrimary: true },
14 { width: 2.125, height: 2.25, pressure: .2500, tiltX: 25, tiltY: 26, pointer Type: "pen", isPrimary: true }, 14 { width: 2.125, height: 2.25, pressure: .2500, tiltX: 25, tiltY: 26, pointer Type: "pen", isPrimary: true },
15 { width: 3.125, height: 3.25, pressure: .3125, tiltX: 0, tiltY: 0, pointerTy pe: "touch", isPrimary: true }, 15 { width: 3.125, height: 3.25, pressure: .3125, tiltX: 0, tiltY: 0, pointerTy pe: "touch", isPrimary: true },
16 { width: 4.125, height: 4.25, pressure: .4375, tiltX: 0, tiltY: 0, pointerTy pe: "touch", isPrimary: false } 16 { width: 4.125, height: 4.25, pressure: .4375, tiltX: 0, tiltY: 0, pointerTy pe: "touch", isPrimary: false }
17 ]; 17 ];
18 var receivedPointerEvents = []; 18 var receivedPointerEvents = [];
19 var target0 = document.getElementById("target0"); 19 var target0 = document.getElementById("target0");
20 function checkPointerEvent(event) { 20 function checkPointerEvent(event) {
21 receivedPointerEvents.push(event); 21 receivedPointerEvents.push(event);
22 test(function() { 22 test(function() {
23 assert_between_inclusive(event.pointerId, 0, POINTER_PROPERTIES.length - 1 ); 23 assert_between_inclusive(event.pointerId, 1, POINTER_PROPERTIES.length);
24 var pp = POINTER_PROPERTIES[event.pointerId]; 24 var pp = POINTER_PROPERTIES[event.pointerId-1];
25 for ( var i in pp ) 25 for ( var i in pp )
26 assert_equals(event[i], pp[i], "" + i); 26 assert_equals(event[i], pp[i], "" + i);
27 }, "Pointer event properties for pointer " + event.pointerId + " on " + even t.type); 27 }, "Pointer event properties for pointer " + event.pointerId + " on " + even t.type);
28 } 28 }
29 on_event(target0, "pointerdown", this.step_func(checkPointerEvent)); 29 on_event(target0, "pointerdown", this.step_func(checkPointerEvent));
30 on_event(target0, "pointermove", this.step_func(checkPointerEvent)); 30 on_event(target0, "pointermove", this.step_func(checkPointerEvent));
31 on_event(target0, "pointerup", this.step_func(checkPointerEvent)); 31 on_event(target0, "pointerup", this.step_func(checkPointerEvent));
32 on_event(window, "load", this.step_func_done(function() { 32 on_event(window, "load", this.step_func_done(function() {
33 assert_not_equals(window.PointerEvent, undefined, "window.PointerEvent"); 33 assert_not_equals(window.PointerEvent, undefined, "window.PointerEvent");
34 var x = target0.offsetLeft + 2; 34 var x = target0.offsetLeft + 2;
(...skipping 18 matching lines...) Expand all
53 test(function() { 53 test(function() {
54 assert_array_equals( 54 assert_array_equals(
55 receivedPointerEvents.map(function(event) { return event.type; }), 55 receivedPointerEvents.map(function(event) { return event.type; }),
56 ["pointerdown", "pointerdown", "pointerdown", "pointerdown", 56 ["pointerdown", "pointerdown", "pointerdown", "pointerdown",
57 "pointermove", "pointermove", "pointermove", "pointermove", 57 "pointermove", "pointermove", "pointermove", "pointermove",
58 "pointerup", "pointerup", "pointerup", "pointerup"]); 58 "pointerup", "pointerup", "pointerup", "pointerup"]);
59 }, "Received pointer events"); 59 }, "Received pointer events");
60 })); 60 }));
61 }, "Pointer property propagation from touches to PointerEvents"); 61 }, "Pointer property propagation from touches to PointerEvents");
62 </script> 62 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698