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

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

Issue 2510133002: Add getCoalescedEvents API to PointerEvent (Closed)
Patch Set: rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d971c169b44b14b86d52f7c79c45e8644f88403c..134bb2f24212d1a0491088b09fd2e8f9639e5965 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
@@ -80,4 +80,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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698