[cupertino_ui] Enable switch_test.dart#12076
Conversation
There was a problem hiding this comment.
Code Review
This pull request re-enables the switch_test.dart test file by removing the @Skip annotation and removes the SemanticsTester import and its usages. The review feedback points out that removing SemanticsTester without enabling semantics will cause object.debugSemantics to be null, leading to null-check crashes. It is recommended to use tester.ensureSemantics() and register its disposal via addTearDown to resolve this issue.
| ); | ||
| final semanticsTester = SemanticsTester(tester); | ||
|
|
||
| await tester.pumpWidget( |
There was a problem hiding this comment.
Removing SemanticsTester without enabling semantics will cause object.debugSemantics to be null, leading to a null-check crash when object.debugSemantics! is called. To fix this, use tester.ensureSemantics() and register its disposal via addTearDown.
final SemanticsHandle semantics = tester.ensureSemantics();
addTearDown(semantics.dispose);
await tester.pumpWidget(| ); | ||
| final semanticsTester = SemanticsTester(tester); | ||
|
|
||
| await tester.pumpWidget( |
There was a problem hiding this comment.
Removing SemanticsTester without enabling semantics will cause object.debugSemantics to be null, leading to a null-check crash when object.debugSemantics! is called. To fix this, use tester.ensureSemantics() and register its disposal via addTearDown.
final SemanticsHandle semantics = tester.ensureSemantics();
addTearDown(semantics.dispose);
await tester.pumpWidget(39cd313 to
8ca6b91
Compare
switch_test.dart
Renzo-Olivares
left a comment
There was a problem hiding this comment.
LGTM, w/ small comments about ensureSemantics.
8ca6b91 to
f4c8d80
Compare
…er#188916) flutter/packages@e742106...420e135 2026-07-02 dkwingsmt@users.noreply.github.com [material_ui] Migrate api sample code to @example dartdoc directive (flutter/packages#12078) 2026-07-02 dkwingsmt@users.noreply.github.com [material_ui] Move over more API samples (flutter/packages#12092) 2026-07-01 katelovett@google.com [cupertino_ui] Migrate api sample code to @example dartdoc directive (flutter/packages#12063) 2026-07-01 katelovett@google.com [cupertino_ui] Move over more API samples (flutter/packages#12086) 2026-07-01 48776784+mackings@users.noreply.github.com [two_dimensional_scrollables] Fix TreeView horizontal hit testing (flutter/packages#11859) 2026-07-01 1063596+reidbaker@users.noreply.github.com [camera_android_camerax][tool] Integrate dart_code_linter for cyclomatic complexity checks (flutter/packages#11999) 2026-07-01 dinurymomshad.dev@gmail.com [cross_file] Add runnable example with main() (flutter/packages#11527) 2026-07-01 36861262+QuncCccccc@users.noreply.github.com [cupertino_ui] Enable `switch_test.dart` (flutter/packages#12076) 2026-07-01 jmccandless@google.com [cupertino_ui] Re-enable dialog_test.dart (flutter/packages#12057) 2026-07-01 jmccandless@google.com [cupertino_ui] Re-enable action_sheet_test.dart (flutter/packages#12055) 2026-07-01 rmolivares@renzo-olivares.dev [cupertino_ui] Migrate `bottom_tab_bar_test.dart` to `SemanticsHandle` (flutter/packages#12012) 2026-07-01 1063596+reidbaker@users.noreply.github.com [repo] Add comment style guideline to AGENTS.md (flutter/packages#12077) 2026-07-01 43054281+camsim99@users.noreply.github.com Adds pre-push readiness skill (flutter/packages#11935) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Part of flutter/flutter#182636 and flutter/flutter#188395
This PR:
widgets/semantics_tester.dartfromswitch_test.dart.SemanticsTesterusages.@Skipannotation and moves the file to thetest/folder.Pre-Review Checklist
[shared_preferences]///).