Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

@Skip(
'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.',
)
// This file is run as part of a reduced test set in CI on Mac and Windows
// machines.
@Tags(<String>['reduced-test-set'])
Expand All @@ -20,7 +17,6 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

import '../widgets/semantics_tester.dart';
import 'list_tile_tester.dart';

void main() {
Expand Down Expand Up @@ -1425,8 +1421,6 @@ void main() {
semanticEvent = message;
},
);
final semanticsTester = SemanticsTester(tester);

await tester.pumpWidget(

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.

high

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(

Directionality(
textDirection: TextDirection.ltr,
Expand Down Expand Up @@ -1457,7 +1451,6 @@ void main() {
});
expect(object.debugSemantics!.getSemanticsData().hasAction(SemanticsAction.tap), true);

semanticsTester.dispose();
tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(
SystemChannels.accessibility,
null,
Expand All @@ -1475,8 +1468,6 @@ void main() {
semanticEvent = message;
},
);
final semanticsTester = SemanticsTester(tester);

await tester.pumpWidget(

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.

high

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(

CupertinoApp(
home: StatefulBuilder(
Expand Down Expand Up @@ -1510,7 +1501,6 @@ void main() {
});
expect(object.debugSemantics!.getSemanticsData().hasAction(SemanticsAction.tap), true);

semanticsTester.dispose();
tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(
SystemChannels.accessibility,
null,
Expand Down
Loading