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

Side by Side 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 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/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 3
4 <script> 4 <script>
5 5
6 description("This tests the constructor for the PointerEvent DOM class."); 6 description("This tests the constructor for the PointerEvent DOM class.");
7 7
8 debug("--- tests for intrinsic attributes ---"); 8 debug("--- tests for intrinsic attributes ---");
9 9
10 ["pointerId", "tiltX", "tiltY"].forEach(function (attr) { 10 ["pointerId", "tiltX", "tiltY"].forEach(function (attr) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 shouldBeZero("new PointerEvent('eventType').clientX"); 76 shouldBeZero("new PointerEvent('eventType').clientX");
77 shouldBeZero("new PointerEvent('eventType').clientY"); 77 shouldBeZero("new PointerEvent('eventType').clientY");
78 shouldBeFalse("new PointerEvent('eventType').ctrlKey"); 78 shouldBeFalse("new PointerEvent('eventType').ctrlKey");
79 shouldBeFalse("new PointerEvent('eventType').shiftKey"); 79 shouldBeFalse("new PointerEvent('eventType').shiftKey");
80 shouldBeFalse("new PointerEvent('eventType').altKey"); 80 shouldBeFalse("new PointerEvent('eventType').altKey");
81 shouldBeFalse("new PointerEvent('eventType').metaKey"); 81 shouldBeFalse("new PointerEvent('eventType').metaKey");
82 shouldBeZero("new PointerEvent('eventType').button"); 82 shouldBeZero("new PointerEvent('eventType').button");
83 shouldBeZero("new PointerEvent('eventType').buttons"); 83 shouldBeZero("new PointerEvent('eventType').buttons");
84 shouldBeNull("new PointerEvent('eventType').relatedTarget"); 84 shouldBeNull("new PointerEvent('eventType').relatedTarget");
85 85
86 debug("--- tests for coalesced events ---");
87 var coalescedEvents = [
88 new PointerEvent('eventType', { 'pressure' : 1, pointerId : 2 }),
89 new PointerEvent('eventType', { 'pressure' : 0.5, pointerId : 2 }),
90 ];
91 var pe = new PointerEvent('eventType', {'coalescedEvents': coalescedEvents, 'pre ssure' : 0.1, pointerId : 1 });
92 shouldBeEqualToNumber("pe.getCoalescedEvents().length", coalescedEvents.length);
93
94 shouldBeCloseTo("pe.pressure", 0.1, 0.00001);
95 shouldBeCloseTo("pe.getCoalescedEvents()[0].pressure", 1, 0.00001);
96 shouldBeCloseTo("pe.getCoalescedEvents()[1].pressure", 0.5, 0.00001);
97
98 shouldBeEqualToNumber("pe.pointerId", 1);
99 shouldBeEqualToNumber("pe.getCoalescedEvents()[0].pointerId", 2);
100 shouldBeEqualToNumber("pe.getCoalescedEvents()[1].pointerId", 2);
101
102
86 </script> 103 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698