Skip to content

Flutter Tester asset and font loading #103724

@jonahwilliams

Description

@jonahwilliams

Discovered while working on #103496 and then moved into #103667

We don't pass --flutter-assets-dir to the flutter tester, so it cannot resolve files in the asset bundle.

We'd like to make asset loading (images, shaders) work via the regular means, since we already go through all the effort to build the bundle and configure a work around in the framework: https://github.com/flutter/flutter/blob/master/packages/flutter_test/lib/src/_binding_io.dart#L34

However, with this change we'll also load bundled fonts correctly. This will cause all Scuba tests in google3 currently using ahem to opt into real fonts, as well as breaking contrast checker tests that rely on ahem. This is a no-go, obviously.

Current Plan of Action:

  • Allow asset loading through normal means, and deprecate and remove the binding work around.
  • Configure the tester to only support ahem font unless a user explicitly called a loadFont API in the framework.
  • Delete any binding registration code in google3

Long term, we could perhaps think of a smarter way to handle loading fonts. @goderbauer

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions