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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html

Issue 2510133002: Add getCoalescedEvents API to PointerEvent (Closed)
Patch Set: add comment about the two added functions Created 4 years, 1 month 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: third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html b/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html
index 0b2ae15cfba3f30d9a65c22dfed32f6f3364d7c3..4e3cdad15da738c138ddaccbcbd7a69ca0829840 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html
@@ -83,4 +83,21 @@ shouldBeZero("new PointerEvent('eventType').button");
shouldBeZero("new PointerEvent('eventType').buttons");
shouldBeNull("new PointerEvent('eventType').relatedTarget");
+debug("--- tests for coalesced events ---");
+var coalescedEvents = [
+ new PointerEvent('eventType', { 'pressure' : 1, pointerId : 2 }),
+ new PointerEvent('eventType', { 'pressure' : 0.5, pointerId : 2 }),
+];
+var pe = new PointerEvent('eventType', {'coalescedEvents': coalescedEvents, 'pressure' : 0.1, pointerId : 1 });
+shouldBeEqualToNumber("pe.getCoalescedEvents().length", coalescedEvents.length);
+
+shouldBeCloseTo("pe.pressure", 0.1, 0.00001);
+shouldBeCloseTo("pe.getCoalescedEvents()[0].pressure", 1, 0.00001);
+shouldBeCloseTo("pe.getCoalescedEvents()[1].pressure", 0.5, 0.00001);
+
+shouldBeEqualToNumber("pe.pointerId", 1);
+shouldBeEqualToNumber("pe.getCoalescedEvents()[0].pointerId", 2);
+shouldBeEqualToNumber("pe.getCoalescedEvents()[1].pointerId", 2);
+
+
</script>

Powered by Google App Engine
This is Rietveld 408576698