Fix layout tests that would fail if ScrollAnchoring was promoted to experimental
A lot of these tests were failing because the test expectations such as 'shouldBe' and
'shouldBeGreaterThan', etc were actively modifying the DOM. This resulted in scroll
anchoring making adjustments, and consequently causing the succeeding expectations
to fail. The simple fix here is to add "setPrintTestResultsLazily" to the tests so that the
logging from the expectations is queued up and outputted at the end of the tests. This
CL also migrates some js-tests to use testharness.js where its easy to do so.
Some of the fixes are non-trivial and the inline comments explain the reasoning behind
the fixes.
Can't promote ScrollAnchoring to experiment until the following bug is fixed:
crbug.com/624534, which causes inspector/console/console-viewport-selection.html
to fail.
BUG=
597479
Committed:
https://crrev.com/4577baf99363df344a6e1180cce4ac0436f5ce04
Cr-Commit-Position: refs/heads/master@{#407941}