Skip to content

Consider removing debugEmulateFlutterTesterEnvironment flag #145779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eyebrowsoffire opened this issue Mar 26, 2024 · 2 comments · May be fixed by #168767
Open

Consider removing debugEmulateFlutterTesterEnvironment flag #145779

eyebrowsoffire opened this issue Mar 26, 2024 · 2 comments · May be fixed by #168767
Assignees
Labels
c: tech-debt Technical debt, code quality, testing, etc. engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@eyebrowsoffire
Copy link
Contributor

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.

@yjbanov
Copy link
Contributor

yjbanov commented Mar 26, 2024

SGTM. The idea with debugEmulateFlutterTesterEnvironment was to make the web test environment look the same as the native flutter test environment to package:flutter, package:flutter_test, and widget and test code. If we have better ways to achieve this, it should be a matter of updating the test bootstrap code to use the alternative APIs.

@yjbanov yjbanov added engine flutter/engine repository. See also e: labels. platform-web Web applications specifically P2 Important issues not at the top of the work list team-web Owned by Web platform team triaged-web Triaged by Web platform team labels Mar 26, 2024
@mdebbar
Copy link
Contributor

mdebbar commented May 15, 2025

As part of my work on #168686, I followed a yak shave that lead me here.

Here's a WIP PR to address this issue: #168767

@mdebbar mdebbar added P1 High-priority issues at the top of the work list and removed P2 Important issues not at the top of the work list labels May 15, 2025
@mdebbar mdebbar self-assigned this May 15, 2025
@mdebbar mdebbar added the c: tech-debt Technical debt, code quality, testing, etc. label May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: tech-debt Technical debt, code quality, testing, etc. engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy