Skip to content

Test golden files without shadows #17262

@tvolkert

Description

@tvolkert

Now that we have golden file testing, it will significantly reduce the churn on our golden files if we test out golden files against scenes that contain no shadows.

Proposal

  1. We add the ability to turn shadows off in the framework. Ideas as to how to do this:

    1. We introduce a debugZeroElevation global in the rendering layer that will cause all elevations to be zero, thus implicitly turning off shadows even though the code to draw the shadows is still active.

    2. We introduce a debugNoShadows global in the rendering layer that will be consulted in places like PhysicalModelLayer.addtoScene() and RenderPhysicalModel.paint()

    3. Something else...?

  2. We make the flutter test harness turn shadows off by default in all widget tests. Tests that specifically want shadows can update the flag in their test configuration (either via setUp() or flutter_test_config.dart).

  3. We provide a small suite of golden file tests that explicitly enable shadows and test them, so that we can catch regressions in Skia or our own shadow rendering.

Metadata

Metadata

Assignees

Labels

a: tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions