OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta name="viewport" content="width=device-width, initial-scale=1"> | 2 <meta name="viewport" content="width=device-width, initial-scale=1"> |
3 <style> | 3 <style> |
4 html { | 4 html { |
5 font-family: Ahem; | 5 font-family: Ahem; |
6 font-size: 10px; | 6 font-size: 10px; |
7 } | 7 } |
8 #testArea { | 8 #testArea { |
9 position: absolute; | 9 position: absolute; |
10 right: 50px; | 10 right: 50px; |
(...skipping 25 matching lines...) Expand all Loading... | |
36 function hitTestCountDelta(doc) | 36 function hitTestCountDelta(doc) |
37 { | 37 { |
38 var lastCount = 0; | 38 var lastCount = 0; |
39 if ('lastHitTestCount' in doc) | 39 if ('lastHitTestCount' in doc) |
40 lastCount = doc.lastHitTestCount; | 40 lastCount = doc.lastHitTestCount; |
41 var newCount = internals.hitTestCount(doc); | 41 var newCount = internals.hitTestCount(doc); |
42 doc.lastHitTestCount = newCount; | 42 doc.lastHitTestCount = newCount; |
43 return newCount - lastCount; | 43 return newCount - lastCount; |
44 } | 44 } |
45 | 45 |
46 function hitTestCacheHitsDelta(doc) | |
47 { | |
48 var lastCount = 0; | |
49 if ('lastHitTestCacheHits' in doc) | |
50 lastCount = doc.lastHitTestCacheHits; | |
51 var newCount = internals.hitTestCacheHits(doc); | |
52 doc.lastHitTestCacheHits = newCount; | |
53 return newCount - lastCount; | |
54 } | |
55 | |
46 function logCounts(label, documents, multiTapNotification, eventSenderFunction) | 56 function logCounts(label, documents, multiTapNotification, eventSenderFunction) |
47 { | 57 { |
48 if (eventSenderFunction) | 58 if (eventSenderFunction) |
49 eventSenderFunction(); | 59 eventSenderFunction(); |
50 | 60 |
51 var countStr = ''; | 61 var countStr = ''; |
52 for(var i = 0; i < documents.length; i++) | 62 for(var i = 0; i < documents.length; i++) |
53 countStr += ' ' + hitTestCountDelta(documents[i]); | 63 countStr += ' ' + hitTestCountDelta(documents[i]) + "/" + hitTestCacheHi tsDelta(documents[i]); |
Rick Byers
2015/06/05 20:48:59
nit: I'd find this more readable if it was "<misse
dtapuska
2015/06/09 18:21:23
Done.
| |
54 | 64 |
55 if (multiTapNotification) { | 65 if (multiTapNotification) { |
56 debug(label + ':' + eventCounts[label] | 66 debug(label + ':' + eventCounts[label] |
57 + ((countStr == eventCounts[label])? '': ' [with multiTargetTapNotificat ion:' + countStr + ']')); | 67 + ((countStr == eventCounts[label])? '': ' [with multiTargetTapNotificat ion:' + countStr + ']')); |
58 } else { | 68 } else { |
59 // store the count for later; to be compared when the | 69 // store the count for later; to be compared when the |
60 // multiTapNotification test is run. | 70 // multiTapNotification test is run. |
61 eventCounts[label] = countStr; | 71 eventCounts[label] = countStr; |
62 } | 72 } |
63 } | 73 } |
64 | 74 |
65 function clearCounts(documents) | 75 function clearCounts(documents) |
66 { | 76 { |
67 for(var i = 0; i < documents.length; i++) | 77 for(var i = 0; i < documents.length; i++) { |
68 documents[i].lastHitTestCount = internals.hitTestCount(documents[i]); | 78 documents[i].lastHitTestCount = internals.hitTestCount(documents[i]); |
79 documents[i].lastHitTestCacheHits = internals.hitTestCacheHits(documents [i]); | |
80 } | |
69 } | 81 } |
70 | 82 |
71 function sendEvents(targetX, targetY, documents, multiTapNotification) | 83 function sendEvents(targetX, targetY, documents, multiTapNotification) |
72 { | 84 { |
73 logCounts('Initial', documents, multiTapNotification); | 85 logCounts('Initial', documents, multiTapNotification); |
74 | 86 |
75 logCounts('MouseMove', documents, multiTapNotification, function() { | 87 logCounts('MouseMove', documents, multiTapNotification, function() { |
76 eventSender.mouseMoveTo(targetX, targetY); | 88 eventSender.mouseMoveTo(targetX, targetY); |
77 }); | 89 }); |
78 | 90 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 | 188 |
177 window.internals.settings.setViewportEnabled(false); | 189 window.internals.settings.setViewportEnabled(false); |
178 debug('Event on a simple div (desktop viewport)'); | 190 debug('Event on a simple div (desktop viewport)'); |
179 debug('---------------------'); | 191 debug('---------------------'); |
180 var point = centerOf(document.getElementById('target')); | 192 var point = centerOf(document.getElementById('target')); |
181 runTestForDocuments(point.x, point.y, [document]); | 193 runTestForDocuments(point.x, point.y, [document]); |
182 debug(''); | 194 debug(''); |
183 window.internals.settings.setViewportEnabled(true); | 195 window.internals.settings.setViewportEnabled(true); |
184 } | 196 } |
185 </script> | 197 </script> |
OLD | NEW |