Sitelet https://github.com/flutter/flutter/pull/193172
Skip to content

[web] Enable snapshot_widget_test.dart on Web - #193172

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
harryterkelsen:unskip-web-snapshot-widget-test
Sep 23, 2026
Merged

auto-submit[bot] merged 4 commits into
flutter:masterfrom
harryterkelsen:unskip-web-snapshot-widget-test

Conversation

@harryterkelsen

Copy link
Copy Markdown
Contributor

Unskips all 10 tests in packages/flutter/test/widgets/snapshot_widget_test.dart on the web now that the HTML renderer has been removed (#106689 — closed) and SnapshotWidget is supported on CanvasKit/Skwasm.

  • Verified both golden tests (widgets.raster_widget.yellow.png and widgets.raster_widget.red.png) produce a 100.00% exact pixel match (0 / 480,000 differing pixels) on Chrome against the upstream Linux Skia Gold baseline.
  • Updates 'SnapshotWidget should have same result as enabled' to capture the RepaintBoundary via RenderRepaintBoundary.toImageSync() so that it works across both VM and Web test environments.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

Unskips all 10 tests in `packages/flutter/test/widgets/snapshot_widget_test.dart` on Web now that the HTML renderer has been removed (flutter#106689, closed) and `SnapshotWidget` works on CanvasKit/Skwasm.

- Verified both golden tests (`widgets.raster_widget.yellow.png` and `widgets.raster_widget.red.png`) produce a 100.00% exact pixel match (`0 / 480,000` differing pixels) against the upstream Linux Skia Gold baseline.
- Updates `'SnapshotWidget should have same result as enabled'` to capture the `RepaintBoundary` via `RenderRepaintBoundary.toImageSync()` so that it works across both VM and Web test environments.

TAG=agy
CONV=2b17fd22-3b50-437d-bf9a-4077924956f1
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables several tests on the web platform in 'snapshot_widget_test.dart' by removing the 'skip: kIsWeb' parameter. Additionally, it updates a test to synchronously capture a 'RenderRepaintBoundary' image using 'toImageSync', registers it for disposal with 'addTearDown', and compares the image directly instead of using a finder. There are no review comments, and I have no feedback to provide.

@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 22, 2026
Removing the trailing `skip: kIsWeb` argument lets `dart format` collapse
these `testWidgets(...)` calls back into the standard trailing-closure style.

TAG=agy
CONV=2ef6722f-0cc3-4e2c-bfe0-769079846fee
kIsWeb is no longer referenced now that the skips are gone, and the
analyzer flags the import as unnecessary (unnecessary_import).
The previous formatting commit was produced with a stale Dart SDK from an
older checkout. This re-formats with the SDK matching this branch's engine
hash, so the diff is now limited to the unskipped tests.

TAG=agy
CONV=2ef6722f-0cc3-4e2c-bfe0-769079846fee

@Renzo-Olivares Renzo-Olivares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants