From 099ae9b4179467b5cc9a6a4be19f75763a6c3d28 Mon Sep 17 00:00:00 2001 From: Alexander Brusher Date: Thu, 22 Oct 2020 15:32:03 -0700 Subject: [PATCH] Re-enables tests previously failing due to new semantics flag. (#66916) --- packages/flutter/lib/src/rendering/custom_paint.dart | 3 +++ packages/flutter/test/widgets/custom_painter_test.dart | 2 +- packages/flutter/test/widgets/semantics_test.dart | 2 +- packages/flutter_test/lib/src/matchers.dart | 3 ++- packages/flutter_test/test/matchers_test.dart | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/rendering/custom_paint.dart b/packages/flutter/lib/src/rendering/custom_paint.dart index bb8cac9c56..2017d69a07 100644 --- a/packages/flutter/lib/src/rendering/custom_paint.dart +++ b/packages/flutter/lib/src/rendering/custom_paint.dart @@ -838,6 +838,9 @@ class RenderCustomPaint extends RenderProxyBox { if (properties.textField != null) { config.isTextField = properties.textField!; } + if (properties.slider != null) { + config.isSlider = properties.slider!; + } if (properties.readOnly != null) { config.isReadOnly = properties.readOnly!; } diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index fba22c87a9..f8cbf3b5e7 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -501,7 +501,7 @@ void _defineTests() { ); expect(semantics, hasSemantics(expectedSemantics, ignoreRect: true, ignoreTransform: true)); semantics.dispose(); - }, skip: true); // TODO(abrusher): Enable once engine PR #20385 lands. + }); group('diffing', () { testWidgets('complains about duplicate keys', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/semantics_test.dart b/packages/flutter/test/widgets/semantics_test.dart index c05adac827..d899ec980e 100644 --- a/packages/flutter/test/widgets/semantics_test.dart +++ b/packages/flutter/test/widgets/semantics_test.dart @@ -541,7 +541,7 @@ void main() { expect(semantics, hasSemantics(expectedSemantics, ignoreId: true)); semantics.dispose(); - }, skip: true); // TODO(abrusher): Enable once engine PR #20385 lands. + }); testWidgets('Actions can be replaced without triggering semantics update', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index 0a4f912f5b..4adde27704 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart @@ -449,6 +449,7 @@ Matcher matchesSemantics({ bool isChecked = false, bool isSelected = false, bool isButton = false, + bool isSlider = false, bool isLink = false, bool isFocused = false, bool isFocusable = false, @@ -468,7 +469,6 @@ Matcher matchesSemantics({ bool hasToggledState = false, bool isToggled = false, bool hasImplicitScrolling = false, - bool isSlider = false, // Actions // bool hasTapAction = false, bool hasLongPressAction = false, @@ -501,6 +501,7 @@ Matcher matchesSemantics({ if (isChecked) SemanticsFlag.isChecked, if (isSelected) SemanticsFlag.isSelected, if (isButton) SemanticsFlag.isButton, + if (isSlider) SemanticsFlag.isSlider, if (isLink) SemanticsFlag.isLink, if (isTextField) SemanticsFlag.isTextField, if (isReadOnly) SemanticsFlag.isReadOnly, diff --git a/packages/flutter_test/test/matchers_test.dart b/packages/flutter_test/test/matchers_test.dart index 121d4ca240..e18f589acc 100644 --- a/packages/flutter_test/test/matchers_test.dart +++ b/packages/flutter_test/test/matchers_test.dart @@ -573,6 +573,7 @@ void main() { isChecked: true, isSelected: true, isButton: true, + isSlider: true, isLink: true, isTextField: true, isReadOnly: true, @@ -616,7 +617,7 @@ void main() { hasDismissAction: true, customActions: [action], )); - }, skip: true); // TODO(abrusher): Enable once engine PR #20385 lands. + }); testWidgets('Can match child semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics();