Commit ef2f10e2 authored by eustas@chromium.org's avatar eustas@chromium.org

Fix compositor-touch-hit-rects.html

Test do not run, because "return" is not allowed at top level
(syntax error).

BUG=

Review URL: https://codereview.chromium.org/540613004

git-svn-id: svn://svn.chromium.org/blink/trunk@181550 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 426fbf99
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
</style> </style>
</head> </head>
<body> <body>
<pre id='log'>
</pre>
<div id='test'> <div id='test'>
</div> </div>
<script src="../resources/magnitude-perf.js"></script> <script src="../resources/magnitude-perf.js"></script>
...@@ -24,7 +22,7 @@ ...@@ -24,7 +22,7 @@
function log(msg) function log(msg)
{ {
document.getElementById('log').innerText += msg + '\n'; Magnitude._log(msg);
} }
var testNode; var testNode;
...@@ -83,8 +81,13 @@ Magnitude.description('Tests that compositor touch hit rect calculation is ' + ...@@ -83,8 +81,13 @@ Magnitude.description('Tests that compositor touch hit rect calculation is ' +
// Wait for first layout. // Wait for first layout.
document.body.getBoundingClientRect(); document.body.getBoundingClientRect();
// Verify that compositor touch hit testing is properly enabled. function main()
if (window.internals) { {
// Verify that compositor touch hit testing is properly enabled.
if (!window.internals) {
log("WARNING - missing windows.internals, can't verify hit testing is enabled.");
return;
}
var testNode = document.getElementById('test'); var testNode = document.getElementById('test');
r = testNode.getBoundingClientRect(); r = testNode.getBoundingClientRect();
...@@ -96,23 +99,23 @@ if (window.internals) { ...@@ -96,23 +99,23 @@ if (window.internals) {
} }
if (!rects.length) { if (!rects.length) {
log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTestingEnabled false?"); log("FAIL - no hit test rects found, is ScrollingCoordinator::touchHitTestingEnabled false?");
return;
} }
testNode.removeEventListener('touchstart', touchHandler); testNode.removeEventListener('touchstart', touchHandler);
} else {
log("WARNING - missing windows.internals, can't verify hit testing is enabled.");
}
Magnitude.trim = 1; Magnitude.trim = 1;
Magnitude.tolerance = 0.80; Magnitude.tolerance = 0.80;
Magnitude.initialExponent = 7; Magnitude.initialExponent = 7;
Magnitude.numPoints = 5; Magnitude.numPoints = 5;
Magnitude.run(setupFunction1, test, Magnitude.LINEAR); Magnitude.run(setupFunction1, test, Magnitude.LINEAR);
Magnitude.initialExponent = 4; Magnitude.initialExponent = 4;
Magnitude.numPoints = 5; Magnitude.numPoints = 5;
Magnitude.run(setupFunction2, test, Magnitude.LINEAR); Magnitude.run(setupFunction2, test, Magnitude.LINEAR);
}
main();
</script> </script>
</body> </body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment