8000 Consider removing `debugEmulateFlutterTesterEnvironment` flag · Issue #145779 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Consider removing debugEmulateFlutterTesterEnvironment flag #145779
Closed
@eyebrowsoffire

Description

@eyebrowsoffire

We have a number of backdoor flags in the web engine that the framework uses to set up its test environment. Out of all of them, I dislike debugEmulateFlutterTesterEnvironment the most.

  • This flag does too many completely orthogonal things.
  • Many of the things it does could be achieved through normal publicly visible APIs.
  • Using special modes that don't actually apply to users' apps lowers the fidelity of our tests.
  • The flag is not well documented in how it changes the engine's behavior.
  • The flag creates leaky abstractions between the engine and the framework. If the APIs we expose through normal channels are not sufficient for the framework's unit tests, we should consider augmenting those APIs so that any consumer of the engine could set up their own test environment without the use of a special handshake flag like this.

From what I can tell, this flag does a couple different things:

  • Changes the size of the implicit view. This could be done in the framework's test harness.
  • Sets a special mode that uses only some specific test fonts, instead of what the user passes in. I think it would be better if the test harness in the framework explicitly loads the test fonts and explicitly uses them in each of the tests.
  • Suppresses platform messages in the PlatformDispatcher. I'm not entirely sure why this is necessary, but I have to imagine it can be possible to suppress these at the framework level. If not, and we truly need a flag for suppressing these, I would rather have an explicit flag as part of the ui_web API or something similar, rather than it just being a undocumented side effect of this flag.
  • Turns semantics off. I'm pretty sure this can be also be done with our normal APIs.
  • Sets a special test UrlStrategy. This could also be done from the framework side with normal APIs.

I think we should consider removing this flag and being more explicit about how we set up any given test.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.engineflutter/engine repository. See also e: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0