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

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: rebase 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 plus screen & client coordinates ---") ; 8 debug("--- tests for intrinsic attributes plus screen & client coordinates ---") ;
9 9
10 ["pointerId", "tiltX", "tiltY"].forEach(function (attr) { 10 ["pointerId", "tiltX", "tiltY"].forEach(function (attr) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 shouldBeNull("new PointerEvent('eventType').view"); 73 shouldBeNull("new PointerEvent('eventType').view");
74 shouldBeZero("new PointerEvent('eventType').detail"); 74 shouldBeZero("new PointerEvent('eventType').detail");
75 shouldBeFalse("new PointerEvent('eventType').ctrlKey"); 75 shouldBeFalse("new PointerEvent('eventType').ctrlKey");
76 shouldBeFalse("new PointerEvent('eventType').shiftKey"); 76 shouldBeFalse("new PointerEvent('eventType').shiftKey");
77 shouldBeFalse("new PointerEvent('eventType').altKey"); 77 shouldBeFalse("new PointerEvent('eventType').altKey");
78 shouldBeFalse("new PointerEvent('eventType').metaKey"); 78 shouldBeFalse("new PointerEvent('eventType').metaKey");
79 shouldBeZero("new PointerEvent('eventType').button"); 79 shouldBeZero("new PointerEvent('eventType').button");
80 shouldBeZero("new PointerEvent('eventType').buttons"); 80 shouldBeZero("new PointerEvent('eventType').buttons");
81 shouldBeNull("new PointerEvent('eventType').relatedTarget"); 81 shouldBeNull("new PointerEvent('eventType').relatedTarget");
82 82
83 debug("--- tests for coalesced events ---");
84 var coalescedEvents = [
85 new PointerEvent('eventType', { 'pressure' : 1, pointerId : 2 }),
86 new PointerEvent('eventType', { 'pressure' : 0.5, pointerId : 2 }),
87 ];
88 var pe = new PointerEvent('eventType', {'coalescedEvents': coalescedEvents, 'pre ssure' : 0.1, pointerId : 1 });
89 shouldBeEqualToNumber("pe.getCoalescedEvents().length", coalescedEvents.length);
90
91 shouldBeCloseTo("pe.pressure", 0.1, 0.00001);
92 shouldBeCloseTo("pe.getCoalescedEvents()[0].pressure", 1, 0.00001);
93 shouldBeCloseTo("pe.getCoalescedEvents()[1].pressure", 0.5, 0.00001);
94
95 shouldBeEqualToNumber("pe.pointerId", 1);
96 shouldBeEqualToNumber("pe.getCoalescedEvents()[0].pointerId", 2);
97 shouldBeEqualToNumber("pe.getCoalescedEvents()[1].pointerId", 2);
98
99
83 </script> 100 </script>
OLDNEW
« 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