22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- @Skip (
6- 'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.' ,
7- )
85// reduced-test-set:
96// This file is run as part of a reduced test set in CI on Mac and Windows
107// machines.
@@ -18,8 +15,6 @@ import 'package:flutter/rendering.dart';
1815import 'package:flutter/services.dart' ;
1916import 'package:flutter_test/flutter_test.dart' ;
2017
21- import '../widgets/semantics_tester.dart' ;
22-
2318void main () {
2419 testWidgets ('Radio control test' , (WidgetTester tester) async {
2520 final Key key = UniqueKey ();
@@ -146,7 +141,7 @@ void main() {
146141 });
147142
148143 testWidgets ('Radio selected semantics - platform adaptive' , (WidgetTester tester) async {
149- final semantics = SemanticsTester ( tester);
144+ final SemanticsHandle handle = tester. ensureSemantics ( );
150145
151146 await tester.pumpWidget (
152147 CupertinoApp (
@@ -158,29 +153,26 @@ void main() {
158153 defaultTargetPlatform == TargetPlatform .iOS ||
159154 defaultTargetPlatform == TargetPlatform .macOS;
160155 expect (
161- semantics,
162- includesNodeWith (
163- flags: < SemanticsFlag > [
164- SemanticsFlag .isInMutuallyExclusiveGroup,
165- SemanticsFlag .hasCheckedState,
166- SemanticsFlag .hasEnabledState,
167- SemanticsFlag .isEnabled,
168- SemanticsFlag .isFocusable,
169- SemanticsFlag .isChecked,
170- if (isApple) SemanticsFlag .hasSelectedState,
171- if (isApple) SemanticsFlag .isSelected,
172- ],
173- actions: < SemanticsAction > [
174- SemanticsAction .tap,
175- if (defaultTargetPlatform != TargetPlatform .iOS) SemanticsAction .focus,
176- ],
177- ),
178- );
179- semantics.dispose ();
156+ tester.getSemantics (find.byType (CupertinoRadio <int >)),
157+ isSemantics (
158+ isInMutuallyExclusiveGroup: true ,
159+ hasCheckedState: true ,
160+ hasEnabledState: true ,
161+ isEnabled: true ,
162+ isFocusable: true ,
163+ isChecked: true ,
164+ hasSelectedState: isApple ? true : null ,
165+ isSelected: isApple ? true : null ,
166+ hasTapAction: true ,
167+ hasFocusAction: defaultTargetPlatform != TargetPlatform .iOS ? true : null ,
168+ ),
169+ );
170+
171+ handle.dispose ();
180172 }, variant: TargetPlatformVariant .all ());
181173
182174 testWidgets ('Radio semantics' , (WidgetTester tester) async {
183- final semantics = SemanticsTester ( tester);
175+ final SemanticsHandle handle = tester. ensureSemantics ( );
184176
185177 await tester.pumpWidget (
186178 CupertinoApp (
@@ -262,11 +254,12 @@ void main() {
262254 ),
263255 );
264256
265- semantics .dispose ();
257+ handle .dispose ();
266258 });
267259
268260 testWidgets ('has semantic events' , (WidgetTester tester) async {
269- final semantics = SemanticsTester (tester);
261+ final SemanticsHandle handle = tester.ensureSemantics ();
262+
270263 final Key key = UniqueKey ();
271264 dynamic semanticEvent;
272265 int ? radioValue = 2 ;
@@ -303,7 +296,7 @@ void main() {
303296 });
304297 expect (object.debugSemantics! .getSemanticsData ().hasAction (SemanticsAction .tap), true );
305298
306- semantics .dispose ();
299+ handle .dispose ();
307300 tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler <dynamic >(
308301 SystemChannels .accessibility,
309302 null ,
0 commit comments