* refactoring before implementing the firefox installer. This PR carries utilities to a common place. Renames the lock file with a generic name.
* Fixed README file for browser_lock
* addressing PR comments: removing unimplemented firefox methods.
* Import all golden files and tests from internal repo.
* Adapt test files to new screenshot API, and tweak some settings.
(Check PR to see individual changes to each file)
Fixes https://github.com/flutter/flutter/issues/40975
New features for golden tests (for web):
* Height/width of headless browser instance extracted to constants
* Remove border from the host iframe
* Added 'region' to matchGoldenFile, so screenshots can capture only
a subset of the viewport
* Added image-format-awareness (png) to screenshot comparison, so it
doesn't only look at raw bytes
* When a test fails, output a diff image alongside the unexpected
output.
1. Various functionalities offered by this tool are now organized into commands (e.g. `felt test`, `felt check-licenses`).
2. The felt tool can now be invoked from anywhere, not necessarily from the web_ui directory.
3. This new structure helps us scale better as we add more commands (e.g. soon a `build/watch` command is coming).
- Add a custom `PlatformPlugin` that spins up a server waiting for test to request a screenshot.
- When a screenshot is requested the plugin talks to Chrome via the debug port, captures a screenshot, and compares it with a golden file
- This PR also adds proper CLI for `dev/test.dart` with an `ArgParser` for future extension into a proper developer tool for the team.
- As a first couple of features, it adds `--debug` option to launch Chrome in debug mode, a `--target` option to choose a single test to run rather than all tests, and `--shard` option to choose a subset of tests to run.
Limitations:
- While screenshot test will run on Cirrus, they are configured to not fail on Cirrus. Need to solve Chrome version skew.
- Stack maps do not work yet (you get stacks, but they are nonsensical)
- When requesting a single test, build_runner builds all tests anyway
- Nothing but desktop Chrome is supported
- Nothing but Linux is supported
- There's no Chrome version pinning; currently assumed stable Chrome channel