Skip to content

flutter_test should support testing the new Display API #127225

@pdblasi-google

Description

@pdblasi-google

With the new PlatformDispatcher.displays and FlutterView.display properties, flutter_test should have the same capability to mock and modify them as other properties on PlatformDispatcher and FlutterView.

  • A new TestDisplay class will be created that allows for setting values that are read only in the Display implementation similar to TestFlutterView
    • Setters will have the same name as the get only property, not follow the old TestWindow patterns with separate names
  • When no display is available (running in headless mode), a default TestDisplay will be created with properties that match up with default values for the view that would be embedded in it.
  • When one or more displays are available on the PlatformDispatcher, they will be wrapped in TestDisplays similarly to TestFlutterViews
  • TestFlutterView.display will reference the same TestDisplay as TestPlatformDispatcher.displays[view.displayId] so that any mocked values will be in sync regardless of how they are accessed.

Metadata

Metadata

Assignees

No one assigned

    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