Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style> | 3 <style> |
| 4 #test { | 4 #test { |
| 5 height: 0px; | 5 height: 0px; |
| 6 } | 6 } |
| 7 .child { | 7 .child { |
| 8 height: 5px; | 8 height: 5px; |
| 9 width: 5px; | 9 width: 5px; |
| 10 margin: 5px; | 10 margin: 5px; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // For example, run in content_shell with --expose-internals-for-testing. | 76 // For example, run in content_shell with --expose-internals-for-testing. |
| 77 testNode.removeEventListener('touchstart', touchHandler); | 77 testNode.removeEventListener('touchstart', touchHandler); |
| 78 } | 78 } |
| 79 | 79 |
| 80 Magnitude.description('Tests that compositor touch hit rect calculation is ' + | 80 Magnitude.description('Tests that compositor touch hit rect calculation is ' + |
| 81 'linear in the number of rects and in the number of layers .'); | 81 'linear in the number of rects and in the number of layers .'); |
| 82 | 82 |
| 83 // Wait for first layout. | 83 // Wait for first layout. |
| 84 document.body.getBoundingClientRect(); | 84 document.body.getBoundingClientRect(); |
| 85 | 85 |
| 86 // Verify that compositor touch hit testing is properly enabled. | 86 function main() |
| 87 if (window.internals) { | 87 { |
| 88 var testNode = document.getElementById('test'); | 88 // Verify that compositor touch hit testing is properly enabled. |
| 89 r = testNode.getBoundingClientRect(); | 89 if (window.internals) { |
|
Rick Byers
2014/09/06 00:17:29
If you're going to wrap this all in a function, th
eustas
2014/09/08 05:38:51
Done. Also fixed log function.
| |
| 90 | 90 var testNode = document.getElementById('test'); |
| 91 testNode.addEventListener('touchstart', touchHandler); | 91 r = testNode.getBoundingClientRect(); |
| 92 var rects = window.internals.touchEventTargetLayerRects(document); | 92 |
| 93 if (!rects) { | 93 testNode.addEventListener('touchstart', touchHandler); |
| 94 log("FAIL - no hit test rects exist, is compositing enabled?"); | 94 var rects = window.internals.touchEventTargetLayerRects(document); |
| 95 return; | 95 if (!rects) { |
| 96 log("FAIL - no hit test rects exist, is compositing enabled?"); | |
| 97 return; | |
| 98 } | |
| 99 if (!rects.length) { | |
| 100 log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHit TestingEnabled false?"); | |
| 101 } | |
| 102 testNode.removeEventListener('touchstart', touchHandler); | |
| 103 } else { | |
| 104 log("WARNING - missing windows.internals, can't verify hit testing is en abled."); | |
| 96 } | 105 } |
| 97 if (!rects.length) { | |
| 98 log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTest ingEnabled false?"); | |
| 99 } | |
| 100 testNode.removeEventListener('touchstart', touchHandler); | |
| 101 } else { | |
| 102 log("WARNING - missing windows.internals, can't verify hit testing is enable d."); | |
| 103 } | |
| 104 | 106 |
| 105 | 107 |
| 106 Magnitude.trim = 1; | 108 Magnitude.trim = 1; |
| 107 Magnitude.tolerance = 0.80; | 109 Magnitude.tolerance = 0.80; |
| 108 | 110 |
| 109 Magnitude.initialExponent = 7; | 111 Magnitude.initialExponent = 7; |
| 110 Magnitude.numPoints = 5; | 112 Magnitude.numPoints = 5; |
| 111 Magnitude.run(setupFunction1, test, Magnitude.LINEAR); | 113 Magnitude.run(setupFunction1, test, Magnitude.LINEAR); |
| 112 | 114 |
| 113 Magnitude.initialExponent = 4; | 115 Magnitude.initialExponent = 4; |
| 114 Magnitude.numPoints = 5; | 116 Magnitude.numPoints = 5; |
| 115 Magnitude.run(setupFunction2, test, Magnitude.LINEAR); | 117 Magnitude.run(setupFunction2, test, Magnitude.LINEAR); |
| 116 | 118 } |
| 119 main(); | |
| 117 </script> | 120 </script> |
| 118 </body> | 121 </body> |
| OLD | NEW |