From 4b4783d1f034816f17822049f557045320a8e9aa Mon Sep 17 00:00:00 2001 From: Xilai Zhang Date: Fri, 23 Dec 2022 14:46:45 -0800 Subject: [PATCH] [flutter roll] Revert both #117338 and #117547 (#117557) * Revert "Exposed tooltip longPress action when available (#117338)" This reverts commit 38e3930f39d8efca0a27f9663129d27a9093cca8. * Revert "fixes android_semantics_integration_test to expect long press for tootip" --- .../android_semantics_testing/test_driver/main_test.dart | 1 - packages/flutter/lib/src/material/tooltip.dart | 2 +- packages/flutter/test/material/back_button_test.dart | 2 -- .../flutter/test/material/calendar_date_picker_test.dart | 2 -- packages/flutter/test/material/chip_test.dart | 5 +---- packages/flutter/test/material/date_picker_test.dart | 2 -- .../flutter/test/material/floating_action_button_test.dart | 1 - packages/flutter/test/material/search_test.dart | 5 +---- packages/flutter/test/material/tooltip_test.dart | 6 ------ packages/flutter/test/material/tooltip_theme_test.dart | 6 ------ 10 files changed, 3 insertions(+), 29 deletions(-) diff --git a/dev/integration_tests/android_semantics_testing/test_driver/main_test.dart b/dev/integration_tests/android_semantics_testing/test_driver/main_test.dart index 6a8f98d279..df0f14f263 100644 --- a/dev/integration_tests/android_semantics_testing/test_driver/main_test.dart +++ b/dev/integration_tests/android_semantics_testing/test_driver/main_test.dart @@ -439,7 +439,6 @@ void main() { ignoredActions: ignoredAccessibilityFocusActions, actions: [ AndroidSemanticsAction.click, - AndroidSemanticsAction.longClick, ], ), ); diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 6879f216e3..b0be65d286 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -751,7 +751,7 @@ class TooltipState extends State with SingleTickerProviderStateMixin { behavior: HitTestBehavior.opaque, onLongPress: (_triggerMode == TooltipTriggerMode.longPress) ? _handlePress : null, onTap: (_triggerMode == TooltipTriggerMode.tap) ? _handleTap : null, - excludeFromSemantics: _excludeFromSemantics, + excludeFromSemantics: true, child: result, ); // Only check for hovering if there is a mouse connected. diff --git a/packages/flutter/test/material/back_button_test.dart b/packages/flutter/test/material/back_button_test.dart index df7801fb1e..09d9fd1d66 100644 --- a/packages/flutter/test/material/back_button_test.dart +++ b/packages/flutter/test/material/back_button_test.dart @@ -172,7 +172,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasLongPressAction: true, isFocusable: true, )); handle.dispose(); @@ -217,7 +216,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasLongPressAction: true, isFocusable: true, )); handle.dispose(); diff --git a/packages/flutter/test/material/calendar_date_picker_test.dart b/packages/flutter/test/material/calendar_date_picker_test.dart index fe6d1eb99b..ac7788206e 100644 --- a/packages/flutter/test/material/calendar_date_picker_test.dart +++ b/packages/flutter/test/material/calendar_date_picker_test.dart @@ -672,7 +672,6 @@ void main() { tooltip: 'Previous month', isButton: true, hasTapAction: true, - hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -681,7 +680,6 @@ void main() { tooltip: 'Next month', isButton: true, hasTapAction: true, - hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index db782afd8f..1cec48192c 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -2047,10 +2047,7 @@ void main() { children: [ TestSemantics( tooltip: 'Delete', - actions: [ - SemanticsAction.tap, - SemanticsAction.longPress - ], + actions: [SemanticsAction.tap], textDirection: TextDirection.ltr, flags: [ SemanticsFlag.isButton, diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index e344dc6431..1f49edb3a0 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -833,7 +833,6 @@ void main() { tooltip: 'Switch to input', isButton: true, hasTapAction: true, - hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -877,7 +876,6 @@ void main() { tooltip: 'Switch to calendar', isButton: true, hasTapAction: true, - hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index 15b4f27c63..3a1827045a 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -700,7 +700,6 @@ void main() { tooltip: 'Add Photo', actions: [ SemanticsAction.tap, - SemanticsAction.longPress, ], flags: [ SemanticsFlag.hasEnabledState, diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index a3d1c60eec..19f03af5d5 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -620,10 +620,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [ - SemanticsAction.tap, - SemanticsAction.longPress, - ], + actions: [SemanticsAction.tap], tooltip: 'Back', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart index f0dfdb5e30..88ee8bc56d 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -1420,9 +1420,6 @@ void main() { id: 1, tooltip: 'TIP', textDirection: TextDirection.ltr, - actions: [ - SemanticsAction.longPress, - ], ), ], ); @@ -1623,9 +1620,6 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, - actions: [ - SemanticsAction.longPress, - ], ), ], ), diff --git a/packages/flutter/test/material/tooltip_theme_test.dart b/packages/flutter/test/material/tooltip_theme_test.dart index d26a8d31a2..4595bda8d5 100644 --- a/packages/flutter/test/material/tooltip_theme_test.dart +++ b/packages/flutter/test/material/tooltip_theme_test.dart @@ -1075,9 +1075,6 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, - actions: [ - SemanticsAction.longPress, - ], ), ], ), @@ -1121,9 +1118,6 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, - actions: [ - SemanticsAction.longPress, - ], ), ], ),