diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index a7d080a386..4010148873 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -94,7 +94,7 @@ void main() { await tester.tap(find.text('Pirate package ')); await tester.pumpAndSettle(const Duration(milliseconds: 100)); expect(find.text('Pirate license'), findsOneWidget); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/54385 + }); testWidgets('About box logic defaults to executable name for app name', (WidgetTester tester) async { await tester.pumpWidget( @@ -155,7 +155,7 @@ void main() { await tester.tap(find.text('Another package')); await tester.pumpAndSettle(const Duration(milliseconds: 100)); expect(find.text('Another license'), findsOneWidget); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/54385 + }); testWidgets('LicensePage control test with all properties', (WidgetTester tester) async { const FlutterLogo logo = FlutterLogo(); @@ -231,7 +231,7 @@ void main() { await tester.tap(find.text('Another package')); await tester.pumpAndSettle(const Duration(milliseconds: 100)); expect(find.text('Another license'), findsOneWidget); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/54385 + }); testWidgets('_PackageLicensePage title style without AppBarTheme', (WidgetTester tester) async { LicenseRegistry.addLicense(() { @@ -278,7 +278,7 @@ void main() { expect(title.style, titleTextStyle); final Text subtitle = tester.widget(find.text('1 license.')); expect(subtitle.style, subtitleTextStyle); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/54385 + }); testWidgets('_PackageLicensePage title style with AppBarTheme', (WidgetTester tester) async { LicenseRegistry.addLicense(() { @@ -336,7 +336,7 @@ void main() { expect(title.style, titleTextStyle); final Text subtitle = tester.widget(find.text('1 license.')); expect(subtitle.style, subtitleTextStyle); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/54385 + }); testWidgets('LicensePage respects the notch', (WidgetTester tester) async { const double safeareaPadding = 27.0; @@ -366,7 +366,7 @@ void main() { tester.getTopLeft(find.text('Licenses')), const Offset(16.0 + safeareaPadding, 18.0 + safeareaPadding), ); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/54385 + }); testWidgets('LicensePage returns early if unmounted', (WidgetTester tester) async { final Completer licenseCompleter = Completer(); diff --git a/packages/flutter/test/material/app_bar_theme_test.dart b/packages/flutter/test/material/app_bar_theme_test.dart index dd8be5d402..5029f645fd 100644 --- a/packages/flutter/test/material/app_bar_theme_test.dart +++ b/packages/flutter/test/material/app_bar_theme_test.dart @@ -516,7 +516,7 @@ void main() { // to "4", which results in the web evaluating to the value "4" regardless of which // one is used. This results in a difference for doubles in debugFillProperties between // the web and the rest of Flutter's target platforms. - }, skip: kIsWeb); + }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87364 } AppBarTheme _appBarTheme() { diff --git a/packages/flutter/test/material/bottom_app_bar_test.dart b/packages/flutter/test/material/bottom_app_bar_test.dart index ec03397474..f6a8b5e09f 100644 --- a/packages/flutter/test/material/bottom_app_bar_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_test.dart @@ -79,8 +79,7 @@ void main() { find.byKey(key), matchesGoldenFile('bottom_app_bar.custom_shape.2.png'), ); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/51675, - // https://github.com/flutter/flutter/issues/44572 + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/44572 testWidgets('color defaults to Theme.bottomAppBarColor', (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/material/page_test.dart b/packages/flutter/test/material/page_test.dart index 2cded91e64..9aa15259ec 100644 --- a/packages/flutter/test/material/page_test.dart +++ b/packages/flutter/test/material/page_test.dart @@ -66,7 +66,10 @@ void main() { expect(find.text('Page 1'), isOnstage); expect(find.text('Page 2'), findsNothing); - }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.android), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('test page transition', (WidgetTester tester) async { final Key page2Key = UniqueKey(); @@ -147,7 +150,10 @@ void main() { // Page 1 is back where it started. expect(widget1InitialTopLeft == widget1TransientTopLeft, true); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('test fullscreen dialog transition', (WidgetTester tester) async { await tester.pumpWidget( @@ -207,7 +213,10 @@ void main() { // Page 1 is back where it started. expect(widget1InitialTopLeft == widget1TransientTopLeft, true); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('test no back gesture on Android', (WidgetTester tester) async { await tester.pumpWidget( @@ -237,7 +246,10 @@ void main() { // Page 2 didn't move expect(tester.getTopLeft(find.text('Page 2')), Offset.zero); - }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.android), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('test back gesture', (WidgetTester tester) async { await tester.pumpWidget( @@ -278,7 +290,10 @@ void main() { await tester.pump(); expect(tester.getTopLeft(find.text('Page 2')), const Offset(100.0, 0.0)); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('back gesture while OS changes', (WidgetTester tester) async { final Map routes = { @@ -369,7 +384,7 @@ void main() { final Offset helloPosition6 = tester.getCenter(find.text('HELLO')); expect(helloPosition5, helloPosition6); expect(Theme.of(tester.element(find.text('HELLO'))).platform, TargetPlatform.macOS); - }, skip: kIsWeb); + }, skip: kIsWeb); // [intended] doesn't apply to the web. testWidgets('test no back gesture on fullscreen dialogs', (WidgetTester tester) async { await tester.pumpWidget( @@ -480,7 +495,10 @@ void main() { // Page 1 is back where it started. expect(widget1InitialTopLeft == widget1TransientTopLeft, true); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('test edge swipe then drop back at starting point works', (WidgetTester tester) async { await tester.pumpWidget( @@ -548,7 +566,10 @@ void main() { expect(find.text('Page 1'), isOnstage); expect(find.text('Page 2'), findsNothing); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('Back swipe dismiss interrupted by route push', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28728 @@ -643,7 +664,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('route'), findsOneWidget); expect(find.text('push'), findsNothing); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('During back swipe the route ignores input', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/39989 @@ -713,7 +737,10 @@ void main() { await tester.pumpAndSettle(); expect(tester.getTopLeft(find.byKey(pageScaffoldKey)), const Offset(400, 0)); expect(tester.getTopLeft(find.byKey(homeScaffoldKey)).dx, lessThan(0)); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('After a pop caused by a back-swipe, input reaches the exposed route', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/41024 @@ -784,7 +811,10 @@ void main() { await tester.tap(find.byKey(homeScaffoldKey)); expect(homeTapCount, 2); expect(pageTapCount, 1); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('A MaterialPageRoute should slide out with CupertinoPageTransition when a compatible PageRoute is pushed on top of it', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/44864. @@ -812,7 +842,10 @@ void main() { // Title of the first route slides to the left. expect(titleInitialTopLeft.dy, equals(titleTransientTopLeft.dy)); expect(titleInitialTopLeft.dx, greaterThan(titleTransientTopLeft.dx)); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('MaterialPage works', (WidgetTester tester) async { final LocalKey pageKey = UniqueKey(); diff --git a/packages/flutter/test/material/page_transitions_theme_test.dart b/packages/flutter/test/material/page_transitions_theme_test.dart index 6856194f12..aa56211ca9 100644 --- a/packages/flutter/test/material/page_transitions_theme_test.dart +++ b/packages/flutter/test/material/page_transitions_theme_test.dart @@ -61,7 +61,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('page b'), findsOneWidget); expect(find.byType(CupertinoPageTransition), findsOneWidget); - }, variant: TargetPlatformVariant.only(TargetPlatform.iOS), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.iOS), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('Default PageTransitionsTheme builds a _FadeUpwardsPageTransition for android', (WidgetTester tester) async { final Map routes = { @@ -94,7 +97,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('page b'), findsOneWidget); expect(findFadeUpwardsPageTransition(), findsOneWidget); - }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.android), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('PageTransitionsTheme override builds a _OpenUpwardsPageTransition', (WidgetTester tester) async { final Map routes = { @@ -134,7 +140,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('page b'), findsOneWidget); expect(findOpenUpwardsPageTransition(), findsOneWidget); - }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.android), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('PageTransitionsTheme override builds a _ZoomPageTransition', (WidgetTester tester) async { final Map routes = { @@ -174,7 +183,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('page b'), findsOneWidget); expect(findZoomPageTransition(), findsOneWidget); - }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.android), + skip: kIsWeb, // [intended] no default transitions on the web. + ); testWidgets('_ZoomPageTransition only cause child widget built once', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/58345 @@ -220,5 +232,8 @@ void main() { await tester.tap(find.text('pop')); await tester.pumpAndSettle(); expect(builtCount, 1); - }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); + }, + variant: TargetPlatformVariant.only(TargetPlatform.android), + skip: kIsWeb, // [intended] no default transitions on the web. + ); } diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index f018449212..b97e6a4237 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -782,7 +782,7 @@ void main() { await animationSheet.collate(20), matchesGoldenFile('material.circular_progress_indicator.indeterminate.png'), ); - }, skip: isBrowser); // https://github.com/flutter/flutter/issues/42767 + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/56001 testWidgets( 'Adaptive CircularProgressIndicator displays CupertinoActivityIndicator in iOS', diff --git a/packages/flutter/test/material/scrollbar_theme_test.dart b/packages/flutter/test/material/scrollbar_theme_test.dart index 351573f998..07ad46caa9 100644 --- a/packages/flutter/test/material/scrollbar_theme_test.dart +++ b/packages/flutter/test/material/scrollbar_theme_test.dart @@ -624,7 +624,7 @@ void main() { // to "4", which results in the web evaluating to the value "4" regardless of which // one is used. This results in a difference for doubles in debugFillProperties between // the web and the rest of Flutter's target platforms. - }, skip: kIsWeb); + }, skip: kIsWeb); // [intended] } class NoScrollbarBehavior extends ScrollBehavior { diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 8bd5ca7238..e16d93f8dc 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -294,7 +294,10 @@ 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, TargetPlatform.windows, TargetPlatform.linux }), skip: isContextMenuProvidedByPlatform); + }, + variant: TargetPlatformVariant.desktop(), + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. + ); testWidgets('Activates the text field when receives semantics focus on Mac', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -653,7 +656,7 @@ void main() { selection: TextSelection.collapsed(offset: 2), ), ); - }, skip: areKeyEventsHandledByPlatform); + }, skip: areKeyEventsHandledByPlatform); // [intended] only applies to platforms where we handle key events. testWidgets('text field selection toolbar renders correctly inside opacity', (WidgetTester tester) async { await tester.pumpWidget( @@ -704,7 +707,7 @@ void main() { find.byType(Overlay), matchesGoldenFile('text_field_opacity_test.0.png'), ); - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. testWidgets('text field toolbar options correctly changes options', (WidgetTester tester) async { @@ -754,7 +757,7 @@ void main() { expect(find.text('Select All'), findsNothing); }, variant: const TargetPlatformVariant({ TargetPlatform.iOS, TargetPlatform.macOS }), - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); testWidgets('text selection style 1', (WidgetTester tester) async { @@ -907,7 +910,7 @@ void main() { TargetPlatform.linux, TargetPlatform.windows, }), - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); testWidgets('cursor layout has correct width', (WidgetTester tester) async { @@ -1291,7 +1294,7 @@ void main() { await tester.longPressAt(emptyPos, pointer: 7); await tester.pumpAndSettle(); expect(find.text('Paste'), findsOneWidget); - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. testWidgets('Entering text hides selection handle caret', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -2017,7 +2020,10 @@ void main() { expect(controller.selection.baseOffset, 7); expect(controller.value.composing.start, 4); expect(controller.value.composing.end, 7); - }, skip: kIsWeb, variant: const TargetPlatformVariant({ TargetPlatform.android, TargetPlatform.iOS })); + }, + skip: kIsWeb, // [intended] text selection is handled by the browser + variant: const TargetPlatformVariant({ TargetPlatform.android, TargetPlatform.iOS }) + ); testWidgets('Can use selection toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -2085,7 +2091,7 @@ void main() { await tester.tap(find.text('Paste')); await tester.pump(); expect(controller.text, 'abc d${testValue}ef ghi'); - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. // Show the selection menu at the given index into the text by tapping to // place the cursor and then tapping on the handle. @@ -2164,7 +2170,7 @@ void main() { textFieldTopLeft = tester.getTopLeft(find.byType(TextField)); expect(toolbarTopLeft.dy, lessThan(textFieldTopLeft.dy)); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); testWidgets( @@ -2235,7 +2241,7 @@ void main() { textFieldTopLeft = tester.getTopLeft(find.byType(TextField)); expect(toolbarTopLeft.dy, lessThan(textFieldTopLeft.dy)); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); testWidgets( @@ -2291,7 +2297,7 @@ void main() { expect(lastLineToolbarTopLeft.dy, lessThan(lastLineTopLeft.dy)); expect(lastLineToolbarTopLeft.dy, greaterThan(penultimateLineToolbarTopLeft.dy)); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); testWidgets('Selection toolbar fades in', (WidgetTester tester) async { @@ -2337,7 +2343,7 @@ void main() { expect(opacity.opacity.value, lessThan(1.0)); // End the test here to ensure the animation is properly disposed of. - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. testWidgets('An obscured TextField is selectable by default', (WidgetTester tester) async { // This is a regression test for @@ -2450,7 +2456,7 @@ void main() { expect(find.text('Select all'), findsOneWidget); expect(find.text('Copy'), findsNothing); expect(find.text('Cut'), findsNothing); - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. testWidgets('TextField height with minLines unset', (WidgetTester tester) async { await tester.pumpWidget(textFieldBuilder()); @@ -3780,7 +3786,7 @@ void main() { await tester.pump(); // Puts 456 before the 2 in 123. expect(textController.text, '145623'); - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. testWidgets('Pasted values are formatted (deprecated names)', (WidgetTester tester) async { final TextEditingController textController = TextEditingController(); @@ -3818,7 +3824,7 @@ void main() { await tester.pump(); // Puts 456 before the 2 in 123. expect(textController.text, '145623'); - }, skip: isContextMenuProvidedByPlatform); + }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. testWidgets('Do not add LengthLimiting formatter to the user supplied list', (WidgetTester tester) async { final List formatters = []; @@ -4870,7 +4876,7 @@ void main() { await tester.sendKeyDownEvent(LogicalKeyboardKey.arrowLeft); expect(controller.selection.extentOffset - controller.selection.baseOffset, -1); }, variant: KeySimulatorTransitModeVariant.all()); - }, skip: areKeyEventsHandledByPlatform); + }, skip: areKeyEventsHandledByPlatform); // [intended] only applies to platforms where we handle key events. testWidgets('Copy paste test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -4944,7 +4950,10 @@ void main() { const String expected = 'a biga big house\njumped over a mouse'; expect(find.text(expected), findsOneWidget, reason: 'Because text contains ${controller.text}'); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all() + ); testWidgets('Copy paste obscured text test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -5018,7 +5027,10 @@ void main() { const String expected = 'a biga big house jumped over a mouse'; expect(find.text(expected), findsOneWidget, reason: 'Because text contains ${controller.text}'); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all() + ); // Regressing test for https://github.com/flutter/flutter/issues/78219 testWidgets('Paste does not crash when the section is inValid', (WidgetTester tester) async { @@ -5145,7 +5157,10 @@ void main() { const String expected = ' housa bige\njumped over a mouse'; expect(find.text(expected), findsOneWidget); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all() + ); testWidgets('Cut obscured text test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -5269,7 +5284,10 @@ void main() { const String expected = ''; expect(find.text(expected), findsOneWidget); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all() + ); testWidgets('Delete test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -5321,7 +5339,10 @@ void main() { const String expected2 = ''; expect(find.text(expected2), findsOneWidget); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all(), + ); testWidgets('Changing positions of text fields', (WidgetTester tester) async { @@ -5413,8 +5434,10 @@ void main() { await tester.sendKeyUpEvent(LogicalKeyboardKey.shift); expect(c1.selection.extentOffset - c1.selection.baseOffset, -10); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); - + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all() + ); testWidgets('Changing focus test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -5488,7 +5511,10 @@ void main() { expect(c1.selection.extentOffset - c1.selection.baseOffset, 0); expect(c2.selection.extentOffset - c2.selection.baseOffset, -5); - }, skip: areKeyEventsHandledByPlatform, variant: KeySimulatorTransitModeVariant.all()); + }, + skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events. + variant: KeySimulatorTransitModeVariant.all() + ); testWidgets('Caret works when maxLines is null', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -6226,7 +6252,7 @@ void main() { // On web (just like iOS), we don't check for pasteability because that // triggers a permission dialog in the browser. // https://github.com/flutter/flutter/pull/57139#issuecomment-629048058 - }, skip: isBrowser); + }, skip: isBrowser); // [intended] see above. testWidgets('TextField throws when not descended from a Material widget', (WidgetTester tester) async { const Widget textField = TextField(); @@ -6344,10 +6370,7 @@ void main() { ); expect(topLeft.dx, equals(160.0)); - - // TODO(mdebbar): RTL support still has issues on the web. - // https://github.com/flutter/flutter/projects/159 - }, skip: isBrowser); + }); testWidgets('TextField semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); @@ -7168,7 +7191,7 @@ void main() { expect(find.byType(TextButton), findsNWidgets(4)); }, variant: TargetPlatformVariant.all(), - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); testWidgets( @@ -7202,7 +7225,7 @@ void main() { expect(find.byType(CupertinoButton), findsNWidgets(3)); }, variant: TargetPlatformVariant.all(), - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); testWidgets('selectionControls is passed to EditableText', (WidgetTester tester) async { @@ -7305,7 +7328,7 @@ void main() { await tester.pumpAndSettle(); expect(find.text('Paste'), findsOneWidget); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); testWidgets( @@ -7336,7 +7359,7 @@ void main() { await tester.pump(); expect(find.text('Paste'), findsOneWidget); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); testWidgets( @@ -7367,7 +7390,7 @@ void main() { await tester.pump(); expect(find.text('Paste'), findsNothing); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); testWidgets( @@ -7398,7 +7421,7 @@ void main() { await tester.pumpAndSettle(); expect(find.text('Paste'), findsOneWidget); }, - skip: isContextMenuProvidedByPlatform, + skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); testWidgets( @@ -8640,9 +8663,7 @@ void main() { const Size(800, 174), ); }, - - // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 - skip: isBrowser, + skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 ); testWidgets( @@ -8671,9 +8692,7 @@ void main() { const Size(800, 48), ); }, - - // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 - skip: isBrowser, + skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 ); testWidgets( @@ -8704,9 +8723,7 @@ void main() { const Size(800, 78), ); }, - - // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 - skip: isBrowser, + skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 ); testWidgets('Caret center position', (WidgetTester tester) async { @@ -9722,10 +9739,7 @@ void main() { inputWidth = editable.size.width; expect(inputWidth, wideWidth); expect(cursorRight, inputWidth - kCaretGap); - - // TODO(mdebbar): RTL support still has issues on the web. - // https://github.com/flutter/flutter/projects/159 - }, skip: isBrowser); + }); // Regressing test for https://github.com/flutter/flutter/issues/70625 testWidgets('TextFields can inherit [FloatingLabelBehaviour] from InputDecorationTheme.', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index 8255ea3036..36f8b5b5a7 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -112,7 +112,10 @@ 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, TargetPlatform.windows, TargetPlatform.linux }), skip: kIsWeb); + }, + variant: TargetPlatformVariant.desktop(), + skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. + ); testWidgets('TextFormField accepts TextField.noMaxLength as value to maxLength parameter', (WidgetTester tester) async { bool asserted; @@ -471,7 +474,7 @@ void main() { await tester.pump(const Duration(milliseconds: 200)); expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0)); - }, skip: isBrowser); // We do not use Flutter-rendered context menu on the Web + }, skip: isBrowser); // [intended] 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/material/text_selection_test.dart b/packages/flutter/test/material/text_selection_test.dart index 950be89cdc..0ce861ea74 100644 --- a/packages/flutter/test/material/text_selection_test.dart +++ b/packages/flutter/test/material/text_selection_test.dart @@ -149,7 +149,7 @@ void main() { expect(find.text('Select all'), findsOneWidget); expect(find.byType(IconButton), findsNothing); }, - skip: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. variant: const TargetPlatformVariant({ TargetPlatform.android }), ); @@ -223,7 +223,7 @@ void main() { expect(find.text('Select all'), findsNothing); expect(find.byType(IconButton), findsOneWidget); }, - skip: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. variant: const TargetPlatformVariant({ TargetPlatform.android }), ); @@ -288,7 +288,7 @@ void main() { expect(find.text('Select all'), findsNothing); expect(find.byType(IconButton), findsOneWidget); }, - skip: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. variant: const TargetPlatformVariant({ TargetPlatform.android }), ); @@ -362,7 +362,7 @@ void main() { expect(find.text('Select all'), findsNothing); expect(find.byType(IconButton), findsOneWidget); }, - skip: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. variant: const TargetPlatformVariant({ TargetPlatform.android }), ); @@ -468,7 +468,7 @@ void main() { final Offset newCutOffset = tester.getTopLeft(find.text('Cut')); expect(newCutOffset, equals(cutOffset)); }, - skip: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. variant: const TargetPlatformVariant({ TargetPlatform.android }), ); }); @@ -542,7 +542,7 @@ void main() { final Offset cutOffset = tester.getTopLeft(find.text('Cut')); expect(cutOffset.dy, greaterThan(bottomHandlePos.dy)); }, - skip: isBrowser, // We do not use Flutter-rendered context menu on the Web + skip: isBrowser, // [intended] We do not use Flutter-rendered context menu on the Web. variant: const TargetPlatformVariant({ TargetPlatform.android }), ); }); @@ -667,7 +667,10 @@ void main() { expect(find.text('Cut'), findsOneWidget); expect(find.text('Paste'), findsOneWidget); expect(find.text('Select all'), findsOneWidget); - }, skip: isBrowser, variant: const TargetPlatformVariant({ TargetPlatform.android })); + }, + skip: isBrowser, // [intended] we don't supply the cut/copy/paste buttons on the web. + variant: const TargetPlatformVariant({ TargetPlatform.android }) + ); // TODO(justinmc): https://github.com/flutter/flutter/issues/60145 testWidgets('Paste always appears regardless of clipboard content on iOS', (WidgetTester tester) async { @@ -719,5 +722,8 @@ void main() { expect(find.text('Copy'), findsOneWidget); expect(find.text('Cut'), findsOneWidget); expect(find.text('Paste'), findsOneWidget); - }, skip: isBrowser, variant: const TargetPlatformVariant({ TargetPlatform.iOS })); + }, + skip: isBrowser, // [intended] we don't supply the cut/copy/paste buttons on the web. + variant: const TargetPlatformVariant({ TargetPlatform.iOS }) + ); } diff --git a/packages/flutter/test/material/text_selection_toolbar_test.dart b/packages/flutter/test/material/text_selection_toolbar_test.dart index cefaa80405..eaea86f947 100644 --- a/packages/flutter/test/material/text_selection_toolbar_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_test.dart @@ -204,5 +204,5 @@ void main() { expect(find.text('Copy'), findsNothing); expect(find.text('Paste'), findsNothing); expect(find.text('Select all'), findsNothing); - }, skip: kIsWeb); + }, skip: kIsWeb); // [intended] We don't show the toolbar on the web. }