[CI] Adding full lifecycle/raster during autoscroll/animation tests
Previous to this CL, these autoscroll/animation tests passed only because there
is a default surface deadline (typically 4 frames) in place. Surface activation
does not happen automatically, because in layout test mode, rasterization is not
performed until the very end of the test, for image capture. For the tests in
question, that deadline was previously always being hit, causing the surface to
be activated, triggering the monitored scroll events and passing the test.
When the --enable-display-compositor-pixel-dump flag is enabled, however, the
default surface activation deadline is changed to be infinite (no deadline). As
a result, all such autoscroll/animation tests fail.
With this CL, those tests that looked at animation behavior have been modified
to call a new continuouslyRunAnimations() javascript method, which sets a flag
that causes full rasterization to be included in the lifecycle update that was
already taking place. This triggers surface activation, and runs the
animations, allowing these tests to pass even with an infinite deadline.
Bug: 883547, 874162
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I0d9e1ae7d10fab186207cdfbc8e2f85f60d99f35
Reviewed-on: https://chromium-review.googlesource.com/c/1229354
Commit-Queue: Mason Freed <[email protected]>
Reviewed-by: Kent Tamura <[email protected]>
Reviewed-by: Philip Rogers <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Timothy Dresser <[email protected]>
Cr-Commit-Position: refs/heads/master@{#595898}
diff --git a/docs/testing/writing_layout_tests.md b/docs/testing/writing_layout_tests.md
index f71eb3a..9fa8b07 100644
--- a/docs/testing/writing_layout_tests.md
+++ b/docs/testing/writing_layout_tests.md
@@ -491,6 +491,18 @@
[third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js](../../third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js)
to help with writing paint invalidation and repaint tests.
+### Tests for scrolling animations
+
+Some layout tests need to ensure animations such as middle-click auto-scroll,
+fling, etc. get performed properly. When testing in display compositor pixel
+dump mode (now the standard), the standard behavior for tests is to
+synchronously composite without rastering (to save time). However, animations
+run upon surface activation, which only happens once rasterization is performed.
+Therefore, for these tests, an additional setting needs to be set. Near the
+beginning of these tests, call `continuouslyRunAnimations()` defined in
+[third_party/WebKit/LayoutTests/resources/compositor-controls.js](../../third_party/WebKit/LayoutTests/resources/compositor-controls.js)
+which will enable full rasterization during the test.
+
## Layout tree tests
A layout tree test renders a web page and produces up to two results, which