Repository navigation
[web] Trim kWebTestFileKnownFailures - #194877
Conversation
|
This pull request contains changes to Material or Cupertino, which are currently frozen in this repository. Changes should be made in Please refer to #188444 for instructions. |
There was a problem hiding this comment.
Code Review
This pull request simplifies the web test suite runner by converting kWebTestFileKnownFailures from a map to a flat list and removing several previously skipped tests. In text_field_test.dart, tests are updated to skip on unsupported platforms, and drag-selection tests are refactored to use absolute coordinates via moveTo instead of relative offsets. Feedback on the changes identifies an inaccurate comment in text_field_test.dart that refers to 'Bonaventure' instead of 'Guy-Concordia' at index 30.
text_field_test.dart on web and trim kWebTestFileKnownFailureskWebTestFileKnownFailures
Most entries in `kWebTestFileKnownFailures` (framework test files
excluded from the web shards) have been passing on the web for a while:
`performance_overlay_test.dart`, `html_element_view_test.dart`,
`cupertino/scaffold_test.dart`, and `rendering/platform_view_test.dart`
pass on both JS and wasm and are removed from the list.
The two "not compilable" entries stay (`Int64List`, relative import
outside the package). `@TestOn('!chrome')` can't replace them because
`flutter test --platform=chrome` compiles all test files into a single
entrypoint before the test runner evaluates the annotation. The JS and
wasm lists are now identical, so the map is collapsed into one list.
`test/material/text_field_test.dart` still has 3 failing cases on the
web, but that file is under the Material code freeze
(flutter#188444), so it stays in the
list with a TODO. The web fix for that test lives in `material_ui`:
flutter/packages#13358
Follow-up to flutter/flutter#194877. `long press drag extends the selection to the word under the drag and shows toolbar on lift on non-Apple platforms` is skipped on the web, but the only thing that actually breaks there is the drag geometry: `textOffsetToPosition` nudges the position by 1px on web, so `moveBy(const Offset(-200, 0))` lands exactly on the glyph boundary between `Peel` and the following space, and `getWordAtOffset` resolves to the whitespace instead of the word. `_expectMaterialToolbarForPartialSelection()` already handles `isContextMenuProvidedByPlatform`, so the skip is not needed once the drag targets are fixed. This PR drags to the middle of each target word instead of relative offsets, drops the skip, and tags the test with `reduced-web-test-set` so it runs on the web shards. Verified with `flutter test`, `flutter test --platform chrome`, and `flutter test --platform chrome --wasm`. Test-only change, so no version bump or CHANGELOG entry is needed.
Most entries in `kWebTestFileKnownFailures` (framework test files
excluded from the web shards) have been passing on the web for a while:
`performance_overlay_test.dart`, `html_element_view_test.dart`,
`cupertino/scaffold_test.dart`, and `rendering/platform_view_test.dart`
pass on both JS and wasm and are removed from the list.
The two "not compilable" entries stay (`Int64List`, relative import
outside the package). `@TestOn('!chrome')` can't replace them because
`flutter test --platform=chrome` compiles all test files into a single
entrypoint before the test runner evaluates the annotation. The JS and
wasm lists are now identical, so the map is collapsed into one list.
`test/material/text_field_test.dart` still has 3 failing cases on the
web, but that file is under the Material code freeze
(flutter#188444), so it stays in the
list with a TODO. The web fix for that test lives in `material_ui`:
flutter/packages#13358
Most entries in
kWebTestFileKnownFailures(framework test files excluded from the web shards) have been passing on the web for a while:performance_overlay_test.dart,html_element_view_test.dart,cupertino/scaffold_test.dart, andrendering/platform_view_test.dartpass on both JS and wasm and are removed from the list.The two "not compilable" entries stay (
Int64List, relative import outside the package).@TestOn('!chrome')can't replace them becauseflutter test --platform=chromecompiles all test files into a single entrypoint before the test runner evaluates the annotation. The JS and wasm lists are now identical, so the map is collapsed into one list.test/material/text_field_test.dartstill has 3 failing cases on the web, but that file is under the Material code freeze (#188444), so it stays in the list with a TODO. The web fix for that test lives inmaterial_ui: flutter/packages#13358