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.',
)
// reduced-test-set:
// This file is run as part of a reduced test set in CI on Mac and Windows
// machines.
Expand All @@ -18,8 +15,6 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

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

void main() {
setUp(() {
debugResetSemanticsIdCounter();
Expand Down Expand Up @@ -206,25 +201,23 @@ void main() {
});

testWidgets('has semantics for tristate', (WidgetTester tester) async {
final semantics = SemanticsTester(tester);
await tester.pumpWidget(
CupertinoApp(
home: CupertinoCheckbox(tristate: true, value: null, onChanged: (bool? newValue) {}),
),
);

expect(
semantics.nodesWith(
flags: <SemanticsFlag>[
SemanticsFlag.hasCheckedState,
SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled,
SemanticsFlag.isFocusable,
SemanticsFlag.isCheckStateMixed,
],
actions: <SemanticsAction>[SemanticsAction.focus, SemanticsAction.tap],
tester.getSemantics(find.byType(CupertinoCheckbox)),
matchesSemantics(
hasCheckedState: true,
hasEnabledState: true,
isEnabled: true,
isFocusable: true,
isCheckStateMixed: true,
hasFocusAction: true,
hasTapAction: true,
),
hasLength(1),
);

await tester.pumpWidget(
Expand All @@ -234,17 +227,16 @@ void main() {
);

expect(
semantics.nodesWith(
flags: <SemanticsFlag>[
SemanticsFlag.hasCheckedState,
SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled,
SemanticsFlag.isChecked,
SemanticsFlag.isFocusable,
],
actions: <SemanticsAction>[SemanticsAction.tap, SemanticsAction.focus],
tester.getSemantics(find.byType(CupertinoCheckbox)),
matchesSemantics(
hasCheckedState: true,
hasEnabledState: true,
isEnabled: true,
isChecked: true,
isFocusable: true,
hasTapAction: true,
hasFocusAction: true,
),
hasLength(1),
);

await tester.pumpWidget(
Expand All @@ -254,19 +246,16 @@ void main() {
);

expect(
semantics.nodesWith(
flags: <SemanticsFlag>[
SemanticsFlag.hasCheckedState,
SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled,
SemanticsFlag.isFocusable,
],
actions: <SemanticsAction>[SemanticsAction.tap, SemanticsAction.focus],
tester.getSemantics(find.byType(CupertinoCheckbox)),
matchesSemantics(
hasCheckedState: true,
hasEnabledState: true,
isEnabled: true,
isFocusable: true,
hasTapAction: true,
hasFocusAction: true,
),
hasLength(1),
);

semantics.dispose();
});

testWidgets('has semantic events', (WidgetTester tester) async {
Expand All @@ -278,7 +267,6 @@ void main() {
semanticEvent = message;
},
);
final semanticsTester = SemanticsTester(tester);

await tester.pumpWidget(
CupertinoApp(
Expand Down Expand Up @@ -312,7 +300,6 @@ void main() {
SystemChannels.accessibility,
null,
);
semanticsTester.dispose();
});

testWidgets('Checkbox can configure a semantic label', (WidgetTester tester) async {
Expand Down
Loading