feat(vrt): add Canvas2D visual regression tests#804
Open
wouterlucas wants to merge 3 commits into
Open
Conversation
wouterlucas
commented
Jun 4, 2026
Contributor
- visual-regression: add --renderMode flag (webgl|canvas|all) to run VRT against Canvas2D renderer, storing snapshots in a separate chromium-ci-canvas/ subdirectory to keep them isolated from WebGL
- CI (tests.yml): pass --renderMode all so both renderers are always exercised on every PR and merge group check
- examples/index.ts: wrap per-test automation() calls in try/catch so an unsupported feature in one test (e.g. SDF text in canvas mode) cannot block doneTests() and hang the entire runner
- certified-snapshots/chromium-ci-canvas: 122 baseline canvas snapshots captured and committed
- visual-regression: add --renderMode flag (webgl|canvas|all) to run VRT against Canvas2D renderer, storing snapshots in a separate chromium-ci-canvas/ subdirectory to keep them isolated from WebGL - CI (tests.yml): pass --renderMode all so both renderers are always exercised on every PR and merge group check - examples/index.ts: wrap per-test automation() calls in try/catch so an unsupported feature in one test (e.g. SDF text in canvas mode) cannot block doneTests() and hang the entire runner - certified-snapshots/chromium-ci-canvas: 122 baseline canvas snapshots captured and committed
Contributor
Author
|
guess we got to check a couple of these @jfboeve 😅 |
Relying on pnpm arg threading through two script levels to pass --renderMode all was unreliable. Instead, make the renderMode default context-aware: 'all' in CI, 'webgl' locally. The workflow step needs no extra arguments.
Allow up to 10 pixels to differ before failing (default). Absorbs sub-pixel rounding differences between macOS and Linux headless Chromium without masking real layout regressions. - compareBuffers: accepts maxDiffPixels param (default 10) - compareSnapshot: threads maxDiffPixels from SnapshotOptions - SnapshotOptions (both snapshot.ts and ExampleSettings.ts): adds optional maxDiffPixels field so individual tests can tighten or loosen the tolerance as needed - failure reason now reports both actual count and allowed max
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.