From 9664a109d94699fcc91a97a59e332cc7e5f27a45 Mon Sep 17 00:00:00 2001 From: Darren Austin Date: Mon, 2 Aug 2021 18:14:46 -0700 Subject: [PATCH] Revert "Updated the skipped tests for cupertino package. (#87289)" (#87537) This reverts commit faf774eb97fd11c6c483aeee84c1abd3187b022f. --- .../flutter/test/cupertino/dialog_test.dart | 2 +- .../test/cupertino/text_field_test.dart | 25 +++++++++---------- .../cupertino/text_form_field_row_test.dart | 2 +- .../test/cupertino/text_selection_test.dart | 18 ++++++------- .../text_selection_toolbar_test.dart | 6 ++--- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index ea7ab9d87b..ceee1b2621 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -917,7 +917,7 @@ void main() { // We must explicitly cause an "up" gesture to avoid a crash. // todo(mattcarroll) remove this call, https://github.com/flutter/flutter/issues/19540 await gesture.up(); - }); + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/52960 testWidgets('ScaleTransition animation for showCupertinoDialog()', (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index 7555428e6c..ed2c875ad8 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -289,10 +289,7 @@ void main() { expect(controller.text, ' blah2blah1'); expect(controller.selection, const TextSelection(baseOffset: 0, extentOffset: 0)); expect(find.byType(CupertinoButton), findsNothing); - }, - variant: const TargetPlatformVariant({ TargetPlatform.macOS }), - skip: kIsWeb, // [intended] the web handles this on its own. - ); + }, variant: const TargetPlatformVariant({ TargetPlatform.macOS }), skip: kIsWeb); testWidgets('Activates the text field when receives semantics focus on Mac', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -457,7 +454,8 @@ void main() { ); }, // TODO(mdebbar): Strut styles support. - skip: isBrowser, // https://github.com/flutter/flutter/issues/32243 + // https://github.com/flutter/flutter/issues/32243 + skip: isBrowser, ); testWidgets( @@ -487,7 +485,8 @@ void main() { ); }, // TODO(mdebbar): Strut styles support. - skip: isBrowser, // https://github.com/flutter/flutter/issues/32243 + // https://github.com/flutter/flutter/issues/32243 + skip: isBrowser, ); testWidgets( @@ -1490,7 +1489,7 @@ void main() { expect(text.style!.fontSize, 14); expect(text.style!.letterSpacing, -0.15); expect(text.style!.fontWeight, FontWeight.w400); - }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. + }, skip: isContextMenuProvidedByPlatform); testWidgets('text field toolbar options correctly changes options', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -1533,7 +1532,7 @@ void main() { expect(find.text('Copy'), findsOneWidget); expect(find.text('Cut'), findsNothing); expect(find.text('Select All'), findsNothing); - }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. + }, skip: isContextMenuProvidedByPlatform); testWidgets('Read only text field', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'readonly'); @@ -1570,7 +1569,7 @@ void main() { expect(find.text('Copy'), findsOneWidget); expect(find.text('Paste'), findsNothing); expect(find.text('Cut'), findsNothing); - }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. + }, skip: isContextMenuProvidedByPlatform); testWidgets('copy paste', (WidgetTester tester) async { await tester.pumpWidget( @@ -1621,7 +1620,7 @@ void main() { expect(find.text('field 1'), findsOneWidget); expect(find.text("j'aime la poutine"), findsOneWidget); expect(find.text('field 2'), findsNothing); - }, exclude: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); testWidgets( 'tap moves cursor to the edge of the word it tapped on', @@ -2205,7 +2204,7 @@ void main() { expect(find.text('Select All'), findsOneWidget); expect(find.text('Copy'), findsNothing); expect(find.text('Cut'), findsNothing); - }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. + }, skip: isContextMenuProvidedByPlatform); testWidgets( 'long press moves cursor to the exact long press position and shows toolbar', @@ -3230,7 +3229,7 @@ void main() { textFieldTopLeft = tester.getTopLeft(find.byType(CupertinoTextField)); expect(toolbarTopLeft.dy, lessThan(textFieldTopLeft.dy)); }, - skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. + skip: isContextMenuProvidedByPlatform, ); testWidgets('text field respects keyboardAppearance from theme', (WidgetTester tester) async { @@ -3827,7 +3826,7 @@ void main() { expect(find.byType(CupertinoTextSelectionToolbar), findsOneWidget); expect(tester.takeException(), null); }); - }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. + }, skip: isContextMenuProvidedByPlatform); group('textAlignVertical position', () { group('simple case', () { diff --git a/packages/flutter/test/cupertino/text_form_field_row_test.dart b/packages/flutter/test/cupertino/text_form_field_row_test.dart index 9445afd4e9..691e3e9a95 100644 --- a/packages/flutter/test/cupertino/text_form_field_row_test.dart +++ b/packages/flutter/test/cupertino/text_form_field_row_test.dart @@ -262,7 +262,7 @@ void main() { await tester.pump(const Duration(milliseconds: 200)); expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0)); - }, skip: isBrowser); // [intended] We do not use Flutter-rendered context menu on the Web. + }, skip: isBrowser); // We do not use Flutter-rendered context menu on the Web testWidgets('onTap is called upon tap', (WidgetTester tester) async { int tapCount = 0; diff --git a/packages/flutter/test/cupertino/text_selection_test.dart b/packages/flutter/test/cupertino/text_selection_test.dart index 4b862384e6..b5a95b98b9 100644 --- a/packages/flutter/test/cupertino/text_selection_test.dart +++ b/packages/flutter/test/cupertino/text_selection_test.dart @@ -251,7 +251,7 @@ void main() { expect(find.text('Copy'), findsOneWidget); expect(find.text('Cut'), findsOneWidget); }, - exclude: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -305,7 +305,7 @@ void main() { expect(find.text('◀'), findsNothing); expect(find.text('▶'), findsNothing); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -376,7 +376,7 @@ void main() { expect(find.text('▶'), findsOneWidget); expect(appearsEnabled(tester, '▶'), true); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -478,7 +478,7 @@ void main() { expect(find.text('▶'), findsOneWidget); expect(appearsEnabled(tester, '▶'), true); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -596,7 +596,7 @@ void main() { expect(find.text('▶'), findsOneWidget); expect(appearsEnabled(tester, '▶'), true); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); }); @@ -677,7 +677,7 @@ void main() { expect(handles.first.size.height, 60.5); expect(handles.last.size.height, 35.5); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -761,7 +761,7 @@ void main() { expect(handles.first.size.height, 110.5); expect(handles.last.size.height, 110.5); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -842,7 +842,7 @@ void main() { expect(handles.first.size.height, 60.5); expect(handles.last.size.height, 45.5); }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); @@ -928,7 +928,7 @@ void main() { expect(handles.first.size.height, 50.5); expect(handles.last.size.height, 50.5); // This is 60.5 with the previous frame. }, - skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. + skip: isBrowser, // We do not use Flutter-rendered context menu on the Web variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); } diff --git a/packages/flutter/test/cupertino/text_selection_toolbar_test.dart b/packages/flutter/test/cupertino/text_selection_toolbar_test.dart index 7156dd1117..1a8028c869 100644 --- a/packages/flutter/test/cupertino/text_selection_toolbar_test.dart +++ b/packages/flutter/test/cupertino/text_selection_toolbar_test.dart @@ -180,7 +180,7 @@ void main() { expect(find.byType(TestBox), findsNWidgets(7)); expect(_findOverflowNextButton(), findsOneWidget); expect(_findOverflowBackButton(), findsNothing); - }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. + }, skip: kIsWeb); testWidgets('positions itself at anchorAbove if it fits', (WidgetTester tester) async { late StateSetter setState; @@ -229,7 +229,7 @@ void main() { await tester.pump(); toolbarY = tester.getTopLeft(_findToolbar()).dy; expect(toolbarY, equals(anchorAboveY - height - _kToolbarContentDistance)); - }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. + }, skip: kIsWeb); testWidgets('can create and use a custom toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -262,5 +262,5 @@ void main() { expect(find.text('Copy'), findsNothing); expect(find.text('Paste'), findsNothing); expect(find.text('Select all'), findsNothing); - }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. + }, skip: kIsWeb); }