Index: LayoutTests/perf/compositor-touch-hit-rects.html |
diff --git a/LayoutTests/perf/compositor-touch-hit-rects.html b/LayoutTests/perf/compositor-touch-hit-rects.html |
index aac1f297f6eb47d5de2971ebc3a7783d0d660a29..95a9c63092cfa5c75f9f25b266c8034e5917e6fd 100644 |
--- a/LayoutTests/perf/compositor-touch-hit-rects.html |
+++ b/LayoutTests/perf/compositor-touch-hit-rects.html |
@@ -83,36 +83,39 @@ Magnitude.description('Tests that compositor touch hit rect calculation is ' + |
// Wait for first layout. |
document.body.getBoundingClientRect(); |
-// Verify that compositor touch hit testing is properly enabled. |
-if (window.internals) { |
- var testNode = document.getElementById('test'); |
- r = testNode.getBoundingClientRect(); |
- |
- testNode.addEventListener('touchstart', touchHandler); |
- var rects = window.internals.touchEventTargetLayerRects(document); |
- if (!rects) { |
- log("FAIL - no hit test rects exist, is compositing enabled?"); |
- return; |
- } |
- if (!rects.length) { |
- log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTestingEnabled false?"); |
+function main() |
+{ |
+ // Verify that compositor touch hit testing is properly enabled. |
+ 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.
|
+ var testNode = document.getElementById('test'); |
+ r = testNode.getBoundingClientRect(); |
+ |
+ testNode.addEventListener('touchstart', touchHandler); |
+ var rects = window.internals.touchEventTargetLayerRects(document); |
+ if (!rects) { |
+ log("FAIL - no hit test rects exist, is compositing enabled?"); |
+ return; |
+ } |
+ if (!rects.length) { |
+ log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTestingEnabled false?"); |
+ } |
+ testNode.removeEventListener('touchstart', touchHandler); |
+ } else { |
+ log("WARNING - missing windows.internals, can't verify hit testing is enabled."); |
} |
- testNode.removeEventListener('touchstart', touchHandler); |
-} else { |
- log("WARNING - missing windows.internals, can't verify hit testing is enabled."); |
-} |
- |
-Magnitude.trim = 1; |
-Magnitude.tolerance = 0.80; |
-Magnitude.initialExponent = 7; |
-Magnitude.numPoints = 5; |
-Magnitude.run(setupFunction1, test, Magnitude.LINEAR); |
+ Magnitude.trim = 1; |
+ Magnitude.tolerance = 0.80; |
-Magnitude.initialExponent = 4; |
-Magnitude.numPoints = 5; |
-Magnitude.run(setupFunction2, test, Magnitude.LINEAR); |
+ Magnitude.initialExponent = 7; |
+ Magnitude.numPoints = 5; |
+ Magnitude.run(setupFunction1, test, Magnitude.LINEAR); |
+ Magnitude.initialExponent = 4; |
+ Magnitude.numPoints = 5; |
+ Magnitude.run(setupFunction2, test, Magnitude.LINEAR); |
+} |
+main(); |
</script> |
</body> |