OLD | NEW |
---|---|
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Pointer Events coalesced events count and properties<</title> | 4 <title>Pointer Events coalesced events count and properties<</title> |
5 <meta name="viewport" content="width=device-width"> | 5 <meta name="viewport" content="width=device-width"> |
6 <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css" > | 6 <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css" > |
7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
9 <!-- Additional helper script for common checks across event types --> | 9 <!-- Additional helper script for common checks across event types --> |
10 <script type="text/javascript" src="../pointerevent_support.js"></script > | 10 <script type="text/javascript" src="../pointerevent_support.js"></script > |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 break; | 70 break; |
71 case PhaseEnum.WaitingForMove: | 71 case PhaseEnum.WaitingForMove: |
72 if (eventName == 'pointermove') { | 72 if (eventName == 'pointermove') { |
73 var coalescedEvents = event.getCoalescedEvents(); | 73 var coalescedEvents = event.getCoalescedEvents(); |
74 test (function() { | 74 test (function() { |
75 assert_greater_than(event.getCoalescedEvents().l ength, 1, 'pointermove should have at least 2 coalesced events.'); | 75 assert_greater_than(event.getCoalescedEvents().l ength, 1, 'pointermove should have at least 2 coalesced events.'); |
76 }, expectedPointerType + ' pointermove should have >2 coalesced events as main thread is busy.'); | 76 }, expectedPointerType + ' pointermove should have >2 coalesced events as main thread is busy.'); |
77 test (function() { | 77 test (function() { |
78 for (var i=0; i<coalescedEvents.length; i++) { | 78 for (var i=0; i<coalescedEvents.length; i++) { |
79 assert_equals(coalescedEvents[i].isTrusted, tr ue, 'isTrusted flag should be true for coalesced events.'); | 79 assert_equals(coalescedEvents[i].isTrusted, tr ue, 'isTrusted flag should be true for coalesced events.'); |
80 if (i > 0) | |
81 assert_greater_than_equal(coalescedEvents[i] .timeStamp, coalescedEvents[i-1].timeStamp, 'Time stamps of coalesced events mus t be ascending.'); | |
80 } | 82 } |
81 }, expectedPointerType + ' pointermove coalesced e vents should all be marked as trusted.'); | 83 }, expectedPointerType + ' pointermove coalesced e vents should all be marked as trusted.'); |
84 console.log('navid'); | |
dtapuska
2017/04/21 20:18:10
I think the console.log('navid') should be removed
Navid Zolghadr
2017/04/24 15:19:41
I somehow have very clear memory of removing these
| |
85 test (function() { | |
86 for (var i=1; i<coalescedEvents.length; i++) { | |
87 console.log('i=' + i + ' ' +coalescedEvents[i] .timeStamp + ' ' + coalescedEvents[i-1].timeStamp); | |
dtapuska
2017/04/21 20:18:10
likewise with this log.
| |
88 assert_greater_than_equal(coalescedEvents[i].t imeStamp, coalescedEvents[i-1].timeStamp, 'Time stamps of coalesced events must be ascending.'); | |
89 } | |
90 }, expectedPointerType + ' time stamps of coalesce d events must be ascending.'); | |
82 test (function() { | 91 test (function() { |
83 for (var i=0; i<coalescedEvents.length; i++) { | 92 for (var i=0; i<coalescedEvents.length; i++) { |
84 assert_equals(coalescedEvents[i].bubbles, fals e, 'Bubbles attribute should be false for coalesced events.'); | 93 assert_equals(coalescedEvents[i].bubbles, fals e, 'Bubbles attribute should be false for coalesced events.'); |
85 assert_equals(coalescedEvents[i].cancelable, f alse, 'Cancelable attribute should be false for coalesced events.'); | 94 assert_equals(coalescedEvents[i].cancelable, f alse, 'Cancelable attribute should be false for coalesced events.'); |
86 } | 95 } |
87 }, expectedPointerType + ' pointermove coalesced e vents should all bubbles and cancelable as false.'); | 96 }, expectedPointerType + ' pointermove coalesced e vents should all bubbles and cancelable as false.'); |
88 phase++; | 97 phase++; |
89 } | 98 } |
90 break; | 99 break; |
91 case PhaseEnum.WaitingForUp: | 100 case PhaseEnum.WaitingForUp: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 </h4> | 138 </h4> |
130 <div id="target0"></div> | 139 <div id="target0"></div> |
131 <div id="target1" class="touchActionNone"></div> | 140 <div id="target1" class="touchActionNone"></div> |
132 <div id="complete-notice"> | 141 <div id="complete-notice"> |
133 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p> | 142 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p> |
134 <p>Refresh the page to run the tests again with a different pointer type.</p> | 143 <p>Refresh the page to run the tests again with a different pointer type.</p> |
135 </div> | 144 </div> |
136 </body> | 145 </body> |
137 </html> | 146 </html> |
138 | 147 |
OLD | NEW |