diff --git a/packages/flutter/test/animation/animation_sheet_test.dart b/packages/flutter/test/animation/animation_sheet_test.dart index c04bb535c5a..1c7c018b4a9 100644 --- a/packages/flutter/test/animation/animation_sheet_test.dart +++ b/packages/flutter/test/animation/animation_sheet_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -18,7 +17,7 @@ void main() { * because [matchesGoldenFile] does not use Skia Gold in its native package. */ - testWidgetsWithLeakTracking('recording disposes images', + testWidgets('recording disposes images', (WidgetTester tester) async { final AnimationSheetBuilder builder = AnimationSheetBuilder(frameSize: _DecuplePixels.size); addTearDown(builder.dispose); @@ -34,7 +33,7 @@ void main() { skip: isBrowser, // [intended] https://github.com/flutter/flutter/issues/56001 ); - testWidgetsWithLeakTracking('correctly records frames using collate', + testWidgets('correctly records frames using collate', (WidgetTester tester) async { final AnimationSheetBuilder builder = AnimationSheetBuilder(frameSize: _DecuplePixels.size); addTearDown(builder.dispose); @@ -72,7 +71,7 @@ void main() { skip: isBrowser, // [intended] https://github.com/flutter/flutter/issues/56001 ); // https://github.com/flutter/flutter/issues/56001 - testWidgetsWithLeakTracking('use allLayers to record out-of-subtree contents', (WidgetTester tester) async { + testWidgets('use allLayers to record out-of-subtree contents', (WidgetTester tester) async { final AnimationSheetBuilder builder = AnimationSheetBuilder( frameSize: const Size(8, 2), allLayers: true, diff --git a/packages/flutter/test/animation/animation_style_test.dart b/packages/flutter/test/animation/animation_style_test.dart index 9221339b3d0..cdcd0161135 100644 --- a/packages/flutter/test/animation/animation_style_test.dart +++ b/packages/flutter/test/animation/animation_style_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/animation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('copyWith, ==, hashCode basics', () { @@ -13,7 +12,7 @@ void main() { expect(AnimationStyle().hashCode, AnimationStyle().copyWith().hashCode); }); - testWidgetsWithLeakTracking('AnimationStyle.copyWith() overrides all properties', (WidgetTester tester) async { + testWidgets('AnimationStyle.copyWith() overrides all properties', (WidgetTester tester) async { final AnimationStyle original = AnimationStyle( curve: Curves.ease, duration: const Duration(seconds: 1), @@ -38,7 +37,7 @@ void main() { expect(identical(AnimationStyle.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('default AnimationStyle debugFillProperties', (WidgetTester tester) async { + testWidgets('default AnimationStyle debugFillProperties', (WidgetTester tester) async { final AnimationStyle a = AnimationStyle( curve: Curves.ease, duration: const Duration(seconds: 1), @@ -57,7 +56,7 @@ void main() { expect(AnimationStyle.lerp(a, b, 1.0), b); }); - testWidgetsWithLeakTracking('default AnimationStyle debugFillProperties', (WidgetTester tester) async { + testWidgets('default AnimationStyle debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); AnimationStyle().debugFillProperties(builder); @@ -69,7 +68,7 @@ void main() { expect(description, []); }); - testWidgetsWithLeakTracking('AnimationStyle implements debugFillProperties', (WidgetTester tester) async { + testWidgets('AnimationStyle implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); AnimationStyle( diff --git a/packages/flutter/test/animation/futures_test.dart b/packages/flutter/test/animation/futures_test.dart index 366014681d8..b305f3c632b 100644 --- a/packages/flutter/test/animation/futures_test.dart +++ b/packages/flutter/test/animation/futures_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('awaiting animation controllers - using direct future', (WidgetTester tester) async { + testWidgets('awaiting animation controllers - using direct future', (WidgetTester tester) async { final AnimationController controller1 = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), @@ -60,7 +59,7 @@ void main() { expect(log, ['start', 'a', 'b', 'c', 'd', 'end']); }); - testWidgetsWithLeakTracking('awaiting animation controllers - using orCancel', (WidgetTester tester) async { + testWidgets('awaiting animation controllers - using orCancel', (WidgetTester tester) async { final AnimationController controller1 = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), @@ -112,7 +111,7 @@ void main() { expect(log, ['start', 'a', 'b', 'c', 'd', 'end']); }); - testWidgetsWithLeakTracking('awaiting animation controllers and failing', (WidgetTester tester) async { + testWidgets('awaiting animation controllers and failing', (WidgetTester tester) async { final AnimationController controller1 = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), @@ -140,7 +139,7 @@ void main() { expect(log, ['start', 'caught', 'end']); }); - testWidgetsWithLeakTracking('creating orCancel future later', (WidgetTester tester) async { + testWidgets('creating orCancel future later', (WidgetTester tester) async { final AnimationController controller1 = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), @@ -154,7 +153,7 @@ void main() { expect(true, isTrue); // should reach here }); - testWidgetsWithLeakTracking('creating orCancel future later', (WidgetTester tester) async { + testWidgets('creating orCancel future later', (WidgetTester tester) async { final AnimationController controller1 = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), @@ -172,7 +171,7 @@ void main() { expect(ok, isTrue); // should reach here }); - testWidgetsWithLeakTracking('TickerFuture is a Future', (WidgetTester tester) async { + testWidgets('TickerFuture is a Future', (WidgetTester tester) async { final AnimationController controller1 = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), diff --git a/packages/flutter/test/animation/iteration_patterns_test.dart b/packages/flutter/test/animation/iteration_patterns_test.dart index d8bcea8491b..62c905ca47d 100644 --- a/packages/flutter/test/animation/iteration_patterns_test.dart +++ b/packages/flutter/test/animation/iteration_patterns_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { setUp(() { @@ -80,7 +79,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('AnimationController with throwing listener', (WidgetTester tester) async { + testWidgets('AnimationController with throwing listener', (WidgetTester tester) async { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), @@ -104,7 +103,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('AnimationController with throwing status listener', (WidgetTester tester) async { + testWidgets('AnimationController with throwing status listener', (WidgetTester tester) async { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), vsync: const TestVSync(), diff --git a/packages/flutter/test/animation/live_binding_test.dart b/packages/flutter/test/animation/live_binding_test.dart index aa9310f0120..197175e5aa7 100644 --- a/packages/flutter/test/animation/live_binding_test.dart +++ b/packages/flutter/test/animation/live_binding_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { /* @@ -19,7 +18,7 @@ void main() { LiveTestWidgetsFlutterBinding().framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.onlyPumps; - testWidgetsWithLeakTracking('Should show event indicator for pointer events', (WidgetTester tester) async { + testWidgets('Should show event indicator for pointer events', (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(200, 200), allLayers: true); addTearDown(animationSheet.dispose); final List taps = []; @@ -78,7 +77,7 @@ void main() { // Currently skipped due to daily flake: https://github.com/flutter/flutter/issues/87588 }, skip: true); // Typically skip: isBrowser https://github.com/flutter/flutter/issues/42767 - testWidgetsWithLeakTracking('Should show event indicator for pointer events with setSurfaceSize', (WidgetTester tester) async { + testWidgets('Should show event indicator for pointer events with setSurfaceSize', (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(200, 200), allLayers: true); addTearDown(animationSheet.dispose); final List taps = []; diff --git a/packages/flutter/test/cupertino/action_sheet_test.dart b/packages/flutter/test/cupertino/action_sheet_test.dart index 5754eb66d60..f998199100f 100644 --- a/packages/flutter/test/cupertino/action_sheet_test.dart +++ b/packages/flutter/test/cupertino/action_sheet_test.dart @@ -9,12 +9,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Verify that a tap on modal barrier dismisses an action sheet', (WidgetTester tester) async { + testWidgets('Verify that a tap on modal barrier dismisses an action sheet', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( const CupertinoActionSheet( @@ -33,7 +32,7 @@ void main() { expect(find.text('Action Sheet'), findsNothing); }); - testWidgetsWithLeakTracking('Verify that a tap on title section (not buttons) does not dismiss an action sheet', (WidgetTester tester) async { + testWidgets('Verify that a tap on title section (not buttons) does not dismiss an action sheet', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( const CupertinoActionSheet( @@ -53,7 +52,7 @@ void main() { expect(find.text('Action Sheet'), findsOneWidget); }); - testWidgetsWithLeakTracking('Action sheet destructive text style', (WidgetTester tester) async { + testWidgets('Action sheet destructive text style', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( CupertinoActionSheetAction( @@ -74,7 +73,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Action sheet dark mode', (WidgetTester tester) async { + testWidgets('Action sheet dark mode', (WidgetTester tester) async { final Widget action = CupertinoActionSheetAction( child: const Text('action'), onPressed: () {}, @@ -131,7 +130,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Action sheet default text style', (WidgetTester tester) async { + testWidgets('Action sheet default text style', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( CupertinoActionSheetAction( @@ -147,7 +146,7 @@ void main() { expect(widget.style.fontWeight, equals(FontWeight.w600)); }); - testWidgetsWithLeakTracking('Action sheet text styles are correct when both title and message are included', (WidgetTester tester) async { + testWidgets('Action sheet text styles are correct when both title and message are included', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( const CupertinoActionSheet( @@ -167,7 +166,7 @@ void main() { expect(messageStyle.style.fontWeight, FontWeight.w400); }); - testWidgetsWithLeakTracking('Action sheet text styles are correct when title but no message is included', (WidgetTester tester) async { + testWidgets('Action sheet text styles are correct when title but no message is included', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( const CupertinoActionSheet( @@ -184,7 +183,7 @@ void main() { expect(titleStyle.style.fontWeight, FontWeight.w400); }); - testWidgetsWithLeakTracking('Action sheet text styles are correct when message but no title is included', (WidgetTester tester) async { + testWidgets('Action sheet text styles are correct when message but no title is included', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( const CupertinoActionSheet( @@ -201,7 +200,7 @@ void main() { expect(messageStyle.style.fontWeight, FontWeight.w600); }); - testWidgetsWithLeakTracking('Content section but no actions', (WidgetTester tester) async { + testWidgets('Content section but no actions', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -239,7 +238,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions but no content section', (WidgetTester tester) async { + testWidgets('Actions but no content section', (WidgetTester tester) async { final ScrollController actionScrollController = ScrollController(); addTearDown(actionScrollController.dispose); await tester.pumpWidget( @@ -288,7 +287,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Action section is scrollable', (WidgetTester tester) async { + testWidgets('Action section is scrollable', (WidgetTester tester) async { final ScrollController actionScrollController = ScrollController(); addTearDown(actionScrollController.dispose); await tester.pumpWidget( @@ -354,7 +353,7 @@ void main() { expect(tester.getSize(find.widgetWithText(CupertinoActionSheetAction, 'Five')).height, equals(83.0)); }); - testWidgetsWithLeakTracking('Content section is scrollable', (WidgetTester tester) async { + testWidgets('Content section is scrollable', (WidgetTester tester) async { final ScrollController messageScrollController = ScrollController(); addTearDown(messageScrollController.dispose); late double screenHeight; @@ -397,7 +396,7 @@ void main() { expect(tester.getSize(find.byType(CupertinoActionSheet)).height, screenHeight); }); - testWidgetsWithLeakTracking('CupertinoActionSheet scrollbars controllers should be different', (WidgetTester tester) async { + testWidgets('CupertinoActionSheet scrollbars controllers should be different', (WidgetTester tester) async { // https://github.com/flutter/flutter/pull/81278 await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( @@ -427,7 +426,7 @@ void main() { expect(scrollbars[0].controller != scrollbars[1].controller, isTrue); }); - testWidgetsWithLeakTracking('Tap on button calls onPressed', (WidgetTester tester) async { + testWidgets('Tap on button calls onPressed', (WidgetTester tester) async { bool wasPressed = false; await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( @@ -464,7 +463,7 @@ void main() { expect(find.text('One'), findsNothing); }); - testWidgetsWithLeakTracking('Action sheet width is correct when given infinite horizontal space', (WidgetTester tester) async { + testWidgets('Action sheet width is correct when given infinite horizontal space', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( Row( @@ -492,7 +491,7 @@ void main() { expect(tester.getSize(find.byType(CupertinoActionSheet)).width, 600.0); }); - testWidgetsWithLeakTracking('Action sheet height is correct when given infinite vertical space', (WidgetTester tester) async { + testWidgets('Action sheet height is correct when given infinite vertical space', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( Column( @@ -520,7 +519,7 @@ void main() { expect(tester.getSize(find.byType(CupertinoActionSheet)).height, moreOrLessEquals(132.3)); }); - testWidgetsWithLeakTracking('1 action button with cancel button', (WidgetTester tester) async { + testWidgets('1 action button with cancel button', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -547,7 +546,7 @@ void main() { expect(findScrollableActionsSectionRenderBox(tester).size.height, 56.0); }); - testWidgetsWithLeakTracking('2 action buttons with cancel button', (WidgetTester tester) async { + testWidgets('2 action buttons with cancel button', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -577,7 +576,7 @@ void main() { expect(findScrollableActionsSectionRenderBox(tester).size.height, moreOrLessEquals(112.3)); }); - testWidgetsWithLeakTracking('3 action buttons with cancel button', (WidgetTester tester) async { + testWidgets('3 action buttons with cancel button', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -611,7 +610,7 @@ void main() { expect(findScrollableActionsSectionRenderBox(tester).size.height, moreOrLessEquals(168.6)); }); - testWidgetsWithLeakTracking('4+ action buttons with cancel button', (WidgetTester tester) async { + testWidgets('4+ action buttons with cancel button', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -649,7 +648,7 @@ void main() { expect(findScrollableActionsSectionRenderBox(tester).size.height, moreOrLessEquals(84.3)); }); - testWidgetsWithLeakTracking('1 action button without cancel button', (WidgetTester tester) async { + testWidgets('1 action button without cancel button', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -671,7 +670,7 @@ void main() { expect(findScrollableActionsSectionRenderBox(tester).size.height, 56.0); }); - testWidgetsWithLeakTracking('2+ action buttons without cancel button', (WidgetTester tester) async { + testWidgets('2+ action buttons without cancel button', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -697,7 +696,7 @@ void main() { expect(findScrollableActionsSectionRenderBox(tester).size.height, moreOrLessEquals(84.3)); }); - testWidgetsWithLeakTracking('Action sheet with just cancel button is correct', (WidgetTester tester) async { + testWidgets('Action sheet with just cancel button is correct', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -717,7 +716,7 @@ void main() { expect(tester.getSize(find.byType(CupertinoActionSheet)).width, 600.0); }); - testWidgetsWithLeakTracking('Cancel button tap calls onPressed', (WidgetTester tester) async { + testWidgets('Cancel button tap calls onPressed', (WidgetTester tester) async { bool wasPressed = false; await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( @@ -752,7 +751,7 @@ void main() { expect(find.text('Cancel'), findsNothing); }); - testWidgetsWithLeakTracking('Layout is correct when cancel button is present', (WidgetTester tester) async { + testWidgets('Layout is correct when cancel button is present', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -789,7 +788,7 @@ void main() { expect(tester.getBottomLeft(find.widgetWithText(CupertinoActionSheetAction, 'Two')).dy, 526.0); }); - testWidgetsWithLeakTracking('Enter/exit animation is correct', (WidgetTester tester) async { + testWidgets('Enter/exit animation is correct', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -866,7 +865,7 @@ void main() { expect(find.byType(CupertinoActionSheet), findsNothing); }); - testWidgetsWithLeakTracking('Modal barrier is pressed during transition', (WidgetTester tester) async { + testWidgets('Modal barrier is pressed during transition', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( @@ -924,7 +923,7 @@ void main() { }); - testWidgetsWithLeakTracking('Action sheet semantics', (WidgetTester tester) async { + testWidgets('Action sheet semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1033,7 +1032,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Conflicting scrollbars are not applied by ScrollBehavior to CupertinoActionSheet', (WidgetTester tester) async { + testWidgets('Conflicting scrollbars are not applied by ScrollBehavior to CupertinoActionSheet', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/83819 final ScrollController actionScrollController = ScrollController(); addTearDown(actionScrollController.dispose); @@ -1074,7 +1073,7 @@ void main() { expect(find.byType(CupertinoScrollbar), findsNWidgets(2)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Hovering over Cupertino action sheet action updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino action sheet action updates cursor to clickable on Web', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesActionSheet( CupertinoActionSheet( diff --git a/packages/flutter/test/cupertino/activity_indicator_test.dart b/packages/flutter/test/cupertino/activity_indicator_test.dart index 1db90ea77ce..dcb8ac43156 100644 --- a/packages/flutter/test/cupertino/activity_indicator_test.dart +++ b/packages/flutter/test/cupertino/activity_indicator_test.dart @@ -10,10 +10,9 @@ library; import 'package:flutter/cupertino.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Activity indicator animate property works', (WidgetTester tester) async { + testWidgets('Activity indicator animate property works', (WidgetTester tester) async { await tester.pumpWidget(buildCupertinoActivityIndicator()); expect(SchedulerBinding.instance.transientCallbackCount, equals(1)); @@ -29,7 +28,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(1)); }); - testWidgetsWithLeakTracking('Activity indicator dark mode', (WidgetTester tester) async { + testWidgets('Activity indicator dark mode', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( @@ -78,7 +77,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Activity indicator 0% in progress', (WidgetTester tester) async { + testWidgets('Activity indicator 0% in progress', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( @@ -100,7 +99,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Activity indicator 30% in progress', (WidgetTester tester) async { + testWidgets('Activity indicator 30% in progress', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( @@ -122,7 +121,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Activity indicator 100% in progress', (WidgetTester tester) async { + testWidgets('Activity indicator 100% in progress', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( @@ -143,7 +142,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/41345. - testWidgetsWithLeakTracking('has the correct corner radius', (WidgetTester tester) async { + testWidgets('has the correct corner radius', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoActivityIndicator(animating: false, radius: 100), ); @@ -159,7 +158,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can specify color', (WidgetTester tester) async { + testWidgets('Can specify color', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( diff --git a/packages/flutter/test/cupertino/adaptive_text_selection_toolbar_test.dart b/packages/flutter/test/cupertino/adaptive_text_selection_toolbar_test.dart index 072597abfe6..0fc08af596c 100644 --- a/packages/flutter/test/cupertino/adaptive_text_selection_toolbar_test.dart +++ b/packages/flutter/test/cupertino/adaptive_text_selection_toolbar_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/live_text_utils.dart'; @@ -32,7 +31,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Builds the right toolbar on each platform, including web, and shows buttonItems', (WidgetTester tester) async { + testWidgets('Builds the right toolbar on each platform, including web, and shows buttonItems', (WidgetTester tester) async { const String buttonText = 'Click me'; await tester.pumpWidget( @@ -73,7 +72,7 @@ void main() { skip: isBrowser, // [intended] see https://github.com/flutter/flutter/issues/108382 ); - testWidgetsWithLeakTracking('Can build children directly as well', (WidgetTester tester) async { + testWidgets('Can build children directly as well', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( @@ -96,7 +95,7 @@ void main() { skip: isBrowser, // [intended] see https://github.com/flutter/flutter/issues/108382 ); - testWidgetsWithLeakTracking('Can build from EditableTextState', (WidgetTester tester) async { + testWidgets('Can build from EditableTextState', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -159,7 +158,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('Can build for editable text from raw parameters', (WidgetTester tester) async { + testWidgets('Can build for editable text from raw parameters', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(CupertinoApp( home: Center( @@ -237,7 +236,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('Builds the correct button per-platform', (WidgetTester tester) async { + testWidgets('Builds the correct button per-platform', (WidgetTester tester) async { const String buttonText = 'Click me'; await tester.pumpWidget( diff --git a/packages/flutter/test/cupertino/app_test.dart b/packages/flutter/test/cupertino/app_test.dart index 3d59a2554b2..2a77e40a846 100644 --- a/packages/flutter/test/cupertino/app_test.dart +++ b/packages/flutter/test/cupertino/app_test.dart @@ -7,10 +7,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Heroes work', (WidgetTester tester) async { + testWidgets('Heroes work', (WidgetTester tester) async { await tester.pumpWidget(CupertinoApp( home: ListView(children: [ const Hero(tag: 'a', child: Text('foo')), @@ -40,7 +39,7 @@ void main() { expect(find.widgetWithText(Navigator, 'foo'), findsOneWidget); }); - testWidgetsWithLeakTracking('Has default cupertino localizations', (WidgetTester tester) async { + testWidgets('Has default cupertino localizations', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Builder( @@ -62,7 +61,7 @@ void main() { expect(find.text('Thu Oct 4 '), findsOneWidget); }); - testWidgetsWithLeakTracking('Can use dynamic color', (WidgetTester tester) async { + testWidgets('Can use dynamic color', (WidgetTester tester) async { const CupertinoDynamicColor dynamicColor = CupertinoDynamicColor.withBrightness( color: Color(0xFF000000), darkColor: Color(0xFF000001), @@ -84,7 +83,7 @@ void main() { expect(tester.widget(find.byType(Title)).color.value, 0xFF000001); }); - testWidgetsWithLeakTracking('Can customize initial routes', (WidgetTester tester) async { + testWidgets('Can customize initial routes', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( CupertinoApp( @@ -131,7 +130,7 @@ void main() { expect(find.text('regular page two'), findsNothing); }); - testWidgetsWithLeakTracking('CupertinoApp.navigatorKey can be updated', (WidgetTester tester) async { + testWidgets('CupertinoApp.navigatorKey can be updated', (WidgetTester tester) async { final GlobalKey<NavigatorState> key1 = GlobalKey<NavigatorState>(); await tester.pumpWidget(CupertinoApp( navigatorKey: key1, @@ -147,7 +146,7 @@ void main() { expect(key1.currentState, isNull); }); - testWidgetsWithLeakTracking('CupertinoApp.router works', (WidgetTester tester) async { + testWidgets('CupertinoApp.router works', (WidgetTester tester) async { final PlatformRouteInformationProvider provider = PlatformRouteInformationProvider( initialRouteInformation: RouteInformation( uri: Uri.parse('initial'), @@ -180,7 +179,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoApp.router route information parser is optional', (WidgetTester tester) async { + testWidgets('CupertinoApp.router route information parser is optional', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -206,7 +205,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoApp.router throw if route information provider is provided but no route information parser', (WidgetTester tester) async { + testWidgets('CupertinoApp.router throw if route information provider is provided but no route information parser', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -233,7 +232,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('CupertinoApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async { + testWidgets('CupertinoApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -255,7 +254,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('CupertinoApp.router router config works', (WidgetTester tester) async { + testWidgets('CupertinoApp.router router config works', (WidgetTester tester) async { late SimpleNavigatorRouterDelegate delegate; addTearDown(() => delegate.dispose()); final PlatformRouteInformationProvider provider = PlatformRouteInformationProvider( @@ -292,7 +291,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoApp has correct default ScrollBehavior', (WidgetTester tester) async { + testWidgets('CupertinoApp has correct default ScrollBehavior', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( CupertinoApp( @@ -307,7 +306,7 @@ void main() { expect(ScrollConfiguration.of(capturedContext).runtimeType, CupertinoScrollBehavior); }); - testWidgetsWithLeakTracking('A ScrollBehavior can be set for CupertinoApp', (WidgetTester tester) async { + testWidgets('A ScrollBehavior can be set for CupertinoApp', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( CupertinoApp( @@ -325,7 +324,7 @@ void main() { expect(scrollBehavior.getScrollPhysics(capturedContext).runtimeType, NeverScrollableScrollPhysics); }); - testWidgetsWithLeakTracking('When `useInheritedMediaQuery` is true an existing MediaQuery is used if one is available', (WidgetTester tester) async { + testWidgets('When `useInheritedMediaQuery` is true an existing MediaQuery is used if one is available', (WidgetTester tester) async { late BuildContext capturedContext; final UniqueKey uniqueKey = UniqueKey(); await tester.pumpWidget( @@ -345,7 +344,7 @@ void main() { expect(capturedContext.dependOnInheritedWidgetOfExactType<MediaQuery>()?.key, uniqueKey); }); - testWidgetsWithLeakTracking('Text color is correctly resolved when CupertinoThemeData.brightness is null', (WidgetTester tester) async { + testWidgets('Text color is correctly resolved when CupertinoThemeData.brightness is null', (WidgetTester tester) async { debugBrightnessOverride = Brightness.dark; await tester.pumpWidget( @@ -384,7 +383,7 @@ void main() { debugBrightnessOverride = null; }); - testWidgetsWithLeakTracking('Cursor color is resolved when CupertinoThemeData.brightness is null', (WidgetTester tester) async { + testWidgets('Cursor color is resolved when CupertinoThemeData.brightness is null', (WidgetTester tester) async { debugBrightnessOverride = Brightness.dark; RenderEditable findRenderEditable(WidgetTester tester) { @@ -441,7 +440,7 @@ void main() { debugBrightnessOverride = null; }); - testWidgetsWithLeakTracking('Assert in buildScrollbar that controller != null when using it', (WidgetTester tester) async { + testWidgets('Assert in buildScrollbar that controller != null when using it', (WidgetTester tester) async { const ScrollBehavior defaultBehavior = CupertinoScrollBehavior(); late BuildContext capturedContext; diff --git a/packages/flutter/test/cupertino/bottom_tab_bar_test.dart b/packages/flutter/test/cupertino/bottom_tab_bar_test.dart index 20c8b054aa9..04576a904d6 100644 --- a/packages/flutter/test/cupertino/bottom_tab_bar_test.dart +++ b/packages/flutter/test/cupertino/bottom_tab_bar_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import '../widgets/semantics_tester.dart'; @@ -30,7 +29,7 @@ Future<void> pumpWidgetWithBoilerplate(WidgetTester tester, Widget widget) async Future<void> main() async { - testWidgetsWithLeakTracking('Need at least 2 tabs', (WidgetTester tester) async { + testWidgets('Need at least 2 tabs', (WidgetTester tester) async { await expectLater( () => pumpWidgetWithBoilerplate(tester, CupertinoTabBar( items: <BottomNavigationBarItem>[ @@ -48,7 +47,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('Active and inactive colors', (WidgetTester tester) async { + testWidgets('Active and inactive colors', (WidgetTester tester) async { await pumpWidgetWithBoilerplate(tester, MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( @@ -82,7 +81,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('BottomNavigationBar.label will create a text widget', (WidgetTester tester) async { + testWidgets('BottomNavigationBar.label will create a text widget', (WidgetTester tester) async { await pumpWidgetWithBoilerplate(tester, MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( @@ -104,7 +103,7 @@ Future<void> main() async { expect(find.text('Tab 2'), findsOneWidget); }); - testWidgetsWithLeakTracking('Active and inactive colors dark mode', (WidgetTester tester) async { + testWidgets('Active and inactive colors dark mode', (WidgetTester tester) async { const CupertinoDynamicColor dynamicActiveColor = CupertinoDynamicColor.withBrightness( color: Color(0xFF000000), darkColor: Color(0xFF000001), @@ -192,7 +191,7 @@ Future<void> main() async { expect(decoration2.border!.top.color.value, 0x29000000); }); - testWidgetsWithLeakTracking('Tabs respects themes', (WidgetTester tester) async { + testWidgets('Tabs respects themes', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabBar( @@ -256,7 +255,7 @@ Future<void> main() async { expect(actualActive.text.style!.color, isSameColorAs(CupertinoColors.activeBlue.darkColor)); }); - testWidgetsWithLeakTracking('Use active icon', (WidgetTester tester) async { + testWidgets('Use active icon', (WidgetTester tester) async { final MemoryImage activeIcon = MemoryImage(Uint8List.fromList(kBlueSquarePng)); final MemoryImage inactiveIcon = MemoryImage(Uint8List.fromList(kTransparentImage)); @@ -289,7 +288,7 @@ Future<void> main() async { expect(image.image, activeIcon); }); - testWidgetsWithLeakTracking('Adjusts height to account for bottom padding', (WidgetTester tester) async { + testWidgets('Adjusts height to account for bottom padding', (WidgetTester tester) async { final CupertinoTabBar tabBar = CupertinoTabBar( items: <BottomNavigationBarItem>[ BottomNavigationBarItem( @@ -328,7 +327,7 @@ Future<void> main() async { expect(tester.getSize(find.byType(CupertinoTabBar)).height, 90.0); }); - testWidgetsWithLeakTracking('Set custom height', (WidgetTester tester) async { + testWidgets('Set custom height', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/51704 const double tabBarHeight = 56.0; final CupertinoTabBar tabBar = CupertinoTabBar( @@ -371,7 +370,7 @@ Future<void> main() async { expect(tester.getSize(find.byType(CupertinoTabBar)).height, tabBarHeight + bottomPadding); }); - testWidgetsWithLeakTracking('Ensure bar height will not change when toggle keyboard', (WidgetTester tester) async { + testWidgets('Ensure bar height will not change when toggle keyboard', (WidgetTester tester) async { const double tabBarHeight = 56.0; final CupertinoTabBar tabBar = CupertinoTabBar( height: tabBarHeight, @@ -425,7 +424,7 @@ Future<void> main() async { expect(tester.getSize(find.byType(CupertinoTabBar)).height, tabBarHeight + bottomPadding); }); - testWidgetsWithLeakTracking('Opaque background does not add blur effects', (WidgetTester tester) async { + testWidgets('Opaque background does not add blur effects', (WidgetTester tester) async { await pumpWidgetWithBoilerplate(tester, MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( @@ -464,7 +463,7 @@ Future<void> main() async { expect(find.byType(BackdropFilter), findsNothing); }); - testWidgetsWithLeakTracking('Tap callback', (WidgetTester tester) async { + testWidgets('Tap callback', (WidgetTester tester) async { late int callbackTab; await pumpWidgetWithBoilerplate(tester, MediaQuery( @@ -492,7 +491,7 @@ Future<void> main() async { expect(callbackTab, 1); }); - testWidgetsWithLeakTracking('tabs announce semantics', (WidgetTester tester) async { + testWidgets('tabs announce semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await pumpWidgetWithBoilerplate(tester, MediaQuery( @@ -527,7 +526,7 @@ Future<void> main() async { semantics.dispose(); }); - testWidgetsWithLeakTracking('Label of items should be nullable', (WidgetTester tester) async { + testWidgets('Label of items should be nullable', (WidgetTester tester) async { final MemoryImage iconProvider = MemoryImage(Uint8List.fromList(kTransparentImage)); final List<int> itemsTapped = <int>[]; @@ -564,7 +563,7 @@ Future<void> main() async { expect(itemsTapped, <int>[1]); }); - testWidgetsWithLeakTracking('Hide border hides the top border of the tabBar', (WidgetTester tester) async { + testWidgets('Hide border hides the top border of the tabBar', (WidgetTester tester) async { await pumpWidgetWithBoilerplate( tester, MediaQuery( @@ -624,7 +623,7 @@ Future<void> main() async { expect(boxDecorationHiddenBorder.border, isNull); }); - testWidgetsWithLeakTracking('Hovering over tab bar item updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over tab bar item updates cursor to clickable on Web', (WidgetTester tester) async { await pumpWidgetWithBoilerplate( tester, MediaQuery( diff --git a/packages/flutter/test/cupertino/button_test.dart b/packages/flutter/test/cupertino/button_test.dart index 6fda4d7c68f..c05f8ca8d8e 100644 --- a/packages/flutter/test/cupertino/button_test.dart +++ b/packages/flutter/test/cupertino/button_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -18,7 +17,7 @@ const TextStyle testStyle = TextStyle( ); void main() { - testWidgetsWithLeakTracking('Default layout minimum size', (WidgetTester tester) async { + testWidgets('Default layout minimum size', (WidgetTester tester) async { await tester.pumpWidget( boilerplate(child: const CupertinoButton( onPressed: null, @@ -33,7 +32,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Minimum size parameter', (WidgetTester tester) async { + testWidgets('Minimum size parameter', (WidgetTester tester) async { const double minSize = 60.0; await tester.pumpWidget( boilerplate(child: const CupertinoButton( @@ -50,7 +49,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Size grows with text', (WidgetTester tester) async { + testWidgets('Size grows with text', (WidgetTester tester) async { await tester.pumpWidget( boilerplate(child: const CupertinoButton( onPressed: null, @@ -68,7 +67,7 @@ void main() { // TODO(LongCatIsLoong): Uncomment once https://github.com/flutter/flutter/issues/44115 // is fixed. /* - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoButton.filled default color contrast meets guideline', (WidgetTester tester) async { // The native color combination systemBlue text over white background fails @@ -103,7 +102,7 @@ void main() { }); */ - testWidgetsWithLeakTracking('Button child alignment', (WidgetTester tester) async { + testWidgets('Button child alignment', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoButton( @@ -130,7 +129,7 @@ void main() { expect(align.alignment, Alignment.centerLeft); }); - testWidgetsWithLeakTracking('Button with background is wider', (WidgetTester tester) async { + testWidgets('Button with background is wider', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(child: const CupertinoButton( onPressed: null, color: Color(0xFFFFFFFF), @@ -144,7 +143,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Custom padding', (WidgetTester tester) async { + testWidgets('Custom padding', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(child: const CupertinoButton( onPressed: null, padding: EdgeInsets.all(100.0), @@ -157,7 +156,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Button takes taps', (WidgetTester tester) async { + testWidgets('Button takes taps', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( StatefulBuilder( @@ -185,7 +184,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(1)); }); - testWidgetsWithLeakTracking("Disabled button doesn't animate", (WidgetTester tester) async { + testWidgets("Disabled button doesn't animate", (WidgetTester tester) async { await tester.pumpWidget(boilerplate(child: const CupertinoButton( onPressed: null, child: Text('Tap me'), @@ -196,7 +195,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Enabled button animates', (WidgetTester tester) async { + testWidgets('Enabled button animates', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(child: CupertinoButton( child: const Text('Tap me'), onPressed: () { }, @@ -232,7 +231,7 @@ void main() { expect(transition.opacity.value, moreOrLessEquals(1.0, epsilon: 0.001)); }); - testWidgetsWithLeakTracking('pressedOpacity defaults to 0.1', (WidgetTester tester) async { + testWidgets('pressedOpacity defaults to 0.1', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(child: CupertinoButton( child: const Text('Tap me'), onPressed: () { }, @@ -255,7 +254,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('pressedOpacity parameter', (WidgetTester tester) async { + testWidgets('pressedOpacity parameter', (WidgetTester tester) async { const double pressedOpacity = 0.5; await tester.pumpWidget(boilerplate(child: CupertinoButton( pressedOpacity: pressedOpacity, @@ -280,7 +279,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Cupertino button is semantically a button', (WidgetTester tester) async { + testWidgets('Cupertino button is semantically a button', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( boilerplate( @@ -311,7 +310,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Can specify colors', (WidgetTester tester) async { + testWidgets('Can specify colors', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(child: CupertinoButton( color: const Color(0x000000FF), disabledColor: const Color(0x0000FF00), @@ -339,7 +338,7 @@ void main() { expect(boxDecoration.color, const Color(0x0000FF00)); }); - testWidgetsWithLeakTracking('Can specify dynamic colors', (WidgetTester tester) async { + testWidgets('Can specify dynamic colors', (WidgetTester tester) async { const Color bgColor = CupertinoDynamicColor.withBrightness( color: Color(0xFF123456), darkColor: Color(0xFF654321), @@ -388,7 +387,7 @@ void main() { expect(boxDecoration.color!.value, 0xFF111111); }); - testWidgetsWithLeakTracking('Button respects themes', (WidgetTester tester) async { + testWidgets('Button respects themes', (WidgetTester tester) async { late TextStyle textStyle; await tester.pumpWidget( @@ -462,7 +461,7 @@ void main() { expect(decoration.color, isSameColorAs(CupertinoColors.systemBlue.darkColor)); }); - testWidgetsWithLeakTracking('Hovering over Cupertino button updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino button updates cursor to clickable on Web', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( diff --git a/packages/flutter/test/cupertino/checkbox_test.dart b/packages/flutter/test/cupertino/checkbox_test.dart index 7f047e62cf7..601aef991d8 100644 --- a/packages/flutter/test/cupertino/checkbox_test.dart +++ b/packages/flutter/test/cupertino/checkbox_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -16,7 +15,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('CupertinoCheckbox semantics', (WidgetTester tester) async { + testWidgets('CupertinoCheckbox semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( @@ -156,7 +155,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Can wrap CupertinoCheckbox with Semantics', (WidgetTester tester) async { + testWidgets('Can wrap CupertinoCheckbox with Semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( @@ -184,7 +183,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('CupertinoCheckbox tristate: true', (WidgetTester tester) async { + testWidgets('CupertinoCheckbox tristate: true', (WidgetTester tester) async { bool? checkBoxValue; await tester.pumpWidget( @@ -228,7 +227,7 @@ void main() { expect(checkBoxValue, null); }); - testWidgetsWithLeakTracking('has semantics for tristate', (WidgetTester tester) async { + testWidgets('has semantics for tristate', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( CupertinoApp( @@ -295,7 +294,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('has semantic events', (WidgetTester tester) async { + testWidgets('has semantic events', (WidgetTester tester) async { dynamic semanticEvent; bool? checkboxValue = false; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { @@ -335,7 +334,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('Checkbox can be toggled by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('Checkbox can be toggled by keyboard shortcuts', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp({bool enabled = true}) { @@ -372,7 +371,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('Checkbox respects shape and side', (WidgetTester tester) async { + testWidgets('Checkbox respects shape and side', (WidgetTester tester) async { const RoundedRectangleBorder roundedRectangleBorder = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))); diff --git a/packages/flutter/test/cupertino/colors_test.dart b/packages/flutter/test/cupertino/colors_test.dart index a98a856a24d..f334426d29b 100644 --- a/packages/flutter/test/cupertino/colors_test.dart +++ b/packages/flutter/test/cupertino/colors_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class DependentWidget extends StatelessWidget { const DependentWidget({ @@ -201,7 +200,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Dynamic colors that are not actually dynamic should not claim dependencies', (WidgetTester tester) async { await tester.pumpWidget(const DependentWidget(color: notSoDynamicColor1)); @@ -211,7 +210,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Dynamic colors that are only dependent on vibrancy should not claim unnecessary dependencies, ' 'and its resolved color should change when its dependency changes', (WidgetTester tester) async { @@ -255,7 +254,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Dynamic colors that are only dependent on accessibility contrast should not claim unnecessary dependencies, ' 'and its resolved color should change when its dependency changes', (WidgetTester tester) async { @@ -284,7 +283,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Dynamic colors that are only dependent on elevation level should not claim unnecessary dependencies, ' 'and its resolved color should change when its dependency changes', (WidgetTester tester) async { @@ -313,7 +312,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Dynamic color with all 3 dependencies works', (WidgetTester tester) async { + testWidgets('Dynamic color with all 3 dependencies works', (WidgetTester tester) async { const Color dynamicRainbowColor1 = CupertinoDynamicColor( color: color0, darkColor: color1, @@ -414,7 +413,7 @@ void main() { expect(find.byType(DependentWidget), paints..rect(color: color7)); }); - testWidgetsWithLeakTracking('CupertinoDynamicColor used in a CupertinoTheme', (WidgetTester tester) async { + testWidgets('CupertinoDynamicColor used in a CupertinoTheme', (WidgetTester tester) async { late CupertinoDynamicColor color; await tester.pumpWidget( CupertinoApp( @@ -499,7 +498,7 @@ void main() { Color? color; setUp(() { color = null; }); - testWidgetsWithLeakTracking('dynamic color works in cupertino override theme', (WidgetTester tester) async { + testWidgets('dynamic color works in cupertino override theme', (WidgetTester tester) async { CupertinoDynamicColor typedColor() => color! as CupertinoDynamicColor; await tester.pumpWidget( @@ -556,7 +555,7 @@ void main() { expect(typedColor().value, dynamicColor.darkHighContrastElevatedColor.value); }); - testWidgetsWithLeakTracking('dynamic color does not work in a material theme', (WidgetTester tester) async { + testWidgets('dynamic color does not work in a material theme', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( // This will create a MaterialBasedCupertinoThemeData with primaryColor set to `dynamicColor`. diff --git a/packages/flutter/test/cupertino/context_menu_action_test.dart b/packages/flutter/test/cupertino/context_menu_action_test.dart index 535d502a69a..ad6a52b9c31 100644 --- a/packages/flutter/test/cupertino/context_menu_action_test.dart +++ b/packages/flutter/test/cupertino/context_menu_action_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Constants taken from _ContextMenuActionState. @@ -72,7 +71,7 @@ void main() { return icon; } - testWidgetsWithLeakTracking('responds to taps', (WidgetTester tester) async { + testWidgets('responds to taps', (WidgetTester tester) async { bool wasPressed = false; await tester.pumpWidget(getApp(onPressed: () { wasPressed = true; @@ -83,7 +82,7 @@ void main() { expect(wasPressed, true); }); - testWidgetsWithLeakTracking('turns grey when pressed and held', (WidgetTester tester) async { + testWidgets('turns grey when pressed and held', (WidgetTester tester) async { await tester.pumpWidget(getApp()); expect(find.byType(CupertinoContextMenuAction), paints..rect(color: kBackgroundColor.color)); @@ -118,27 +117,27 @@ void main() { paints..rect(color: kBackgroundColor.darkColor)); }); - testWidgetsWithLeakTracking('icon and textStyle colors are correct out of the box', + testWidgets('icon and textStyle colors are correct out of the box', (WidgetTester tester) async { await tester.pumpWidget(getApp()); expect(getTextStyle(tester).color, CupertinoColors.label); expect(getIcon(tester).color, CupertinoColors.label); }); - testWidgetsWithLeakTracking('icon and textStyle colors are correct for destructive actions', + testWidgets('icon and textStyle colors are correct for destructive actions', (WidgetTester tester) async { await tester.pumpWidget(getApp(isDestructiveAction: true)); expect(getTextStyle(tester).color, kDestructiveActionColor); expect(getIcon(tester).color, kDestructiveActionColor); }); - testWidgetsWithLeakTracking('textStyle is correct for defaultAction', + testWidgets('textStyle is correct for defaultAction', (WidgetTester tester) async { await tester.pumpWidget(getApp(isDefaultAction: true)); expect(getTextStyle(tester).fontWeight, kDefaultActionWeight); }); - testWidgetsWithLeakTracking( + testWidgets( 'Hovering over Cupertino context menu action updates cursor to clickable on Web', (WidgetTester tester) async { /// Cupertino context menu action without "onPressed" callback. diff --git a/packages/flutter/test/cupertino/context_menu_test.dart b/packages/flutter/test/cupertino/context_menu_test.dart index 8b789cab086..bc1dd8bd56b 100644 --- a/packages/flutter/test/cupertino/context_menu_test.dart +++ b/packages/flutter/test/cupertino/context_menu_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized(); @@ -121,7 +120,7 @@ void main() { } group('CupertinoContextMenu before and during opening', () { - testWidgetsWithLeakTracking('An unopened CupertinoContextMenu renders child in the same place as without', (WidgetTester tester) async { + testWidgets('An unopened CupertinoContextMenu renders child in the same place as without', (WidgetTester tester) async { // Measure the child in the scene with no CupertinoContextMenu. final Widget child = getChild(); await tester.pumpWidget( @@ -141,7 +140,7 @@ void main() { expect(tester.getRect(find.byWidget(child)), childRect); }); - testWidgetsWithLeakTracking('Can open CupertinoContextMenu by tap and hold', (WidgetTester tester) async { + testWidgets('Can open CupertinoContextMenu by tap and hold', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); expect(find.byWidget(child), findsOneWidget); @@ -177,7 +176,7 @@ void main() { expect(findStatic(), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoContextMenu is in the correct position when within a nested navigator', (WidgetTester tester) async { + testWidgets('CupertinoContextMenu is in the correct position when within a nested navigator', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(CupertinoApp( home: CupertinoPageScaffold( @@ -242,7 +241,7 @@ void main() { expect(findStatic(), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoContextMenu with a basic builder opens and closes the same as when providing a child', (WidgetTester tester) async { + testWidgets('CupertinoContextMenu with a basic builder opens and closes the same as when providing a child', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getBuilderContextMenu(builder: (BuildContext context, Animation<double> animation) { return child; @@ -280,7 +279,7 @@ void main() { expect(findStatic(), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoContextMenu with a builder can change the animation', (WidgetTester tester) async { + testWidgets('CupertinoContextMenu with a builder can change the animation', (WidgetTester tester) async { await tester.pumpWidget(getBuilderContextMenu(builder: (BuildContext context, Animation<double> animation) { return Container( width: 300.0, @@ -325,7 +324,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Hovering over Cupertino context menu updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino context menu updates cursor to clickable on Web', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(CupertinoApp( home: CupertinoPageScaffold( @@ -356,7 +355,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CupertinoContextMenu is in the correct position when within a Transform.scale', (WidgetTester tester) async { + testWidgets('CupertinoContextMenu is in the correct position when within a Transform.scale', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(CupertinoApp( home: CupertinoPageScaffold( @@ -414,7 +413,7 @@ void main() { }); group('CupertinoContextMenu when open', () { - testWidgetsWithLeakTracking('Last action does not have border', (WidgetTester tester) async { + testWidgets('Last action does not have border', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(CupertinoApp( home: CupertinoPageScaffold( @@ -473,7 +472,7 @@ void main() { expect(findStaticChildDecoration(tester), findsNWidgets(3)); }); - testWidgetsWithLeakTracking('Can close CupertinoContextMenu by background tap', (WidgetTester tester) async { + testWidgets('Can close CupertinoContextMenu by background tap', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); @@ -491,7 +490,7 @@ void main() { expect(findStatic(), findsNothing); }); - testWidgetsWithLeakTracking('Can close CupertinoContextMenu by dragging down', (WidgetTester tester) async { + testWidgets('Can close CupertinoContextMenu by dragging down', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); @@ -533,7 +532,7 @@ void main() { expect(findStatic(), findsNothing); }); - testWidgetsWithLeakTracking('Can close CupertinoContextMenu by flinging down', (WidgetTester tester) async { + testWidgets('Can close CupertinoContextMenu by flinging down', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); @@ -558,7 +557,7 @@ void main() { expect(findStatic(), findsNothing); }); - testWidgetsWithLeakTracking("Backdrop is added using ModalRoute's filter parameter", (WidgetTester tester) async { + testWidgets("Backdrop is added using ModalRoute's filter parameter", (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); expect(find.byType(BackdropFilter), findsNothing); @@ -573,7 +572,7 @@ void main() { expect(find.byType(BackdropFilter), findsOneWidget); }); - testWidgetsWithLeakTracking('Preview widget should have the correct border radius', (WidgetTester tester) async { + testWidgets('Preview widget should have the correct border radius', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); @@ -591,7 +590,7 @@ void main() { expect(previewWidget.borderRadius, equals(BorderRadius.circular(12.0))); }); - testWidgetsWithLeakTracking('CupertinoContextMenu width is correct', (WidgetTester tester) async { + testWidgets('CupertinoContextMenu width is correct', (WidgetTester tester) async { final Widget child = getChild(); await tester.pumpWidget(getContextMenu(child: child)); expect(find.byWidget(child), findsOneWidget); @@ -634,7 +633,7 @@ void main() { } }); - testWidgetsWithLeakTracking("ContextMenu route animation doesn't throw exception on dismiss", (WidgetTester tester) async { + testWidgets("ContextMenu route animation doesn't throw exception on dismiss", (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/124597. final List<int> items = List<int>.generate(2, (int index) => index).toList(); @@ -681,7 +680,7 @@ void main() { }); group("Open layout differs depending on child's position on screen", () { - testWidgetsWithLeakTracking('Portrait', (WidgetTester tester) async { + testWidgets('Portrait', (WidgetTester tester) async { const Size portraitScreenSize = Size(600.0, 800.0); await binding.setSurfaceSize(portraitScreenSize); @@ -753,7 +752,7 @@ void main() { await binding.setSurfaceSize(const Size(800.0, 600.0)); }); - testWidgetsWithLeakTracking('Landscape', (WidgetTester tester) async { + testWidgets('Landscape', (WidgetTester tester) async { // Pump a CupertinoContextMenu in the center of the screen and open it. final Widget child = getChild(); await tester.pumpWidget(getContextMenu( @@ -818,7 +817,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Conflicting gesture detectors', (WidgetTester tester) async { + testWidgets('Conflicting gesture detectors', (WidgetTester tester) async { int? onPointerDownTime; int? onPointerUpTime; bool insideTapTriggered = false; diff --git a/packages/flutter/test/cupertino/date_picker_test.dart b/packages/flutter/test/cupertino/date_picker_test.dart index 944c2aabce1..7656623ebe0 100644 --- a/packages/flutter/test/cupertino/date_picker_test.dart +++ b/packages/flutter/test/cupertino/date_picker_test.dart @@ -14,7 +14,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // TODO(yjbanov): on the web text rendered with perspective produces flaky goldens: https://github.com/flutter/flutter/issues/110785 const bool skipPerspectiveTextGoldens = isBrowser; @@ -28,7 +27,7 @@ const Offset _kRowOffset = Offset(0.0, -50.0); void main() { group('Countdown timer picker', () { - testWidgetsWithLeakTracking('initialTimerDuration falls within limit', (WidgetTester tester) async { + testWidgets('initialTimerDuration falls within limit', (WidgetTester tester) async { expect( () { CupertinoTimerPicker( @@ -50,7 +49,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('minuteInterval is positive and is a factor of 60', (WidgetTester tester) async { + testWidgets('minuteInterval is positive and is a factor of 60', (WidgetTester tester) async { expect( () { CupertinoTimerPicker( @@ -80,7 +79,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('secondInterval is positive and is a factor of 60', (WidgetTester tester) async { + testWidgets('secondInterval is positive and is a factor of 60', (WidgetTester tester) async { expect( () { CupertinoTimerPicker( @@ -110,7 +109,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('background color default value', (WidgetTester tester) async { + testWidgets('background color default value', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTimerPicker( @@ -123,7 +122,7 @@ void main() { expect(pickers.any((CupertinoPicker picker) => picker.backgroundColor != null), false); }); - testWidgetsWithLeakTracking('background color can be null', (WidgetTester tester) async { + testWidgets('background color can be null', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTimerPicker( @@ -135,7 +134,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('specified background color is applied', (WidgetTester tester) async { + testWidgets('specified background color is applied', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTimerPicker( @@ -149,7 +148,7 @@ void main() { expect(pickers.any((CupertinoPicker picker) => picker.backgroundColor != CupertinoColors.black), false); }); - testWidgetsWithLeakTracking('specified item extent value is applied', (WidgetTester tester) async { + testWidgets('specified item extent value is applied', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTimerPicker( @@ -163,7 +162,7 @@ void main() { expect(pickers.any((CupertinoPicker picker) => picker.itemExtent != 42), false); }); - testWidgetsWithLeakTracking('columns are ordered correctly when text direction is ltr', (WidgetTester tester) async { + testWidgets('columns are ordered correctly when text direction is ltr', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTimerPicker( @@ -190,7 +189,7 @@ void main() { expect(tester.getTopLeft(find.text('sec.')).dx > lastOffset.dx, true); }); - testWidgetsWithLeakTracking('columns are ordered correctly when text direction is rtl', (WidgetTester tester) async { + testWidgets('columns are ordered correctly when text direction is rtl', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Directionality( @@ -220,7 +219,7 @@ void main() { expect(tester.getTopLeft(find.text('sec.')).dx > lastOffset.dx, false); }); - testWidgetsWithLeakTracking('width of picker is consistent', (WidgetTester tester) async { + testWidgets('width of picker is consistent', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: SizedBox( @@ -258,7 +257,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('picker honors minuteInterval and secondInterval', (WidgetTester tester) async { + testWidgets('picker honors minuteInterval and secondInterval', (WidgetTester tester) async { late Duration duration; await tester.pumpWidget( CupertinoApp( @@ -289,14 +288,14 @@ void main() { }); group('Date picker', () { - testWidgetsWithLeakTracking('initial date is set to default value', (WidgetTester tester) async { + testWidgets('initial date is set to default value', (WidgetTester tester) async { final CupertinoDatePicker picker = CupertinoDatePicker( onDateTimeChanged: (_) { }, ); expect(picker.initialDateTime, isNotNull); }); - testWidgetsWithLeakTracking('background color default value', (WidgetTester tester) async { + testWidgets('background color default value', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoDatePicker( @@ -309,7 +308,7 @@ void main() { expect(pickers.any((CupertinoPicker picker) => picker.backgroundColor != null), false); }); - testWidgetsWithLeakTracking('background color can be null', (WidgetTester tester) async { + testWidgets('background color can be null', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoDatePicker( @@ -321,7 +320,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('specified background color is applied', (WidgetTester tester) async { + testWidgets('specified background color is applied', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoDatePicker( @@ -335,7 +334,7 @@ void main() { expect(pickers.any((CupertinoPicker picker) => picker.backgroundColor != CupertinoColors.black), false); }); - testWidgetsWithLeakTracking('specified item extent value is applied', (WidgetTester tester) async { + testWidgets('specified item extent value is applied', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoDatePicker( @@ -349,7 +348,7 @@ void main() { expect(pickers.any((CupertinoPicker picker) => picker.itemExtent != 55), false); }); - testWidgetsWithLeakTracking('initial date honors minuteInterval', (WidgetTester tester) async { + testWidgets('initial date honors minuteInterval', (WidgetTester tester) async { late DateTime newDateTime; await tester.pumpWidget( CupertinoApp( @@ -398,7 +397,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('changing initialDateTime after first build does not do anything', (WidgetTester tester) async { + testWidgets('changing initialDateTime after first build does not do anything', (WidgetTester tester) async { late DateTime selectedDateTime; await tester.pumpWidget( CupertinoApp( @@ -445,7 +444,7 @@ void main() { expect(selectedDateTime, DateTime(2018, 1, 1, 8, 30)); }); - testWidgetsWithLeakTracking('date picker has expected string', (WidgetTester tester) async { + testWidgets('date picker has expected string', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -467,7 +466,7 @@ void main() { expect(find.text('2018'), findsOneWidget); }); - testWidgetsWithLeakTracking('datetime picker has expected string', (WidgetTester tester) async { + testWidgets('datetime picker has expected string', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -489,7 +488,7 @@ void main() { expect(find.text('AM'), findsOneWidget); }); - testWidgetsWithLeakTracking('monthYear picker has expected string', (WidgetTester tester) async { + testWidgets('monthYear picker has expected string', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -510,7 +509,7 @@ void main() { expect(find.text('2018'), findsOneWidget); }); - testWidgetsWithLeakTracking('width of picker in date and time mode is consistent', (WidgetTester tester) async { + testWidgets('width of picker in date and time mode is consistent', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Directionality( @@ -549,7 +548,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('width of picker in date mode is consistent', (WidgetTester tester) async { + testWidgets('width of picker in date mode is consistent', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -593,7 +592,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('width of picker in time mode is consistent', (WidgetTester tester) async { + testWidgets('width of picker in time mode is consistent', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -637,7 +636,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('width of picker in monthYear mode is consistent', (WidgetTester tester) async { + testWidgets('width of picker in monthYear mode is consistent', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -681,7 +680,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('wheel does not bend outwards', (WidgetTester tester) async { + testWidgets('wheel does not bend outwards', (WidgetTester tester) async { final Widget dateWidget = CupertinoDatePicker( mode: CupertinoDatePickerMode.date, @@ -746,7 +745,7 @@ void main() { } }); - testWidgetsWithLeakTracking('picker automatically scrolls away from invalid date on month change', (WidgetTester tester) async { + testWidgets('picker automatically scrolls away from invalid date on month change', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -787,7 +786,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'date picker automatically scrolls away from invalid date, ' "and onDateTimeChanged doesn't report these dates", (WidgetTester tester) async { @@ -855,7 +854,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'dateTime picker automatically scrolls away from invalid date, ' "and onDateTimeChanged doesn't report these dates", (WidgetTester tester) async { @@ -932,7 +931,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'time picker automatically scrolls away from invalid date, ' "and onDateTimeChanged doesn't report these dates", (WidgetTester tester) async { @@ -1010,7 +1009,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'monthYear picker automatically scrolls away from invalid date, ' "and onDateTimeChanged doesn't report these dates", (WidgetTester tester) async { @@ -1069,7 +1068,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('picker automatically scrolls away from invalid date on day change', (WidgetTester tester) async { + testWidgets('picker automatically scrolls away from invalid date on day change', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -1123,7 +1122,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'date picker should only take into account the date part of minimumDate and maximumDate', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/49606. @@ -1156,7 +1155,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('date picker does not display previous day of minimumDate if it is set at midnight', (WidgetTester tester) async { + testWidgets('date picker does not display previous day of minimumDate if it is set at midnight', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/72932 final DateTime minDate = DateTime(2019, 12, 31); await tester.pumpWidget( @@ -1180,7 +1179,7 @@ void main() { group('Picker handles initial noon/midnight times', () { - testWidgetsWithLeakTracking('midnight', (WidgetTester tester) async { + testWidgets('midnight', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -1208,7 +1207,7 @@ void main() { expect(date, DateTime(2019, 1, 1, 0, 16)); }); - testWidgetsWithLeakTracking('noon', (WidgetTester tester) async { + testWidgets('noon', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -1236,7 +1235,7 @@ void main() { expect(date, DateTime(2019, 1, 1, 12, 16)); }); - testWidgetsWithLeakTracking('noon in 24 hour time', (WidgetTester tester) async { + testWidgets('noon in 24 hour time', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -1266,7 +1265,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('picker persists am/pm value when scrolling hours', (WidgetTester tester) async { + testWidgets('picker persists am/pm value when scrolling hours', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -1315,7 +1314,7 @@ void main() { expect(date, DateTime(2019, 1, 1, 3)); }); - testWidgetsWithLeakTracking('picker automatically scrolls the am/pm column when the hour column changes enough', (WidgetTester tester) async { + testWidgets('picker automatically scrolls the am/pm column when the hour column changes enough', (WidgetTester tester) async { late DateTime date; await tester.pumpWidget( CupertinoApp( @@ -1366,7 +1365,7 @@ void main() { expect(date, DateTime(2018, 1, 1, 15, 59)); }); - testWidgetsWithLeakTracking('date picker given too narrow space horizontally shows message', (WidgetTester tester) async { + testWidgets('date picker given too narrow space horizontally shows message', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -1390,7 +1389,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DatePicker golden tests', (WidgetTester tester) async { + testWidgets('DatePicker golden tests', (WidgetTester tester) async { Widget buildApp(CupertinoDatePickerMode mode) { return CupertinoApp( home: Center( @@ -1454,7 +1453,7 @@ void main() { } }); - testWidgetsWithLeakTracking('DatePicker displays the date in correct order', (WidgetTester tester) async { + testWidgets('DatePicker displays the date in correct order', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -1483,7 +1482,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('monthYear DatePicker displays the date in correct order', (WidgetTester tester) async { + testWidgets('monthYear DatePicker displays the date in correct order', (WidgetTester tester) async { Widget buildApp(DatePickerDateOrder order) { return CupertinoApp( home: Center( @@ -1527,7 +1526,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DatePicker displays hours and minutes correctly in RTL', (WidgetTester tester) async { + testWidgets('DatePicker displays hours and minutes correctly in RTL', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Directionality( @@ -1552,7 +1551,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('TimerPicker golden tests', (WidgetTester tester) async { + testWidgets('TimerPicker golden tests', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( // Also check if the picker respects the theme. @@ -1599,7 +1598,7 @@ void main() { } }); - testWidgetsWithLeakTracking('TimerPicker only changes hour label after scrolling stops', (WidgetTester tester) async { + testWidgets('TimerPicker only changes hour label after scrolling stops', (WidgetTester tester) async { Duration? duration; await tester.pumpWidget( CupertinoApp( @@ -1634,7 +1633,7 @@ void main() { expect(find.text('hour'), findsOneWidget); }); - testWidgetsWithLeakTracking('TimerPicker has intrinsic width and height', (WidgetTester tester) async { + testWidgets('TimerPicker has intrinsic width and height', (WidgetTester tester) async { const Key key = Key('key'); await tester.pumpWidget( @@ -1680,7 +1679,7 @@ void main() { expect(tester.getSize(find.descendant(of: find.byKey(key), matching: find.byType(Row))), const Size(342, 216)); }); - testWidgetsWithLeakTracking('scrollController can be removed or added', (WidgetTester tester) async { + testWidgets('scrollController can be removed or added', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); late int lastSelectedItem; void onSelectedItemChanged(int index) { @@ -1719,7 +1718,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('CupertinoDataPicker does not provide invalid MediaQuery', (WidgetTester tester) async { + testWidgets('CupertinoDataPicker does not provide invalid MediaQuery', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/47989. Brightness brightness = Brightness.light; late StateSetter setState; @@ -1764,7 +1763,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('picker exports semantics', (WidgetTester tester) async { + testWidgets('picker exports semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); debugResetSemanticsIdCounter(); int? lastSelectedItem; @@ -1803,7 +1802,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/98567 - testWidgetsWithLeakTracking('picker semantics action test', (WidgetTester tester) async { + testWidgets('picker semantics action test', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); debugResetSemanticsIdCounter(); final DateTime initialDate = DateTime(2018, 6, 8); @@ -1833,7 +1832,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('DatePicker adapts to MaterialApp dark mode', (WidgetTester tester) async { + testWidgets('DatePicker adapts to MaterialApp dark mode', (WidgetTester tester) async { Widget buildDatePicker(Brightness brightness) { return MaterialApp( theme: ThemeData(brightness: brightness), @@ -1860,7 +1859,7 @@ void main() { expect(paragraph.text.style!.color.toString().contains('UNRESOLVED'), isFalse); }); - testWidgetsWithLeakTracking('TimerPicker adapts to MaterialApp dark mode', (WidgetTester tester) async { + testWidgets('TimerPicker adapts to MaterialApp dark mode', (WidgetTester tester) async { Widget buildTimerPicker(Brightness brightness) { return MaterialApp( theme: ThemeData(brightness: brightness), @@ -1887,7 +1886,7 @@ void main() { expect(paragraph.text.style!.color.toString().contains('UNRESOLVED'), isFalse); }); - testWidgetsWithLeakTracking('TimerPicker minDate - maxDate with minuteInterval', (WidgetTester tester) async { + testWidgets('TimerPicker minDate - maxDate with minuteInterval', (WidgetTester tester) async { late DateTime date; final DateTime minimum = DateTime(2022, 6, 14, 3, 31); final DateTime initial = DateTime(2022, 6, 14, 3, 40); @@ -1934,7 +1933,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('date picker has expected day of week', (WidgetTester tester) async { + testWidgets('date picker has expected day of week', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( diff --git a/packages/flutter/test/cupertino/debug_test.dart b/packages/flutter/test/cupertino/debug_test.dart index f392a5a59ff..85dca9e4045 100644 --- a/packages/flutter/test/cupertino/debug_test.dart +++ b/packages/flutter/test/cupertino/debug_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('debugCheckHasCupertinoLocalizations throws', (WidgetTester tester) async { + testWidgets('debugCheckHasCupertinoLocalizations throws', (WidgetTester tester) async { final GlobalKey noLocalizationsAvailable = GlobalKey(); final GlobalKey localizationsAvailable = GlobalKey(); diff --git a/packages/flutter/test/cupertino/desktop_text_selection_toolbar_button_test.dart b/packages/flutter/test/cupertino/desktop_text_selection_toolbar_button_test.dart index 107caba6f0e..4ca0433e3cf 100644 --- a/packages/flutter/test/cupertino/desktop_text_selection_toolbar_button_test.dart +++ b/packages/flutter/test/cupertino/desktop_text_selection_toolbar_button_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('can press', (WidgetTester tester) async { + testWidgets('can press', (WidgetTester tester) async { bool pressed = false; await tester.pumpWidget( CupertinoApp( @@ -31,7 +30,7 @@ void main() { expect(pressed, true); }); - testWidgetsWithLeakTracking('keeps contrast with background on hover', + testWidgets('keeps contrast with background on hover', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( @@ -71,7 +70,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('pressedOpacity defaults to 0.1', (WidgetTester tester) async { + testWidgets('pressedOpacity defaults to 0.1', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -115,7 +114,7 @@ void main() { expect(opacity.opacity.value, 1.0); }); - testWidgetsWithLeakTracking('passing null to onPressed disables the button', (WidgetTester tester) async { + testWidgets('passing null to onPressed disables the button', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( diff --git a/packages/flutter/test/cupertino/desktop_text_selection_toolbar_test.dart b/packages/flutter/test/cupertino/desktop_text_selection_toolbar_test.dart index 3536d68de58..c3519e6a8ad 100644 --- a/packages/flutter/test/cupertino/desktop_text_selection_toolbar_test.dart +++ b/packages/flutter/test/cupertino/desktop_text_selection_toolbar_test.dart @@ -7,12 +7,11 @@ import 'dart:ui'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('has correct backdrop filters', (WidgetTester tester) async { + testWidgets('has correct backdrop filters', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -54,7 +53,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('has shadow', (WidgetTester tester) async { + testWidgets('has shadow', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -84,7 +83,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('is translucent', (WidgetTester tester) async { + testWidgets('is translucent', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -117,7 +116,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('positions itself at the anchor', (WidgetTester tester) async { + testWidgets('positions itself at the anchor', (WidgetTester tester) async { // An arbitrary point on the screen to position at. const Offset anchor = Offset(30.0, 40.0); diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index 770d28f8aa5..9e1b06b2939 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -15,12 +15,11 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Alert dialog control test', (WidgetTester tester) async { + testWidgets('Alert dialog control test', (WidgetTester tester) async { bool didDelete = false; await tester.pumpWidget( @@ -59,7 +58,7 @@ void main() { expect(find.text('Delete'), findsNothing); }); - testWidgetsWithLeakTracking('Dialog not barrier dismissible by default', (WidgetTester tester) async { + testWidgets('Dialog not barrier dismissible by default', (WidgetTester tester) async { await tester.pumpWidget(createAppWithCenteredButton(const Text('Go'))); final BuildContext context = tester.element(find.text('Go')); @@ -87,7 +86,7 @@ void main() { }); - testWidgetsWithLeakTracking('Dialog configurable to be barrier dismissible', (WidgetTester tester) async { + testWidgets('Dialog configurable to be barrier dismissible', (WidgetTester tester) async { await tester.pumpWidget(createAppWithCenteredButton(const Text('Go'))); final BuildContext context = tester.element(find.text('Go')); @@ -115,7 +114,7 @@ void main() { expect(find.text('Dialog'), findsNothing); }); - testWidgetsWithLeakTracking('Dialog destructive action style', (WidgetTester tester) async { + testWidgets('Dialog destructive action style', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(const CupertinoDialogAction( isDestructiveAction: true, child: Text('Ok'), @@ -126,7 +125,7 @@ void main() { expect(widget.style.color!.withAlpha(255), CupertinoColors.systemRed.color); }); - testWidgetsWithLeakTracking('Dialog default action style', (WidgetTester tester) async { + testWidgets('Dialog default action style', (WidgetTester tester) async { await tester.pumpWidget( CupertinoTheme( data: const CupertinoThemeData( @@ -143,7 +142,7 @@ void main() { expect(widget.style.color!.withAlpha(255), CupertinoColors.systemGreen.color); }); - testWidgetsWithLeakTracking('Dialog dark theme', (WidgetTester tester) async { + testWidgets('Dialog dark theme', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: MediaQuery( @@ -179,7 +178,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Has semantic annotations', (WidgetTester tester) async { + testWidgets('Has semantic annotations', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const MaterialApp(home: Material( child: CupertinoAlertDialog( @@ -251,7 +250,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Dialog default action style', (WidgetTester tester) async { + testWidgets('Dialog default action style', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(const CupertinoDialogAction( isDefaultAction: true, child: Text('Ok'), @@ -262,7 +261,7 @@ void main() { expect(widget.style.fontWeight, equals(FontWeight.w600)); }); - testWidgetsWithLeakTracking('Dialog default and destructive action styles', (WidgetTester tester) async { + testWidgets('Dialog default and destructive action styles', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(const CupertinoDialogAction( isDefaultAction: true, isDestructiveAction: true, @@ -275,7 +274,7 @@ void main() { expect(widget.style.fontWeight, equals(FontWeight.w600)); }); - testWidgetsWithLeakTracking('Dialog disabled action style', (WidgetTester tester) async { + testWidgets('Dialog disabled action style', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(const CupertinoDialogAction( child: Text('Ok'), ))); @@ -286,7 +285,7 @@ void main() { expect(widget.style.color!.opacity, lessThanOrEqualTo(128 / 255)); }); - testWidgetsWithLeakTracking('Dialog enabled action style', (WidgetTester tester) async { + testWidgets('Dialog enabled action style', (WidgetTester tester) async { await tester.pumpWidget(boilerplate(CupertinoDialogAction( child: const Text('Ok'), onPressed: () {}, @@ -297,7 +296,7 @@ void main() { expect(widget.style.color!.opacity, equals(1.0)); }); - testWidgetsWithLeakTracking('Message is scrollable, has correct padding with large text sizes', (WidgetTester tester) async { + testWidgets('Message is scrollable, has correct padding with large text sizes', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -354,7 +353,7 @@ void main() { expect(tester.getSize(find.widgetWithText(CupertinoDialogAction, 'OK')), equals(const Size(310.0, 98.0))); }); - testWidgetsWithLeakTracking('Dialog respects small constraints.', (WidgetTester tester) async { + testWidgets('Dialog respects small constraints.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -400,7 +399,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Button list is scrollable, has correct position with large text sizes.', (WidgetTester tester) async { + testWidgets('Button list is scrollable, has correct position with large text sizes.', (WidgetTester tester) async { final ScrollController actionScrollController = ScrollController(); addTearDown(actionScrollController.dispose); await tester.pumpWidget( @@ -461,7 +460,7 @@ void main() { expect(tester.getSize(find.widgetWithText(CupertinoDialogAction, 'Cancel')).height, equals(148.0)); }); - testWidgetsWithLeakTracking('Title Section is empty, Button section is not empty.', (WidgetTester tester) async { + testWidgets('Title Section is empty, Button section is not empty.', (WidgetTester tester) async { const double textScaleFactor = 1.0; final ScrollController actionScrollController = ScrollController(); addTearDown(actionScrollController.dispose); @@ -515,7 +514,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Button section is empty, Title section is not empty.', (WidgetTester tester) async { + testWidgets('Button section is empty, Title section is not empty.', (WidgetTester tester) async { const double textScaleFactor = 1.0; final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -557,7 +556,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions section height for 1 button is height of button.', (WidgetTester tester) async { + testWidgets('Actions section height for 1 button is height of button.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -587,7 +586,7 @@ void main() { expect(okButtonBox.size.height, actionsSectionBox.size.height); }); - testWidgetsWithLeakTracking('Actions section height for 2 side-by-side buttons is height of tallest button.', (WidgetTester tester) async { + testWidgets('Actions section height for 2 side-by-side buttons is height of tallest button.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); late double dividerWidth; // Will be set when the dialog builder runs. Needs a BuildContext. @@ -633,7 +632,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions section height for 2 stacked buttons with enough room is height of both buttons.', (WidgetTester tester) async { + testWidgets('Actions section height for 2 stacked buttons with enough room is height of both buttons.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); const double dividerThickness = 0.3; @@ -675,7 +674,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions section height for 2 stacked buttons without enough room and regular font is 1.5 buttons tall.', (WidgetTester tester) async { + testWidgets('Actions section height for 2 stacked buttons without enough room and regular font is 1.5 buttons tall.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -710,7 +709,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions section height for 2 stacked buttons without enough room and large accessibility font is 50% of dialog height.', (WidgetTester tester) async { + testWidgets('Actions section height for 2 stacked buttons without enough room and large accessibility font is 50% of dialog height.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -751,7 +750,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions section height for 3 buttons without enough room is 1.5 buttons tall.', (WidgetTester tester) async { + testWidgets('Actions section height for 3 buttons without enough room is 1.5 buttons tall.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -796,7 +795,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions section overscroll is painted white.', (WidgetTester tester) async { + testWidgets('Actions section overscroll is painted white.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -845,7 +844,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Pressed button changes appearance and dividers disappear.', (WidgetTester tester) async { + testWidgets('Pressed button changes appearance and dividers disappear.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); const double dividerThickness = 0.3; @@ -958,7 +957,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('ScaleTransition animation for showCupertinoDialog()', (WidgetTester tester) async { + testWidgets('ScaleTransition animation for showCupertinoDialog()', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -1036,7 +1035,7 @@ void main() { expect(find.byType(Transform), findsNothing); }); - testWidgetsWithLeakTracking('FadeTransition animation for showCupertinoDialog()', (WidgetTester tester) async { + testWidgets('FadeTransition animation for showCupertinoDialog()', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -1129,7 +1128,7 @@ void main() { expect(transition.opacity.value, moreOrLessEquals(0.0, epsilon: 0.001)); }); - testWidgetsWithLeakTracking('Actions are accessible by key', (WidgetTester tester) async { + testWidgets('Actions are accessible by key', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesDialog( dialogBuilder: (BuildContext context) { @@ -1159,7 +1158,7 @@ void main() { expect(find.byKey(const Key('option_3')), findsNothing); }); - testWidgetsWithLeakTracking('Dialog widget insets by MediaQuery viewInsets', (WidgetTester tester) async { + testWidgets('Dialog widget insets by MediaQuery viewInsets', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: MediaQuery( @@ -1189,7 +1188,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder)), placeholderRectWithoutInsets.translate(10, 10)); }); - testWidgetsWithLeakTracking('Material2 - Default cupertino dialog golden', (WidgetTester tester) async { + testWidgets('Material2 - Default cupertino dialog golden', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesDialog( useMaterial3: false, @@ -1220,7 +1219,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Default cupertino dialog golden', (WidgetTester tester) async { + testWidgets('Material3 - Default cupertino dialog golden', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesDialog( useMaterial3: true, @@ -1251,7 +1250,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('showCupertinoDialog - custom barrierLabel', (WidgetTester tester) async { + testWidgets('showCupertinoDialog - custom barrierLabel', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1291,7 +1290,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('CupertinoDialogRoute is state restorable', (WidgetTester tester) async { + testWidgets('CupertinoDialogRoute is state restorable', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( restorationScopeId: 'app', @@ -1321,7 +1320,7 @@ void main() { expect(find.byType(CupertinoAlertDialog), findsOneWidget); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('Conflicting scrollbars are not applied by ScrollBehavior to CupertinoAlertDialog', (WidgetTester tester) async { + testWidgets('Conflicting scrollbars are not applied by ScrollBehavior to CupertinoAlertDialog', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/83819 const double textScaleFactor = 1.0; final ScrollController actionScrollController = ScrollController(); @@ -1361,7 +1360,7 @@ void main() { expect(find.byType(CupertinoScrollbar), findsNWidgets(2)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('CupertinoAlertDialog scrollbars controllers should be different', (WidgetTester tester) async { + testWidgets('CupertinoAlertDialog scrollbars controllers should be different', (WidgetTester tester) async { // https://github.com/flutter/flutter/pull/81278 await tester.pumpWidget( const MaterialApp( @@ -1388,7 +1387,7 @@ void main() { }); group('showCupertinoDialog avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning using anchorPoint', (WidgetTester tester) async { + testWidgets('positioning using anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -1426,7 +1425,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning using Directionality', (WidgetTester tester) async { + testWidgets('positioning using Directionality', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -1466,7 +1465,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('default positioning', (WidgetTester tester) async { + testWidgets('default positioning', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -1504,7 +1503,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Hovering over Cupertino alert dialog action updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino alert dialog action updates cursor to clickable on Web', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesDialog( dialogBuilder: (BuildContext context) { diff --git a/packages/flutter/test/cupertino/form_row_test.dart b/packages/flutter/test/cupertino/form_row_test.dart index 926f0002f91..9cb079905a6 100644 --- a/packages/flutter/test/cupertino/form_row_test.dart +++ b/packages/flutter/test/cupertino/form_row_test.dart @@ -6,10 +6,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Shows prefix', (WidgetTester tester) async { + testWidgets('Shows prefix', (WidgetTester tester) async { const Widget prefix = Text('Enter Value'); await tester.pumpWidget( @@ -26,7 +25,7 @@ void main() { expect(prefix, tester.widget(find.byType(Text))); }); - testWidgetsWithLeakTracking('Shows child', (WidgetTester tester) async { + testWidgets('Shows child', (WidgetTester tester) async { const Widget child = CupertinoTextField(); await tester.pumpWidget( @@ -42,7 +41,7 @@ void main() { expect(child, tester.widget(find.byType(CupertinoTextField))); }); - testWidgetsWithLeakTracking('RTL puts prefix after child', (WidgetTester tester) async { + testWidgets('RTL puts prefix after child', (WidgetTester tester) async { const Widget prefix = Text('Enter Value'); const Widget child = CupertinoTextField(); @@ -63,7 +62,7 @@ void main() { expect(tester.getTopLeft(find.byType(Text)).dx > tester.getTopLeft(find.byType(CupertinoTextField)).dx, true); }); - testWidgetsWithLeakTracking('LTR puts child after prefix', (WidgetTester tester) async { + testWidgets('LTR puts child after prefix', (WidgetTester tester) async { const Widget prefix = Text('Enter Value'); const Widget child = CupertinoTextField(); @@ -84,7 +83,7 @@ void main() { expect(tester.getTopLeft(find.byType(Text)).dx > tester.getTopLeft(find.byType(CupertinoTextField)).dx, false); }); - testWidgetsWithLeakTracking('Shows error widget', (WidgetTester tester) async { + testWidgets('Shows error widget', (WidgetTester tester) async { const Widget error = Text('Error'); await tester.pumpWidget( @@ -101,7 +100,7 @@ void main() { expect(error, tester.widget(find.byType(Text))); }); - testWidgetsWithLeakTracking('Shows helper widget', (WidgetTester tester) async { + testWidgets('Shows helper widget', (WidgetTester tester) async { const Widget helper = Text('Helper'); await tester.pumpWidget( @@ -118,7 +117,7 @@ void main() { expect(helper, tester.widget(find.byType(Text))); }); - testWidgetsWithLeakTracking('Shows helper text above error text', (WidgetTester tester) async { + testWidgets('Shows helper text above error text', (WidgetTester tester) async { const Widget helper = Text('Helper'); const Widget error = CupertinoActivityIndicator(); @@ -140,7 +139,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Shows helper in label color and error text in red color', (WidgetTester tester) async { + testWidgets('Shows helper in label color and error text in red color', (WidgetTester tester) async { const Widget helper = Text('Helper'); const Widget error = Text('Error'); @@ -167,7 +166,7 @@ void main() { expect(errorTextStyle.style.color, CupertinoColors.destructiveRed); }); - testWidgetsWithLeakTracking('CupertinoFormRow adapts to MaterialApp dark mode', (WidgetTester tester) async { + testWidgets('CupertinoFormRow adapts to MaterialApp dark mode', (WidgetTester tester) async { const Widget prefix = Text('Prefix'); const Widget helper = Text('Helper'); diff --git a/packages/flutter/test/cupertino/form_section_test.dart b/packages/flutter/test/cupertino/form_section_test.dart index 1909e68b1c8..fd7bc887ef6 100644 --- a/packages/flutter/test/cupertino/form_section_test.dart +++ b/packages/flutter/test/cupertino/form_section_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Shows header', (WidgetTester tester) async { + testWidgets('Shows header', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -23,7 +22,7 @@ void main() { expect(find.text('Header'), findsOneWidget); }); - testWidgetsWithLeakTracking('Shows footer', (WidgetTester tester) async { + testWidgets('Shows footer', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -38,7 +37,7 @@ void main() { expect(find.text('Footer'), findsOneWidget); }); - testWidgetsWithLeakTracking('Shows long dividers in edge-to-edge section part 1', (WidgetTester tester) async { + testWidgets('Shows long dividers in edge-to-edge section part 1', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -55,7 +54,7 @@ void main() { expect(childrenColumn.children.length, 3); }); - testWidgetsWithLeakTracking('Shows long dividers in edge-to-edge section part 2', (WidgetTester tester) async { + testWidgets('Shows long dividers in edge-to-edge section part 2', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -76,7 +75,7 @@ void main() { expect(childrenColumn.children.length, 5); }); - testWidgetsWithLeakTracking('Does not show long dividers in insetGrouped section part 1', (WidgetTester tester) async { + testWidgets('Does not show long dividers in insetGrouped section part 1', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -94,7 +93,7 @@ void main() { expect(childrenColumn.children.length, 1); }); - testWidgetsWithLeakTracking('Does not show long dividers in insetGrouped section part 2', (WidgetTester tester) async { + testWidgets('Does not show long dividers in insetGrouped section part 2', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( restorationScopeId: 'App', @@ -116,7 +115,7 @@ void main() { expect(childrenColumn.children.length, 3); }); - testWidgetsWithLeakTracking('Sets background color for section', (WidgetTester tester) async { + testWidgets('Sets background color for section', (WidgetTester tester) async { const Color backgroundColor = CupertinoColors.systemBlue; await tester.pumpWidget( @@ -139,7 +138,7 @@ void main() { expect(boxDecoration.color, backgroundColor); }); - testWidgetsWithLeakTracking('Setting clipBehavior clips children section', (WidgetTester tester) async { + testWidgets('Setting clipBehavior clips children section', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -154,7 +153,7 @@ void main() { expect(find.byType(ClipRRect), findsOneWidget); }); - testWidgetsWithLeakTracking('Not setting clipBehavior does not produce a RenderClipRRect object', (WidgetTester tester) async { + testWidgets('Not setting clipBehavior does not produce a RenderClipRRect object', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -169,7 +168,7 @@ void main() { expect(renderClips, isEmpty); }); - testWidgetsWithLeakTracking('Does not double up padding on header', (WidgetTester tester) async { + testWidgets('Does not double up padding on header', (WidgetTester tester) async { const Widget header = Text('Header'); await tester.pumpWidget( @@ -186,7 +185,7 @@ void main() { expect(tester.getTopLeft(find.byWidget(header)), const Offset(20, 22)); }); - testWidgetsWithLeakTracking('Does not double up padding on footer', (WidgetTester tester) async { + testWidgets('Does not double up padding on footer', (WidgetTester tester) async { const Widget footer = Text('Footer'); await tester.pumpWidget( @@ -203,7 +202,7 @@ void main() { expect(tester.getTopLeft(find.byWidget(footer)), offsetMoreOrLessEquals(const Offset(20, 65), epsilon: 1)); }); - testWidgetsWithLeakTracking('Sets custom margin', (WidgetTester tester) async { + testWidgets('Sets custom margin', (WidgetTester tester) async { final Widget child = CupertinoTextFormFieldRow(); const double margin = 35; diff --git a/packages/flutter/test/cupertino/icon_theme_data_test.dart b/packages/flutter/test/cupertino/icon_theme_data_test.dart index 30d107464aa..785d1714eb0 100644 --- a/packages/flutter/test/cupertino/icon_theme_data_test.dart +++ b/packages/flutter/test/cupertino/icon_theme_data_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('IconTheme.of works', (WidgetTester tester) async { + testWidgets('IconTheme.of works', (WidgetTester tester) async { const IconThemeData data = IconThemeData( size: 16.0, fill: 0.0, diff --git a/packages/flutter/test/cupertino/list_section_test.dart b/packages/flutter/test/cupertino/list_section_test.dart index 0f81a989779..00349e962d2 100644 --- a/packages/flutter/test/cupertino/list_section_test.dart +++ b/packages/flutter/test/cupertino/list_section_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('shows header', (WidgetTester tester) async { + testWidgets('shows header', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -24,7 +23,7 @@ void main() { expect(find.text('Header'), findsOneWidget); }); - testWidgetsWithLeakTracking('shows footer', (WidgetTester tester) async { + testWidgets('shows footer', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -41,7 +40,7 @@ void main() { expect(find.text('Footer'), findsOneWidget); }); - testWidgetsWithLeakTracking('shows long dividers in edge-to-edge section part 1', (WidgetTester tester) async { + testWidgets('shows long dividers in edge-to-edge section part 1', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -60,7 +59,7 @@ void main() { expect(childrenColumn.children.length, 3); }); - testWidgetsWithLeakTracking('shows long dividers in edge-to-edge section part 2', (WidgetTester tester) async { + testWidgets('shows long dividers in edge-to-edge section part 2', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -81,7 +80,7 @@ void main() { expect(childrenColumn.children.length, 5); }); - testWidgetsWithLeakTracking('does not show long dividers in insetGrouped section part 1', (WidgetTester tester) async { + testWidgets('does not show long dividers in insetGrouped section part 1', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -101,7 +100,7 @@ void main() { expect(childrenColumn.children.length, 1); }); - testWidgetsWithLeakTracking('does not show long dividers in insetGrouped section part 2', (WidgetTester tester) async { + testWidgets('does not show long dividers in insetGrouped section part 2', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -122,7 +121,7 @@ void main() { expect(childrenColumn.children.length, 3); }); - testWidgetsWithLeakTracking('sets background color for section', (WidgetTester tester) async { + testWidgets('sets background color for section', (WidgetTester tester) async { const Color backgroundColor = CupertinoColors.systemBlue; await tester.pumpWidget( @@ -145,7 +144,7 @@ void main() { expect(boxDecoration.color, backgroundColor); }); - testWidgetsWithLeakTracking('setting clipBehavior clips children section', (WidgetTester tester) async { + testWidgets('setting clipBehavior clips children section', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -162,7 +161,7 @@ void main() { expect(find.byType(ClipRRect), findsOneWidget); }); - testWidgetsWithLeakTracking('not setting clipBehavior does not clip children section', (WidgetTester tester) async { + testWidgets('not setting clipBehavior does not clip children section', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -178,7 +177,7 @@ void main() { expect(find.byType(ClipRRect), findsNothing); }); - testWidgetsWithLeakTracking('CupertinoListSection respects separatorColor', (WidgetTester tester) async { + testWidgets('CupertinoListSection respects separatorColor', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -201,7 +200,7 @@ void main() { } }); - testWidgetsWithLeakTracking('CupertinoListSection.separatorColor defaults CupertinoColors.separator', (WidgetTester tester) async { + testWidgets('CupertinoListSection.separatorColor defaults CupertinoColors.separator', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -224,7 +223,7 @@ void main() { } }); - testWidgetsWithLeakTracking('does not show margin by default', (WidgetTester tester) async { + testWidgets('does not show margin by default', (WidgetTester tester) async { const Widget child = CupertinoListTile(title: Text('CupertinoListTile')); await tester.pumpWidget( @@ -243,7 +242,7 @@ void main() { expect(tester.getTopLeft(find.byWidget(child)), offsetMoreOrLessEquals(const Offset(0, 41), epsilon: 1)); }); - testWidgetsWithLeakTracking('shows custom margin', (WidgetTester tester) async { + testWidgets('shows custom margin', (WidgetTester tester) async { const Widget child = CupertinoListTile(title: Text('CupertinoListTile')); const double margin = 10; diff --git a/packages/flutter/test/cupertino/list_tile_test.dart b/packages/flutter/test/cupertino/list_tile_test.dart index 0501613bbde..9ff90e82faa 100644 --- a/packages/flutter/test/cupertino/list_tile_test.dart +++ b/packages/flutter/test/cupertino/list_tile_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('shows title', (WidgetTester tester) async { + testWidgets('shows title', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); await tester.pumpWidget( @@ -24,7 +23,7 @@ void main() { expect(find.text('CupertinoListTile'), findsOneWidget); }); - testWidgetsWithLeakTracking('shows subtitle', (WidgetTester tester) async { + testWidgets('shows subtitle', (WidgetTester tester) async { const Widget subtitle = Text('CupertinoListTile subtitle'); await tester.pumpWidget( @@ -42,7 +41,7 @@ void main() { expect(find.text('CupertinoListTile subtitle'), findsOneWidget); }); - testWidgetsWithLeakTracking('shows additionalInfo', (WidgetTester tester) async { + testWidgets('shows additionalInfo', (WidgetTester tester) async { const Widget additionalInfo = Text('Not Connected'); await tester.pumpWidget( @@ -60,7 +59,7 @@ void main() { expect(find.text('Not Connected'), findsOneWidget); }); - testWidgetsWithLeakTracking('shows trailing', (WidgetTester tester) async { + testWidgets('shows trailing', (WidgetTester tester) async { const Widget trailing = CupertinoListTileChevron(); await tester.pumpWidget( @@ -77,7 +76,7 @@ void main() { expect(tester.widget<CupertinoListTileChevron>(find.byType(CupertinoListTileChevron)), trailing); }); - testWidgetsWithLeakTracking('shows leading', (WidgetTester tester) async { + testWidgets('shows leading', (WidgetTester tester) async { const Widget leading = Icon(CupertinoIcons.add); await tester.pumpWidget( @@ -94,7 +93,7 @@ void main() { expect(tester.widget<Icon>(find.byType(Icon)), leading); }); - testWidgetsWithLeakTracking('sets backgroundColor', (WidgetTester tester) async { + testWidgets('sets backgroundColor', (WidgetTester tester) async { const Color backgroundColor = CupertinoColors.systemRed; await tester.pumpWidget( @@ -119,7 +118,7 @@ void main() { expect(container.color, backgroundColor); }); - testWidgetsWithLeakTracking('does not change backgroundColor when tapped if onTap is not provided', (WidgetTester tester) async { + testWidgets('does not change backgroundColor when tapped if onTap is not provided', (WidgetTester tester) async { const Color backgroundColor = CupertinoColors.systemBlue; const Color backgroundColorActivated = CupertinoColors.systemRed; @@ -149,7 +148,7 @@ void main() { expect(container.color, backgroundColor); }); - testWidgetsWithLeakTracking('changes backgroundColor when tapped if onTap is provided', (WidgetTester tester) async { + testWidgets('changes backgroundColor when tapped if onTap is provided', (WidgetTester tester) async { const Color backgroundColor = CupertinoColors.systemBlue; const Color backgroundColorActivated = CupertinoColors.systemRed; @@ -188,7 +187,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('does not contain GestureDetector if onTap is not provided', (WidgetTester tester) async { + testWidgets('does not contain GestureDetector if onTap is not provided', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -209,7 +208,7 @@ void main() { expect(find.byType(GestureDetector), findsNothing); }); - testWidgetsWithLeakTracking('contains GestureDetector if onTap is provided', (WidgetTester tester) async { + testWidgets('contains GestureDetector if onTap is provided', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -231,7 +230,7 @@ void main() { expect(find.byType(GestureDetector), findsOneWidget); }); - testWidgetsWithLeakTracking('resets the background color when navigated back', (WidgetTester tester) async { + testWidgets('resets the background color when navigated back', (WidgetTester tester) async { const Color backgroundColor = CupertinoColors.systemBlue; const Color backgroundColorActivated = CupertinoColors.systemRed; @@ -280,7 +279,7 @@ void main() { }); group('alignment of widgets for left-to-right', () { - testWidgetsWithLeakTracking('leading is on the left of title', (WidgetTester tester) async { + testWidgets('leading is on the left of title', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); const Widget leading = Icon(CupertinoIcons.add); @@ -304,7 +303,7 @@ void main() { expect(foundTitle.dx > foundLeading.dx, true); }); - testWidgetsWithLeakTracking('subtitle is placed below title and aligned on left', (WidgetTester tester) async { + testWidgets('subtitle is placed below title and aligned on left', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile title'); const Widget subtitle = Text('CupertinoListTile subtitle'); @@ -329,7 +328,7 @@ void main() { expect(foundTitle.dy < foundSubtitle.dy, isTrue); }); - testWidgetsWithLeakTracking('additionalInfo is on the right of title', (WidgetTester tester) async { + testWidgets('additionalInfo is on the right of title', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); const Widget additionalInfo = Text('Not Connected'); @@ -353,7 +352,7 @@ void main() { expect(foundTitle.dx < foundInfo.dx, isTrue); }); - testWidgetsWithLeakTracking('trailing is on the right of additionalInfo', (WidgetTester tester) async { + testWidgets('trailing is on the right of additionalInfo', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); const Widget additionalInfo = Text('Not Connected'); const Widget trailing = CupertinoListTileChevron(); @@ -381,7 +380,7 @@ void main() { }); group('alignment of widgets for right-to-left', () { - testWidgetsWithLeakTracking('leading is on the right of title', (WidgetTester tester) async { + testWidgets('leading is on the right of title', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); const Widget leading = Icon(CupertinoIcons.add); @@ -405,7 +404,7 @@ void main() { expect(foundTitle.dx < foundLeading.dx, true); }); - testWidgetsWithLeakTracking('subtitle is placed below title and aligned on right', (WidgetTester tester) async { + testWidgets('subtitle is placed below title and aligned on right', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile title'); const Widget subtitle = Text('CupertinoListTile subtitle'); @@ -430,7 +429,7 @@ void main() { expect(foundTitle.dy < foundSubtitle.dy, isTrue); }); - testWidgetsWithLeakTracking('additionalInfo is on the left of title', (WidgetTester tester) async { + testWidgets('additionalInfo is on the left of title', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); const Widget additionalInfo = Text('Not Connected'); @@ -454,7 +453,7 @@ void main() { expect(foundTitle.dx > foundInfo.dx, isTrue); }); - testWidgetsWithLeakTracking('trailing is on the left of additionalInfo', (WidgetTester tester) async { + testWidgets('trailing is on the left of additionalInfo', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); const Widget additionalInfo = Text('Not Connected'); const Widget trailing = CupertinoListTileChevron(); @@ -481,7 +480,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('onTap with delay does not throw an exception', (WidgetTester tester) async { + testWidgets('onTap with delay does not throw an exception', (WidgetTester tester) async { const Widget title = Text('CupertinoListTile'); bool showTile = true; @@ -521,7 +520,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('title does not overflow', (WidgetTester tester) async { + testWidgets('title does not overflow', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoPageScaffold( @@ -535,7 +534,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('subtitle does not overflow', (WidgetTester tester) async { + testWidgets('subtitle does not overflow', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoPageScaffold( diff --git a/packages/flutter/test/cupertino/localizations_test.dart b/packages/flutter/test/cupertino/localizations_test.dart index f58f97a9bb4..9725de3e6d5 100644 --- a/packages/flutter/test/cupertino/localizations_test.dart +++ b/packages/flutter/test/cupertino/localizations_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('English translations exist for all CupertinoLocalization properties', (WidgetTester tester) async { + testWidgets('English translations exist for all CupertinoLocalization properties', (WidgetTester tester) async { const CupertinoLocalizations localizations = DefaultCupertinoLocalizations(); expect(localizations.datePickerYear(2018), isNotNull); @@ -38,7 +37,7 @@ void main() { expect(localizations.clearButtonLabel, isNotNull); }); - testWidgetsWithLeakTracking('CupertinoLocalizations.of throws', (WidgetTester tester) async { + testWidgets('CupertinoLocalizations.of throws', (WidgetTester tester) async { final GlobalKey noLocalizationsAvailable = GlobalKey(); final GlobalKey localizationsAvailable = GlobalKey(); diff --git a/packages/flutter/test/cupertino/magnifier_test.dart b/packages/flutter/test/cupertino/magnifier_test.dart index 87c22f1b961..ba90c936ced 100644 --- a/packages/flutter/test/cupertino/magnifier_test.dart +++ b/packages/flutter/test/cupertino/magnifier_test.dart @@ -8,7 +8,6 @@ library; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { final Offset basicOffset = Offset(CupertinoMagnifier.kDefaultSize.width / 2, @@ -49,7 +48,7 @@ void main() { animatedPositioned.left ?? 0, animatedPositioned.top ?? 0); } - testWidgetsWithLeakTracking('should be at gesture position if does not violate any positioning rules', (WidgetTester tester) async { + testWidgets('should be at gesture position if does not violate any positioning rules', (WidgetTester tester) async { final Key fakeTextFieldKey = UniqueKey(); final Key outerKey = UniqueKey(); @@ -100,7 +99,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('should never horizontally be outside of Screen Padding', (WidgetTester tester) async { + testWidgets('should never horizontally be outside of Screen Padding', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( color: Color.fromARGB(7, 0, 129, 90), @@ -132,7 +131,7 @@ void main() { lessThan(MediaQuery.sizeOf(context).width)); }); - testWidgetsWithLeakTracking('should have some vertical drag', (WidgetTester tester) async { + testWidgets('should have some vertical drag', (WidgetTester tester) async { final double dragPositionBelowTextField = reasonableTextField.center.dy + 30; await tester.pumpWidget( @@ -173,7 +172,7 @@ void main() { }); group('status', () { - testWidgetsWithLeakTracking('should hide if gesture is far below the text field', (WidgetTester tester) async { + testWidgets('should hide if gesture is far below the text field', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( color: Color.fromARGB(7, 0, 129, 90), @@ -213,7 +212,7 @@ void main() { expect(magnifierController.overlayEntry, isNotNull); }); - testWidgetsWithLeakTracking('should re-show if gesture moves back up', + testWidgets('should re-show if gesture moves back up', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( diff --git a/packages/flutter/test/cupertino/material/tab_scaffold_test.dart b/packages/flutter/test/cupertino/material/tab_scaffold_test.dart index 7f15919b3ef..2ccf74c1feb 100644 --- a/packages/flutter/test/cupertino/material/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/material/tab_scaffold_test.dart @@ -7,7 +7,6 @@ import 'dart:typed_data'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../../image_data.dart'; @@ -18,7 +17,7 @@ void main() { selectedTabs = <int>[]; }); - testWidgetsWithLeakTracking('Last tab gets focus', (WidgetTester tester) async { + testWidgets('Last tab gets focus', (WidgetTester tester) async { // 2 nodes for 2 tabs final List<FocusNode> focusNodes = <FocusNode>[]; for (int i = 0; i < 2; i++) { @@ -58,7 +57,7 @@ void main() { expect(focusNodes[1].hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Do not affect focus order in the route', (WidgetTester tester) async { + testWidgets('Do not affect focus order in the route', (WidgetTester tester) async { final List<FocusNode> focusNodes = <FocusNode>[]; for (int i = 0; i < 4; i++) { final FocusNode focusNode = FocusNode(); @@ -127,7 +126,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar respects themes', (WidgetTester tester) async { + testWidgets('Tab bar respects themes', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabScaffold( @@ -185,7 +184,7 @@ void main() { expect(tab2.text.style!.color!.value, CupertinoColors.systemRed.darkColor.value); }); - testWidgetsWithLeakTracking('dark mode background color', (WidgetTester tester) async { + testWidgets('dark mode background color', (WidgetTester tester) async { const CupertinoDynamicColor backgroundColor = CupertinoDynamicColor.withBrightness( color: Color(0xFF123456), darkColor: Color(0xFF654321), @@ -238,7 +237,7 @@ void main() { expect(tabDecoration.color!.value, backgroundColor.darkColor.value); }); - testWidgetsWithLeakTracking('Does not lose state when focusing on text input', (WidgetTester tester) async { + testWidgets('Does not lose state when focusing on text input', (WidgetTester tester) async { // Regression testing for https://github.com/flutter/flutter/issues/28457. await tester.pumpWidget( @@ -284,7 +283,7 @@ void main() { expect(find.text("don't lose me"), findsOneWidget); }); - testWidgetsWithLeakTracking('textScaleFactor is set to 1.0', (WidgetTester tester) async { + testWidgets('textScaleFactor is set to 1.0', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Builder(builder: (BuildContext context) { diff --git a/packages/flutter/test/cupertino/nav_bar_test.dart b/packages/flutter/test/cupertino/nav_bar_test.dart index 35d434eca2e..241a854b225 100644 --- a/packages/flutter/test/cupertino/nav_bar_test.dart +++ b/packages/flutter/test/cupertino/nav_bar_test.dart @@ -11,14 +11,13 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; int count = 0; void main() { - testWidgetsWithLeakTracking('Middle still in center with asymmetrical actions', (WidgetTester tester) async { + testWidgets('Middle still in center with asymmetrical actions', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -35,7 +34,7 @@ void main() { expect(tester.getCenter(find.text('Title')).dx, 400.0); }); - testWidgetsWithLeakTracking('Middle still in center with back button', (WidgetTester tester) async { + testWidgets('Middle still in center with back button', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -59,7 +58,7 @@ void main() { expect(tester.getCenter(find.text('Page 2')).dx, 400.0); }); - testWidgetsWithLeakTracking('Opaque background does not add blur effects, non-opaque background adds blur effects', (WidgetTester tester) async { + testWidgets('Opaque background does not add blur effects, non-opaque background adds blur effects', (WidgetTester tester) async { const CupertinoDynamicColor background = CupertinoDynamicColor.withBrightness( color: Color(0xFFE5E5E5), darkColor: Color(0xF3E5E5E5), @@ -90,7 +89,7 @@ void main() { expect(find.byType(CupertinoNavigationBar), paints..rect(color: background.darkColor)); }); - testWidgetsWithLeakTracking('Non-opaque background adds blur effects', (WidgetTester tester) async { + testWidgets('Non-opaque background adds blur effects', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -101,7 +100,7 @@ void main() { expect(find.byType(BackdropFilter), findsOneWidget); }); - testWidgetsWithLeakTracking('Nav bar displays correctly', (WidgetTester tester) async { + testWidgets('Nav bar displays correctly', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget( CupertinoApp( @@ -131,7 +130,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Can specify custom padding', (WidgetTester tester) async { + testWidgets('Can specify custom padding', (WidgetTester tester) async { final Key middleBox = GlobalKey(); await tester.pumpWidget( CupertinoApp( @@ -188,7 +187,7 @@ void main() { } // Regression test for https://github.com/flutter/flutter/issues/119270 - testWidgetsWithLeakTracking('System navigation bar properties are not overridden', (WidgetTester tester) async { + testWidgets('System navigation bar properties are not overridden', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -199,7 +198,7 @@ void main() { expectSameStatusBarStyle(SystemChrome.latestStyle!, SystemUiOverlayStyle.dark); }); - testWidgetsWithLeakTracking('Can specify custom brightness', (WidgetTester tester) async { + testWidgets('Can specify custom brightness', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -251,7 +250,7 @@ void main() { expectSameStatusBarStyle(SystemChrome.latestStyle!, SystemUiOverlayStyle.dark); }); - testWidgetsWithLeakTracking('Padding works in RTL', (WidgetTester tester) async { + testWidgets('Padding works in RTL', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Directionality( @@ -281,7 +280,7 @@ void main() { expect(tester.getCenter(find.text('Title')).dx, 400.0); }); - testWidgetsWithLeakTracking('Nav bar uses theme defaults', (WidgetTester tester) async { + testWidgets('Nav bar uses theme defaults', (WidgetTester tester) async { count = 0x000000; await tester.pumpWidget( CupertinoApp( @@ -301,7 +300,7 @@ void main() { expect(count, 0x010101); }); - testWidgetsWithLeakTracking('Nav bar respects themes', (WidgetTester tester) async { + testWidgets('Nav bar respects themes', (WidgetTester tester) async { count = 0x000000; await tester.pumpWidget( CupertinoApp( @@ -322,7 +321,7 @@ void main() { expect(count, 0x010101); }); - testWidgetsWithLeakTracking('Theme active color can be overridden', (WidgetTester tester) async { + testWidgets('Theme active color can be overridden', (WidgetTester tester) async { count = 0x000000; await tester.pumpWidget( CupertinoApp( @@ -343,7 +342,7 @@ void main() { expect(count, 0x010101); }); - testWidgetsWithLeakTracking('No slivers with no large titles', (WidgetTester tester) async { + testWidgets('No slivers with no large titles', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -358,7 +357,7 @@ void main() { expect(find.byType(SliverPersistentHeader), findsNothing); }); - testWidgetsWithLeakTracking('Media padding is applied to CupertinoSliverNavigationBar', (WidgetTester tester) async { + testWidgets('Media padding is applied to CupertinoSliverNavigationBar', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); final Key leadingKey = GlobalKey(); @@ -407,7 +406,7 @@ void main() { expect(tester.getTopLeft(find.byKey(titleKey)), const Offset(16.0 + 20.0, 54.0 + 10.0)); }); - testWidgetsWithLeakTracking('Large title nav bar scrolls', (WidgetTester tester) async { + testWidgets('Large title nav bar scrolls', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -488,7 +487,7 @@ void main() { expect(tester.getSize(find.widgetWithText(ClipRect, 'Title').first).height, 0.0); }); - testWidgetsWithLeakTracking('User specified middle is always visible in sliver', (WidgetTester tester) async { + testWidgets('User specified middle is always visible in sliver', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); final Key segmentedControlsKey = UniqueKey(); @@ -546,7 +545,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('User specified middle is only visible when sliver is collapsed if alwaysShowMiddle is false', (WidgetTester tester) async { + testWidgets('User specified middle is only visible when sliver is collapsed if alwaysShowMiddle is false', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -593,7 +592,7 @@ void main() { expect(middleOpacity.opacity.value, 0.0); }); - testWidgetsWithLeakTracking('Small title can be overridden', (WidgetTester tester) async { + testWidgets('Small title can be overridden', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -658,7 +657,7 @@ void main() { expect(tester.getBottomLeft(find.text('Title')).dy, 44.0); // Extension gone. }); - testWidgetsWithLeakTracking('Auto back/close button', (WidgetTester tester) async { + testWidgets('Auto back/close button', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -713,7 +712,7 @@ void main() { expect(find.text('Home page'), findsOneWidget); }); - testWidgetsWithLeakTracking('Long back label turns into "back"', (WidgetTester tester) async { + testWidgets('Long back label turns into "back"', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -756,7 +755,7 @@ void main() { expect(find.widgetWithText(CupertinoButton, 'Back'), findsOneWidget); }); - testWidgetsWithLeakTracking('Border should be displayed by default', (WidgetTester tester) async { + testWidgets('Border should be displayed by default', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -778,7 +777,7 @@ void main() { expect(side, isNotNull); }); - testWidgetsWithLeakTracking('Overrides border color', (WidgetTester tester) async { + testWidgets('Overrides border color', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -807,7 +806,7 @@ void main() { expect(side.color, const Color(0xFFAABBCC)); }); - testWidgetsWithLeakTracking('Border should not be displayed when null', (WidgetTester tester) async { + testWidgets('Border should not be displayed when null', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBar( @@ -827,7 +826,7 @@ void main() { expect(decoration.border, isNull); }); - testWidgetsWithLeakTracking('Border is displayed by default in sliver nav bar', (WidgetTester tester) async { + testWidgets('Border is displayed by default in sliver nav bar', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -855,7 +854,7 @@ void main() { expect(bottom, isNotNull); }); - testWidgetsWithLeakTracking('Border is not displayed when null in sliver nav bar', (WidgetTester tester) async { + testWidgets('Border is not displayed when null in sliver nav bar', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -881,7 +880,7 @@ void main() { expect(decoration.border, isNull); }); - testWidgetsWithLeakTracking('CupertinoSliverNavigationBar has semantics', (WidgetTester tester) async { + testWidgets('CupertinoSliverNavigationBar has semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const CupertinoApp( @@ -906,7 +905,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('CupertinoNavigationBar has semantics', (WidgetTester tester) async { + testWidgets('CupertinoNavigationBar has semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(CupertinoApp( @@ -927,7 +926,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Border can be overridden in sliver nav bar', (WidgetTester tester) async { + testWidgets('Border can be overridden in sliver nav bar', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -965,7 +964,7 @@ void main() { expect(bottom.color, const Color(0xFFAABBCC)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Standard title golden', (WidgetTester tester) async { await tester.pumpWidget( @@ -988,7 +987,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Large title golden', (WidgetTester tester) async { await tester.pumpWidget( @@ -1019,7 +1018,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('NavBar draws a light system bar for a dark background', (WidgetTester tester) async { + testWidgets('NavBar draws a light system bar for a dark background', (WidgetTester tester) async { await tester.pumpWidget( WidgetsApp( color: const Color(0xFFFFFFFF), @@ -1039,7 +1038,7 @@ void main() { expectSameStatusBarStyle(SystemChrome.latestStyle!, SystemUiOverlayStyle.light); }); - testWidgetsWithLeakTracking('NavBar draws a dark system bar for a light background', (WidgetTester tester) async { + testWidgets('NavBar draws a dark system bar for a light background', (WidgetTester tester) async { await tester.pumpWidget( WidgetsApp( color: const Color(0xFFFFFFFF), @@ -1059,7 +1058,7 @@ void main() { expectSameStatusBarStyle(SystemChrome.latestStyle!, SystemUiOverlayStyle.dark); }); - testWidgetsWithLeakTracking('CupertinoNavigationBarBackButton shows an error when manually added outside a route', (WidgetTester tester) async { + testWidgets('CupertinoNavigationBarBackButton shows an error when manually added outside a route', (WidgetTester tester) async { await tester.pumpWidget(const CupertinoNavigationBarBackButton()); final dynamic exception = tester.takeException(); @@ -1067,7 +1066,7 @@ void main() { expect(exception.toString(), contains('CupertinoNavigationBarBackButton should only be used in routes that can be popped')); }); - testWidgetsWithLeakTracking('CupertinoNavigationBarBackButton shows an error when placed in a route that cannot be popped', (WidgetTester tester) async { + testWidgets('CupertinoNavigationBarBackButton shows an error when placed in a route that cannot be popped', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoNavigationBarBackButton(), @@ -1079,7 +1078,7 @@ void main() { expect(exception.toString(), contains('CupertinoNavigationBarBackButton should only be used in routes that can be popped')); }); - testWidgetsWithLeakTracking('CupertinoNavigationBarBackButton with a custom onPressed callback can be placed anywhere', (WidgetTester tester) async { + testWidgets('CupertinoNavigationBarBackButton with a custom onPressed callback can be placed anywhere', (WidgetTester tester) async { bool backPressed = false; await tester.pumpWidget( @@ -1098,7 +1097,7 @@ void main() { expect(backPressed, true); }); - testWidgetsWithLeakTracking( + testWidgets( 'Manually inserted CupertinoNavigationBarBackButton still automatically ' 'show previous page title when possible', (WidgetTester tester) async { @@ -1139,7 +1138,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoNavigationBarBackButton onPressed overrides default pop behavior', (WidgetTester tester) async { bool backPressed = false; @@ -1194,7 +1193,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('textScaleFactor is set to 1.0', (WidgetTester tester) async { + testWidgets('textScaleFactor is set to 1.0', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Builder(builder: (BuildContext context) { @@ -1273,7 +1272,7 @@ void main() { expect(barItems2.any((RichText t) => t.textScaleFactor != 1), isFalse); }); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoSliverNavigationBar stretches upon over-scroll and bounces back once over-scroll ends', (WidgetTester tester) async { const Text trailingText = Text('Bar Button'); @@ -1328,7 +1327,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoSliverNavigationBar does not stretch upon over-scroll if stretch parameter is false', (WidgetTester tester) async { const Text trailingText = Text('Bar Button'); @@ -1382,7 +1381,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Null NavigationBar border transition', (WidgetTester tester) async { + testWidgets('Null NavigationBar border transition', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/71389 await tester.pumpWidget( const CupertinoApp( @@ -1422,7 +1421,7 @@ void main() { expect(find.text('Page 2'), findsNothing); }); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoSliverNavigationBar magnifies upon over-scroll and shrinks back once over-scroll ends', (WidgetTester tester) async { const Text titleText = Text('Large Title'); @@ -1480,7 +1479,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoSliverNavigationBar large title text does not get clipped when magnified', (WidgetTester tester) async { const Text titleText = Text('Very very very long large title'); @@ -1527,7 +1526,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoSliverNavigationBar large title can be hit tested when magnified', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); diff --git a/packages/flutter/test/cupertino/nav_bar_transition_test.dart b/packages/flutter/test/cupertino/nav_bar_transition_test.dart index 2c1c3d52038..1b656d597fb 100644 --- a/packages/flutter/test/cupertino/nav_bar_transition_test.dart +++ b/packages/flutter/test/cupertino/nav_bar_transition_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Future<void> startTransitionBetween( WidgetTester tester, { @@ -132,7 +131,7 @@ void checkOpacity(WidgetTester tester, Finder finder, double opacity) { } void main() { - testWidgetsWithLeakTracking('Bottom middle moves between middle and back label', (WidgetTester tester) async { + testWidgets('Bottom middle moves between middle and back label', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1'); // Be mid-transition. @@ -160,7 +159,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom middle moves between middle and back label RTL', (WidgetTester tester) async { + testWidgets('Bottom middle moves between middle and back label RTL', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -187,7 +186,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom middle never changes size during the animation', (WidgetTester tester) async { + testWidgets('Bottom middle never changes size during the animation', (WidgetTester tester) async { await tester.binding.setSurfaceSize(const Size(1080.0 / 2.75, 600)); addTearDown(() async { await tester.binding.setSurfaceSize(const Size(800.0, 600.0)); @@ -208,7 +207,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Bottom middle and top back label transitions their font', (WidgetTester tester) async { + testWidgets('Bottom middle and top back label transitions their font', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1'); // Be mid-transition. @@ -252,7 +251,7 @@ void main() { checkOpacity(tester, flying(tester, find.text('Page 1')).last, 0.5292819738388062); }); - testWidgetsWithLeakTracking('Font transitions respect themes', (WidgetTester tester) async { + testWidgets('Font transitions respect themes', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -300,7 +299,7 @@ void main() { checkOpacity(tester, flying(tester, find.text('Page 1')).last, 0.5292819738388062); }); - testWidgetsWithLeakTracking('Fullscreen dialogs do not create heroes', (WidgetTester tester) async { + testWidgets('Fullscreen dialogs do not create heroes', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -334,7 +333,7 @@ void main() { expect(() => flying(tester, find.text('Page 2')), throwsAssertionError); }); - testWidgetsWithLeakTracking('Turning off transition works', (WidgetTester tester) async { + testWidgets('Turning off transition works', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoNavigationBar( @@ -358,7 +357,7 @@ void main() { expect(() => flying(tester, find.text('Page 2')), throwsAssertionError); }); - testWidgetsWithLeakTracking('Popping mid-transition is symmetrical', (WidgetTester tester) async { + testWidgets('Popping mid-transition is symmetrical', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1'); // Be mid-transition. @@ -406,7 +405,7 @@ void main() { checkColorAndPositionAt50ms(); }); - testWidgetsWithLeakTracking('Popping mid-transition is symmetrical RTL', (WidgetTester tester) async { + testWidgets('Popping mid-transition is symmetrical RTL', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -457,7 +456,7 @@ void main() { checkColorAndPositionAt50ms(); }); - testWidgetsWithLeakTracking('There should be no global keys in the hero flight', (WidgetTester tester) async { + testWidgets('There should be no global keys in the hero flight', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1'); // Be mid-transition. @@ -472,7 +471,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DartPerformanceMode is latency mid-animation', (WidgetTester tester) async { + testWidgets('DartPerformanceMode is latency mid-animation', (WidgetTester tester) async { DartPerformanceMode? mode; // before the animation starts, no requests are active. @@ -492,7 +491,7 @@ void main() { expect(mode, isNull); }); - testWidgetsWithLeakTracking('Multiple nav bars tags do not conflict if in different navigators', (WidgetTester tester) async { + testWidgets('Multiple nav bars tags do not conflict if in different navigators', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabScaffold( @@ -567,7 +566,7 @@ void main() { expect(find.text('Tab 1 Page 2', skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('Transition box grows to large title size', (WidgetTester tester) async { + testWidgets('Transition box grows to large title size', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -591,7 +590,7 @@ void main() { checkBackgroundBoxHeight(tester, 84.33018499612808); }); - testWidgetsWithLeakTracking('Large transition box shrinks to standard nav bar size', (WidgetTester tester) async { + testWidgets('Large transition box shrinks to standard nav bar size', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoSliverNavigationBar(), @@ -615,7 +614,7 @@ void main() { checkBackgroundBoxHeight(tester, 55.66981500387192); }); - testWidgetsWithLeakTracking('Hero flight removed at the end of page transition', (WidgetTester tester) async { + testWidgets('Hero flight removed at the end of page transition', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1'); await tester.pump(const Duration(milliseconds: 50)); @@ -630,7 +629,7 @@ void main() { expect(() => flying(tester, find.text('Page 1')), throwsAssertionError); }); - testWidgetsWithLeakTracking('Exact widget is reused to build inside the transition', (WidgetTester tester) async { + testWidgets('Exact widget is reused to build inside the transition', (WidgetTester tester) async { const Widget userMiddle = Placeholder(); await startTransitionBetween( tester, @@ -646,7 +645,7 @@ void main() { expect(flying(tester, find.byWidget(userMiddle)), findsOneWidget); }); - testWidgetsWithLeakTracking('Middle is not shown if alwaysShowMiddle is false and the nav bar is expanded', (WidgetTester tester) async { + testWidgets('Middle is not shown if alwaysShowMiddle is false and the nav bar is expanded', (WidgetTester tester) async { const Widget userMiddle = Placeholder(); await startTransitionBetween( tester, @@ -663,7 +662,7 @@ void main() { expect(flying(tester, find.byWidget(userMiddle)), findsNothing); }); - testWidgetsWithLeakTracking('Middle is shown if alwaysShowMiddle is false but the nav bar is collapsed', (WidgetTester tester) async { + testWidgets('Middle is shown if alwaysShowMiddle is false but the nav bar is collapsed', (WidgetTester tester) async { const Widget userMiddle = Placeholder(); final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -712,7 +711,7 @@ void main() { expect(flying(tester, find.byWidget(userMiddle)), findsOneWidget); }); - testWidgetsWithLeakTracking('First appearance of back chevron fades in from the right', (WidgetTester tester) async { + testWidgets('First appearance of back chevron fades in from the right', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: scaffoldForNavBar(null), @@ -751,7 +750,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('First appearance of back chevron fades in from the left in RTL', (WidgetTester tester) async { + testWidgets('First appearance of back chevron fades in from the left in RTL', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? navigator) { @@ -803,7 +802,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Back chevron fades out and in when both pages have it', (WidgetTester tester) async { + testWidgets('Back chevron fades out and in when both pages have it', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1'); await tester.pump(const Duration(milliseconds: 50)); @@ -829,7 +828,7 @@ void main() { expect(tester.getTopLeft(backChevrons.last), const Offset(14.0, 7.0)); }); - testWidgetsWithLeakTracking('Bottom middle just fades if top page has a custom leading', (WidgetTester tester) async { + testWidgets('Bottom middle just fades if top page has a custom leading', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -860,7 +859,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom leading fades in place', (WidgetTester tester) async { + testWidgets('Bottom leading fades in place', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoSliverNavigationBar(leading: Text('custom')), @@ -886,7 +885,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom trailing fades in place', (WidgetTester tester) async { + testWidgets('Bottom trailing fades in place', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoSliverNavigationBar(trailing: Text('custom')), @@ -918,7 +917,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom back label fades and slides to the left', (WidgetTester tester) async { + testWidgets('Bottom back label fades and slides to the left', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -960,7 +959,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom back label fades and slides to the right in RTL', (WidgetTester tester) async { + testWidgets('Bottom back label fades and slides to the right in RTL', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -1004,7 +1003,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom large title moves to top back label', (WidgetTester tester) async { + testWidgets('Bottom large title moves to top back label', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoSliverNavigationBar(), @@ -1056,7 +1055,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Long title turns into the word back mid transition', (WidgetTester tester) async { + testWidgets('Long title turns into the word back mid transition', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoSliverNavigationBar(), @@ -1106,7 +1105,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Bottom large title and top back label transitions their font', (WidgetTester tester) async { + testWidgets('Bottom large title and top back label transitions their font', (WidgetTester tester) async { await startTransitionBetween( tester, from: const CupertinoSliverNavigationBar(), @@ -1145,7 +1144,7 @@ void main() { expect(topBackLabel.text.style!.letterSpacing, moreOrLessEquals(-0.23270857974886894)); }); - testWidgetsWithLeakTracking('Top middle fades in and slides in from the right', (WidgetTester tester) async { + testWidgets('Top middle fades in and slides in from the right', (WidgetTester tester) async { await startTransitionBetween( tester, toTitle: 'Page 2', @@ -1176,7 +1175,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Top middle never changes size during the animation', (WidgetTester tester) async { + testWidgets('Top middle never changes size during the animation', (WidgetTester tester) async { await tester.binding.setSurfaceSize(const Size(1080.0 / 2.75, 600)); addTearDown(() async { await tester.binding.setSurfaceSize(const Size(800.0, 600.0)); @@ -1200,7 +1199,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Top middle fades in and slides in from the left in RTL', (WidgetTester tester) async { + testWidgets('Top middle fades in and slides in from the left in RTL', (WidgetTester tester) async { await startTransitionBetween( tester, toTitle: 'Page 2', @@ -1232,7 +1231,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Top large title fades in and slides in from the right', (WidgetTester tester) async { + testWidgets('Top large title fades in and slides in from the right', (WidgetTester tester) async { await startTransitionBetween( tester, to: const CupertinoSliverNavigationBar(), @@ -1258,7 +1257,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Top large title fades in and slides in from the left in RTL', (WidgetTester tester) async { + testWidgets('Top large title fades in and slides in from the left in RTL', (WidgetTester tester) async { await startTransitionBetween( tester, to: const CupertinoSliverNavigationBar(), @@ -1285,7 +1284,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Components are not unnecessarily rebuilt during transitions', (WidgetTester tester) async { + testWidgets('Components are not unnecessarily rebuilt during transitions', (WidgetTester tester) async { int bottomBuildTimes = 0; int topBuildTimes = 0; await startTransitionBetween( @@ -1330,7 +1329,7 @@ void main() { expect(topBuildTimes, 3); }); - testWidgetsWithLeakTracking('Back swipe gesture transitions', (WidgetTester tester) async { + testWidgets('Back swipe gesture transitions', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', @@ -1393,7 +1392,7 @@ void main() { expect(find.text('Page 1'), findsOneWidget); }); - testWidgetsWithLeakTracking('textScaleFactor is set to 1.0 on transition', (WidgetTester tester) async { + testWidgets('textScaleFactor is set to 1.0 on transition', (WidgetTester tester) async { await startTransitionBetween(tester, fromTitle: 'Page 1', textScale: 99); await tester.pump(const Duration(milliseconds: 50)); @@ -1401,7 +1400,7 @@ void main() { expect(tester.firstWidget<RichText>(flying(tester, find.byType(RichText))).textScaleFactor, 1); }); - testWidgetsWithLeakTracking('Back swipe gesture cancels properly with transition', (WidgetTester tester) async { + testWidgets('Back swipe gesture cancels properly with transition', (WidgetTester tester) async { await startTransitionBetween( tester, fromTitle: 'Page 1', diff --git a/packages/flutter/test/cupertino/page_test.dart b/packages/flutter/test/cupertino/page_test.dart index 7fbed63b517..de6b92ea2e5 100644 --- a/packages/flutter/test/cupertino/page_test.dart +++ b/packages/flutter/test/cupertino/page_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('test iOS page transition (LTR)', (WidgetTester tester) async { + testWidgets('test iOS page transition (LTR)', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( onGenerateRoute: (RouteSettings settings) { @@ -80,7 +79,7 @@ void main() { expect(widget1InitialTopLeft, equals(widget1TransientTopLeft)); }); - testWidgetsWithLeakTracking('test iOS page transition (RTL)', (WidgetTester tester) async { + testWidgets('test iOS page transition (RTL)', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( localizationsDelegates: const <LocalizationsDelegate<dynamic>>[ @@ -151,7 +150,7 @@ void main() { expect(widget1InitialTopLeft, equals(widget1TransientTopLeft)); }); - testWidgetsWithLeakTracking('test iOS fullscreen dialog transition', (WidgetTester tester) async { + testWidgets('test iOS fullscreen dialog transition', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center(child: Text('Page 1')), @@ -211,7 +210,7 @@ void main() { expect(widget1InitialTopLeft, equals(widget1TransientTopLeft)); }); - testWidgetsWithLeakTracking('test only edge swipes work (LTR)', (WidgetTester tester) async { + testWidgets('test only edge swipes work (LTR)', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( onGenerateRoute: (RouteSettings settings) { @@ -272,7 +271,7 @@ void main() { expect(find.text('Page 2'), isOnstage); }); - testWidgetsWithLeakTracking('test edge swipes work with media query padding (LTR)', (WidgetTester tester) async { + testWidgets('test edge swipes work with media query padding (LTR)', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? navigator) { @@ -316,7 +315,7 @@ void main() { expect(find.text('Page 2'), isOnstage); }); - testWidgetsWithLeakTracking('test edge swipes work with media query padding (RLT)', (WidgetTester tester) async { + testWidgets('test edge swipes work with media query padding (RLT)', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? navigator) { @@ -364,7 +363,7 @@ void main() { expect(find.text('Page 2'), isOnstage); }); - testWidgetsWithLeakTracking('test only edge swipes work (RTL)', (WidgetTester tester) async { + testWidgets('test only edge swipes work (RTL)', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( localizationsDelegates: const <LocalizationsDelegate<dynamic>>[ @@ -429,7 +428,7 @@ void main() { expect(find.text('Page 2'), isOnstage); }); - testWidgetsWithLeakTracking('test edge swipe then drop back at starting point works', (WidgetTester tester) async { + testWidgets('test edge swipe then drop back at starting point works', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( onGenerateRoute: (RouteSettings settings) { @@ -464,7 +463,7 @@ void main() { expect(find.text('Page 2'), isOnstage); }); - testWidgetsWithLeakTracking('CupertinoPage does not lose its state when transitioning out', (WidgetTester tester) async { + testWidgets('CupertinoPage does not lose its state when transitioning out', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget(KeepsStateTestWidget(navigatorKey: navigator)); expect(find.text('subpage'), findsOneWidget); @@ -477,7 +476,7 @@ void main() { expect(find.text('home'), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoPage restores its state', (WidgetTester tester) async { + testWidgets('CupertinoPage restores its state', (WidgetTester tester) async { await tester.pumpWidget( RootRestorationScope( restorationId: 'root', diff --git a/packages/flutter/test/cupertino/picker_test.dart b/packages/flutter/test/cupertino/picker_test.dart index 68698d379ff..4215227cb17 100644 --- a/packages/flutter/test/cupertino/picker_test.dart +++ b/packages/flutter/test/cupertino/picker_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart'; @@ -19,7 +18,7 @@ class SpyFixedExtentScrollController extends FixedExtentScrollController { } void main() { - testWidgetsWithLeakTracking('Picker respects theme styling', (WidgetTester tester) async { + testWidgets('Picker respects theme styling', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Align( @@ -58,7 +57,7 @@ void main() { group('layout', () { // Regression test for https://github.com/flutter/flutter/issues/22999 - testWidgetsWithLeakTracking('CupertinoPicker.builder test', (WidgetTester tester) async { + testWidgets('CupertinoPicker.builder test', (WidgetTester tester) async { Widget buildFrame(int childCount) { return Directionality( textDirection: TextDirection.ltr, @@ -81,7 +80,7 @@ void main() { expect(tester.renderObject(find.text('1')).attached, true); }); - testWidgetsWithLeakTracking('selected item is in the middle', (WidgetTester tester) async { + testWidgets('selected item is in the middle', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 1); addTearDown(controller.dispose); await tester.pumpWidget( @@ -128,7 +127,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('picker dark mode', (WidgetTester tester) async { + testWidgets('picker dark mode', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.light), @@ -180,7 +179,7 @@ void main() { expect(find.byType(CupertinoPicker), paints..rect(color: const Color(0xFF654321))); }); - testWidgetsWithLeakTracking('picker selectionOverlay', (WidgetTester tester) async { + testWidgets('picker selectionOverlay', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.light), @@ -203,7 +202,7 @@ void main() { expect(find.byType(CupertinoPicker), paints..rrect(color: const Color(0x12345678))); }); - testWidgetsWithLeakTracking('CupertinoPicker.selectionOverlay is nullable', (WidgetTester tester) async { + testWidgets('CupertinoPicker.selectionOverlay is nullable', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.light), @@ -227,7 +226,7 @@ void main() { }); group('scroll', () { - testWidgetsWithLeakTracking( + testWidgets( 'scrolling calls onSelectedItemChanged and triggers haptic feedback', (WidgetTester tester) async { final List<int> selectedItems = <int>[]; @@ -281,7 +280,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.iOS), ); - testWidgetsWithLeakTracking( + testWidgets( 'do not trigger haptic effects on non-iOS devices', (WidgetTester tester) async { final List<int> selectedItems = <int>[]; @@ -318,7 +317,7 @@ void main() { variant: TargetPlatformVariant(TargetPlatform.values.where((TargetPlatform platform) => platform != TargetPlatform.iOS).toSet()), ); - testWidgetsWithLeakTracking('a drag in between items settles back', (WidgetTester tester) async { + testWidgets('a drag in between items settles back', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); final List<int> selectedItems = <int>[]; @@ -373,7 +372,7 @@ void main() { expect(selectedItems, <int>[9]); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('a big fling that overscrolls springs back', (WidgetTester tester) async { + testWidgets('a big fling that overscrolls springs back', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); @@ -436,7 +435,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); }); - testWidgetsWithLeakTracking('Picker adapts to MaterialApp dark mode', (WidgetTester tester) async { + testWidgets('Picker adapts to MaterialApp dark mode', (WidgetTester tester) async { Widget buildCupertinoPicker(Brightness brightness) { return MaterialApp( theme: ThemeData(brightness: brightness), @@ -477,7 +476,7 @@ void main() { }); group('CupertinoPickerDefaultSelectionOverlay', () { - testWidgetsWithLeakTracking('should be using directional decoration', (WidgetTester tester) async { + testWidgets('should be using directional decoration', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.light), @@ -500,7 +499,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Scroll controller is detached upon dispose', (WidgetTester tester) async { + testWidgets('Scroll controller is detached upon dispose', (WidgetTester tester) async { final SpyFixedExtentScrollController controller = SpyFixedExtentScrollController(); addTearDown(controller.dispose); expect(controller.hasListeners, false); @@ -532,7 +531,7 @@ void main() { expect(controller.positions.length, 0); }); - testWidgetsWithLeakTracking( + testWidgets( 'Registers taps and does not crash with certain diameterRatio', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126491 diff --git a/packages/flutter/test/cupertino/radio_test.dart b/packages/flutter/test/cupertino/radio_test.dart index da62e4c6baf..c1eb4e6b52e 100644 --- a/packages/flutter/test/cupertino/radio_test.dart +++ b/packages/flutter/test/cupertino/radio_test.dart @@ -7,12 +7,11 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Radio control test', (WidgetTester tester) async { + testWidgets('Radio control test', (WidgetTester tester) async { final Key key = UniqueKey(); final List<int?> log = <int?>[]; @@ -64,7 +63,7 @@ void main() { expect(log, isEmpty); }); - testWidgetsWithLeakTracking('Radio can be toggled when toggleable is set', (WidgetTester tester) async { + testWidgets('Radio can be toggled when toggleable is set', (WidgetTester tester) async { final Key key = UniqueKey(); final List<int?> log = <int?>[]; @@ -119,7 +118,7 @@ void main() { expect(log, equals(<int>[1])); }); - testWidgetsWithLeakTracking('Radio selected semantics - platform adaptive', (WidgetTester tester) async { + testWidgets('Radio selected semantics - platform adaptive', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(CupertinoApp( @@ -154,7 +153,7 @@ void main() { semantics.dispose(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Radio semantics', (WidgetTester tester) async { + testWidgets('Radio semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(CupertinoApp( @@ -242,7 +241,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('has semantic events', (WidgetTester tester) async { + testWidgets('has semantic events', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); dynamic semanticEvent; @@ -279,7 +278,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('Radio can be controlled by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('Radio can be controlled by keyboard shortcuts', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 1; const Key radioKey0 = Key('radio0'); @@ -352,7 +351,7 @@ void main() { expect(groupValue, equals(2)); }); - testWidgetsWithLeakTracking('Show a checkmark when useCheckmarkStyle is true', (WidgetTester tester) async { + testWidgets('Show a checkmark when useCheckmarkStyle is true', (WidgetTester tester) async { await tester.pumpWidget(CupertinoApp( home: Center( child: CupertinoRadio<int>( @@ -407,7 +406,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { + testWidgets('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { final Key key = UniqueKey(); Widget buildRadio(bool show) { diff --git a/packages/flutter/test/cupertino/refresh_test.dart b/packages/flutter/test/cupertino/refresh_test.dart index cc4b757ee39..5601753a471 100644 --- a/packages/flutter/test/cupertino/refresh_test.dart +++ b/packages/flutter/test/cupertino/refresh_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { late FakeBuilder mockHelper; @@ -35,7 +34,7 @@ void main() { } void uiTestGroup() { - testWidgetsWithLeakTracking("doesn't invoke anything without user interaction", (WidgetTester tester) async { + testWidgets("doesn't invoke anything without user interaction", (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -57,7 +56,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('calls the indicator builder when starting to overscroll', (WidgetTester tester) async { + testWidgets('calls the indicator builder when starting to overscroll', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -91,7 +90,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( "don't call the builder if overscroll doesn't move slivers like on Android", (WidgetTester tester) async { await tester.pumpWidget( @@ -125,7 +124,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.android), ); - testWidgetsWithLeakTracking('let the builder update as canceled drag scrolls away', (WidgetTester tester) async { + testWidgets('let the builder update as canceled drag scrolls away', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -187,7 +186,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('drag past threshold triggers refresh task', (WidgetTester tester) async { + testWidgets('drag past threshold triggers refresh task', (WidgetTester tester) async { final List<MethodCall> platformCallLog = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -269,7 +268,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'refreshing task keeps the sliver expanded forever until done', (WidgetTester tester) async { await tester.pumpWidget( @@ -344,7 +343,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'refreshing task keeps the sliver expanded forever until completes with error', (WidgetTester tester) async { final FlutterError error = FlutterError('Oops'); @@ -432,7 +431,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('expanded refreshing sliver scrolls normally', (WidgetTester tester) async { + testWidgets('expanded refreshing sliver scrolls normally', (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); await tester.pumpWidget( @@ -521,7 +520,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('expanded refreshing sliver goes away when done', (WidgetTester tester) async { + testWidgets('expanded refreshing sliver goes away when done', (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); await tester.pumpWidget( @@ -589,7 +588,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('builder still called when sliver snapped back more than 90%', (WidgetTester tester) async { + testWidgets('builder still called when sliver snapped back more than 90%', (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); await tester.pumpWidget( @@ -687,7 +686,7 @@ void main() { expect(find.text('-1'), findsOneWidget); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'retracting sliver during done cannot be pulled to refresh again until fully retracted', (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); @@ -792,7 +791,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'sliver held in overscroll when task finishes completes normally', (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); @@ -844,7 +843,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'sliver scrolled away when task completes properly removes itself', (WidgetTester tester) async { if (testListLength < 4) { @@ -930,7 +929,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( "don't do anything unless it can be overscrolled at the start of the list", (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); @@ -958,7 +957,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'without an onRefresh, builder is called with arm for one frame then sliver goes away', (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); @@ -1015,7 +1014,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('Should not crash when dragged', (WidgetTester tester) async { + testWidgets('Should not crash when dragged', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -1040,7 +1039,7 @@ void main() { // Test to make sure the refresh sliver's overscroll isn't eaten by the // nav bar sliver https://github.com/flutter/flutter/issues/74516. - testWidgetsWithLeakTracking( + testWidgets( 'properly displays when the refresh sliver is behind the large title nav bar sliver', (WidgetTester tester) async { await tester.pumpWidget( @@ -1083,7 +1082,7 @@ void main() { } void stateMachineTestGroup() { - testWidgetsWithLeakTracking('starts in inactive state', (WidgetTester tester) async { + testWidgets('starts in inactive state', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -1103,7 +1102,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('goes to drag and returns to inactive in a small drag', (WidgetTester tester) async { + testWidgets('goes to drag and returns to inactive in a small drag', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -1133,7 +1132,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('goes to armed the frame it passes the threshold', (WidgetTester tester) async { + testWidgets('goes to armed the frame it passes the threshold', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CustomScrollView( @@ -1168,7 +1167,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'goes to refresh the frame it crossed back the refresh threshold', (WidgetTester tester) async { await tester.pumpWidget( @@ -1217,7 +1216,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'goes to done internally as soon as the task finishes', (WidgetTester tester) async { await tester.pumpWidget( @@ -1265,7 +1264,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'goes back to inactive when retracting back past 10% of arming distance', (WidgetTester tester) async { await tester.pumpWidget( @@ -1350,7 +1349,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'goes back to inactive if already scrolled away when task completes', (WidgetTester tester) async { await tester.pumpWidget( @@ -1414,7 +1413,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( "don't have to build any indicators or occupy space during refresh", (WidgetTester tester) async { mockHelper.refreshIndicator = const Center(child: Text('-1')); @@ -1464,7 +1463,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('buildRefreshIndicator progress', (WidgetTester tester) async { + testWidgets('buildRefreshIndicator progress', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Builder( @@ -1511,7 +1510,7 @@ void main() { expect(tester.widget<CupertinoActivityIndicator>(find.byType(CupertinoActivityIndicator)).progress, 100.0 / 100.0); }); - testWidgetsWithLeakTracking('indicator should not become larger when overscrolled', (WidgetTester tester) async { + testWidgets('indicator should not become larger when overscrolled', (WidgetTester tester) async { // test for https://github.com/flutter/flutter/issues/79841 await tester.pumpWidget( Directionality( @@ -1547,7 +1546,7 @@ void main() { // correct by coincidence. group('state machine test short list', stateMachineTestGroup); - testWidgetsWithLeakTracking( + testWidgets( 'Does not crash when paintExtent > remainingPaintExtent', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/46871. diff --git a/packages/flutter/test/cupertino/route_test.dart b/packages/flutter/test/cupertino/route_test.dart index 8a71b206239..1f0659f1aa0 100644 --- a/packages/flutter/test/cupertino/route_test.dart +++ b/packages/flutter/test/cupertino/route_test.dart @@ -12,7 +12,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -23,7 +22,7 @@ void main() { navigatorObserver = MockNavigatorObserver(); }); - testWidgetsWithLeakTracking('Middle auto-populates with title', (WidgetTester tester) async { + testWidgets('Middle auto-populates with title', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -53,7 +52,7 @@ void main() { expect(tester.getCenter(find.text('An iPod')).dx, 400.0); }); - testWidgetsWithLeakTracking('Large title auto-populates with title', (WidgetTester tester) async { + testWidgets('Large title auto-populates with title', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -118,7 +117,7 @@ void main() { expect(tester.getCenter(find.byWidget(titles[0].widget)).dx, 400.0); }); - testWidgetsWithLeakTracking('Leading auto-populates with back button with previous title', (WidgetTester tester) async { + testWidgets('Leading auto-populates with back button with previous title', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -165,7 +164,7 @@ void main() { expect(tester.getTopLeft(find.text('An iPod')).dx, moreOrLessEquals(8.0 + 4.0 + 34.0 + 6.0, epsilon: 0.5)); }); - testWidgetsWithLeakTracking('Previous title is correct on first transition frame', (WidgetTester tester) async { + testWidgets('Previous title is correct on first transition frame', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -208,7 +207,7 @@ void main() { expect(find.widgetWithText(CupertinoButton, 'An iPod'), findsOneWidget); }); - testWidgetsWithLeakTracking('Previous title stays up to date with changing routes', (WidgetTester tester) async { + testWidgets('Previous title stays up to date with changing routes', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Placeholder(), @@ -272,7 +271,7 @@ void main() { expect(tester.getTopLeft(find.text('Back')).dx, moreOrLessEquals(8.0 + 4.0 + 34.0 + 6.0, epsilon: 0.5)); }); - testWidgetsWithLeakTracking('Back swipe dismiss interrupted by route push', (WidgetTester tester) async { + testWidgets('Back swipe dismiss interrupted by route push', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28728 final GlobalKey scaffoldKey = GlobalKey(); @@ -378,7 +377,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Fullscreen route animates correct transform values over time', (WidgetTester tester) async { + testWidgets('Fullscreen route animates correct transform values over time', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Builder( @@ -563,11 +562,11 @@ void main() { expect(tester.getTopLeft(find.byType(Placeholder)).dx, moreOrLessEquals(-0.0, epsilon: 1.0)); } - testWidgetsWithLeakTracking('CupertinoPageRoute has parallax when non fullscreenDialog route is pushed on top', (WidgetTester tester) async { + testWidgets('CupertinoPageRoute has parallax when non fullscreenDialog route is pushed on top', (WidgetTester tester) async { await testParallax(tester, fromFullscreenDialog: false); }); - testWidgetsWithLeakTracking('FullscreenDialog CupertinoPageRoute has parallax when non fullscreenDialog route is pushed on top', (WidgetTester tester) async { + testWidgets('FullscreenDialog CupertinoPageRoute has parallax when non fullscreenDialog route is pushed on top', (WidgetTester tester) async { await testParallax(tester, fromFullscreenDialog: true); }); @@ -652,15 +651,15 @@ void main() { expect(tester.getTopLeft(find.byType(Placeholder)).dx, 0.0); } - testWidgetsWithLeakTracking('CupertinoPageRoute has no parallax when fullscreenDialog route is pushed on top', (WidgetTester tester) async { + testWidgets('CupertinoPageRoute has no parallax when fullscreenDialog route is pushed on top', (WidgetTester tester) async { await testNoParallax(tester, fromFullscreenDialog: false); }); - testWidgetsWithLeakTracking('FullscreenDialog CupertinoPageRoute has no parallax when fullscreenDialog route is pushed on top', (WidgetTester tester) async { + testWidgets('FullscreenDialog CupertinoPageRoute has no parallax when fullscreenDialog route is pushed on top', (WidgetTester tester) async { await testNoParallax(tester, fromFullscreenDialog: true); }); - testWidgetsWithLeakTracking('Animated push/pop is not linear', (WidgetTester tester) async { + testWidgets('Animated push/pop is not linear', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Text('1'), @@ -712,7 +711,7 @@ void main() { expect(tester.getTopLeft(find.text('2')).dx, moreOrLessEquals(607, epsilon: 1)); }); - testWidgetsWithLeakTracking('Dragged pop gesture is linear', (WidgetTester tester) async { + testWidgets('Dragged pop gesture is linear', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Text('1'), @@ -759,7 +758,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/137033. - testWidgetsWithLeakTracking('Update pages during a drag gesture will not stuck', (WidgetTester tester) async { + testWidgets('Update pages during a drag gesture will not stuck', (WidgetTester tester) async { await tester.pumpWidget(const _TestPageUpdate()); @@ -792,7 +791,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Pop gesture snapping is not linear', (WidgetTester tester) async { + testWidgets('Pop gesture snapping is not linear', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Text('1'), @@ -839,7 +838,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Snapped drags forwards and backwards should signal didStart/StopUserGesture', (WidgetTester tester) async { + testWidgets('Snapped drags forwards and backwards should signal didStart/StopUserGesture', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey(); await tester.pumpWidget( CupertinoApp( @@ -893,7 +892,7 @@ void main() { }); /// Regression test for https://github.com/flutter/flutter/issues/29596. - testWidgetsWithLeakTracking('test edge swipe then drop back at ending point works', (WidgetTester tester) async { + testWidgets('test edge swipe then drop back at ending point works', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( navigatorObservers: <NavigatorObserver>[navigatorObserver], @@ -930,7 +929,7 @@ void main() { expect(navigatorObserver.invocations.removeLast(), NavigatorInvocation.didPop); }); - testWidgetsWithLeakTracking('test edge swipe then drop back at starting point works', (WidgetTester tester) async { + testWidgets('test edge swipe then drop back at starting point works', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( navigatorObservers: <NavigatorObserver>[navigatorObserver], @@ -987,7 +986,7 @@ void main() { ); } - testWidgetsWithLeakTracking('when route is not fullscreenDialog, it has a barrierColor', (WidgetTester tester) async { + testWidgets('when route is not fullscreenDialog, it has a barrierColor', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: SizedBox.expand(), @@ -1002,7 +1001,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, const Color(0x18000000)); }); - testWidgetsWithLeakTracking('when route is a fullscreenDialog, it has no barrierColor', (WidgetTester tester) async { + testWidgets('when route is a fullscreenDialog, it has no barrierColor', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: SizedBox.expand(), @@ -1017,7 +1016,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, isNull); }); - testWidgetsWithLeakTracking('when route is not fullscreenDialog, it has a _CupertinoEdgeShadowDecoration', (WidgetTester tester) async { + testWidgets('when route is not fullscreenDialog, it has a _CupertinoEdgeShadowDecoration', (WidgetTester tester) async { PaintPattern paintsShadowRect({required double dx, required Color color}) { return paints..everything((Symbol methodName, List<dynamic> arguments) { if (methodName != #drawRect) { @@ -1107,7 +1106,7 @@ void main() { expect(box, paintsShadowRect(dx: 754, color: const Color(0x00000000))); }); - testWidgetsWithLeakTracking('when route is fullscreenDialog, it has no visible _CupertinoEdgeShadowDecoration', (WidgetTester tester) async { + testWidgets('when route is fullscreenDialog, it has no visible _CupertinoEdgeShadowDecoration', (WidgetTester tester) async { PaintPattern paintsNoShadows() { return paints..everything((Symbol methodName, List<dynamic> arguments) { if (methodName != #drawRect) { @@ -1149,7 +1148,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ModalPopup overlay dark mode', (WidgetTester tester) async { + testWidgets('ModalPopup overlay dark mode', (WidgetTester tester) async { late StateSetter stateSetter; Brightness brightness = Brightness.light; @@ -1222,7 +1221,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('During back swipe the route ignores input', (WidgetTester tester) async { + testWidgets('During back swipe the route ignores input', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/39989 final GlobalKey homeScaffoldKey = GlobalKey(); @@ -1285,7 +1284,7 @@ void main() { expect(pageTapCount, 1); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup uses root navigator by default', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup uses root navigator by default', (WidgetTester tester) async { final PopupObserver rootObserver = PopupObserver(); final PopupObserver nestedObserver = PopupObserver(); @@ -1318,7 +1317,7 @@ void main() { expect(nestedObserver.popupCount, 0); }); - testWidgetsWithLeakTracking('back swipe to screen edges does not dismiss the hero animation', (WidgetTester tester) async { + testWidgets('back swipe to screen edges does not dismiss the hero animation', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); final UniqueKey container = UniqueKey(); await tester.pumpWidget(CupertinoApp( @@ -1388,7 +1387,7 @@ void main() { expect(firstPosition, greaterThan(thirdPosition)); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final PopupObserver rootObserver = PopupObserver(); final PopupObserver nestedObserver = PopupObserver(); @@ -1422,7 +1421,7 @@ void main() { expect(nestedObserver.popupCount, 1); }); - testWidgetsWithLeakTracking('showCupertinoDialog uses root navigator by default', (WidgetTester tester) async { + testWidgets('showCupertinoDialog uses root navigator by default', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); final DialogObserver nestedObserver = DialogObserver(); @@ -1455,7 +1454,7 @@ void main() { expect(nestedObserver.dialogCount, 0); }); - testWidgetsWithLeakTracking('showCupertinoDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('showCupertinoDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); final DialogObserver nestedObserver = DialogObserver(); @@ -1489,7 +1488,7 @@ void main() { expect(nestedObserver.dialogCount, 1); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup does not allow for semantics dismiss by default', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup does not allow for semantics dismiss by default', (WidgetTester tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.iOS; final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(CupertinoApp( @@ -1524,7 +1523,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup allows for semantics dismiss when set', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup allows for semantics dismiss when set', (WidgetTester tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.iOS; final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(CupertinoApp( @@ -1560,7 +1559,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup passes RouteSettings to PopupRoute', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup passes RouteSettings to PopupRoute', (WidgetTester tester) async { final RouteSettingsObserver routeSettingsObserver = RouteSettingsObserver(); await tester.pumpWidget(CupertinoApp( @@ -1591,7 +1590,7 @@ void main() { expect(routeSettingsObserver.routeName, '/modal'); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup transparent barrier color is transparent', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup transparent barrier color is transparent', (WidgetTester tester) async { const Color kTransparentColor = Color(0x00000000); await tester.pumpWidget(CupertinoApp( @@ -1617,7 +1616,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, null); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup null barrier color must be default gray barrier color', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup null barrier color must be default gray barrier color', (WidgetTester tester) async { // Barrier color for a Cupertino modal barrier. // Extracted from https://developer.apple.com/design/resources/. const Color kModalBarrierColor = CupertinoDynamicColor.withBrightness( @@ -1647,7 +1646,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, kModalBarrierColor); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup custom barrier color', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup custom barrier color', (WidgetTester tester) async { const Color customColor = Color(0x11223344); await tester.pumpWidget(CupertinoApp( @@ -1673,7 +1672,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, customColor); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup barrier dismissible', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup barrier dismissible', (WidgetTester tester) async { await tester.pumpWidget(CupertinoApp( home: CupertinoPageScaffold( child: Builder(builder: (BuildContext context) { @@ -1698,7 +1697,7 @@ void main() { expect(find.text('Visible'), findsNothing); }); - testWidgetsWithLeakTracking('showCupertinoModalPopup barrier not dismissible', (WidgetTester tester) async { + testWidgets('showCupertinoModalPopup barrier not dismissible', (WidgetTester tester) async { await tester.pumpWidget(CupertinoApp( home: CupertinoPageScaffold( child: Builder(builder: (BuildContext context) { @@ -1724,7 +1723,7 @@ void main() { expect(find.text('Visible'), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoPage works', (WidgetTester tester) async { + testWidgets('CupertinoPage works', (WidgetTester tester) async { final LocalKey pageKey = UniqueKey(); final TransitionDetector detector = TransitionDetector(); List<Page<void>> myPages = <Page<void>>[ @@ -1785,7 +1784,7 @@ void main() { expect(find.widgetWithText(CupertinoNavigationBar, 'title two'), findsOneWidget); }); - testWidgetsWithLeakTracking('CupertinoPage can toggle MaintainState', (WidgetTester tester) async { + testWidgets('CupertinoPage can toggle MaintainState', (WidgetTester tester) async { final LocalKey pageKeyOne = UniqueKey(); final LocalKey pageKeyTwo = UniqueKey(); final TransitionDetector detector = TransitionDetector(); @@ -1834,7 +1833,7 @@ void main() { expect(find.text('second'), findsOneWidget); }); - testWidgetsWithLeakTracking('Popping routes should cancel down events', (WidgetTester tester) async { + testWidgets('Popping routes should cancel down events', (WidgetTester tester) async { await tester.pumpWidget(const _TestPostRouteCancel()); final TestGesture gesture = await tester.createGesture(); @@ -1853,7 +1852,7 @@ void main() { expect(find.text('PointerCancelEvents: 1'), findsOneWidget); }); - testWidgetsWithLeakTracking('Popping routes during back swipe should not crash', (WidgetTester tester) async { + testWidgets('Popping routes during back swipe should not crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/63984#issuecomment-675679939 final CupertinoPageRoute<void> r = CupertinoPageRoute<void>(builder: (BuildContext context) { @@ -1903,7 +1902,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('CupertinoModalPopupRoute is state restorable', (WidgetTester tester) async { + testWidgets('CupertinoModalPopupRoute is state restorable', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( restorationScopeId: 'app', @@ -1934,7 +1933,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 group('showCupertinoDialog avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning with anchorPoint', (WidgetTester tester) async { + testWidgets('positioning with anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -1972,7 +1971,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with Directionality', (WidgetTester tester) async { + testWidgets('positioning with Directionality', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -2012,7 +2011,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning by default', (WidgetTester tester) async { + testWidgets('positioning by default', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -2051,7 +2050,7 @@ void main() { }); group('showCupertinoModalPopup avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning using anchorPoint', (WidgetTester tester) async { + testWidgets('positioning using anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -2089,7 +2088,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)).dx, 800); }); - testWidgetsWithLeakTracking('positioning using Directionality', (WidgetTester tester) async { + testWidgets('positioning using Directionality', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -2129,7 +2128,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)).dx, 800); }); - testWidgetsWithLeakTracking('default positioning', (WidgetTester tester) async { + testWidgets('default positioning', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { diff --git a/packages/flutter/test/cupertino/scaffold_test.dart b/packages/flutter/test/cupertino/scaffold_test.dart index 99dea5cc1c1..2dd4f74dd37 100644 --- a/packages/flutter/test/cupertino/scaffold_test.dart +++ b/packages/flutter/test/cupertino/scaffold_test.dart @@ -6,13 +6,12 @@ import 'dart:typed_data'; import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; /// Integration tests testing both [CupertinoPageScaffold] and [CupertinoTabScaffold]. void main() { - testWidgetsWithLeakTracking('Contents are behind translucent bar', (WidgetTester tester) async { + testWidgets('Contents are behind translucent bar', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -28,7 +27,7 @@ void main() { expect(tester.getTopLeft(find.byType(Center)), Offset.zero); }); - testWidgetsWithLeakTracking('Opaque bar pushes contents down', (WidgetTester tester) async { + testWidgets('Opaque bar pushes contents down', (WidgetTester tester) async { late BuildContext childContext; await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -56,7 +55,7 @@ void main() { expect(tester.getRect(find.byType(Container)), const Rect.fromLTRB(0, 44, 800, 600)); }); - testWidgetsWithLeakTracking('dark mode and obstruction work', (WidgetTester tester) async { + testWidgets('dark mode and obstruction work', (WidgetTester tester) async { const Color dynamicColor = CupertinoDynamicColor.withBrightness( color: Color(0xFFF8F8F8), darkColor: Color(0xEE333333), @@ -103,7 +102,7 @@ void main() { expect(find.byType(CupertinoPageScaffold), paints..rect(color: backgroundColor.darkColor)); }); - testWidgetsWithLeakTracking('Contents padding from viewInsets', (WidgetTester tester) async { + testWidgets('Contents padding from viewInsets', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: MediaQuery( @@ -161,7 +160,7 @@ void main() { expect(tester.getSize(find.byType(Container)).height, 600.0); }); - testWidgetsWithLeakTracking('Contents bottom padding are not consumed by viewInsets when resizeToAvoidBottomInset overridden', (WidgetTester tester) async { + testWidgets('Contents bottom padding are not consumed by viewInsets when resizeToAvoidBottomInset overridden', (WidgetTester tester) async { const Widget child = CupertinoPageScaffold( resizeToAvoidBottomInset: false, navigationBar: CupertinoNavigationBar( @@ -199,7 +198,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('Contents are between opaque bars', (WidgetTester tester) async { + testWidgets('Contents are between opaque bars', (WidgetTester tester) async { const Center page1Center = Center(); await tester.pumpWidget( @@ -236,7 +235,7 @@ void main() { expect(tester.getSize(find.byWidget(page1Center)).height, 600.0 - 44.0 - 50.0); }); - testWidgetsWithLeakTracking('Contents have automatic sliver padding between translucent bars', (WidgetTester tester) async { + testWidgets('Contents have automatic sliver padding between translucent bars', (WidgetTester tester) async { const SizedBox content = SizedBox(height: 600.0, width: 600.0); await tester.pumpWidget( @@ -290,7 +289,7 @@ void main() { expect(tester.getBottomLeft(find.byWidget(content)).dy, 600 - 20.0 - 50.0); }); - testWidgetsWithLeakTracking('iOS independent tab navigation', (WidgetTester tester) async { + testWidgets('iOS independent tab navigation', (WidgetTester tester) async { // A full on iOS information architecture app with 2 tabs, and 2 pages // in each with independent navigation states. await tester.pumpWidget( @@ -399,7 +398,7 @@ void main() { expect(find.text('Page 2 of tab 1', skipOffstage: false), isOffstage); }); - testWidgetsWithLeakTracking('Decorated with white background by default', (WidgetTester tester) async { + testWidgets('Decorated with white background by default', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -415,7 +414,7 @@ void main() { expect(decoration.color, isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking('Overrides background color', (WidgetTester tester) async { + testWidgets('Overrides background color', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoPageScaffold( @@ -432,7 +431,7 @@ void main() { expect(decoration.color, const Color(0xFF010203)); }); - testWidgetsWithLeakTracking('Lists in CupertinoPageScaffold scroll to the top when status bar tapped', (WidgetTester tester) async { + testWidgets('Lists in CupertinoPageScaffold scroll to the top when status bar tapped', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( builder: (BuildContext context, Widget? child) { @@ -484,7 +483,7 @@ void main() { expect(find.text('12'), findsNothing); }); - testWidgetsWithLeakTracking('resizeToAvoidBottomInset is supported even when no navigationBar', (WidgetTester tester) async { + testWidgets('resizeToAvoidBottomInset is supported even when no navigationBar', (WidgetTester tester) async { Widget buildFrame(bool showNavigationBar, bool showKeyboard) { return CupertinoApp( home: MediaQuery( @@ -529,7 +528,7 @@ void main() { expect(positionWithInsetNoNavBar, equals(positionWithInsetWithNavBar)); }); - testWidgetsWithLeakTracking('textScaleFactor is set to 1.0', (WidgetTester tester) async { + testWidgets('textScaleFactor is set to 1.0', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Builder(builder: (BuildContext context) { diff --git a/packages/flutter/test/cupertino/scrollbar_paint_test.dart b/packages/flutter/test/cupertino/scrollbar_paint_test.dart index f9bc1822ac1..a19a3ca8567 100644 --- a/packages/flutter/test/cupertino/scrollbar_paint_test.dart +++ b/packages/flutter/test/cupertino/scrollbar_paint_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Color _kScrollbarColor = Color(0x59000000); @@ -14,7 +13,7 @@ const Offset _kGestureOffset = Offset(0, -25); const Radius _kScrollbarRadius = Radius.circular(1.5); void main() { - testWidgetsWithLeakTracking('Paints iOS spec', (WidgetTester tester) async { + testWidgets('Paints iOS spec', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -52,7 +51,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Paints iOS spec with nav bar', (WidgetTester tester) async { + testWidgets('Paints iOS spec with nav bar', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: MediaQuery( @@ -97,7 +96,7 @@ void main() { )); }); - testWidgetsWithLeakTracking("should not paint when there isn't enough space", (WidgetTester tester) async { + testWidgets("should not paint when there isn't enough space", (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: MediaQuery( diff --git a/packages/flutter/test/cupertino/scrollbar_test.dart b/packages/flutter/test/cupertino/scrollbar_test.dart index 702a3ca8c81..624b32aa1a8 100644 --- a/packages/flutter/test/cupertino/scrollbar_test.dart +++ b/packages/flutter/test/cupertino/scrollbar_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const CupertinoDynamicColor _kScrollbarColor = CupertinoDynamicColor.withBrightness( color: Color(0x59000000), @@ -21,7 +20,7 @@ void main() { const Duration kScrollbarResizeDuration = Duration(milliseconds: 100); const Duration kLongPressDuration = Duration(milliseconds: 100); - testWidgetsWithLeakTracking('Scrollbar never goes away until finger lift', (WidgetTester tester) async { + testWidgets('Scrollbar never goes away until finger lift', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -59,7 +58,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Scrollbar dark mode', (WidgetTester tester) async { + testWidgets('Scrollbar dark mode', (WidgetTester tester) async { Brightness brightness = Brightness.light; late StateSetter setState; await tester.pumpWidget( @@ -96,7 +95,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged with long press', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged with long press', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -169,7 +168,7 @@ void main() { await tester.pump(kScrollbarFadeDuration); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged with long press - reverse', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged with long press - reverse', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -245,7 +244,7 @@ void main() { await tester.pump(kScrollbarFadeDuration); }); - testWidgetsWithLeakTracking('Scrollbar changes thickness and radius when dragged', (WidgetTester tester) async { + testWidgets('Scrollbar changes thickness and radius when dragged', (WidgetTester tester) async { const double thickness = 20; const double thicknessWhileDragging = 40; const double radius = 10; @@ -343,7 +342,7 @@ void main() { await tester.pump(kScrollbarFadeDuration); }); - testWidgetsWithLeakTracking('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { + testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { Widget viewWithScroll() { return const Directionality( textDirection: TextDirection.ltr, @@ -368,7 +367,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('When thumbVisibility is true, must pass a controller or find PrimaryScrollController that is attached to a scroll view', (WidgetTester tester) async { + testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController that is attached to a scroll view', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -403,7 +402,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { + testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { Widget viewWithScroll() { return const Directionality( textDirection: TextDirection.ltr, @@ -428,7 +427,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('When thumbVisibility is true, must pass a controller or find PrimaryScrollController that is attached to a scroll view', (WidgetTester tester) async { + testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController that is attached to a scroll view', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -463,7 +462,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -498,7 +497,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -532,7 +531,7 @@ void main() { expect(find.byType(CupertinoScrollbar), paints..rrect()); }); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -567,7 +566,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -601,7 +600,7 @@ void main() { expect(find.byType(CupertinoScrollbar), paints..rrect()); }); - testWidgetsWithLeakTracking('On first render with thumbVisibility: false, the thumb is hidden', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: false, the thumb is hidden', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget viewWithScroll() { @@ -630,7 +629,7 @@ void main() { expect(find.byType(CupertinoScrollbar), isNot(paints..rect())); }); - testWidgetsWithLeakTracking('With thumbVisibility: true, fling a scroll. While it is still scrolling, set thumbVisibility: false. The thumb should not fade out until the scrolling stops.', (WidgetTester tester) async { + testWidgets('With thumbVisibility: true, fling a scroll. While it is still scrolling, set thumbVisibility: false. The thumb should not fade out until the scrolling stops.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); bool thumbVisibility = true; @@ -688,7 +687,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'With thumbVisibility: false, set thumbVisibility: true. The thumb should be always shown directly', (WidgetTester tester) async { final ScrollController controller = ScrollController(); @@ -743,7 +742,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'With thumbVisibility: false, fling a scroll. While it is still scrolling, set thumbVisibility: true. ' 'The thumb should not fade even after the scrolling stops', (WidgetTester tester) async { @@ -811,7 +810,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Toggling thumbVisibility while not scrolling fades the thumb in/out. ' 'This works even when you have never scrolled at all yet', (WidgetTester tester) async { @@ -867,7 +866,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged with long press - horizontal axis', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged with long press - horizontal axis', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -942,7 +941,7 @@ void main() { await tester.pump(kScrollbarFadeDuration); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged with long press - horizontal axis, reverse', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged with long press - horizontal axis, reverse', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1018,7 +1017,7 @@ void main() { await tester.pump(kScrollbarFadeDuration); }); - testWidgetsWithLeakTracking('Tapping the track area pages the Scroll View', (WidgetTester tester) async { + testWidgets('Tapping the track area pages the Scroll View', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1078,7 +1077,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Throw if interactive with the bar when no position attached', (WidgetTester tester) async { + testWidgets('Throw if interactive with the bar when no position attached', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1123,7 +1122,7 @@ void main() { FlutterError.onError = handler; }); - testWidgetsWithLeakTracking('Interactive scrollbars should have a valid scroll controller', (WidgetTester tester) async { + testWidgets('Interactive scrollbars should have a valid scroll controller', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); final ScrollController scrollController = ScrollController(); @@ -1166,7 +1165,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Simultaneous dragging and pointer scrolling does not cause a crash', (WidgetTester tester) async { + testWidgets('Simultaneous dragging and pointer scrolling does not cause a crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/70105 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1278,7 +1277,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CupertinoScrollbar scrollOrientation works correctly', (WidgetTester tester) async { + testWidgets('CupertinoScrollbar scrollOrientation works correctly', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); diff --git a/packages/flutter/test/cupertino/search_field_test.dart b/packages/flutter/test/cupertino/search_field_test.dart index ee7f1fc9883..ec21764ea9d 100644 --- a/packages/flutter/test/cupertino/search_field_test.dart +++ b/packages/flutter/test/cupertino/search_field_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking( + testWidgets( 'default search field has a border radius', (WidgetTester tester) async { await tester.pumpWidget( @@ -34,7 +33,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'decoration overrides default background color', (WidgetTester tester) async { await tester.pumpWidget( @@ -63,7 +62,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'decoration overrides default border radius', (WidgetTester tester) async { await tester.pumpWidget( @@ -92,7 +91,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'text entries are padded by default', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'initial'); @@ -115,7 +114,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('can change keyboard type', (WidgetTester tester) async { + testWidgets('can change keyboard type', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -131,7 +130,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can control text content via controller', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -159,7 +158,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('placeholder color', (WidgetTester tester) async { + testWidgets('placeholder color', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( theme: CupertinoThemeData(brightness: Brightness.dark), @@ -187,7 +186,7 @@ void main() { expect(placeholder.style!.color!.value, CupertinoColors.systemGrey.color.value); }); - testWidgetsWithLeakTracking( + testWidgets( "placeholderStyle modifies placeholder's style and doesn't affect text's style", (WidgetTester tester) async { await tester.pumpWidget( @@ -221,7 +220,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'prefix widget is in front of the text', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input'); @@ -251,7 +250,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'suffix widget is after the text', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'Hi'); @@ -283,7 +282,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('prefix widget visibility', (WidgetTester tester) async { + testWidgets('prefix widget visibility', (WidgetTester tester) async { const Key prefixIcon = Key('prefix'); await tester.pumpWidget( @@ -312,7 +311,7 @@ void main() { expect(find.byKey(prefixIcon), findsOneWidget); }); - testWidgetsWithLeakTracking( + testWidgets( 'suffix widget respects visibility mode', (WidgetTester tester) async { await tester.pumpWidget( @@ -335,7 +334,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'clear button shows with right visibility mode', (WidgetTester tester) async { TextEditingController controller = TextEditingController(); @@ -381,7 +380,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'clear button removes text', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -409,7 +408,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'tapping clear button also calls onChanged when text not empty', (WidgetTester tester) async { String value = 'text entry'; @@ -439,7 +438,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'RTL puts attachments to the right places', (WidgetTester tester) async { await tester.pumpWidget( @@ -467,7 +466,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Can modify prefix and suffix insets', (WidgetTester tester) async { await tester.pumpWidget( @@ -494,7 +493,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'custom suffix onTap overrides default clearing behavior', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'Text'); @@ -520,7 +519,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('onTap is properly forwarded to the inner text field', (WidgetTester tester) async { + testWidgets('onTap is properly forwarded to the inner text field', (WidgetTester tester) async { int onTapCallCount = 0; // onTap can be null. @@ -550,7 +549,7 @@ void main() { expect(onTapCallCount, 1); }); - testWidgetsWithLeakTracking('autocorrect is properly forwarded to the inner text field', (WidgetTester tester) async { + testWidgets('autocorrect is properly forwarded to the inner text field', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -565,7 +564,7 @@ void main() { expect(textField.autocorrect, false); }); - testWidgetsWithLeakTracking('enabled is properly forwarded to the inner text field', (WidgetTester tester) async { + testWidgets('enabled is properly forwarded to the inner text field', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -580,7 +579,7 @@ void main() { expect(textField.enabled, false); }); - testWidgetsWithLeakTracking('textInputAction is set to TextInputAction.search by default', (WidgetTester tester) async { + testWidgets('textInputAction is set to TextInputAction.search by default', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -593,7 +592,7 @@ void main() { expect(textField.textInputAction, TextInputAction.search); }); - testWidgetsWithLeakTracking('autofocus:true gives focus to the widget', (WidgetTester tester) async { + testWidgets('autofocus:true gives focus to the widget', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -610,7 +609,7 @@ void main() { expect(focusNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('smartQuotesType is properly forwarded to the inner text field', (WidgetTester tester) async { + testWidgets('smartQuotesType is properly forwarded to the inner text field', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -625,7 +624,7 @@ void main() { expect(textField.smartQuotesType, SmartQuotesType.disabled); }); - testWidgetsWithLeakTracking('smartDashesType is properly forwarded to the inner text field', (WidgetTester tester) async { + testWidgets('smartDashesType is properly forwarded to the inner text field', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -640,7 +639,7 @@ void main() { expect(textField.smartDashesType, SmartDashesType.disabled); }); - testWidgetsWithLeakTracking( + testWidgets( 'enableIMEPersonalizedLearning is properly forwarded to the inner text field', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index e27587e5178..f28f4b238c1 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -14,7 +14,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -94,7 +93,7 @@ Color getBackgroundColor(WidgetTester tester, int childIndex) { } void main() { - testWidgetsWithLeakTracking('Tap changes toggle state', (WidgetTester tester) async { + testWidgets('Tap changes toggle state', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -128,7 +127,7 @@ void main() { expect(sharedValue, 1); }); - testWidgetsWithLeakTracking('Need at least 2 children', (WidgetTester tester) async { + testWidgets('Need at least 2 children', (WidgetTester tester) async { await expectLater( () => tester.pumpWidget( boilerplate( @@ -162,7 +161,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Padding works', (WidgetTester tester) async { + testWidgets('Padding works', (WidgetTester tester) async { const Key key = Key('Container'); final Map<int, Widget> children = <int, Widget>{}; @@ -249,7 +248,7 @@ void main() { await verifyPadding(padding: const EdgeInsets.fromLTRB(1, 3, 5, 7)); }); - testWidgetsWithLeakTracking('Value attribute must be the key of one of the children widgets', (WidgetTester tester) async { + testWidgets('Value attribute must be the key of one of the children widgets', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -272,7 +271,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Widgets have correct default text/icon styles, change correctly on selection', (WidgetTester tester) async { + testWidgets('Widgets have correct default text/icon styles, change correctly on selection', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Icon(IconData(1)); @@ -315,7 +314,7 @@ void main() { expect(iconTheme.data.color, isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Segmented controls respects themes', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; @@ -361,7 +360,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('SegmentedControl is correct when user provides custom colors', (WidgetTester tester) async { + testWidgets('SegmentedControl is correct when user provides custom colors', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Icon(IconData(1)); @@ -422,7 +421,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Widgets are centered within segments', (WidgetTester tester) async { + testWidgets('Widgets are centered within segments', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -449,7 +448,7 @@ void main() { expect(tester.getCenter(find.text('Child 2')), const Offset(142.0, 100.0)); }); - testWidgetsWithLeakTracking('Tap calls onValueChanged', (WidgetTester tester) async { + testWidgets('Tap calls onValueChanged', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -478,7 +477,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('State does not change if onValueChanged does not call setState()', (WidgetTester tester) async { + testWidgets('State does not change if onValueChanged does not call setState()', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -509,7 +508,7 @@ void main() { expect(getBackgroundColor(tester, 1), isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Background color of child should change on selection, ' 'and should not change when tapped again', (WidgetTester tester) async { @@ -529,7 +528,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Children can be non-Text or Icon widgets (in this case, ' 'a Container or Placeholder widget)', (WidgetTester tester) async { @@ -562,7 +561,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Passed in value is child initially selected', (WidgetTester tester) async { + testWidgets('Passed in value is child initially selected', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); expect(getSelectedIndex(tester), 0); @@ -571,7 +570,7 @@ void main() { expect(getBackgroundColor(tester, 1), isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking('Null input for value results in no child initially selected', (WidgetTester tester) async { + testWidgets('Null input for value results in no child initially selected', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -602,7 +601,7 @@ void main() { expect(getBackgroundColor(tester, 1), isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking('Long press changes background color of not-selected child', (WidgetTester tester) async { + testWidgets('Long press changes background color of not-selected child', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); expect(getBackgroundColor(tester, 0), CupertinoColors.activeBlue); @@ -620,7 +619,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Long press does not change background color of currently-selected child', (WidgetTester tester) async { + testWidgets('Long press does not change background color of currently-selected child', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); expect(getBackgroundColor(tester, 0), CupertinoColors.activeBlue); @@ -638,7 +637,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Height of segmented control is determined by tallest widget', (WidgetTester tester) async { + testWidgets('Height of segmented control is determined by tallest widget', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = Container( constraints: const BoxConstraints.tightFor(height: 100.0), @@ -669,7 +668,7 @@ void main() { expect(buttonBox.size.height, 400.0); }); - testWidgetsWithLeakTracking('Width of each segmented control segment is determined by widest widget', (WidgetTester tester) async { + testWidgets('Width of each segmented control segment is determined by widest widget', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = Container( constraints: const BoxConstraints.tightFor(width: 50.0), @@ -708,7 +707,7 @@ void main() { expect(childWidth, getSurroundingRect(tester, child: 2).width); }); - testWidgetsWithLeakTracking('Width is finite in unbounded space', (WidgetTester tester) async { + testWidgets('Width is finite in unbounded space', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -736,7 +735,7 @@ void main() { expect(segmentedControl.size.width.isFinite, isTrue); }); - testWidgetsWithLeakTracking('Directionality test - RTL should reverse order of widgets', (WidgetTester tester) async { + testWidgets('Directionality test - RTL should reverse order of widgets', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -756,7 +755,7 @@ void main() { expect(tester.getTopRight(find.text('Child 1')).dx > tester.getTopRight(find.text('Child 2')).dx, isTrue); }); - testWidgetsWithLeakTracking('Correct initial selection and toggling behavior - RTL', (WidgetTester tester) async { + testWidgets('Correct initial selection and toggling behavior - RTL', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -799,7 +798,7 @@ void main() { expect(getBackgroundColor(tester, 1), CupertinoColors.activeBlue); }); - testWidgetsWithLeakTracking('Segmented control semantics', (WidgetTester tester) async { + testWidgets('Segmented control semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Map<int, Widget> children = <int, Widget>{}; @@ -902,7 +901,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Non-centered taps work on smaller widgets', (WidgetTester tester) async { + testWidgets('Non-centered taps work on smaller widgets', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -944,7 +943,7 @@ void main() { expect(sharedValue, 0); }); - testWidgetsWithLeakTracking('Hit-tests report accurate local position in segments', (WidgetTester tester) async { + testWidgets('Hit-tests report accurate local position in segments', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; late TapDownDetails tapDownDetails; children[0] = GestureDetector( @@ -984,7 +983,7 @@ void main() { expect(tapDownDetails.globalPosition, segment0GlobalOffset + const Offset(7, 11)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Segment still hittable with a child that has no hitbox', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/57326. @@ -1023,7 +1022,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Animation is correct when the selected segment changes', (WidgetTester tester) async { + testWidgets('Animation is correct when the selected segment changes', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); await tester.tap(find.text('Child 2')); @@ -1053,7 +1052,7 @@ void main() { expect(getBackgroundColor(tester, 1), CupertinoColors.activeBlue); }); - testWidgetsWithLeakTracking('Animation is correct when widget is rebuilt', (WidgetTester tester) async { + testWidgets('Animation is correct when widget is rebuilt', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const Text('Child 2'); @@ -1205,7 +1204,7 @@ void main() { expect(getBackgroundColor(tester, 1), CupertinoColors.activeBlue); }); - testWidgetsWithLeakTracking('Multiple segments are pressed', (WidgetTester tester) async { + testWidgets('Multiple segments are pressed', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); @@ -1252,7 +1251,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Transition is triggered while a transition is already occurring', (WidgetTester tester) async { + testWidgets('Transition is triggered while a transition is already occurring', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); @@ -1314,7 +1313,7 @@ void main() { expect(getBackgroundColor(tester, 2), CupertinoColors.activeBlue); }); - testWidgetsWithLeakTracking('Segment is selected while it is transitioning to unselected state', (WidgetTester tester) async { + testWidgets('Segment is selected while it is transitioning to unselected state', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); await tester.tap(find.text('Child 2')); @@ -1342,7 +1341,7 @@ void main() { expect(getBackgroundColor(tester, 1), isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking('Add segment while animation is running', (WidgetTester tester) async { + testWidgets('Add segment while animation is running', (WidgetTester tester) async { Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); @@ -1390,7 +1389,7 @@ void main() { expect(getBackgroundColor(tester, 3), isSameColorAs(CupertinoColors.white)); }); - testWidgetsWithLeakTracking('Remove segment while animation is running', (WidgetTester tester) async { + testWidgets('Remove segment while animation is running', (WidgetTester tester) async { Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); @@ -1435,7 +1434,7 @@ void main() { expect(getBackgroundColor(tester, 1), CupertinoColors.activeBlue); }); - testWidgetsWithLeakTracking('Remove currently animating segment', (WidgetTester tester) async { + testWidgets('Remove currently animating segment', (WidgetTester tester) async { Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); @@ -1487,7 +1486,7 @@ void main() { }); // Regression test: https://github.com/flutter/flutter/issues/43414. - testWidgetsWithLeakTracking("Quick double tap doesn't break the internal state", (WidgetTester tester) async { + testWidgets("Quick double tap doesn't break the internal state", (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), 1: Text('B'), @@ -1527,7 +1526,7 @@ void main() { expect(sharedValue, 2); }); - testWidgetsWithLeakTracking('Golden Test Placeholder Widget', (WidgetTester tester) async { + testWidgets('Golden Test Placeholder Widget', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = Container(); children[1] = const Placeholder(); @@ -1561,7 +1560,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden Test Pressed State', (WidgetTester tester) async { + testWidgets('Golden Test Pressed State', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); @@ -1603,7 +1602,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Hovering over Cupertino segmented control updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino segmented control updates cursor to clickable on Web', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('A'); children[1] = const Text('B'); diff --git a/packages/flutter/test/cupertino/slider_test.dart b/packages/flutter/test/cupertino/slider_test.dart index 38fd62e11c6..a205276e0e7 100644 --- a/packages/flutter/test/cupertino/slider_test.dart +++ b/packages/flutter/test/cupertino/slider_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -33,7 +32,7 @@ void main() { return tester.dragFrom(topLeft + const Offset(unit, unit), const Offset(delta, 0.0)); } - testWidgetsWithLeakTracking('Slider does not move when tapped (LTR)', (WidgetTester tester) async { + testWidgets('Slider does not move when tapped (LTR)', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; @@ -69,7 +68,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider does not move when tapped (RTL)', (WidgetTester tester) async { + testWidgets('Slider does not move when tapped (RTL)', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; @@ -105,7 +104,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider calls onChangeStart once when interaction begins', (WidgetTester tester) async { + testWidgets('Slider calls onChangeStart once when interaction begins', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; int numberOfTimesOnChangeStartIsCalled = 0; @@ -146,7 +145,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider calls onChangeEnd once after interaction has ended', (WidgetTester tester) async { + testWidgets('Slider calls onChangeEnd once after interaction has ended', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; int numberOfTimesOnChangeEndIsCalled = 0; @@ -187,7 +186,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider moves when dragged (LTR)', (WidgetTester tester) async { + testWidgets('Slider moves when dragged (LTR)', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; late double startValue; @@ -241,7 +240,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider moves when dragged (RTL)', (WidgetTester tester) async { + testWidgets('Slider moves when dragged (RTL)', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; late double startValue; @@ -295,7 +294,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider Semantics', (WidgetTester tester) async { + testWidgets('Slider Semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -359,7 +358,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Slider Semantics can be updated', (WidgetTester tester) async { + testWidgets('Slider Semantics can be updated', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); double value = 0.5; await tester.pumpWidget( @@ -410,7 +409,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Slider respects themes', (WidgetTester tester) async { + testWidgets('Slider respects themes', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -445,7 +444,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Themes can be overridden', (WidgetTester tester) async { + testWidgets('Themes can be overridden', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.dark), @@ -464,7 +463,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Themes can be overridden by dynamic colors', (WidgetTester tester) async { + testWidgets('Themes can be overridden by dynamic colors', (WidgetTester tester) async { const CupertinoDynamicColor activeColor = CupertinoDynamicColor( color: Color(0x00000001), darkColor: Color(0x00000002), @@ -520,7 +519,7 @@ void main() { expect(find.byType(CupertinoSlider), paints..rrect(color: activeColor.highContrastElevatedColor)); }); - testWidgetsWithLeakTracking('track color is dynamic', (WidgetTester tester) async { + testWidgets('track color is dynamic', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.light), @@ -568,7 +567,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Thumb color can be overridden', (WidgetTester tester) async { + testWidgets('Thumb color can be overridden', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -616,7 +615,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Hovering over Cupertino slider thumb updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino slider thumb updates cursor to clickable on Web', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; diff --git a/packages/flutter/test/cupertino/sliding_segmented_control_test.dart b/packages/flutter/test/cupertino/sliding_segmented_control_test.dart index 3413f5d9e78..6cab29b3750 100644 --- a/packages/flutter/test/cupertino/sliding_segmented_control_test.dart +++ b/packages/flutter/test/cupertino/sliding_segmented_control_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -94,7 +93,7 @@ void main() { groupValue = 0; }); - testWidgetsWithLeakTracking('Need at least 2 children', (WidgetTester tester) async { + testWidgets('Need at least 2 children', (WidgetTester tester) async { groupValue = null; await expectLater( () => tester.pumpWidget( @@ -147,7 +146,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Padding works', (WidgetTester tester) async { + testWidgets('Padding works', (WidgetTester tester) async { const Key key = Key('Container'); const Map<int, Widget> children = <int, Widget>{ @@ -224,7 +223,7 @@ void main() { await verifyPadding(padding: const EdgeInsets.fromLTRB(1, 3, 5, 7)); }); - testWidgetsWithLeakTracking('Tap changes toggle state', (WidgetTester tester) async { + testWidgets('Tap changes toggle state', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Text('Child 2'), @@ -256,7 +255,7 @@ void main() { expect(groupValue, 1); }); - testWidgetsWithLeakTracking( + testWidgets( 'Segmented controls respect theme', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ @@ -294,7 +293,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('SegmentedControl dark mode', (WidgetTester tester) async { + testWidgets('SegmentedControl dark mode', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Icon(IconData(1)), @@ -346,7 +345,7 @@ void main() { expect(decorationDark.color!.value, CupertinoColors.systemRed.darkColor.value); }); - testWidgetsWithLeakTracking( + testWidgets( 'Children can be non-Text or Icon widgets (in this case, ' 'a Container or Placeholder widget)', (WidgetTester tester) async { @@ -370,13 +369,13 @@ void main() { }, ); - testWidgetsWithLeakTracking('Passed in value is child initially selected', (WidgetTester tester) async { + testWidgets('Passed in value is child initially selected', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); expect(getHighlightedIndex(tester), 0); }); - testWidgetsWithLeakTracking('Null input for value results in no child initially selected', (WidgetTester tester) async { + testWidgets('Null input for value results in no child initially selected', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Text('Child 2'), @@ -402,7 +401,7 @@ void main() { expect(getHighlightedIndex(tester), null); }); - testWidgetsWithLeakTracking('Long press not-selected child interactions', (WidgetTester tester) async { + testWidgets('Long press not-selected child interactions', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Text('Child 2'), @@ -466,7 +465,7 @@ void main() { expect(getChildOpacityByName('Child 2'), 0.2); }); - testWidgetsWithLeakTracking('Long press does not change the opacity of currently-selected child', (WidgetTester tester) async { + testWidgets('Long press does not change the opacity of currently-selected child', (WidgetTester tester) async { double getChildOpacityByName(String childName) { return tester.renderObject<RenderAnimatedOpacity>( find.ancestor(matching: find.byType(AnimatedOpacity), of: find.text(childName)), @@ -487,7 +486,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Height of segmented control is determined by tallest widget', (WidgetTester tester) async { + testWidgets('Height of segmented control is determined by tallest widget', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{ 0: Container(constraints: const BoxConstraints.tightFor(height: 100.0)), 1: Container(constraints: const BoxConstraints.tightFor(height: 400.0)), @@ -517,7 +516,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Width of each segmented control segment is determined by widest widget', (WidgetTester tester) async { + testWidgets('Width of each segmented control segment is determined by widest widget', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{ 0: Container(constraints: const BoxConstraints.tightFor(width: 50.0)), 1: Container(constraints: const BoxConstraints.tightFor(width: 100.0)), @@ -548,7 +547,7 @@ void main() { expect(childWidth, 200.0 + 9.25 * 2); }); - testWidgetsWithLeakTracking('Width is finite in unbounded space', (WidgetTester tester) async { + testWidgets('Width is finite in unbounded space', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: SizedBox(width: 50), 1: SizedBox(width: 70), @@ -581,7 +580,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Directionality test - RTL should reverse order of widgets', (WidgetTester tester) async { + testWidgets('Directionality test - RTL should reverse order of widgets', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Text('Child 2'), @@ -608,7 +607,7 @@ void main() { expect(tester.getTopRight(find.text('Child 1')).dx > tester.getTopRight(find.text('Child 2')).dx, isTrue); }); - testWidgetsWithLeakTracking('Correct initial selection and toggling behavior - RTL', (WidgetTester tester) async { + testWidgets('Correct initial selection and toggling behavior - RTL', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Text('Child 2'), @@ -645,7 +644,7 @@ void main() { expect(getHighlightedIndex(tester), 0); }); - testWidgetsWithLeakTracking('Segmented control semantics', (WidgetTester tester) async { + testWidgets('Segmented control semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), @@ -738,7 +737,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Non-centered taps work on smaller widgets', (WidgetTester tester) async { + testWidgets('Non-centered taps work on smaller widgets', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; children[0] = const Text('Child 1'); children[1] = const SizedBox(); @@ -766,7 +765,7 @@ void main() { expect(groupValue, 1); }); - testWidgetsWithLeakTracking('Hit-tests report accurate local position in segments', (WidgetTester tester) async { + testWidgets('Hit-tests report accurate local position in segments', (WidgetTester tester) async { final Map<int, Widget> children = <int, Widget>{}; late TapDownDetails tapDownDetails; children[0] = GestureDetector( @@ -798,7 +797,7 @@ void main() { expect(tapDownDetails.globalPosition, segment0GlobalOffset + const Offset(7, 11)); }); - testWidgetsWithLeakTracking('Thumb animation is correct when the selected segment changes', (WidgetTester tester) async { + testWidgets('Thumb animation is correct when the selected segment changes', (WidgetTester tester) async { await tester.pumpWidget(setupSimpleSegmentedControl()); final Rect initialRect = currentUnscaledThumbRect(tester, useGlobalCoordinate: true); @@ -879,7 +878,7 @@ void main() { expect(currentThumbScale(tester), moreOrLessEquals(1, epsilon: 0.01)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Thumb does not go out of bounds in animation', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ @@ -936,7 +935,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Transition is triggered while a transition is already occurring', (WidgetTester tester) async { + testWidgets('Transition is triggered while a transition is already occurring', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), 1: Text('B'), @@ -986,7 +985,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Insert segment while animation is running', (WidgetTester tester) async { + testWidgets('Insert segment while animation is running', (WidgetTester tester) async { final Map<int, Widget> children = SplayTreeMap<int, Widget>((int a, int b) => a - b); children[0] = const Text('A'); @@ -1032,7 +1031,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('change selection programmatically when dragging', (WidgetTester tester) async { + testWidgets('change selection programmatically when dragging', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), 1: Text('B'), @@ -1091,7 +1090,7 @@ void main() { expect(callbackCalled, isFalse); }); - testWidgetsWithLeakTracking('Disallow new gesture when dragging', (WidgetTester tester) async { + testWidgets('Disallow new gesture when dragging', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), 1: Text('B'), @@ -1146,7 +1145,7 @@ void main() { expect(callbackCalled, isFalse); }); - testWidgetsWithLeakTracking('gesture outlives the widget', (WidgetTester tester) async { + testWidgets('gesture outlives the widget', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/63338. const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), @@ -1184,7 +1183,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('computeDryLayout is pure', (WidgetTester tester) async { + testWidgets('computeDryLayout is pure', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/73362. const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), @@ -1218,7 +1217,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Has consistent size, independent of groupValue', (WidgetTester tester) async { + testWidgets('Has consistent size, independent of groupValue', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/62063. const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), @@ -1252,7 +1251,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ScrollView + SlidingSegmentedControl interaction', (WidgetTester tester) async { + testWidgets('ScrollView + SlidingSegmentedControl interaction', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('Child 1'), 1: Text('Child 2'), @@ -1339,7 +1338,7 @@ void main() { expect(groupValue, 1); }); - testWidgetsWithLeakTracking('Hovering over Cupertino sliding segmented control updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino sliding segmented control updates cursor to clickable on Web', (WidgetTester tester) async { const Map<int, Widget> children = <int, Widget>{ 0: Text('A'), 1: Text('BB'), diff --git a/packages/flutter/test/cupertino/spell_check_suggestions_toolbar_test.dart b/packages/flutter/test/cupertino/spell_check_suggestions_toolbar_test.dart index fa88e2859d8..3da42ef7156 100644 --- a/packages/flutter/test/cupertino/spell_check_suggestions_toolbar_test.dart +++ b/packages/flutter/test/cupertino/spell_check_suggestions_toolbar_test.dart @@ -7,12 +7,11 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('more than three suggestions throws an error', (WidgetTester tester) async { + testWidgets('more than three suggestions throws an error', (WidgetTester tester) async { Future<void> pumpToolbar(List<String> suggestions) async { await tester.pumpWidget( CupertinoApp( @@ -62,7 +61,7 @@ void main() { expect(labels, isNot(contains('yeller'))); }); - testWidgetsWithLeakTracking('buildButtonItems builds a disabled "No Replacements Found" button when no suggestions', (WidgetTester tester) async { + testWidgets('buildButtonItems builds a disabled "No Replacements Found" button when no suggestions', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); final FocusNode focusNode = FocusNode(); diff --git a/packages/flutter/test/cupertino/switch_test.dart b/packages/flutter/test/cupertino/switch_test.dart index cf4962c0377..853a51625e6 100644 --- a/packages/flutter/test/cupertino/switch_test.dart +++ b/packages/flutter/test/cupertino/switch_test.dart @@ -14,10 +14,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Switch can toggle on tap', (WidgetTester tester) async { + testWidgets('Switch can toggle on tap', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -47,7 +46,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('CupertinoSwitch can be toggled by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('CupertinoSwitch can be toggled by keyboard shortcuts', (WidgetTester tester) async { bool value = true; Widget buildApp({bool enabled = true}) { return CupertinoApp( @@ -80,7 +79,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('Switch emits light haptic vibration on tap', (WidgetTester tester) async { + testWidgets('Switch emits light haptic vibration on tap', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; @@ -120,7 +119,7 @@ void main() { expect(log.single, isMethodCall('HapticFeedback.vibrate', arguments: 'HapticFeedbackType.lightImpact')); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('Using other widgets that rebuild the switch will not cause vibrations', (WidgetTester tester) async { + testWidgets('Using other widgets that rebuild the switch will not cause vibrations', (WidgetTester tester) async { final Key switchKey = UniqueKey(); final Key switchKey2 = UniqueKey(); bool value = false; @@ -191,7 +190,7 @@ void main() { expect(log[3], isMethodCall('HapticFeedback.vibrate', arguments: 'HapticFeedbackType.lightImpact')); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('Haptic vibration triggers on drag', (WidgetTester tester) async { + testWidgets('Haptic vibration triggers on drag', (WidgetTester tester) async { bool value = false; final List<MethodCall> log = <MethodCall>[]; @@ -229,7 +228,7 @@ void main() { expect(log[0], isMethodCall('HapticFeedback.vibrate', arguments: 'HapticFeedbackType.lightImpact')); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('No haptic vibration triggers from a programmatic value change', (WidgetTester tester) async { + testWidgets('No haptic vibration triggers from a programmatic value change', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; @@ -281,7 +280,7 @@ void main() { expect(log, hasLength(0)); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('Switch can drag (LTR)', (WidgetTester tester) async { + testWidgets('Switch can drag (LTR)', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -325,7 +324,7 @@ void main() { expect(value, isFalse); }); - testWidgetsWithLeakTracking('Switch can drag with dragStartBehavior', (WidgetTester tester) async { + testWidgets('Switch can drag with dragStartBehavior', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -411,7 +410,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('Switch can drag (RTL)', (WidgetTester tester) async { + testWidgets('Switch can drag (RTL)', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -456,7 +455,7 @@ void main() { expect(value, isFalse); }); - testWidgetsWithLeakTracking('can veto switch dragging result', (WidgetTester tester) async { + testWidgets('can veto switch dragging result', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -528,7 +527,7 @@ void main() { expect(position.value, 1.0); }); - testWidgetsWithLeakTracking('Switch is translucent when disabled', (WidgetTester tester) async { + testWidgets('Switch is translucent when disabled', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -546,7 +545,7 @@ void main() { expect(tester.widget<Opacity>(find.byType(Opacity).first).opacity, 0.5); }); - testWidgetsWithLeakTracking('Switch is using track color when set', (WidgetTester tester) async { + testWidgets('Switch is using track color when set', (WidgetTester tester) async { const Color trackColor = Color(0xFF00FF00); await tester.pumpWidget( @@ -568,7 +567,7 @@ void main() { expect(find.byType(CupertinoSwitch), paints..rrect(color: trackColor)); }); - testWidgetsWithLeakTracking('Switch is using default thumb color', (WidgetTester tester) async { + testWidgets('Switch is using default thumb color', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -594,7 +593,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch is using thumb color when set', (WidgetTester tester) async { + testWidgets('Switch is using thumb color when set', (WidgetTester tester) async { const Color thumbColor = Color(0xFF000000); await tester.pumpWidget( const Directionality( @@ -622,7 +621,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch is opaque when enabled', (WidgetTester tester) async { + testWidgets('Switch is opaque when enabled', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -640,7 +639,7 @@ void main() { expect(tester.widget<Opacity>(find.byType(Opacity).first).opacity, 1.0); }); - testWidgetsWithLeakTracking('Switch turns translucent after becoming disabled', (WidgetTester tester) async { + testWidgets('Switch turns translucent after becoming disabled', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -671,7 +670,7 @@ void main() { expect(tester.widget<Opacity>(find.byType(Opacity).first).opacity, 0.5); }); - testWidgetsWithLeakTracking('Switch turns opaque after becoming enabled', (WidgetTester tester) async { + testWidgets('Switch turns opaque after becoming enabled', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -702,7 +701,7 @@ void main() { expect(tester.widget<Opacity>(find.byType(Opacity).first).opacity, 1.0); }); - testWidgetsWithLeakTracking('Switch renders correctly before, during, and after being tapped', (WidgetTester tester) async { + testWidgets('Switch renders correctly before, during, and after being tapped', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -780,7 +779,7 @@ void main() { style: PaintingStyle.stroke, ); - testWidgetsWithLeakTracking('Switch renders switch labels correctly before, during, and after being tapped', (WidgetTester tester) async { + testWidgets('Switch renders switch labels correctly before, during, and after being tapped', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -830,7 +829,7 @@ void main() { expect(switchRenderObject, offLabelPaintPattern(alpha: 0)); }); - testWidgetsWithLeakTracking('Switch renders switch labels correctly before, during, and after being tapped in high contrast', (WidgetTester tester) async { + testWidgets('Switch renders switch labels correctly before, during, and after being tapped in high contrast', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -883,7 +882,7 @@ void main() { expect(switchRenderObject, offLabelPaintPattern(highContrast: true, alpha: 0)); }); - testWidgetsWithLeakTracking('Switch renders switch labels correctly before, during, and after being tapped with direction rtl', (WidgetTester tester) async { + testWidgets('Switch renders switch labels correctly before, during, and after being tapped with direction rtl', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -933,7 +932,7 @@ void main() { expect(switchRenderObject, offLabelPaintPattern(isRtl: true, alpha: 0)); }); - testWidgetsWithLeakTracking('Switch renders correctly in dark mode', (WidgetTester tester) async { + testWidgets('Switch renders correctly in dark mode', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -978,7 +977,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch can apply the ambient theme and be opted out', (WidgetTester tester) async { + testWidgets('Switch can apply the ambient theme and be opted out', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; await tester.pumpWidget( @@ -1038,7 +1037,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Hovering over Cupertino switch updates cursor to clickable on Web', (WidgetTester tester) async { + testWidgets('Hovering over Cupertino switch updates cursor to clickable on Web', (WidgetTester tester) async { const bool value = false; // Disabled CupertinoSwitch does not update cursor on Web. await tester.pumpWidget( @@ -1094,7 +1093,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CupertinoSwitch is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('CupertinoSwitch is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'CupertinoSwitch'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1176,7 +1175,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CupertinoSwitch.onFocusChange callback', (WidgetTester tester) async { + testWidgets('CupertinoSwitch.onFocusChange callback', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'CupertinoSwitch'); addTearDown(focusNode.dispose); bool focused = false; diff --git a/packages/flutter/test/cupertino/tab_scaffold_test.dart b/packages/flutter/test/cupertino/tab_scaffold_test.dart index ea03c5423d2..938fb83c2e2 100644 --- a/packages/flutter/test/cupertino/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/tab_scaffold_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import '../rendering/rendering_tester.dart' show TestCallbackPainter; @@ -51,7 +50,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Tab switching', (WidgetTester tester) async { + testWidgets('Tab switching', (WidgetTester tester) async { final List<int> tabsPainted = <int>[]; await tester.pumpWidget( @@ -105,7 +104,7 @@ void main() { expect(selectedTabs, const <int>[1, 0]); }); - testWidgetsWithLeakTracking('Tabs are lazy built and moved offstage when inactive', (WidgetTester tester) async { + testWidgets('Tabs are lazy built and moved offstage when inactive', (WidgetTester tester) async { final List<int> tabsBuilt = <int>[]; await tester.pumpWidget( @@ -140,7 +139,7 @@ void main() { expect(find.text('Page 2', skipOffstage: false), isOffstage); }); - testWidgetsWithLeakTracking('Last tab gets focus', (WidgetTester tester) async { + testWidgets('Last tab gets focus', (WidgetTester tester) async { // 2 nodes for 2 tabs final List<FocusNode> focusNodes = <FocusNode>[ FocusNode(debugLabel: 'Node 1'), @@ -179,7 +178,7 @@ void main() { expect(focusNodes[1].hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Do not affect focus order in the route', (WidgetTester tester) async { + testWidgets('Do not affect focus order in the route', (WidgetTester tester) async { final List<FocusNode> focusNodes = <FocusNode>[ FocusNode(debugLabel: 'Node 1'), FocusNode(debugLabel: 'Node 2'), @@ -245,7 +244,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Programmatic tab switching by changing the index of an existing controller', (WidgetTester tester) async { + testWidgets('Programmatic tab switching by changing the index of an existing controller', (WidgetTester tester) async { final CupertinoTabController controller = CupertinoTabController(initialIndex: 1); addTearDown(controller.dispose); final List<int> tabsPainted = <int>[]; @@ -284,7 +283,7 @@ void main() { expect(selectedTabs, const <int>[1]); }); - testWidgetsWithLeakTracking('Programmatic tab switching by passing in a new controller', (WidgetTester tester) async { + testWidgets('Programmatic tab switching by passing in a new controller', (WidgetTester tester) async { final List<int> tabsPainted = <int>[]; await tester.pumpWidget( @@ -336,7 +335,7 @@ void main() { expect(selectedTabs, const <int>[0]); }); - testWidgetsWithLeakTracking('Tab bar respects themes', (WidgetTester tester) async { + testWidgets('Tab bar respects themes', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabScaffold( @@ -394,7 +393,7 @@ void main() { expect(tab2.text.style!.color, isSameColorAs(CupertinoColors.systemRed.darkColor)); }); - testWidgetsWithLeakTracking('Tab contents are padded when there are view insets', (WidgetTester tester) async { + testWidgets('Tab contents are padded when there are view insets', (WidgetTester tester) async { late BuildContext innerContext; await tester.pumpWidget( @@ -420,7 +419,7 @@ void main() { expect(MediaQuery.of(innerContext).padding.bottom, 0); }); - testWidgetsWithLeakTracking('Tab contents are not inset when resizeToAvoidBottomInset overridden', (WidgetTester tester) async { + testWidgets('Tab contents are not inset when resizeToAvoidBottomInset overridden', (WidgetTester tester) async { late BuildContext innerContext; await tester.pumpWidget( @@ -447,7 +446,7 @@ void main() { expect(MediaQuery.of(innerContext).padding.bottom, 50); }); - testWidgetsWithLeakTracking('Tab contents bottom padding are not consumed by viewInsets when resizeToAvoidBottomInset overridden', (WidgetTester tester) async { + testWidgets('Tab contents bottom padding are not consumed by viewInsets when resizeToAvoidBottomInset overridden', (WidgetTester tester) async { final Widget child = Localizations( locale: const Locale('en', 'US'), delegates: const <LocalizationsDelegate<dynamic>>[ @@ -495,7 +494,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking( + testWidgets( 'Opaque tab bar consumes bottom padding while non opaque tab bar does not', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/43581. @@ -527,7 +526,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Tab and page scaffolds do not double stack view insets', (WidgetTester tester) async { + testWidgets('Tab and page scaffolds do not double stack view insets', (WidgetTester tester) async { late BuildContext innerContext; await tester.pumpWidget( @@ -557,7 +556,7 @@ void main() { expect(MediaQuery.of(innerContext).padding.bottom, 0); }); - testWidgetsWithLeakTracking('Deleting tabs after selecting them should switch to the last available tab', (WidgetTester tester) async { + testWidgets('Deleting tabs after selecting them should switch to the last available tab', (WidgetTester tester) async { final List<int> tabsBuilt = <int>[]; await tester.pumpWidget( @@ -627,7 +626,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/33455 - testWidgetsWithLeakTracking('Adding new tabs does not crash the app', (WidgetTester tester) async { + testWidgets('Adding new tabs does not crash the app', (WidgetTester tester) async { final List<int> tabsPainted = <int>[]; final CupertinoTabController controller = CupertinoTabController(); addTearDown(controller.dispose); @@ -682,7 +681,7 @@ void main() { expect(tabsPainted, const <int>[0, 0, 18]); }); - testWidgetsWithLeakTracking( + testWidgets( 'If a controller is initially provided then the parent stops doing so for rebuilds, ' 'a new instance of CupertinoTabController should be created and used by the widget, ' "while preserving the previous controller's tab index", @@ -747,7 +746,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Do not call dispose on a controller that we do not own ' 'but do remove from its listeners when done listening to it', (WidgetTester tester) async { @@ -785,7 +784,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('The owner can dispose the old controller', (WidgetTester tester) async { + testWidgets('The owner can dispose the old controller', (WidgetTester tester) async { CupertinoTabController controller = CupertinoTabController(initialIndex: 2); await tester.pumpWidget( @@ -824,7 +823,7 @@ void main() { expect(find.text('Tab 3'), findsNothing); }); - testWidgetsWithLeakTracking('A controller can control more than one CupertinoTabScaffold, ' + testWidgets('A controller can control more than one CupertinoTabScaffold, ' 'removal of listeners does not break the controller', (WidgetTester tester) async { final List<int> tabsPainted0 = <int>[]; @@ -939,7 +938,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Assert when current tab index >= number of tabs', (WidgetTester tester) async { + testWidgets('Assert when current tab index >= number of tabs', (WidgetTester tester) async { final CupertinoTabController controller = CupertinoTabController(initialIndex: 2); addTearDown(controller.dispose); @@ -981,7 +980,7 @@ void main() { expect(message, contains('with 3 tabs')); }); - testWidgetsWithLeakTracking("Don't replace focus nodes for existing tabs when changing tab count", (WidgetTester tester) async { + testWidgets("Don't replace focus nodes for existing tabs when changing tab count", (WidgetTester tester) async { final CupertinoTabController controller = CupertinoTabController(initialIndex: 2); addTearDown(controller.dispose); @@ -1036,7 +1035,7 @@ void main() { expect(scopes.sublist(0, 3), equals(newScopes.sublist(0, 3))); }); - testWidgetsWithLeakTracking('Current tab index cannot go below zero or be null', (WidgetTester tester) async { + testWidgets('Current tab index cannot go below zero or be null', (WidgetTester tester) async { void expectAssertionError(VoidCallback callback, String errorMessage) { try { callback(); @@ -1053,7 +1052,7 @@ void main() { expectAssertionError(() => controller.index = -1, '>= 0'); }); - testWidgetsWithLeakTracking('Does not lose state when focusing on text input', (WidgetTester tester) async { + testWidgets('Does not lose state when focusing on text input', (WidgetTester tester) async { // Regression testing for https://github.com/flutter/flutter/issues/28457. await tester.pumpWidget( @@ -1095,7 +1094,7 @@ void main() { expect(find.text("don't lose me"), findsOneWidget); }); - testWidgetsWithLeakTracking('textScaleFactor is set to 1.0', (WidgetTester tester) async { + testWidgets('textScaleFactor is set to 1.0', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Builder(builder: (BuildContext context) { @@ -1137,7 +1136,7 @@ void main() { expect(contents, isNot(contains(predicate((RichText t) => t.textScaler != const TextScaler.linear(99.0))))); }); - testWidgetsWithLeakTracking('state restoration', (WidgetTester tester) async { + testWidgets('state restoration', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( restorationScopeId: 'app', @@ -1192,7 +1191,7 @@ void main() { expect(find.text('Content 3'), findsNothing); }); - testWidgetsWithLeakTracking('switch from internal to external controller with state restoration', (WidgetTester tester) async { + testWidgets('switch from internal to external controller with state restoration', (WidgetTester tester) async { Widget buildWidget({CupertinoTabController? controller}) { return CupertinoApp( restorationScopeId: 'app', @@ -1267,7 +1266,7 @@ void main() { .setMockMethodCallHandler(SystemChannels.platform, null); }); - testWidgetsWithLeakTracking('System back navigation inside of tabs', (WidgetTester tester) async { + testWidgets('System back navigation inside of tabs', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: MediaQuery( diff --git a/packages/flutter/test/cupertino/tab_test.dart b/packages/flutter/test/cupertino/tab_test.dart index c2f6ede7ada..63001a64f3f 100644 --- a/packages/flutter/test/cupertino/tab_test.dart +++ b/packages/flutter/test/cupertino/tab_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Use home', (WidgetTester tester) async { + testWidgets('Use home', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabView( @@ -19,7 +18,7 @@ void main() { expect(find.text('home'), findsOneWidget); }); - testWidgetsWithLeakTracking('Use routes', (WidgetTester tester) async { + testWidgets('Use routes', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabView( @@ -33,7 +32,7 @@ void main() { expect(find.text('first route'), findsOneWidget); }); - testWidgetsWithLeakTracking('Use home and named routes', (WidgetTester tester) async { + testWidgets('Use home and named routes', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabView( @@ -59,7 +58,7 @@ void main() { expect(find.text('second named route'), findsOneWidget); }); - testWidgetsWithLeakTracking('Use onGenerateRoute', (WidgetTester tester) async { + testWidgets('Use onGenerateRoute', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabView( @@ -81,7 +80,7 @@ void main() { expect(find.text('generated home'), findsOneWidget); }); - testWidgetsWithLeakTracking('Use onUnknownRoute', (WidgetTester tester) async { + testWidgets('Use onUnknownRoute', (WidgetTester tester) async { late String unknownForRouteCalled; await tester.pumpWidget( CupertinoApp( @@ -102,7 +101,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Can use navigatorKey to navigate', (WidgetTester tester) async { + testWidgets('Can use navigatorKey to navigate', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey(); await tester.pumpWidget( CupertinoApp( @@ -123,7 +122,7 @@ void main() { expect(find.text('second route'), findsOneWidget); }); - testWidgetsWithLeakTracking('Changing the key resets the navigator', (WidgetTester tester) async { + testWidgets('Changing the key resets the navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey(); await tester.pumpWidget( CupertinoApp( @@ -173,7 +172,7 @@ void main() { expect(find.text('second route'), findsNothing); }); - testWidgetsWithLeakTracking('Throws FlutterError when onUnknownRoute is null', (WidgetTester tester) async { + testWidgets('Throws FlutterError when onUnknownRoute is null', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey(); await tester.pumpWidget( CupertinoApp( @@ -210,7 +209,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Throws FlutterError when onUnknownRoute returns null', (WidgetTester tester) async { + testWidgets('Throws FlutterError when onUnknownRoute returns null', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); await tester.pumpWidget( CupertinoApp( @@ -240,7 +239,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Navigator of CupertinoTabView restores state', (WidgetTester tester) async { + testWidgets('Navigator of CupertinoTabView restores state', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( restorationScopeId: 'app', diff --git a/packages/flutter/test/cupertino/text_field_restoration_test.dart b/packages/flutter/test/cupertino/text_field_restoration_test.dart index b892984d0d1..ad6c8e12f89 100644 --- a/packages/flutter/test/cupertino/text_field_restoration_test.dart +++ b/packages/flutter/test/cupertino/text_field_restoration_test.dart @@ -5,13 +5,12 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const String text = 'Hello World! How are you? Life is good!'; const String alternativeText = 'Everything is awesome!!'; void main() { - testWidgetsWithLeakTracking('CupertinoTextField restoration', (WidgetTester tester) async { + testWidgets('CupertinoTextField restoration', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( restorationScopeId: 'app', @@ -22,7 +21,7 @@ void main() { await restoreAndVerify(tester); }); - testWidgetsWithLeakTracking('CupertinoTextField restoration with external controller', (WidgetTester tester) async { + testWidgets('CupertinoTextField restoration with external controller', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( restorationScopeId: 'app', diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index cf0ae4a4ec8..a1ee778a701 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -17,7 +17,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart' show OverflowWidgetTextEditingController, isContextMenuProvidedByPlatform; @@ -206,7 +205,7 @@ void main() { await Clipboard.setData(const ClipboardData(text: 'Clipboard data')); }); - testWidgetsWithLeakTracking( + testWidgets( 'Live Text button shows and hides correctly when LiveTextStatus changes', (WidgetTester tester) async { final LiveTextInputTester liveTextInputTester = LiveTextInputTester(); @@ -250,7 +249,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Look Up shows up on iOS only', (WidgetTester tester) async { + testWidgets('Look Up shows up on iOS only', (WidgetTester tester) async { String? lastLookUp; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -300,7 +299,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Search Web shows up on iOS only', (WidgetTester tester) async { + testWidgets('Search Web shows up on iOS only', (WidgetTester tester) async { String? lastSearch; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -350,7 +349,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Share shows up on iOS and Android', (WidgetTester tester) async { + testWidgets('Share shows up on iOS and Android', (WidgetTester tester) async { String? lastShare; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -396,7 +395,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('can use the desktop cut/copy/paste buttons on Mac', (WidgetTester tester) async { + testWidgets('can use the desktop cut/copy/paste buttons on Mac', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -472,7 +471,7 @@ void main() { skip: kIsWeb, // [intended] the web handles this on its own. ); - testWidgetsWithLeakTracking('can get text selection color initially on desktop', (WidgetTester tester) async { + testWidgets('can get text selection color initially on desktop', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final TextEditingController controller = TextEditingController( @@ -504,7 +503,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Activates the text field when receives semantics focus on Mac, Windows', (WidgetTester tester) async { + testWidgets('Activates the text field when receives semantics focus on Mac, Windows', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final SemanticsOwner semanticsOwner = tester.binding.pipelineOwner.semanticsOwner!; final FocusNode focusNode = FocusNode(); @@ -555,7 +554,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows })); - testWidgetsWithLeakTracking( + testWidgets( 'takes available space horizontally and takes intrinsic space vertically no-strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -576,7 +575,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('sets cursorOpacityAnimates on EditableText correctly', (WidgetTester tester) async { + testWidgets('sets cursorOpacityAnimates on EditableText correctly', (WidgetTester tester) async { // True @@ -601,7 +600,7 @@ void main() { expect(editableText.cursorOpacityAnimates, false); }); - testWidgetsWithLeakTracking( + testWidgets( 'takes available space horizontally and takes intrinsic space vertically', (WidgetTester tester) async { await tester.pumpWidget( @@ -622,7 +621,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'uses DefaultSelectionStyle for selection and cursor colors if provided', (WidgetTester tester) async { const Color selectionColor = Colors.black; @@ -648,7 +647,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Text field drops selection color when losing focus', (WidgetTester tester) async { + testWidgets('Text field drops selection color when losing focus', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103341. final Key key1 = UniqueKey(); final Key key2 = UniqueKey(); @@ -706,7 +705,7 @@ void main() { expect(state2.widget.selectionColor, selectionColor); }); - testWidgetsWithLeakTracking( + testWidgets( 'multi-lined text fields are intrinsically taller no-strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -730,7 +729,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'multi-lined text fields are intrinsically taller', (WidgetTester tester) async { await tester.pumpWidget( @@ -751,7 +750,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut height override', (WidgetTester tester) async { await tester.pumpWidget( @@ -780,7 +779,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/32243 ); - testWidgetsWithLeakTracking( + testWidgets( 'strut forces field taller', (WidgetTester tester) async { await tester.pumpWidget( @@ -810,7 +809,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/32243 ); - testWidgetsWithLeakTracking( + testWidgets( 'default text field has a border', (WidgetTester tester) async { await tester.pumpWidget( @@ -865,7 +864,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'decoration can be overridden', (WidgetTester tester) async { await tester.pumpWidget( @@ -888,7 +887,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'text entries are padded by default', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'initial'); @@ -910,7 +909,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('iOS cursor has offset', (WidgetTester tester) async { + testWidgets('iOS cursor has offset', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoTextField(), @@ -921,7 +920,7 @@ void main() { expect(editableText.cursorOffset, const Offset(-2.0 / 3.0, 0)); }); - testWidgetsWithLeakTracking('Cursor radius is 2.0', (WidgetTester tester) async { + testWidgets('Cursor radius is 2.0', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoTextField(), @@ -934,7 +933,7 @@ void main() { expect(renderEditable.cursorRadius, const Radius.circular(2.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Cupertino cursor android golden', (WidgetTester tester) async { + testWidgets('Cupertino cursor android golden', (WidgetTester tester) async { final Widget widget = CupertinoApp( home: Center( child: RepaintBoundary( @@ -961,7 +960,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Cupertino cursor golden', (WidgetTester tester) async { + testWidgets('Cupertino cursor golden', (WidgetTester tester) async { final Widget widget = CupertinoApp( home: Center( child: RepaintBoundary( @@ -990,7 +989,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'can control text content via controller', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -1018,7 +1017,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'placeholder respects textAlign', (WidgetTester tester) async { await tester.pumpWidget( @@ -1043,7 +1042,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('placeholder dark mode', (WidgetTester tester) async { + testWidgets('placeholder dark mode', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( theme: CupertinoThemeData(brightness: Brightness.dark), @@ -1060,7 +1059,7 @@ void main() { expect(placeholder.style!.color!.value, CupertinoColors.placeholderText.darkColor.value); }); - testWidgetsWithLeakTracking( + testWidgets( 'placeholders are lightly colored and disappears once typing starts', (WidgetTester tester) async { await tester.pumpWidget( @@ -1083,7 +1082,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( "placeholderStyle modifies placeholder's style and doesn't affect text's style", (WidgetTester tester) async { await tester.pumpWidget( @@ -1117,7 +1116,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'prefix widget is in front of the text', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -1150,7 +1149,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'prefix widget respects visibility mode', (WidgetTester tester) async { await tester.pumpWidget( @@ -1187,7 +1186,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'suffix widget is after the text', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); @@ -1217,7 +1216,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'suffix widget respects visibility mode', (WidgetTester tester) async { await tester.pumpWidget( @@ -1241,7 +1240,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can customize padding', (WidgetTester tester) async { await tester.pumpWidget( @@ -1261,7 +1260,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'padding is in between prefix and suffix no-strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -1319,7 +1318,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'padding is in between prefix and suffix', (WidgetTester tester) async { await tester.pumpWidget( @@ -1375,7 +1374,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'clear button shows with right visibility mode', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -1447,7 +1446,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'clear button removes text', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -1477,7 +1476,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'tapping clear button also calls onChanged when text not empty', (WidgetTester tester) async { String value = 'text entry'; @@ -1508,7 +1507,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'clear button yields precedence to suffix', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -1548,7 +1547,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'font style controls intrinsic height no-strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -1587,7 +1586,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'font style controls intrinsic height', (WidgetTester tester) async { await tester.pumpWidget( @@ -1623,7 +1622,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'RTL puts attachments to the right places', (WidgetTester tester) async { await tester.pumpWidget( @@ -1653,7 +1652,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'text fields with no max lines can grow no-strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -1682,7 +1681,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'text fields with no max lines can grow', (WidgetTester tester) async { await tester.pumpWidget( @@ -1710,7 +1709,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('cannot enter new lines onto single line TextField', (WidgetTester tester) async { + testWidgets('cannot enter new lines onto single line TextField', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -1729,7 +1728,7 @@ void main() { expect(controller.text, 'abcdef'); }); - testWidgetsWithLeakTracking('toolbar colors change with theme brightness, but nothing else', (WidgetTester tester) async { + testWidgets('toolbar colors change with theme brightness, but nothing else', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: "j'aime la poutine", ); @@ -1792,7 +1791,7 @@ void main() { expect(text.style!.fontWeight, FontWeight.w400); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('text field toolbar options correctly changes options on Apple Platforms', (WidgetTester tester) async { + testWidgets('text field toolbar options correctly changes options on Apple Platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -1843,7 +1842,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('text field toolbar options correctly changes options on non-Apple platforms', (WidgetTester tester) async { + testWidgets('text field toolbar options correctly changes options on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -1899,7 +1898,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Read only text field', (WidgetTester tester) async { + testWidgets('Read only text field', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'readonly'); addTearDown(controller.dispose); @@ -1937,7 +1936,7 @@ void main() { expect(find.text('Cut'), findsNothing); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('copy paste', (WidgetTester tester) async { + testWidgets('copy paste', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Column( @@ -1991,7 +1990,7 @@ void main() { expect(Visibility.of(placeholder2Element), false); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking( + testWidgets( 'tap moves cursor to the edge of the word it tapped on', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2023,7 +2022,7 @@ void main() { expect(find.byType(CupertinoButton), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'slow double tap does not trigger double tap', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2063,7 +2062,7 @@ void main() { } }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'Tapping on a collapsed selection toggles the toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2149,7 +2148,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Tapping on a non-collapsed selection toggles the toolbar and retains the selection', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2225,7 +2224,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word for non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2281,7 +2280,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS}), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word for Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2328,7 +2327,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap does not select word on read-only obscured field', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2367,7 +2366,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Can double click + drag with a mouse to select word by word', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -2417,7 +2416,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Can double tap + drag to select word by word', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -2478,7 +2477,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Readonly text field does not have tap action', (WidgetTester tester) async { + testWidgets('Readonly text field does not have tap action', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2497,7 +2496,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word and first tap of double tap moves cursor', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2542,7 +2541,7 @@ void main() { expectCupertinoToolbarForPartialSelection(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'double tap hold selects word', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2586,7 +2585,7 @@ void main() { expectCupertinoToolbarForPartialSelection(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking( + testWidgets( 'tap after a double tap select is not affected', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2632,7 +2631,7 @@ void main() { expect(find.byType(CupertinoButton), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('double tapping a space selects the previous word on iOS', (WidgetTester tester) async { + testWidgets('double tapping a space selects the previous word on iOS', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: ' blah blah \n blah', ); @@ -2702,7 +2701,7 @@ void main() { expect(controller.value.selection.extentOffset, 14); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('double tapping a space selects the space on Mac', (WidgetTester tester) async { + testWidgets('double tapping a space selects the space on Mac', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: ' blah blah', ); @@ -2757,7 +2756,7 @@ void main() { expect(controller.value.selection.extentOffset, 1); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS })); - testWidgetsWithLeakTracking('double clicking a space selects the space on Mac', (WidgetTester tester) async { + testWidgets('double clicking a space selects the space on Mac', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: ' blah blah', ); @@ -2825,7 +2824,7 @@ void main() { expect(controller.value.selection.extentOffset, 1); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'An obscured CupertinoTextField is not selectable when disabled', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2874,7 +2873,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'A read-only obscured CupertinoTextField is not selectable', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2923,7 +2922,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'An obscured CupertinoTextField is selectable by default', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -2972,7 +2971,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('An obscured TextField has correct default context menu', (WidgetTester tester) async { + testWidgets('An obscured TextField has correct default context menu', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -3017,7 +3016,7 @@ void main() { expect(find.text('Cut'), findsNothing); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking( + testWidgets( 'long press selects the word at the long press position and shows toolbar on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3050,7 +3049,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS}), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press moves cursor to the exact long press position and shows toolbar on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3087,7 +3086,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press tap cannot initiate a double tap', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3135,7 +3134,7 @@ void main() { expectNoCupertinoToolbar(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag selects word by word and shows toolbar on lift on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3201,7 +3200,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag on a focused TextField moves the cursor under the drag and shows toolbar on lift on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3270,7 +3269,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('long press drag can edge scroll on non-Apple platforms', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -3358,7 +3357,7 @@ void main() { expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-310.30, epsilon: 1)); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('long press drag can edge scroll on Apple platforms', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -3451,7 +3450,7 @@ void main() { expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-310.20, epsilon: 0.25)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'long tap after a double tap select is not affected', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3495,7 +3494,7 @@ void main() { expectCupertinoToolbarForCollapsedSelection(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'double tap after a long tap is not affected', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3550,7 +3549,7 @@ void main() { expectCupertinoToolbarForPartialSelection(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking( + testWidgets( 'double tap chains work', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3629,7 +3628,7 @@ void main() { 'all good people\n' // 22 + 16 => 38 'to come to the aid\n' // 38 + 19 => 57 'of their country.'; // 57 + 17 => 74 - testWidgetsWithLeakTracking( + testWidgets( 'Can triple tap to select a paragraph on mobile platforms when tapping at a word edge', (WidgetTester tester) async { // TODO(Renzo-Olivares): Enable, currently broken because selection overlay blocks the TextSelectionGestureDetector. @@ -3690,7 +3689,7 @@ void main() { skip: true, // https://github.com/flutter/flutter/issues/123415 ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple tap to select a paragraph on mobile platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -3749,7 +3748,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Triple click at the beginning of a line should not select the previous paragraph', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132126 @@ -3807,7 +3806,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Triple click at the end of text should select the previous paragraph', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132126. @@ -3866,7 +3865,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple tap chains work on Non-Apple mobile platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -3958,7 +3957,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple tap chains work on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4058,7 +4057,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple click chains work', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4176,7 +4175,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple click after a click on desktop platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4241,7 +4240,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple tap to select all on a single-line textfield on mobile platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4297,7 +4296,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click to select all on a single-line textfield on desktop platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4354,7 +4353,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click to select a line on Linux', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -4416,7 +4415,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.linux), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click to select a paragraph', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -4478,7 +4477,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click + drag to select line by line on Linux', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -4581,7 +4580,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.linux), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click + drag to select paragraph by paragraph', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); @@ -4684,7 +4683,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Going past triple click retains the selection on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4772,7 +4771,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Tap count resets when going past a triple tap on Android, Fuchsia, and Linux', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -4887,7 +4886,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Double click and triple click alternate on Windows', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -5006,7 +5005,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('force press selects word', (WidgetTester tester) async { + testWidgets('force press selects word', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -5047,7 +5046,7 @@ void main() { expectCupertinoToolbarForPartialSelection(); }); - testWidgetsWithLeakTracking('force press on unsupported devices falls back to tap', (WidgetTester tester) async { + testWidgets('force press on unsupported devices falls back to tap', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -5091,7 +5090,7 @@ void main() { expect(find.byType(CupertinoButton), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Cannot drag one handle past the other', (WidgetTester tester) async { + testWidgets('Cannot drag one handle past the other', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'abc def ghi', ); @@ -5159,7 +5158,7 @@ void main() { expect(controller.selection.extentOffset, 5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Dragging between multiple lines keeps the contact point at the same place on the handle on Android', (WidgetTester tester) async { + testWidgets('Dragging between multiple lines keeps the contact point at the same place on the handle on Android', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( // 11 first line, 19 second line, 17 third line = length 49 text: 'a big house\njumped over a mouse\nOne more line yay', @@ -5358,7 +5357,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking('Dragging between multiple lines keeps the contact point at the same place on the handle on iOS', (WidgetTester tester) async { + testWidgets('Dragging between multiple lines keeps the contact point at the same place on the handle on iOS', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( // 11 first line, 19 second line, 17 third line = length 49 text: 'a big house\njumped over a mouse\nOne more line yay', @@ -5548,7 +5547,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Selection updates on tap down (Desktop platforms)', (WidgetTester tester) async { + testWidgets('Selection updates on tap down (Desktop platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -5590,7 +5589,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking('Selection updates on tap up (Mobile platforms)', (WidgetTester tester) async { + testWidgets('Selection updates on tap up (Mobile platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); final bool isTargetPlatformApple = defaultTargetPlatform == TargetPlatform.iOS; @@ -5647,7 +5646,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking('Can select text by dragging with a mouse', (WidgetTester tester) async { + testWidgets('Can select text by dragging with a mouse', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -5683,7 +5682,7 @@ void main() { expect(controller.selection.extentOffset, testValue.indexOf('g')); }); - testWidgetsWithLeakTracking('Cursor should not move on a quick touch drag when touch does not begin on previous selection (iOS)', (WidgetTester tester) async { + testWidgets('Cursor should not move on a quick touch drag when touch does not begin on previous selection (iOS)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -5729,7 +5728,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging, when tap is on collapsed selection (iOS)', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging, when tap is on collapsed selection (iOS)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -5783,7 +5782,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -5838,7 +5837,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging, when tap is on collapsed selection (iOS) - ListView', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging, when tap is on collapsed selection (iOS) - ListView', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/122519 final TextEditingController controller = TextEditingController(); @@ -5915,7 +5914,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging (Android)', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging (Android)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -5966,7 +5965,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking('Continuous dragging does not cause flickering', (WidgetTester tester) async { + testWidgets('Continuous dragging does not cause flickering', (WidgetTester tester) async { int selectionChangedCount = 0; const String testValue = 'abc def ghi'; final TextEditingController controller = TextEditingController(text: testValue); @@ -6019,7 +6018,7 @@ void main() { expect(controller.selection.extentOffset, 9); }); - testWidgetsWithLeakTracking('Tap does not show handles nor toolbar', (WidgetTester tester) async { + testWidgets('Tap does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'abc def ghi', ); @@ -6042,7 +6041,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isFalse); }); - testWidgetsWithLeakTracking('Long press shows toolbar but not handles', (WidgetTester tester) async { + testWidgets('Long press shows toolbar but not handles', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'abc def ghi', ); @@ -6067,7 +6066,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isContextMenuProvidedByPlatform ? isFalse : isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'Double tap shows handles and toolbar if selection is not collapsed', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -6097,7 +6096,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Double tap shows toolbar but not handles if selection is collapsed', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -6127,7 +6126,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse long press does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -6159,7 +6158,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse double tap does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -6211,7 +6210,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('onTap is called upon tap', (WidgetTester tester) async { + testWidgets('onTap is called upon tap', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( CupertinoApp( @@ -6240,7 +6239,7 @@ void main() { expect(tapCount, 2); }); - testWidgetsWithLeakTracking( + testWidgets( 'onTap does not work when the text field is disabled', (WidgetTester tester) async { int tapCount = 0; @@ -6297,7 +6296,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Focus test when the text field is disabled', (WidgetTester tester) async { + testWidgets('Focus test when the text field is disabled', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -6335,7 +6334,7 @@ void main() { expect(focusNode.hasFocus, false); }); - testWidgetsWithLeakTracking( + testWidgets( 'text field respects theme', (WidgetTester tester) async { await tester.pumpWidget( @@ -6373,7 +6372,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Check the toolbar appears below the TextField when there is not enough space above the TextField to show it', (WidgetTester tester) async { // This is a regression test for @@ -6445,7 +6444,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('text field respects keyboardAppearance from theme', (WidgetTester tester) async { + testWidgets('text field respects keyboardAppearance from theme', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -6469,7 +6468,7 @@ void main() { expect(((setClient.arguments as List<dynamic>).last as Map<String, dynamic>)['keyboardAppearance'], 'Brightness.dark'); }); - testWidgetsWithLeakTracking('text field can override keyboardAppearance from theme', (WidgetTester tester) async { + testWidgets('text field can override keyboardAppearance from theme', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -6495,7 +6494,7 @@ void main() { expect(((setClient.arguments as List<dynamic>).last as Map<String, dynamic>)['keyboardAppearance'], 'Brightness.light'); }); - testWidgetsWithLeakTracking('cursorColor respects theme', (WidgetTester tester) async { + testWidgets('cursorColor respects theme', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoTextField(), @@ -6537,7 +6536,7 @@ void main() { expect(renderEditable.cursorColor, const Color(0xFFF44336)); }); - testWidgetsWithLeakTracking('cursor can override color from theme', (WidgetTester tester) async { + testWidgets('cursor can override color from theme', (WidgetTester tester) async { const CupertinoDynamicColor cursorColor = CupertinoDynamicColor.withBrightness( color: Color(0x12345678), darkColor: Color(0x87654321), @@ -6572,7 +6571,7 @@ void main() { expect(editableText.cursorColor.value, 0x87654321); }); - testWidgetsWithLeakTracking('shows selection handles', (WidgetTester tester) async { + testWidgets('shows selection handles', (WidgetTester tester) async { const String testText = 'lorem ipsum'; final TextEditingController controller = TextEditingController(text: testText); addTearDown(controller.dispose); @@ -6605,7 +6604,7 @@ void main() { expect(right.opacity.value, equals(1.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('when CupertinoTextField would be blocked by keyboard, it is shown with enough space for the selection handle', (WidgetTester tester) async { + testWidgets('when CupertinoTextField would be blocked by keyboard, it is shown with enough space for the selection handle', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); final TextEditingController controller = TextEditingController(); @@ -6635,7 +6634,7 @@ void main() { expect(scrollController.offset, 27.0); }); - testWidgetsWithLeakTracking('disabled state golden', (WidgetTester tester) async { + testWidgets('disabled state golden', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'lorem'); addTearDown(controller.dispose); await tester.pumpWidget( @@ -6665,7 +6664,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Can drag the left handle while the right handle remains off-screen', (WidgetTester tester) async { // Text is longer than textfield width. @@ -6751,7 +6750,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Can drag the right handle while the left handle remains off-screen', (WidgetTester tester) async { // Text is longer than textfield width. @@ -6826,7 +6825,7 @@ void main() { ); group('Text selection toolbar', () { - testWidgetsWithLeakTracking('Collapsed selection works', (WidgetTester tester) async { + testWidgets('Collapsed selection works', (WidgetTester tester) async { tester.view.physicalSize = const Size(400, 400); tester.view.devicePixelRatio = 1; addTearDown(tester.view.reset); @@ -7015,7 +7014,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('selecting multiple words works', (WidgetTester tester) async { + testWidgets('selecting multiple words works', (WidgetTester tester) async { tester.view.physicalSize = const Size(400, 400); tester.view.devicePixelRatio = 1; addTearDown(tester.view.reset); @@ -7085,7 +7084,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('selecting multiline works', (WidgetTester tester) async { + testWidgets('selecting multiline works', (WidgetTester tester) async { tester.view.physicalSize = const Size(400, 400); tester.view.devicePixelRatio = 1; addTearDown(tester.view.reset); @@ -7161,7 +7160,7 @@ void main() { // This is a regression test for // https://github.com/flutter/flutter/issues/37046. - testWidgetsWithLeakTracking('No exceptions when showing selection menu inside of nested Navigators', (WidgetTester tester) async { + testWidgets('No exceptions when showing selection menu inside of nested Navigators', (WidgetTester tester) async { const String testValue = '123456'; final TextEditingController controller = TextEditingController( text: testValue, @@ -7208,7 +7207,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Drag selection hides the selection menu', (WidgetTester tester) async { + testWidgets('Drag selection hides the selection menu', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -7259,7 +7258,7 @@ void main() { group('textAlignVertical position', () { group('simple case', () { - testWidgetsWithLeakTracking('align top (default)', (WidgetTester tester) async { + testWidgets('align top (default)', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7306,7 +7305,7 @@ void main() { expect(tester.getTopLeft(find.byType(EditableText)).dy, moreOrLessEquals(207.0, epsilon: .0001)); }); - testWidgetsWithLeakTracking('align center', (WidgetTester tester) async { + testWidgets('align center', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7354,7 +7353,7 @@ void main() { expect(tester.getTopLeft(find.byType(EditableText)).dy, moreOrLessEquals(291.5, epsilon: .0001)); }); - testWidgetsWithLeakTracking('align bottom', (WidgetTester tester) async { + testWidgets('align bottom', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7402,7 +7401,7 @@ void main() { expect(tester.getTopLeft(find.byType(EditableText)).dy, moreOrLessEquals(376.0, epsilon: .0001)); }); - testWidgetsWithLeakTracking('align as a double', (WidgetTester tester) async { + testWidgets('align as a double', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7452,7 +7451,7 @@ void main() { }); group('tall prefix', () { - testWidgetsWithLeakTracking('align center (default when prefix)', (WidgetTester tester) async { + testWidgets('align center (default when prefix)', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7504,7 +7503,7 @@ void main() { expect(tester.getTopLeft(find.byType(EditableText)).dy, moreOrLessEquals(291.5, epsilon: .0001)); }); - testWidgetsWithLeakTracking('align top', (WidgetTester tester) async { + testWidgets('align top', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7558,7 +7557,7 @@ void main() { expect(tester.getTopLeft(find.byType(EditableText)).dy, moreOrLessEquals(241.5, epsilon: .0001)); }); - testWidgetsWithLeakTracking('align bottom', (WidgetTester tester) async { + testWidgets('align bottom', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7612,7 +7611,7 @@ void main() { expect(tester.getTopLeft(find.byType(EditableText)).dy, moreOrLessEquals(341.5, epsilon: .0001)); }); - testWidgetsWithLeakTracking('align as a double', (WidgetTester tester) async { + testWidgets('align as a double', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const Size size = Size(200.0, 200.0); @@ -7666,7 +7665,7 @@ void main() { }); }); - testWidgetsWithLeakTracking( + testWidgets( 'Long press on an autofocused field shows the selection menu', (WidgetTester tester) async { await tester.pumpWidget( @@ -7693,7 +7692,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("Arrow keys don't move input focus", (WidgetTester tester) async { + testWidgets("Arrow keys don't move input focus", (WidgetTester tester) async { final TextEditingController controller1 = TextEditingController(); final TextEditingController controller2 = TextEditingController(); final TextEditingController controller3 = TextEditingController(); @@ -7793,7 +7792,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Scrolling shortcuts are disabled in text fields', (WidgetTester tester) async { + testWidgets('Scrolling shortcuts are disabled in text fields', (WidgetTester tester) async { bool scrollInvoked = false; await tester.pumpWidget( CupertinoApp( @@ -7830,7 +7829,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Cupertino text field semantics', (WidgetTester tester) async { + testWidgets('Cupertino text field semantics', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -7858,7 +7857,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Disabled Cupertino text field semantics', (WidgetTester tester) async { + testWidgets('Disabled Cupertino text field semantics', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -7887,7 +7886,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Cupertino text field clear button semantics', (WidgetTester tester) async { + testWidgets('Cupertino text field clear button semantics', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -7915,7 +7914,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Cupertino text field clear semantic label', (WidgetTester tester) async { + testWidgets('Cupertino text field clear semantic label', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -7946,7 +7945,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('text selection style 1', (WidgetTester tester) async { + testWidgets('text selection style 1', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure\nhi\nwassssup!', ); @@ -8001,7 +8000,7 @@ void main() { skip: kIsWeb, // [intended] the web has its own Select All. ); - testWidgetsWithLeakTracking('text selection style 2', (WidgetTester tester) async { + testWidgets('text selection style 2', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure\nhi\nwassssup!', ); @@ -8055,7 +8054,7 @@ void main() { skip: kIsWeb, // [intended] the web has its own Select All. ); - testWidgetsWithLeakTracking('textSelectionControls is passed to EditableText', (WidgetTester tester) async { + testWidgets('textSelectionControls is passed to EditableText', (WidgetTester tester) async { final MockTextSelectionControls selectionControl = MockTextSelectionControls(); await tester.pumpWidget( CupertinoApp( @@ -8071,7 +8070,7 @@ void main() { expect(widget.selectionControls, equals(selectionControl)); }); - testWidgetsWithLeakTracking('Do not add LengthLimiting formatter to the user supplied list', (WidgetTester tester) async { + testWidgets('Do not add LengthLimiting formatter to the user supplied list', (WidgetTester tester) async { final List<TextInputFormatter> formatters = <TextInputFormatter>[]; await tester.pumpWidget( @@ -8104,7 +8103,7 @@ void main() { await tester.pumpAndSettle(); } - testWidgetsWithLeakTracking('using none enforcement.', (WidgetTester tester) async { + testWidgets('using none enforcement.', (WidgetTester tester) async { const MaxLengthEnforcement enforcement = MaxLengthEnforcement.none; await setupWidget(tester, enforcement); @@ -8124,7 +8123,7 @@ void main() { expect(state.currentTextEditingValue.composing, TextRange.empty); }); - testWidgetsWithLeakTracking('using enforced.', (WidgetTester tester) async { + testWidgets('using enforced.', (WidgetTester tester) async { const MaxLengthEnforcement enforcement = MaxLengthEnforcement.enforced; await setupWidget(tester, enforcement); @@ -8148,7 +8147,7 @@ void main() { expect(state.currentTextEditingValue.composing, const TextRange(start: 3, end: 5)); }); - testWidgetsWithLeakTracking('using truncateAfterCompositionEnds.', (WidgetTester tester) async { + testWidgets('using truncateAfterCompositionEnds.', (WidgetTester tester) async { const MaxLengthEnforcement enforcement = MaxLengthEnforcement.truncateAfterCompositionEnds; await setupWidget(tester, enforcement); @@ -8172,7 +8171,7 @@ void main() { expect(state.currentTextEditingValue.composing, TextRange.empty); }); - testWidgetsWithLeakTracking('using default behavior for different platforms.', (WidgetTester tester) async { + testWidgets('using default behavior for different platforms.', (WidgetTester tester) async { await setupWidget(tester, null); final EditableTextState state = tester.state(find.byType(EditableText)); @@ -8205,7 +8204,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('disabled widget changes background color', (WidgetTester tester) async { + testWidgets('disabled widget changes background color', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -8281,7 +8280,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/78097. - testWidgetsWithLeakTracking( + testWidgets( 'still gets disabled background color when decoration is null', (WidgetTester tester) async { await tester.pumpWidget( @@ -8305,7 +8304,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('autofill info has placeholder text', (WidgetTester tester) async { + testWidgets('autofill info has placeholder text', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoTextField( @@ -8321,7 +8320,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('textDirection is passed to EditableText', (WidgetTester tester) async { + testWidgets('textDirection is passed to EditableText', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -8349,7 +8348,7 @@ void main() { expect(rtlWidget.textDirection, TextDirection.rtl); }); - testWidgetsWithLeakTracking('clipBehavior has expected defaults', (WidgetTester tester) async { + testWidgets('clipBehavior has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: CupertinoTextField( @@ -8361,7 +8360,7 @@ void main() { expect(textField.clipBehavior, Clip.hardEdge); }); - testWidgetsWithLeakTracking('Overflow clipBehavior none golden', (WidgetTester tester) async { + testWidgets('Overflow clipBehavior none golden', (WidgetTester tester) async { final OverflowWidgetTextEditingController controller = OverflowWidgetTextEditingController(); addTearDown(controller.dispose); final Widget widget = CupertinoApp( @@ -8400,7 +8399,7 @@ void main() { } }); - testWidgetsWithLeakTracking('can shift + tap to select with a keyboard (Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap to select with a keyboard (Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8444,7 +8443,7 @@ void main() { expect(controller.selection.extentOffset, 4); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can shift + tap to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8490,7 +8489,7 @@ void main() { expect(controller.selection.extentOffset, 4); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('shift tapping an unfocused field', (WidgetTester tester) async { + testWidgets('shift tapping an unfocused field', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8546,7 +8545,7 @@ void main() { expect(controller.selection.extentOffset, 20); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard (Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard (Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8653,7 +8652,7 @@ void main() { expect(controller.selection.extentOffset, 26); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8761,7 +8760,7 @@ void main() { expect(controller.selection.extentOffset, 26); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.windows })); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard, reversed (Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard, reversed (Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8869,7 +8868,7 @@ void main() { expect(controller.selection.extentOffset, 14); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard, reversed (non-Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard, reversed (non-Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -8978,7 +8977,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.windows })); // Regression test for https://github.com/flutter/flutter/issues/101587. - testWidgetsWithLeakTracking('Right clicking menu behavior', (WidgetTester tester) async { + testWidgets('Right clicking menu behavior', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -9057,7 +9056,7 @@ void main() { ); group('Right click focus', () { - testWidgetsWithLeakTracking('Can right click to focus multiple times', (WidgetTester tester) async { + testWidgets('Can right click to focus multiple times', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/103228 final FocusNode focusNode1 = FocusNode(); final FocusNode focusNode2 = FocusNode(); @@ -9114,7 +9113,7 @@ void main() { expect(focusNode2.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Can right click to focus on previously selected word on Apple platforms', (WidgetTester tester) async { + testWidgets('Can right click to focus on previously selected word on Apple platforms', (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(); final FocusNode focusNode2 = FocusNode(); addTearDown(focusNode1.dispose); @@ -9217,7 +9216,7 @@ void main() { }); group('context menu', () { - testWidgetsWithLeakTracking('builds CupertinoAdaptiveTextSelectionToolbar by default', (WidgetTester tester) async { + testWidgets('builds CupertinoAdaptiveTextSelectionToolbar by default', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: ''); addTearDown(controller.dispose); await tester.pumpWidget( @@ -9248,7 +9247,7 @@ void main() { skip: kIsWeb, // [intended] on web the browser handles the context menu. ); - testWidgetsWithLeakTracking('contextMenuBuilder is used in place of the default text selection toolbar', (WidgetTester tester) async { + testWidgets('contextMenuBuilder is used in place of the default text selection toolbar', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TextEditingController controller = TextEditingController(text: ''); addTearDown(controller.dispose); @@ -9292,7 +9291,7 @@ void main() { final Widget fakeMagnifier = Container(key: UniqueKey()); group('magnifier builder', () { - testWidgetsWithLeakTracking('should build custom magnifier if given', (WidgetTester tester) async { + testWidgets('should build custom magnifier if given', (WidgetTester tester) async { final Widget customMagnifier = Container( key: UniqueKey(), ); @@ -9319,7 +9318,7 @@ void main() { }); group('defaults', () { - testWidgetsWithLeakTracking('should build CupertinoMagnifier on iOS and Android', (WidgetTester tester) async { + testWidgets('should build CupertinoMagnifier on iOS and Android', (WidgetTester tester) async { await tester.pumpWidget(const CupertinoApp( home: CupertinoTextField(), )); @@ -9341,7 +9340,7 @@ void main() { <TargetPlatform>{TargetPlatform.iOS, TargetPlatform.android})); }); - testWidgetsWithLeakTracking('should build nothing on all platforms but iOS and Android', (WidgetTester tester) async { + testWidgets('should build nothing on all platforms but iOS and Android', (WidgetTester tester) async { await tester.pumpWidget(const CupertinoApp( home: CupertinoTextField(), )); @@ -9363,7 +9362,7 @@ void main() { excluding: <TargetPlatform>{TargetPlatform.iOS, TargetPlatform.android})); }); - testWidgetsWithLeakTracking('Can drag handles to show, unshow, and update magnifier', + testWidgets('Can drag handles to show, unshow, and update magnifier', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -9431,7 +9430,7 @@ void main() { expect(find.byKey(fakeMagnifier.key!), findsNothing); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('Can drag to show, unshow, and update magnifier', (WidgetTester tester) async { + testWidgets('Can drag to show, unshow, and update magnifier', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -9531,7 +9530,7 @@ void main() { expect(find.byKey(fakeMagnifier.key!), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Can long press to show, unshow, and update magnifier on non-Apple platforms', (WidgetTester tester) async { + testWidgets('Can long press to show, unshow, and update magnifier on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); final bool isTargetPlatformAndroid = defaultTargetPlatform == TargetPlatform.android; @@ -9591,7 +9590,7 @@ void main() { expect(find.byKey(fakeMagnifier.key!), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); - testWidgetsWithLeakTracking('Can long press to show, unshow, and update magnifier on iOS', (WidgetTester tester) async { + testWidgets('Can long press to show, unshow, and update magnifier on iOS', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); final bool isTargetPlatformAndroid = defaultTargetPlatform == TargetPlatform.android; @@ -9654,7 +9653,7 @@ void main() { }); group('TapRegion integration', () { - testWidgetsWithLeakTracking('Tapping outside loses focus on desktop', (WidgetTester tester) async { + testWidgets('Tapping outside loses focus on desktop', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -9681,7 +9680,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isFalse); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking("Tapping outside doesn't lose focus on mobile", (WidgetTester tester) async { + testWidgets("Tapping outside doesn't lose focus on mobile", (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -9709,7 +9708,7 @@ void main() { expect(focusNode.hasPrimaryFocus, kIsWeb ? isFalse : isTrue); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking("tapping on toolbar doesn't lose focus", (WidgetTester tester) async { + testWidgets("tapping on toolbar doesn't lose focus", (WidgetTester tester) async { final TextEditingController controller; final EditableTextState state; @@ -9770,7 +9769,7 @@ void main() { skip: kIsWeb, // [intended] The toolbar isn't rendered by Flutter on the web, it's rendered by the browser. ); - testWidgetsWithLeakTracking("Tapping on border doesn't lose focus", + testWidgets("Tapping on border doesn't lose focus", (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); @@ -9800,7 +9799,7 @@ void main() { }, variant: TargetPlatformVariant.all()); }); - testWidgetsWithLeakTracking('Can drag handles to change selection correctly in multiline', (WidgetTester tester) async { + testWidgets('Can drag handles to change selection correctly in multiline', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -9898,7 +9897,7 @@ void main() { } }); - testWidgetsWithLeakTracking('placeholder style overflow works', (WidgetTester tester) async { + testWidgets('placeholder style overflow works', (WidgetTester tester) async { final String placeholder = 'hint text' * 20; const TextStyle placeholderStyle = TextStyle( fontSize: 14.0, @@ -9922,7 +9921,7 @@ void main() { expect(placeholderWidget.style!.overflow, placeholderStyle.overflow); }); - testWidgetsWithLeakTracking('tapping on a misspelled word on iOS hides the handles and shows red selection', (WidgetTester tester) async { + testWidgets('tapping on a misspelled word on iOS hides the handles and shows red selection', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; // The default derived color for the iOS text selection highlight. @@ -9996,7 +9995,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('text selection toolbar is hidden on tap down', (WidgetTester tester) async { + testWidgets('text selection toolbar is hidden on tap down', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -10042,7 +10041,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Does not shrink in height when enters text when there is large single-line placeholder', (WidgetTester tester) async { + testWidgets('Does not shrink in height when enters text when there is large single-line placeholder', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/133241. final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -10067,7 +10066,7 @@ void main() { expect(rectWithPlaceholder, rectWithText); }); - testWidgetsWithLeakTracking('Does not match the height of a multiline placeholder', (WidgetTester tester) async { + testWidgets('Does not match the height of a multiline placeholder', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); await tester.pumpWidget( 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 366c7af306a..bf1a229aacf 100644 --- a/packages/flutter/test/cupertino/text_form_field_row_test.dart +++ b/packages/flutter/test/cupertino/text_form_field_row_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Passes textAlign to underlying CupertinoTextField', (WidgetTester tester) async { + testWidgets('Passes textAlign to underlying CupertinoTextField', (WidgetTester tester) async { const TextAlign alignment = TextAlign.center; await tester.pumpWidget( @@ -28,7 +27,7 @@ void main() { expect(textFieldWidget.textAlign, alignment); }); - testWidgetsWithLeakTracking('Passes scrollPhysics to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes scrollPhysics to underlying TextField', (WidgetTester tester) async { const ScrollPhysics scrollPhysics = ScrollPhysics(); await tester.pumpWidget( @@ -48,7 +47,7 @@ void main() { expect(textFieldWidget.scrollPhysics, scrollPhysics); }); - testWidgetsWithLeakTracking('Passes textAlignVertical to underlying CupertinoTextField', (WidgetTester tester) async { + testWidgets('Passes textAlignVertical to underlying CupertinoTextField', (WidgetTester tester) async { const TextAlignVertical textAlignVertical = TextAlignVertical.bottom; await tester.pumpWidget( @@ -68,7 +67,7 @@ void main() { expect(textFieldWidget.textAlignVertical, textAlignVertical); }); - testWidgetsWithLeakTracking('Passes textInputAction to underlying CupertinoTextField', (WidgetTester tester) async { + testWidgets('Passes textInputAction to underlying CupertinoTextField', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -86,7 +85,7 @@ void main() { expect(textFieldWidget.textInputAction, TextInputAction.next); }); - testWidgetsWithLeakTracking('Passes onEditingComplete to underlying CupertinoTextField', (WidgetTester tester) async { + testWidgets('Passes onEditingComplete to underlying CupertinoTextField', (WidgetTester tester) async { void onEditingComplete() {} await tester.pumpWidget( @@ -106,7 +105,7 @@ void main() { expect(textFieldWidget.onEditingComplete, onEditingComplete); }); - testWidgetsWithLeakTracking('Passes cursor attributes to underlying CupertinoTextField', (WidgetTester tester) async { + testWidgets('Passes cursor attributes to underlying CupertinoTextField', (WidgetTester tester) async { const double cursorWidth = 3.14; const double cursorHeight = 6.28; const Radius cursorRadius = Radius.circular(2); @@ -134,7 +133,7 @@ void main() { expect(textFieldWidget.cursorColor, cursorColor); }); - testWidgetsWithLeakTracking('onFieldSubmit callbacks are called', (WidgetTester tester) async { + testWidgets('onFieldSubmit callbacks are called', (WidgetTester tester) async { bool called = false; await tester.pumpWidget( @@ -155,7 +154,7 @@ void main() { expect(called, true); }); - testWidgetsWithLeakTracking('onChanged callbacks are called', (WidgetTester tester) async { + testWidgets('onChanged callbacks are called', (WidgetTester tester) async { late String value; await tester.pumpWidget( @@ -175,7 +174,7 @@ void main() { expect(value, 'Soup'); }); - testWidgetsWithLeakTracking('autovalidateMode is passed to super', (WidgetTester tester) async { + testWidgets('autovalidateMode is passed to super', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -198,7 +197,7 @@ void main() { expect(validateCalled, 2); }); - testWidgetsWithLeakTracking('validate is called if widget is enabled', (WidgetTester tester) async { + testWidgets('validate is called if widget is enabled', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -222,7 +221,7 @@ void main() { expect(validateCalled, 2); }); - testWidgetsWithLeakTracking('readonly text form field will hide cursor by default', (WidgetTester tester) async { + testWidgets('readonly text form field will hide cursor by default', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -263,7 +262,7 @@ void main() { expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0)); }, skip: isBrowser); // [intended] We do not use Flutter-rendered context menu on the Web. - testWidgetsWithLeakTracking('onTap is called upon tap', (WidgetTester tester) async { + testWidgets('onTap is called upon tap', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( CupertinoApp( @@ -289,7 +288,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/54472. - testWidgetsWithLeakTracking('reset resets the text fields value to the initialValue', (WidgetTester tester) async { + testWidgets('reset resets the text fields value to the initialValue', (WidgetTester tester) async { await tester.pumpWidget(CupertinoApp( home: Center( child: CupertinoTextFormFieldRow( @@ -308,7 +307,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/54472. - testWidgetsWithLeakTracking('didChange changes text fields value', (WidgetTester tester) async { + testWidgets('didChange changes text fields value', (WidgetTester tester) async { await tester.pumpWidget(CupertinoApp( home: Center( child: CupertinoTextFormFieldRow( @@ -327,7 +326,7 @@ void main() { expect(find.text('changedValue'), findsOneWidget); }); - testWidgetsWithLeakTracking('onChanged callbacks value and FormFieldState.value are sync', (WidgetTester tester) async { + testWidgets('onChanged callbacks value and FormFieldState.value are sync', (WidgetTester tester) async { bool called = false; late FormFieldState<String> state; @@ -353,7 +352,7 @@ void main() { expect(called, true); }); - testWidgetsWithLeakTracking('autofillHints is passed to super', (WidgetTester tester) async { + testWidgets('autofillHints is passed to super', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -369,7 +368,7 @@ void main() { expect(widget.autofillHints, equals(const <String>[AutofillHints.countryName])); }); - testWidgetsWithLeakTracking('autovalidateMode is passed to super', (WidgetTester tester) async { + testWidgets('autovalidateMode is passed to super', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -392,7 +391,7 @@ void main() { expect(validateCalled, 1); }); - testWidgetsWithLeakTracking('AutovalidateMode.always mode shows error from the start', (WidgetTester tester) async { + testWidgets('AutovalidateMode.always mode shows error from the start', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -412,7 +411,7 @@ void main() { expect(errorText.data, 'Error'); }); - testWidgetsWithLeakTracking('Shows error text upon invalid input', (WidgetTester tester) async { + testWidgets('Shows error text upon invalid input', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: ''); addTearDown(controller.dispose); await tester.pumpWidget( @@ -440,7 +439,7 @@ void main() { expect(errorText.data, 'Error'); }); - testWidgetsWithLeakTracking('Shows prefix', (WidgetTester tester) async { + testWidgets('Shows prefix', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -458,7 +457,7 @@ void main() { expect(errorText.data, 'Enter Value'); }); - testWidgetsWithLeakTracking('Passes textDirection to underlying CupertinoTextField', (WidgetTester tester) async { + testWidgets('Passes textDirection to underlying CupertinoTextField', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -492,7 +491,7 @@ void main() { expect(rtlTextFieldWidget.textDirection, TextDirection.rtl); }); - testWidgetsWithLeakTracking( + testWidgets( 'CupertinoTextFormFieldRow onChanged is called when the form is reset', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123009. final GlobalKey<FormFieldState<String>> stateKey = GlobalKey<FormFieldState<String>>(); diff --git a/packages/flutter/test/cupertino/text_selection_test.dart b/packages/flutter/test/cupertino/text_selection_test.dart index 2cdbd8bfd82..0e1c5a1c8d5 100644 --- a/packages/flutter/test/cupertino/text_selection_test.dart +++ b/packages/flutter/test/cupertino/text_selection_test.dart @@ -15,7 +15,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart' show findRenderEditable, textOffsetToPosition; @@ -111,13 +110,13 @@ void main() { ); } - testWidgetsWithLeakTracking('should return false when there is no text', (WidgetTester tester) async { + testWidgets('should return false when there is no text', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText(key: key)); expect(cupertinoTextSelectionControls.canSelectAll(key.currentState!), false); }); - testWidgetsWithLeakTracking('should return true when there is text and collapsed selection', (WidgetTester tester) async { + testWidgets('should return true when there is text and collapsed selection', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText( key: key, @@ -126,7 +125,7 @@ void main() { expect(cupertinoTextSelectionControls.canSelectAll(key.currentState!), true); }); - testWidgetsWithLeakTracking('should return false when there is text and partial uncollapsed selection', (WidgetTester tester) async { + testWidgets('should return false when there is text and partial uncollapsed selection', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText( key: key, @@ -136,7 +135,7 @@ void main() { expect(cupertinoTextSelectionControls.canSelectAll(key.currentState!), false); }); - testWidgetsWithLeakTracking('should return false when there is text and full selection', (WidgetTester tester) async { + testWidgets('should return false when there is text and full selection', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText( key: key, @@ -148,7 +147,7 @@ void main() { }); group('cupertino handles', () { - testWidgetsWithLeakTracking('draws transparent handle correctly', (WidgetTester tester) async { + testWidgets('draws transparent handle correctly', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: CupertinoTheme( data: const CupertinoThemeData( @@ -196,7 +195,7 @@ void main() { '${widget.painter?.runtimeType}' == '_LeftCupertinoChevronPainter', ); - testWidgetsWithLeakTracking('All menu items show when they fit.', (WidgetTester tester) async { + testWidgets('All menu items show when they fit.', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'abc def ghi'); addTearDown(controller.dispose); await tester.pumpWidget(CupertinoApp( @@ -254,7 +253,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking("When a menu item doesn't fit, a second page is used.", (WidgetTester tester) async { + testWidgets("When a menu item doesn't fit, a second page is used.", (WidgetTester tester) async { // Set the screen size to more narrow, so that Paste can't fit. tester.view.physicalSize = const Size(1000, 800); addTearDown(tester.view.reset); @@ -362,7 +361,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('A smaller menu puts each button on its own page.', (WidgetTester tester) async { + testWidgets('A smaller menu puts each button on its own page.', (WidgetTester tester) async { // Set the screen size to more narrow, so that two buttons can't fit on // the same page. tester.view.physicalSize = const Size(640, 800); @@ -508,7 +507,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Handles very long locale strings', (WidgetTester tester) async { + testWidgets('Handles very long locale strings', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'abc def ghi'); addTearDown(controller.dispose); await tester.pumpWidget(CupertinoApp( @@ -620,7 +619,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'When selecting multiple lines over max lines', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'abc\ndef\nghi\njkl\nmno\npqr'); @@ -689,7 +688,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('iOS selection handles scale with rich text (selection style 1)', (WidgetTester tester) async { + testWidgets('iOS selection handles scale with rich text (selection style 1)', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -769,7 +768,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('iOS selection handles scale with rich text (selection style 2)', (WidgetTester tester) async { + testWidgets('iOS selection handles scale with rich text (selection style 2)', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -853,7 +852,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('iOS selection handles scale with rich text (grapheme clusters)', (WidgetTester tester) async { + testWidgets('iOS selection handles scale with rich text (grapheme clusters)', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( @@ -934,7 +933,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'iOS selection handles scaling falls back to preferredLineHeight when the current frame does not match the previous', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( diff --git a/packages/flutter/test/cupertino/text_selection_toolbar_button_test.dart b/packages/flutter/test/cupertino/text_selection_toolbar_button_test.dart index 575b284abdb..76eee86317a 100644 --- a/packages/flutter/test/cupertino/text_selection_toolbar_button_test.dart +++ b/packages/flutter/test/cupertino/text_selection_toolbar_button_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('can press', (WidgetTester tester) async { + testWidgets('can press', (WidgetTester tester) async { bool pressed = false; await tester.pumpWidget( CupertinoApp( @@ -30,7 +29,7 @@ void main() { expect(pressed, true); }); - testWidgetsWithLeakTracking('background darkens when pressed', (WidgetTester tester) async { + testWidgets('background darkens when pressed', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: Center( @@ -76,7 +75,7 @@ void main() { expect(boxDecoration.color, const Color(0x00000000)); }); - testWidgetsWithLeakTracking('passing null to onPressed disables the button', (WidgetTester tester) async { + testWidgets('passing null to onPressed disables the button', (WidgetTester tester) async { await tester.pumpWidget( const CupertinoApp( home: Center( diff --git a/packages/flutter/test/cupertino/text_selection_toolbar_test.dart b/packages/flutter/test/cupertino/text_selection_toolbar_test.dart index dd87a1eb7fc..17ff2427438 100644 --- a/packages/flutter/test/cupertino/text_selection_toolbar_test.dart +++ b/packages/flutter/test/cupertino/text_selection_toolbar_test.dart @@ -10,7 +10,6 @@ library; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/editable_text_utils.dart' show textOffsetToPosition; @@ -112,7 +111,7 @@ void main() { ); } - testWidgetsWithLeakTracking('chevrons point to the correct side', (WidgetTester tester) async { + testWidgets('chevrons point to the correct side', (WidgetTester tester) async { // Add enough TestBoxes to need 3 pages. final List<Widget> children = List<Widget>.generate(15, (int i) => const TestBox()); await tester.pumpWidget( @@ -152,7 +151,7 @@ void main() { expect(findOverflowBackButton(), overflowBackPaintPattern()); }, skip: kIsWeb); // Path.combine is not implemented in the HTML backend https://github.com/flutter/flutter/issues/44572 - testWidgetsWithLeakTracking('paginates children if they overflow', (WidgetTester tester) async { + testWidgets('paginates children if they overflow', (WidgetTester tester) async { late StateSetter setState; final List<Widget> children = List<Widget>.generate(7, (int i) => const TestBox()); await tester.pumpWidget( @@ -247,7 +246,7 @@ void main() { expect(findOverflowBackButton(), findsNothing); }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. - testWidgetsWithLeakTracking('does not paginate if children fit with zero margin', (WidgetTester tester) async { + testWidgets('does not paginate if children fit with zero margin', (WidgetTester tester) async { final List<Widget> children = List<Widget>.generate(7, (int i) => const TestBox()); final double spacerWidth = 1.0 / tester.view.devicePixelRatio; final double dividerWidth = 1.0 / tester.view.devicePixelRatio; @@ -274,7 +273,7 @@ void main() { expect(findOverflowBackButton(), findsNothing); }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. - testWidgetsWithLeakTracking('positions itself at anchorAbove if it fits', (WidgetTester tester) async { + testWidgets('positions itself at anchorAbove if it fits', (WidgetTester tester) async { late StateSetter setState; const double height = 50.0; const double anchorBelowY = 500.0; @@ -340,7 +339,7 @@ void main() { expect(toolbarY, equals(anchorAboveY - height + _kToolbarArrowSize.height - _kToolbarContentDistance)); }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. - testWidgetsWithLeakTracking('can create and use a custom toolbar', (WidgetTester tester) async { + testWidgets('can create and use a custom toolbar', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Select me custom menu', ); @@ -375,7 +374,7 @@ void main() { for (final Brightness? themeBrightness in <Brightness?>[...Brightness.values, null]) { for (final Brightness? mediaBrightness in <Brightness?>[...Brightness.values, null]) { - testWidgetsWithLeakTracking('draws dark buttons in dark mode and light button in light mode when theme is $themeBrightness and MediaQuery is $mediaBrightness', (WidgetTester tester) async { + testWidgets('draws dark buttons in dark mode and light button in light mode when theme is $themeBrightness and MediaQuery is $mediaBrightness', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( theme: CupertinoThemeData( @@ -432,7 +431,7 @@ void main() { } } - testWidgetsWithLeakTracking('draws a shadow below the toolbar in light mode', (WidgetTester tester) async { + testWidgets('draws a shadow below the toolbar in light mode', (WidgetTester tester) async { late StateSetter setState; const double height = 50.0; double anchorAboveY = 0.0; @@ -499,7 +498,7 @@ void main() { ); }, skip: kIsWeb); // [intended] We do not use Flutter-rendered context menu on the Web. - testWidgetsWithLeakTracking('Basic golden tests', (WidgetTester tester) async { + testWidgets('Basic golden tests', (WidgetTester tester) async { final Key key = UniqueKey(); Widget buildToolbar(Brightness brightness, Offset offset) { final Widget toolbar = CupertinoTextSelectionToolbar( diff --git a/packages/flutter/test/cupertino/theme_test.dart b/packages/flutter/test/cupertino/theme_test.dart index 8ee7c9deb1d..5f8b9a372f1 100644 --- a/packages/flutter/test/cupertino/theme_test.dart +++ b/packages/flutter/test/cupertino/theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; int buildCount = 0; CupertinoThemeData? actualTheme; @@ -47,7 +46,7 @@ void main() { actualIconTheme = null; }); - testWidgetsWithLeakTracking('Default theme has defaults', (WidgetTester tester) async { + testWidgets('Default theme has defaults', (WidgetTester tester) async { final CupertinoThemeData theme = await testTheme(tester, const CupertinoThemeData()); expect(theme.brightness, isNull); @@ -56,7 +55,7 @@ void main() { expect(theme.applyThemeToAll, false); }); - testWidgetsWithLeakTracking('Theme attributes cascade', (WidgetTester tester) async { + testWidgets('Theme attributes cascade', (WidgetTester tester) async { final CupertinoThemeData theme = await testTheme(tester, const CupertinoThemeData( primaryColor: CupertinoColors.systemRed, )); @@ -64,7 +63,7 @@ void main() { expect(theme.textTheme.actionTextStyle.color, isSameColorAs(CupertinoColors.systemRed.color)); }); - testWidgetsWithLeakTracking('Dependent attribute can be overridden from cascaded value', (WidgetTester tester) async { + testWidgets('Dependent attribute can be overridden from cascaded value', (WidgetTester tester) async { final CupertinoThemeData theme = await testTheme(tester, const CupertinoThemeData( brightness: Brightness.dark, textTheme: CupertinoTextThemeData( @@ -78,7 +77,7 @@ void main() { expect(theme.textTheme.textStyle.color, isSameColorAs(CupertinoColors.black)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Reading themes creates dependencies', (WidgetTester tester) async { // Reading the theme creates a dependency. @@ -119,7 +118,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'copyWith works', (WidgetTester tester) async { const CupertinoThemeData originalTheme = CupertinoThemeData( @@ -142,7 +141,7 @@ void main() { }, ); - testWidgetsWithLeakTracking("Theme has default IconThemeData, which is derived from the theme's primary color", (WidgetTester tester) async { + testWidgets("Theme has default IconThemeData, which is derived from the theme's primary color", (WidgetTester tester) async { const CupertinoDynamicColor primaryColor = CupertinoColors.systemRed; const CupertinoThemeData themeData = CupertinoThemeData(primaryColor: primaryColor); @@ -159,7 +158,7 @@ void main() { expect(darkColor, isSameColorAs(primaryColor.darkColor)); }); - testWidgetsWithLeakTracking('IconTheme.of creates a dependency on iconTheme', (WidgetTester tester) async { + testWidgets('IconTheme.of creates a dependency on iconTheme', (WidgetTester tester) async { IconThemeData iconTheme = await testIconTheme(tester, const CupertinoThemeData(primaryColor: CupertinoColors.destructiveRed)); expect(buildCount, 1); @@ -170,7 +169,7 @@ void main() { expect(iconTheme.color, CupertinoColors.activeOrange); }); - testWidgetsWithLeakTracking('CupertinoTheme diagnostics', (WidgetTester tester) async { + testWidgets('CupertinoTheme diagnostics', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const CupertinoThemeData().debugFillProperties(builder); @@ -202,7 +201,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CupertinoTheme.toStringDeep uses single-line style', (WidgetTester tester) async { + testWidgets('CupertinoTheme.toStringDeep uses single-line style', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/47651. expect( const CupertinoTheme( @@ -213,7 +212,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CupertinoThemeData equality', (WidgetTester tester) async { + testWidgets('CupertinoThemeData equality', (WidgetTester tester) async { const CupertinoThemeData a = CupertinoThemeData(brightness: Brightness.dark); final CupertinoThemeData b = a.copyWith(); final CupertinoThemeData c = a.copyWith(brightness: Brightness.light); @@ -236,7 +235,7 @@ void main() { } void dynamicColorsTestGroup() { - testWidgetsWithLeakTracking('CupertinoTheme.of resolves colors', (WidgetTester tester) async { + testWidgets('CupertinoTheme.of resolves colors', (WidgetTester tester) async { final CupertinoThemeData data = CupertinoThemeData(brightness: currentBrightness, primaryColor: CupertinoColors.systemRed); final CupertinoThemeData theme = await testTheme(tester, data); @@ -244,7 +243,7 @@ void main() { colorMatches(theme.primaryColor, CupertinoColors.systemRed); }); - testWidgetsWithLeakTracking('CupertinoTheme.of resolves default values', (WidgetTester tester) async { + testWidgets('CupertinoTheme.of resolves default values', (WidgetTester tester) async { const CupertinoDynamicColor primaryColor = CupertinoColors.systemRed; final CupertinoThemeData data = CupertinoThemeData(brightness: currentBrightness, primaryColor: primaryColor); diff --git a/packages/flutter/test/foundation/change_notifier_test.dart b/packages/flutter/test/foundation/change_notifier_test.dart index 6bb678a9570..aa41dc3beb9 100644 --- a/packages/flutter/test/foundation/change_notifier_test.dart +++ b/packages/flutter/test/foundation/change_notifier_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestNotifier extends ChangeNotifier { void notify() { @@ -62,7 +61,7 @@ class Counter with ChangeNotifier { } void main() { - testWidgetsWithLeakTracking('ChangeNotifier can not dispose in callback', (WidgetTester tester) async { + testWidgets('ChangeNotifier can not dispose in callback', (WidgetTester tester) async { final TestNotifier test = TestNotifier(); bool callbackDidFinish = false; void foo() { @@ -80,7 +79,7 @@ void main() { test.dispose(); }); - testWidgetsWithLeakTracking('ChangeNotifier', (WidgetTester tester) async { + testWidgets('ChangeNotifier', (WidgetTester tester) async { final List<String> log = <String>[]; void listener() { log.add('listener'); diff --git a/packages/flutter/test/gestures/debug_test.dart b/packages/flutter/test/gestures/debug_test.dart index 6a17b906429..952a830708d 100644 --- a/packages/flutter/test/gestures/debug_test.dart +++ b/packages/flutter/test/gestures/debug_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('debugPrintGestureArenaDiagnostics', (WidgetTester tester) async { + testWidgets('debugPrintGestureArenaDiagnostics', (WidgetTester tester) async { PointerEvent event; debugPrintGestureArenaDiagnostics = true; final DebugPrintCallback oldCallback = debugPrint; @@ -54,7 +53,7 @@ void main() { debugPrint = oldCallback; }); - testWidgetsWithLeakTracking('debugPrintRecognizerCallbacksTrace', (WidgetTester tester) async { + testWidgets('debugPrintRecognizerCallbacksTrace', (WidgetTester tester) async { PointerEvent event; debugPrintRecognizerCallbacksTrace = true; final DebugPrintCallback oldCallback = debugPrint; @@ -96,7 +95,7 @@ void main() { debugPrint = oldCallback; }); - testWidgetsWithLeakTracking('debugPrintGestureArenaDiagnostics and debugPrintRecognizerCallbacksTrace', (WidgetTester tester) async { + testWidgets('debugPrintGestureArenaDiagnostics and debugPrintRecognizerCallbacksTrace', (WidgetTester tester) async { PointerEvent event; debugPrintGestureArenaDiagnostics = true; debugPrintRecognizerCallbacksTrace = true; diff --git a/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart b/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart index 0a7464cc780..cb2652710c0 100644 --- a/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart +++ b/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart @@ -8,10 +8,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('PointerEvent resampling on a widget', (WidgetTester tester) async { + testWidgets('PointerEvent resampling on a widget', (WidgetTester tester) async { Duration currentTestFrameTime() => Duration( milliseconds: TestWidgetsFlutterBinding.instance.clock.now().millisecondsSinceEpoch, ); @@ -115,7 +114,7 @@ void main() { expect(events[3], isA<PointerUpEvent>()); }); - testWidgetsWithLeakTracking('Timer should be canceled when resampling stopped', (WidgetTester tester) async { + testWidgets('Timer should be canceled when resampling stopped', (WidgetTester tester) async { // A timer will be started when event's timeStamp is larger than sampleTime. final ui.PointerDataPacket packet = ui.PointerDataPacket( data: <ui.PointerData>[ diff --git a/packages/flutter/test/gestures/gesture_config_regression_test.dart b/packages/flutter/test/gestures/gesture_config_regression_test.dart index fd7569c2e54..c68594910f3 100644 --- a/packages/flutter/test/gestures/gesture_config_regression_test.dart +++ b/packages/flutter/test/gestures/gesture_config_regression_test.dart @@ -6,7 +6,6 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestResult { bool dragStarted = false; @@ -93,7 +92,7 @@ class NestedDraggableCase extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('Scroll Views get the same ScrollConfiguration as GestureDetectors', (WidgetTester tester) async { + testWidgets('Scroll Views get the same ScrollConfiguration as GestureDetectors', (WidgetTester tester) async { tester.view.gestureSettings = const ui.GestureSettings(physicalTouchSlop: 4); addTearDown(tester.view.reset); @@ -116,7 +115,7 @@ void main() { expect(result.dragUpdate, true); }); - testWidgetsWithLeakTracking('Scroll Views get the same ScrollConfiguration as Draggables', (WidgetTester tester) async { + testWidgets('Scroll Views get the same ScrollConfiguration as Draggables', (WidgetTester tester) async { tester.view.gestureSettings = const ui.GestureSettings(physicalTouchSlop: 4); addTearDown(tester.view.reset); diff --git a/packages/flutter/test/gestures/gesture_tester.dart b/packages/flutter/test/gestures/gesture_tester.dart index 602d1ca04ab..876cc4b2467 100644 --- a/packages/flutter/test/gestures/gesture_tester.dart +++ b/packages/flutter/test/gestures/gesture_tester.dart @@ -4,7 +4,7 @@ import 'package:fake_async/fake_async.dart'; import 'package:flutter/gestures.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:meta/meta.dart'; class GestureTester { @@ -26,7 +26,7 @@ typedef GestureTest = void Function(GestureTester tester); @isTest void testGesture(String description, GestureTest callback) { - testWidgetsWithLeakTracking(description, (_) async { + testWidgets(description, (_) async { FakeAsync().run((FakeAsync async) { callback(GestureTester._(async)); }); diff --git a/packages/flutter/test/gestures/transformed_double_tap_test.dart b/packages/flutter/test/gestures/transformed_double_tap_test.dart index b550ad0f3f9..e97fdead82c 100644 --- a/packages/flutter/test/gestures/transformed_double_tap_test.dart +++ b/packages/flutter/test/gestures/transformed_double_tap_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { int doubleTapCount = 0; final Key redContainer = UniqueKey(); @@ -52,7 +51,7 @@ void main() { expect(doubleTapCount, 0); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { int doubleTapCount = 0; final Key redContainer = UniqueKey(); diff --git a/packages/flutter/test/gestures/transformed_long_press_test.dart b/packages/flutter/test/gestures/transformed_long_press_test.dart index 9e222ca41d5..4025ccbce17 100644 --- a/packages/flutter/test/gestures/transformed_long_press_test.dart +++ b/packages/flutter/test/gestures/transformed_long_press_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('gets local coordinates', (WidgetTester tester) async { + testWidgets('gets local coordinates', (WidgetTester tester) async { int longPressCount = 0; int longPressUpCount = 0; final List<LongPressEndDetails> endDetails = <LongPressEndDetails>[]; @@ -54,7 +53,7 @@ void main() { expect(endDetails.single.globalPosition, const Offset(400, 300)); }); - testWidgetsWithLeakTracking('scaled up', (WidgetTester tester) async { + testWidgets('scaled up', (WidgetTester tester) async { int longPressCount = 0; int longPressUpCount = 0; final List<LongPressEndDetails> endDetails = <LongPressEndDetails>[]; @@ -129,7 +128,7 @@ void main() { expect(moveDetails.single.localOffsetFromOrigin, const Offset(0, 100.0 / 2.0)); }); - testWidgetsWithLeakTracking('scaled down', (WidgetTester tester) async { + testWidgets('scaled down', (WidgetTester tester) async { int longPressCount = 0; int longPressUpCount = 0; final List<LongPressEndDetails> endDetails = <LongPressEndDetails>[]; diff --git a/packages/flutter/test/gestures/transformed_monodrag_test.dart b/packages/flutter/test/gestures/transformed_monodrag_test.dart index b433f665b2d..419f8e2fc4e 100644 --- a/packages/flutter/test/gestures/transformed_monodrag_test.dart +++ b/packages/flutter/test/gestures/transformed_monodrag_test.dart @@ -7,11 +7,10 @@ import 'dart:math' as math; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('Horizontal', () { - testWidgetsWithLeakTracking('gets local coordinates', (WidgetTester tester) async { + testWidgets('gets local coordinates', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -66,7 +65,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -164,7 +163,7 @@ void main() { updateDetails.clear(); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -262,7 +261,7 @@ void main() { updateDetails.clear(); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when rotated 45 degrees', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when rotated 45 degrees', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -339,7 +338,7 @@ void main() { }); group('Vertical', () { - testWidgetsWithLeakTracking('gets local coordinates', (WidgetTester tester) async { + testWidgets('gets local coordinates', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -394,7 +393,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -492,7 +491,7 @@ void main() { updateDetails.clear(); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; @@ -590,7 +589,7 @@ void main() { updateDetails.clear(); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when rotated 45 degrees', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when rotated 45 degrees', (WidgetTester tester) async { int dragCancelCount = 0; final List<DragDownDetails> downDetails = <DragDownDetails>[]; final List<DragEndDetails> endDetails = <DragEndDetails>[]; diff --git a/packages/flutter/test/gestures/transformed_scale_test.dart b/packages/flutter/test/gestures/transformed_scale_test.dart index 9da6c5d2336..8392add20c1 100644 --- a/packages/flutter/test/gestures/transformed_scale_test.dart +++ b/packages/flutter/test/gestures/transformed_scale_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('gets local coordinates', (WidgetTester tester) async { + testWidgets('gets local coordinates', (WidgetTester tester) async { final List<ScaleStartDetails> startDetails = <ScaleStartDetails>[]; final List<ScaleUpdateDetails> updateDetails = <ScaleUpdateDetails>[]; diff --git a/packages/flutter/test/gestures/transformed_tap_test.dart b/packages/flutter/test/gestures/transformed_tap_test.dart index 54868059930..5b794db5f54 100644 --- a/packages/flutter/test/gestures/transformed_tap_test.dart +++ b/packages/flutter/test/gestures/transformed_tap_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('gets local coordinates', (WidgetTester tester) async { + testWidgets('gets local coordinates', (WidgetTester tester) async { int tapCount = 0; int tapCancelCount = 0; final List<TapDownDetails> downDetails = <TapDownDetails>[]; @@ -49,7 +48,7 @@ void main() { expect(upDetails.single.globalPosition, const Offset(400, 300)); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled up', (WidgetTester tester) async { int tapCount = 0; int tapCancelCount = 0; final List<TapDownDetails> downDetails = <TapDownDetails>[]; @@ -112,7 +111,7 @@ void main() { expect(upDetails, isEmpty); }); - testWidgetsWithLeakTracking('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { + testWidgets('kTouchSlop is evaluated in the global coordinate space when scaled down', (WidgetTester tester) async { int tapCount = 0; int tapCancelCount = 0; final List<TapDownDetails> downDetails = <TapDownDetails>[]; diff --git a/packages/flutter/test/gestures/velocity_tracker_test.dart b/packages/flutter/test/gestures/velocity_tracker_test.dart index 0aa5138b039..d9bc4d57d18 100644 --- a/packages/flutter/test/gestures/velocity_tracker_test.dart +++ b/packages/flutter/test/gestures/velocity_tracker_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'velocity_tracker_data.dart'; bool _withinTolerance(double actual, double expected) { @@ -35,7 +34,7 @@ void main() { Offset(-71.51939428321249, 3716.7385187526947), ]; - testWidgetsWithLeakTracking('Velocity tracker gives expected results', (WidgetTester tester) async { + testWidgets('Velocity tracker gives expected results', (WidgetTester tester) async { final VelocityTracker tracker = VelocityTracker.withKind(PointerDeviceKind.touch); int i = 0; for (final PointerEvent event in velocityEventData) { @@ -49,7 +48,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Velocity control test', (WidgetTester tester) async { + testWidgets('Velocity control test', (WidgetTester tester) async { const Velocity velocity1 = Velocity(pixelsPerSecond: Offset(7.0, 0.0)); const Velocity velocity2 = Velocity(pixelsPerSecond: Offset(12.0, 0.0)); expect(velocity1, equals(const Velocity(pixelsPerSecond: Offset(7.0, 0.0)))); @@ -61,7 +60,7 @@ void main() { expect(velocity1, hasOneLineDescription); }); - testWidgetsWithLeakTracking('Interrupted velocity estimation', (WidgetTester tester) async { + testWidgets('Interrupted velocity estimation', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/7510 final VelocityTracker tracker = VelocityTracker.withKind(PointerDeviceKind.touch); for (final PointerEvent event in interruptedVelocityEventData) { @@ -74,12 +73,12 @@ void main() { } }); - testWidgetsWithLeakTracking('No data velocity estimation', (WidgetTester tester) async { + testWidgets('No data velocity estimation', (WidgetTester tester) async { final VelocityTracker tracker = VelocityTracker.withKind(PointerDeviceKind.touch); expect(tracker.getVelocity(), Velocity.zero); }); - testWidgetsWithLeakTracking('FreeScrollStartVelocityTracker.getVelocity throws when no points', (WidgetTester tester) async { + testWidgets('FreeScrollStartVelocityTracker.getVelocity throws when no points', (WidgetTester tester) async { final IOSScrollViewFlingVelocityTracker tracker = IOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch); AssertionError? exception; try { @@ -91,7 +90,7 @@ void main() { expect(exception?.toString(), contains('at least 1 point')); }); - testWidgetsWithLeakTracking('FreeScrollStartVelocityTracker.getVelocity throws when the new point precedes the previous point', (WidgetTester tester) async { + testWidgets('FreeScrollStartVelocityTracker.getVelocity throws when the new point precedes the previous point', (WidgetTester tester) async { final IOSScrollViewFlingVelocityTracker tracker = IOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch); AssertionError? exception; @@ -106,7 +105,7 @@ void main() { expect(exception?.toString(), contains('has a smaller timestamp')); }); - testWidgetsWithLeakTracking('Estimate does not throw when there are more than 1 point', (WidgetTester tester) async { + testWidgets('Estimate does not throw when there are more than 1 point', (WidgetTester tester) async { final IOSScrollViewFlingVelocityTracker tracker = IOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch); Offset position = Offset.zero; Duration time = Duration.zero; @@ -128,7 +127,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Makes consistent velocity estimates with consistent velocity', (WidgetTester tester) async { + testWidgets('Makes consistent velocity estimates with consistent velocity', (WidgetTester tester) async { final IOSScrollViewFlingVelocityTracker tracker = IOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch); Offset position = Offset.zero; Duration time = Duration.zero; @@ -146,7 +145,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Assume zero velocity when there are no recent samples - base VelocityTracker', (WidgetTester tester) async { + testWidgets('Assume zero velocity when there are no recent samples - base VelocityTracker', (WidgetTester tester) async { final VelocityTracker tracker = VelocityTracker.withKind(PointerDeviceKind.touch); Offset position = Offset.zero; Duration time = Duration.zero; @@ -163,7 +162,7 @@ void main() { expect(tracker.getVelocity().pixelsPerSecond, Offset.zero); }); - testWidgetsWithLeakTracking('Assume zero velocity when there are no recent samples - IOS', (WidgetTester tester) async { + testWidgets('Assume zero velocity when there are no recent samples - IOS', (WidgetTester tester) async { final IOSScrollViewFlingVelocityTracker tracker = IOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch); Offset position = Offset.zero; Duration time = Duration.zero; @@ -180,7 +179,7 @@ void main() { expect(tracker.getVelocity().pixelsPerSecond, Offset.zero); }); - testWidgetsWithLeakTracking('Assume zero velocity when there are no recent samples - MacOS', (WidgetTester tester) async { + testWidgets('Assume zero velocity when there are no recent samples - MacOS', (WidgetTester tester) async { final MacOSScrollViewFlingVelocityTracker tracker = MacOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch); Offset position = Offset.zero; Duration time = Duration.zero; diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index 4af66cc40b8..102d8a0efbb 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -10,14 +10,13 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { tearDown(() { LicenseRegistry.reset(); }); - testWidgetsWithLeakTracking('Material3 has sentence case labels', (WidgetTester tester) async { + testWidgets('Material3 has sentence case labels', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), builder: (BuildContext context, Widget? child) { @@ -57,7 +56,7 @@ void main() { expect(find.text('View licenses'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - AboutListTile control test', (WidgetTester tester) async { + testWidgets('Material2 - AboutListTile control test', (WidgetTester tester) async { const FlutterLogo logo = FlutterLogo(); await tester.pumpWidget( @@ -140,7 +139,7 @@ void main() { expect(find.text('Pirate license'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - AboutListTile control test', (WidgetTester tester) async { + testWidgets('Material3 - AboutListTile control test', (WidgetTester tester) async { const FlutterLogo logo = FlutterLogo(); await tester.pumpWidget( @@ -223,7 +222,7 @@ void main() { expect(find.text('Pirate license'), findsOneWidget); }); - testWidgetsWithLeakTracking('About box logic defaults to executable name for app name', (WidgetTester tester) async { + testWidgets('About box logic defaults to executable name for app name', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( title: 'flutter_tester', @@ -233,7 +232,7 @@ void main() { expect(find.text('About flutter_tester'), findsOneWidget); }); - testWidgetsWithLeakTracking('LicensePage control test', (WidgetTester tester) async { + testWidgets('LicensePage control test', (WidgetTester tester) async { LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ const LicenseEntryWithLineBreaks(<String>['AAA'], 'BBB'), @@ -284,7 +283,7 @@ void main() { expect(find.text('Another license'), findsOneWidget); }); - testWidgetsWithLeakTracking('LicensePage control test with all properties', (WidgetTester tester) async { + testWidgets('LicensePage control test with all properties', (WidgetTester tester) async { const FlutterLogo logo = FlutterLogo(); LicenseRegistry.addLicense(() { @@ -360,7 +359,7 @@ void main() { expect(find.text('Another license'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - _PackageLicensePage title style without AppBarTheme', (WidgetTester tester) async { + testWidgets('Material2 - _PackageLicensePage title style without AppBarTheme', (WidgetTester tester) async { LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ const LicenseEntryWithLineBreaks(<String>['AAA'], 'BBB'), @@ -408,7 +407,7 @@ void main() { expect(subtitle.style, subtitleTextStyle); }); - testWidgetsWithLeakTracking('Material3 - _PackageLicensePage title style without AppBarTheme', (WidgetTester tester) async { + testWidgets('Material3 - _PackageLicensePage title style without AppBarTheme', (WidgetTester tester) async { LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ const LicenseEntryWithLineBreaks(<String>['AAA'], 'BBB'), @@ -456,7 +455,7 @@ void main() { expect(subtitle.style, subtitleTextStyle); }); - testWidgetsWithLeakTracking('_PackageLicensePage title style with AppBarTheme', (WidgetTester tester) async { + testWidgets('_PackageLicensePage title style with AppBarTheme', (WidgetTester tester) async { LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ const LicenseEntryWithLineBreaks(<String>['AAA'], 'BBB'), @@ -506,7 +505,7 @@ void main() { expect(title.style, titleTextStyle); }); - testWidgetsWithLeakTracking('Material2 - LicensePage respects the notch', (WidgetTester tester) async { + testWidgets('Material2 - LicensePage respects the notch', (WidgetTester tester) async { const double safeareaPadding = 27.0; LicenseRegistry.addLicense(() { @@ -537,7 +536,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - LicensePage respects the notch', (WidgetTester tester) async { + testWidgets('Material3 - LicensePage respects the notch', (WidgetTester tester) async { const double safeareaPadding = 27.0; LicenseRegistry.addLicense(() { @@ -568,7 +567,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('LicensePage returns early if unmounted', (WidgetTester tester) async { + testWidgets('LicensePage returns early if unmounted', (WidgetTester tester) async { final Completer<LicenseEntry> licenseCompleter = Completer<LicenseEntry>(); LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromFuture(licenseCompleter.future); @@ -593,7 +592,7 @@ void main() { expect(licenseEntry.packagesCalled, false); }); - testWidgetsWithLeakTracking('LicensePage returns late if unmounted', (WidgetTester tester) async { + testWidgets('LicensePage returns late if unmounted', (WidgetTester tester) async { final Completer<LicenseEntry> licenseCompleter = Completer<LicenseEntry>(); LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromFuture(licenseCompleter.future); @@ -618,7 +617,7 @@ void main() { expect(licenseEntry.packagesCalled, true); }); - testWidgetsWithLeakTracking('LicensePage logic defaults to executable name for app name', (WidgetTester tester) async { + testWidgets('LicensePage logic defaults to executable name for app name', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( title: 'flutter_tester', @@ -628,7 +627,7 @@ void main() { expect(find.text('flutter_tester'), findsOneWidget); }); - testWidgetsWithLeakTracking('AboutListTile dense property is applied', (WidgetTester tester) async { + testWidgets('AboutListTile dense property is applied', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material(child: Center(child: AboutListTile())), )); @@ -648,7 +647,7 @@ void main() { expect(tileRect.height, 48.0); }); - testWidgetsWithLeakTracking('showLicensePage uses nested navigator by default', (WidgetTester tester) async { + testWidgets('showLicensePage uses nested navigator by default', (WidgetTester tester) async { final LicensePageObserver rootObserver = LicensePageObserver(); final LicensePageObserver nestedObserver = LicensePageObserver(); @@ -686,7 +685,7 @@ void main() { expect(nestedObserver.licensePageCount, 1); }); - testWidgetsWithLeakTracking('showLicensePage uses root navigator if useRootNavigator is true', (WidgetTester tester) async { + testWidgets('showLicensePage uses root navigator if useRootNavigator is true', (WidgetTester tester) async { final LicensePageObserver rootObserver = LicensePageObserver(); final LicensePageObserver nestedObserver = LicensePageObserver(); @@ -732,7 +731,7 @@ void main() { rootObserver = AboutDialogObserver(); }); - testWidgetsWithLeakTracking('Barrier is dismissible with default parameter', (WidgetTester tester) async { + testWidgets('Barrier is dismissible with default parameter', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( navigatorObservers: <NavigatorObserver>[rootObserver], @@ -764,7 +763,7 @@ void main() { expect(rootObserver.dialogCount, 0); }); - testWidgetsWithLeakTracking('Barrier is not dismissible with barrierDismissible is false', (WidgetTester tester) async { + testWidgets('Barrier is not dismissible with barrierDismissible is false', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( navigatorObservers: <NavigatorObserver>[rootObserver], @@ -798,7 +797,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Barrier color', (WidgetTester tester) async { + testWidgets('Barrier color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -852,7 +851,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, Colors.pink); }); - testWidgetsWithLeakTracking('Barrier Label', (WidgetTester tester) async { + testWidgets('Barrier Label', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -879,7 +878,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).semanticsLabel, 'Custom Label'); }); - testWidgetsWithLeakTracking('showAboutDialog uses root navigator by default', (WidgetTester tester) async { + testWidgets('showAboutDialog uses root navigator by default', (WidgetTester tester) async { final AboutDialogObserver rootObserver = AboutDialogObserver(); final AboutDialogObserver nestedObserver = AboutDialogObserver(); @@ -912,7 +911,7 @@ void main() { expect(nestedObserver.dialogCount, 0); }); - testWidgetsWithLeakTracking('showAboutDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('showAboutDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final AboutDialogObserver rootObserver = AboutDialogObserver(); final AboutDialogObserver nestedObserver = AboutDialogObserver(); @@ -947,7 +946,7 @@ void main() { }); group('showAboutDialog avoids overlapping display features', () { - testWidgetsWithLeakTracking('default positioning', (WidgetTester tester) async { + testWidgets('default positioning', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( builder: (BuildContext context, Widget? child) { return MediaQuery( @@ -988,7 +987,7 @@ void main() { expect(tester.getBottomRight(find.byType(AboutDialog)), const Offset(390.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning using anchorPoint', (WidgetTester tester) async { + testWidgets('positioning using anchorPoint', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( builder: (BuildContext context, Widget? child) { return MediaQuery( @@ -1030,7 +1029,7 @@ void main() { expect(tester.getBottomRight(find.byType(AboutDialog)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning using Directionality', (WidgetTester tester) async { + testWidgets('positioning using Directionality', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( builder: (BuildContext context, Widget? child) { return MediaQuery( @@ -1075,7 +1074,7 @@ void main() { }); }); - testWidgetsWithLeakTracking("AboutListTile's child should not be offset when the icon is not specified.", (WidgetTester tester) async { + testWidgets("AboutListTile's child should not be offset when the icon is not specified.", (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -1095,7 +1094,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("AboutDialog's contents are scrollable", (WidgetTester tester) async { + testWidgets("AboutDialog's contents are scrollable", (WidgetTester tester) async { final Key contentKey = UniqueKey(); await tester.pumpWidget(MaterialApp( home: Navigator( @@ -1143,7 +1142,7 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(originalOffset.translate(0.0, -20.0))); }); - testWidgetsWithLeakTracking("Material2 - LicensePage's color must be same whether loading or done", (WidgetTester tester) async { + testWidgets("Material2 - LicensePage's color must be same whether loading or done", (WidgetTester tester) async { const Color scaffoldColor = Color(0xFF123456); const Color cardColor = Color(0xFF654321); @@ -1190,7 +1189,7 @@ void main() { expect(materialDones[1].color, cardColor); }); - testWidgetsWithLeakTracking("Material3 - LicensePage's color must be same whether loading or done", (WidgetTester tester) async { + testWidgets("Material3 - LicensePage's color must be same whether loading or done", (WidgetTester tester) async { const Color scaffoldColor = Color(0xFF123456); const Color cardColor = Color(0xFF654321); @@ -1237,7 +1236,7 @@ void main() { expect(materialDones[1].color, cardColor); }); - testWidgetsWithLeakTracking('Conflicting scrollbars are not applied by ScrollBehavior to _PackageLicensePage', (WidgetTester tester) async { + testWidgets('Conflicting scrollbars are not applied by ScrollBehavior to _PackageLicensePage', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/83819 LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ @@ -1279,7 +1278,7 @@ void main() { }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('ListView of license entries is primary', (WidgetTester tester) async { + testWidgets('ListView of license entries is primary', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/120710 LicenseRegistry.addLicense(() { return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ @@ -1338,7 +1337,7 @@ void main() { await tester.pumpAndSettle(); // No exception triggered. }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('LicensePage padding', (WidgetTester tester) async { + testWidgets('LicensePage padding', (WidgetTester tester) async { const FlutterLogo logo = FlutterLogo(); await tester.pumpWidget( @@ -1381,7 +1380,7 @@ void main() { expect(appLegaleseBottomPadding, 18.0); }); - testWidgetsWithLeakTracking('LicensePage has no extra padding between app icon and app powered text', (WidgetTester tester) async { + testWidgets('LicensePage has no extra padding between app icon and app powered text', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/99559 const FlutterLogo logo = FlutterLogo(); @@ -1414,7 +1413,7 @@ void main() { expect(appIconBottomPadding, 18.0); }); - testWidgetsWithLeakTracking('Material2 - Error handling test', (WidgetTester tester) async { + testWidgets('Material2 - Error handling test', (WidgetTester tester) async { LicenseRegistry.addLicense(() => Stream<LicenseEntry>.error(Exception('Injected failure'))); await tester.pumpWidget( MaterialApp( @@ -1437,7 +1436,7 @@ void main() { expect(find.text('Exception: Injected failure'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - Error handling test', (WidgetTester tester) async { + testWidgets('Material3 - Error handling test', (WidgetTester tester) async { LicenseRegistry.addLicense(() => Stream<LicenseEntry>.error(Exception('Injected failure'))); await tester.pumpWidget( MaterialApp( @@ -1460,7 +1459,7 @@ void main() { expect(find.text('Exception: Injected failure'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - LicensePage master view layout position - ltr', (WidgetTester tester) async { + testWidgets('Material2 - LicensePage master view layout position - ltr', (WidgetTester tester) async { const TextDirection textDirection = TextDirection.ltr; const Size defaultSize = Size(800.0, 600.0); const Size wideSize = Size(1200.0, 600.0); @@ -1525,7 +1524,7 @@ void main() { expect(tester.getCenter(find.byType(ListView)), const Offset(160, 356)); }); - testWidgetsWithLeakTracking('Material3 - LicensePage master view layout position - ltr', (WidgetTester tester) async { + testWidgets('Material3 - LicensePage master view layout position - ltr', (WidgetTester tester) async { const TextDirection textDirection = TextDirection.ltr; const Size defaultSize = Size(800.0, 600.0); const Size wideSize = Size(1200.0, 600.0); @@ -1592,7 +1591,7 @@ void main() { expect(tester.getCenter(find.byType(ListView)), const Offset(160, 356)); }); - testWidgetsWithLeakTracking('Material2 - LicensePage master view layout position - rtl', (WidgetTester tester) async { + testWidgets('Material2 - LicensePage master view layout position - rtl', (WidgetTester tester) async { const TextDirection textDirection = TextDirection.rtl; const Size defaultSize = Size(800.0, 600.0); const Size wideSize = Size(1200.0, 600.0); @@ -1657,7 +1656,7 @@ void main() { expect(tester.getCenter(find.byType(ListView)), const Offset(1040.0, 356.0)); }); - testWidgetsWithLeakTracking('Material3 - LicensePage master view layout position - rtl', (WidgetTester tester) async { + testWidgets('Material3 - LicensePage master view layout position - rtl', (WidgetTester tester) async { const TextDirection textDirection = TextDirection.rtl; const Size defaultSize = Size(800.0, 600.0); const Size wideSize = Size(1200.0, 600.0); @@ -1724,7 +1723,7 @@ void main() { expect(tester.getCenter(find.byType(ListView)), const Offset(1040.0, 356.0)); }); - testWidgetsWithLeakTracking('License page title in lateral UI does not use AppBarTheme.foregroundColor', (WidgetTester tester) async { + testWidgets('License page title in lateral UI does not use AppBarTheme.foregroundColor', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/108991 final ThemeData theme = ThemeData( appBarTheme: const AppBarTheme(foregroundColor: Color(0xFFFFFFFF)), @@ -1765,7 +1764,7 @@ void main() { expect(renderParagraph.text.style!.color, theme.textTheme.titleLarge!.color); }); - testWidgetsWithLeakTracking('License page default title text color in the nested UI', (WidgetTester tester) async { + testWidgets('License page default title text color in the nested UI', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/108991 final ThemeData theme = ThemeData(useMaterial3: true); const String title = 'License ABC'; @@ -1806,7 +1805,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('License page default title text color in the nested UI', (WidgetTester tester) async { + testWidgets('License page default title text color in the nested UI', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/108991 final ThemeData theme = ThemeData(useMaterial3: false); const String title = 'License ABC'; diff --git a/packages/flutter/test/material/action_chip_test.dart b/packages/flutter/test/material/action_chip_test.dart index 4aa5d6110ba..4794ee86aca 100644 --- a/packages/flutter/test/material/action_chip_test.dart +++ b/packages/flutter/test/material/action_chip_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; /// Adds the basic requirements for a Chip. Widget wrapForChip({ @@ -73,7 +72,7 @@ void checkChipMaterialClipBehavior(WidgetTester tester, Clip clipBehavior) { } void main() { - testWidgetsWithLeakTracking('ActionChip defaults', (WidgetTester tester) async { + testWidgets('ActionChip defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const String label = 'action chip'; @@ -147,7 +146,7 @@ void main() { expect(decoration.color, null); }); - testWidgetsWithLeakTracking('ActionChip.elevated defaults', (WidgetTester tester) async { + testWidgets('ActionChip.elevated defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const String label = 'action chip'; @@ -221,7 +220,7 @@ void main() { expect(decoration.color, theme.colorScheme.onSurface.withOpacity(0.12)); }); - testWidgetsWithLeakTracking('ActionChip.color resolves material states', (WidgetTester tester) async { + testWidgets('ActionChip.color resolves material states', (WidgetTester tester) async { const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); final MaterialStateProperty<Color?> color = MaterialStateProperty.resolveWith((Set<MaterialState> states) { @@ -280,7 +279,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ActionChip uses provided state color properties', (WidgetTester tester) async { + testWidgets('ActionChip uses provided state color properties', (WidgetTester tester) async { const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); Widget buildApp({ required bool enabled, required bool selected }) { @@ -335,7 +334,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ActionChip can be tapped', (WidgetTester tester) async { + testWidgets('ActionChip can be tapped', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -351,7 +350,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('ActionChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { + testWidgets('ActionChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { const Text label = Text('label'); await tester.pumpWidget(wrapForChip(child: ActionChip(label: label, onPressed: () { }))); checkChipMaterialClipBehavior(tester, Clip.none); @@ -360,7 +359,7 @@ void main() { checkChipMaterialClipBehavior(tester, Clip.antiAlias); }); - testWidgetsWithLeakTracking('ActionChip uses provided iconTheme', (WidgetTester tester) async { + testWidgets('ActionChip uses provided iconTheme', (WidgetTester tester) async { Widget buildChip({ IconThemeData? iconTheme }) { return MaterialApp( home: Material( diff --git a/packages/flutter/test/material/action_icons_theme_test.dart b/packages/flutter/test/material/action_icons_theme_test.dart index ade5cf55c77..82af904d4ac 100644 --- a/packages/flutter/test/material/action_icons_theme_test.dart +++ b/packages/flutter/test/material/action_icons_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('ActionIconThemeData copyWith, ==, hashCode basics', () { @@ -14,7 +13,7 @@ void main() { const ActionIconThemeData().copyWith().hashCode); }); - testWidgetsWithLeakTracking('ActionIconThemeData copyWith overrides all properties', (WidgetTester tester) async { + testWidgets('ActionIconThemeData copyWith overrides all properties', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/126762. Widget originalButtonBuilder(BuildContext context) { return const SizedBox(); @@ -58,7 +57,7 @@ void main() { expect(themeData.endDrawerButtonIconBuilder, null); }); - testWidgetsWithLeakTracking('Default ActionIconThemeData debugFillProperties', + testWidgets('Default ActionIconThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ActionIconThemeData().debugFillProperties(builder); @@ -71,7 +70,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ActionIconThemeData implements debugFillProperties', + testWidgets('ActionIconThemeData implements debugFillProperties', (WidgetTester tester) async { Widget actionButtonIconBuilder(BuildContext context) { return const Icon(IconData(0)); @@ -99,7 +98,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Action buttons use ThemeData action icon theme', (WidgetTester tester) async { + testWidgets('Action buttons use ThemeData action icon theme', (WidgetTester tester) async { const Color green = Color(0xff00ff00); const IconData icon = IconData(0); @@ -160,7 +159,7 @@ void main() { // This test is essentially the same as 'Action buttons use ThemeData action icon theme'. In // this case the theme is introduced with the ActionIconTheme widget instead of // ThemeData.actionIconTheme. - testWidgetsWithLeakTracking('Action buttons use ActionIconTheme', (WidgetTester tester) async { + testWidgets('Action buttons use ActionIconTheme', (WidgetTester tester) async { const Color green = Color(0xff00ff00); const IconData icon = IconData(0); diff --git a/packages/flutter/test/material/adaptive_text_selection_toolbar_test.dart b/packages/flutter/test/material/adaptive_text_selection_toolbar_test.dart index 3bfcf220461..58bddbbc401 100644 --- a/packages/flutter/test/material/adaptive_text_selection_toolbar_test.dart +++ b/packages/flutter/test/material/adaptive_text_selection_toolbar_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart'; import '../widgets/live_text_utils.dart'; @@ -27,7 +26,7 @@ void main() { await Clipboard.setData(const ClipboardData(text: 'Clipboard data')); }); - testWidgetsWithLeakTracking('Builds the right toolbar on each platform, including web, and shows buttonItems', (WidgetTester tester) async { + testWidgets('Builds the right toolbar on each platform, including web, and shows buttonItems', (WidgetTester tester) async { const String buttonText = 'Click me'; await tester.pumpWidget( @@ -82,7 +81,7 @@ void main() { skip: isBrowser, // [intended] see https://github.com/flutter/flutter/issues/108382 ); - testWidgetsWithLeakTracking('Can build children directly as well', (WidgetTester tester) async { + testWidgets('Can build children directly as well', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( @@ -105,7 +104,7 @@ void main() { expect(find.byKey(key), findsOneWidget); }); - testWidgetsWithLeakTracking('Can build from EditableTextState', (WidgetTester tester) async { + testWidgets('Can build from EditableTextState', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TextEditingController controller = TextEditingController(); final FocusNode focusNode = FocusNode(); @@ -173,7 +172,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('Can build for editable text from raw parameters', (WidgetTester tester) async { + testWidgets('Can build for editable text from raw parameters', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -275,7 +274,7 @@ void main() { ); group('buttonItems', () { - testWidgetsWithLeakTracking('getEditableTextButtonItems builds the correct button items per-platform', (WidgetTester tester) async { + testWidgets('getEditableTextButtonItems builds the correct button items per-platform', (WidgetTester tester) async { // Fill the clipboard so that the Paste option is available in the text // selection menu. await Clipboard.setData(const ClipboardData(text: 'Clipboard data')); @@ -374,7 +373,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('getAdaptiveButtons builds the correct button widgets per-platform', (WidgetTester tester) async { + testWidgets('getAdaptiveButtons builds the correct button widgets per-platform', (WidgetTester tester) async { const String buttonText = 'Click me'; await tester.pumpWidget( diff --git a/packages/flutter/test/material/animated_icons_test.dart b/packages/flutter/test/material/animated_icons_test.dart index b81df836181..1b1668e3882 100644 --- a/packages/flutter/test/material/animated_icons_test.dart +++ b/packages/flutter/test/material/animated_icons_test.dart @@ -9,7 +9,6 @@ import 'dart:math' as math show pi; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; class MockCanvas extends Fake implements Canvas { @@ -95,7 +94,7 @@ class RecordedScale extends RecordedCanvasCall { } void main() { - testWidgetsWithLeakTracking('IconTheme color', (WidgetTester tester) async { + testWidgets('IconTheme color', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -116,7 +115,7 @@ void main() { expect(canvas.capturedPaint, hasColor(0xFF666666)); }); - testWidgetsWithLeakTracking('IconTheme opacity', (WidgetTester tester) async { + testWidgets('IconTheme opacity', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -138,7 +137,7 @@ void main() { expect(canvas.capturedPaint, hasColor(0x80666666)); }); - testWidgetsWithLeakTracking('color overrides IconTheme color', (WidgetTester tester) async { + testWidgets('color overrides IconTheme color', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -160,7 +159,7 @@ void main() { expect(canvas.capturedPaint, hasColor(0xFF0000FF)); }); - testWidgetsWithLeakTracking('IconTheme size', (WidgetTester tester) async { + testWidgets('IconTheme size', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -184,7 +183,7 @@ void main() { expect(canvas.capturedSy, 0.25); }); - testWidgetsWithLeakTracking('size overridesIconTheme size', (WidgetTester tester) async { + testWidgets('size overridesIconTheme size', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -209,7 +208,7 @@ void main() { expect(canvas.capturedSy, 2); }); - testWidgetsWithLeakTracking('Semantic label', (WidgetTester tester) async { + testWidgets('Semantic label', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -229,7 +228,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Inherited text direction rtl', (WidgetTester tester) async { + testWidgets('Inherited text direction rtl', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.rtl, @@ -258,7 +257,7 @@ void main() { matchesGoldenFile('animated_icons_test.icon.rtl.png')); }); - testWidgetsWithLeakTracking('Inherited text direction ltr', (WidgetTester tester) async { + testWidgets('Inherited text direction ltr', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -285,7 +284,7 @@ void main() { matchesGoldenFile('animated_icons_test.icon.ltr.png')); }); - testWidgetsWithLeakTracking('Inherited text direction overridden', (WidgetTester tester) async { + testWidgets('Inherited text direction overridden', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -311,7 +310,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Direction has no effect on position of widget', (WidgetTester tester) async { + testWidgets('Direction has no effect on position of widget', (WidgetTester tester) async { const AnimatedIcon icon = AnimatedIcon( progress: AlwaysStoppedAnimation<double>(0.0), icon: AnimatedIcons.arrow_menu, diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index c37613731f1..49d647d7660 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -82,7 +81,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('AppBar centers title on iOS', (WidgetTester tester) async { + testWidgets('AppBar centers title on iOS', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: TargetPlatform.android), @@ -163,7 +162,7 @@ void main() { } }); - testWidgetsWithLeakTracking('AppBar centerTitle:true centers on Android', (WidgetTester tester) async { + testWidgets('AppBar centerTitle:true centers on Android', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: TargetPlatform.android), @@ -183,7 +182,7 @@ void main() { expect(center.dx, lessThan(400 + size.width / 2.0)); }); - testWidgetsWithLeakTracking('AppBar centerTitle:false title start edge is 16.0 (LTR)', (WidgetTester tester) async { + testWidgets('AppBar centerTitle:false title start edge is 16.0 (LTR)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -200,7 +199,7 @@ void main() { expect(tester.getTopRight(titleWidget).dx, 800 - 16.0); }); - testWidgetsWithLeakTracking('AppBar centerTitle:false title start edge is 16.0 (RTL)', (WidgetTester tester) async { + testWidgets('AppBar centerTitle:false title start edge is 16.0 (RTL)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -220,7 +219,7 @@ void main() { expect(tester.getTopLeft(titleWidget).dx, 16.0); }); - testWidgetsWithLeakTracking('AppBar titleSpacing:32 title start edge is 32.0 (LTR)', (WidgetTester tester) async { + testWidgets('AppBar titleSpacing:32 title start edge is 32.0 (LTR)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -238,7 +237,7 @@ void main() { expect(tester.getTopRight(titleWidget).dx, 800 - 32.0); }); - testWidgetsWithLeakTracking('AppBar titleSpacing:32 title start edge is 32.0 (RTL)', (WidgetTester tester) async { + testWidgets('AppBar titleSpacing:32 title start edge is 32.0 (RTL)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -259,7 +258,7 @@ void main() { expect(tester.getTopLeft(titleWidget).dx, 32.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'AppBar centerTitle:false leading button title left edge is 72.0 (LTR)', (WidgetTester tester) async { await tester.pumpWidget( @@ -279,7 +278,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'AppBar centerTitle:false leading button title left edge is 72.0 (RTL)', (WidgetTester tester) async { await tester.pumpWidget( @@ -302,7 +301,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('AppBar centerTitle:false title overflow OK', (WidgetTester tester) async { + testWidgets('AppBar centerTitle:false title overflow OK', (WidgetTester tester) async { // The app bar's title should be constrained to fit within the available space // between the leading and actions widgets. @@ -363,7 +362,7 @@ void main() { expect(tester.getSize(title).width, equals(800.0 - 56.0 - 16.0 - 16.0 - 200.0)); }); - testWidgetsWithLeakTracking('AppBar centerTitle:true title overflow OK (LTR)', (WidgetTester tester) async { + testWidgets('AppBar centerTitle:true title overflow OK (LTR)', (WidgetTester tester) async { // The app bar's title should be constrained to fit within the available space // between the leading and actions widgets. When it's also centered it may // also be start or end justified if it doesn't fit in the overall center. @@ -415,7 +414,7 @@ void main() { expect(tester.getSize(title).width, equals(620.0)); }); - testWidgetsWithLeakTracking('AppBar centerTitle:true title overflow OK (RTL)', (WidgetTester tester) async { + testWidgets('AppBar centerTitle:true title overflow OK (RTL)', (WidgetTester tester) async { // The app bar's title should be constrained to fit within the available space // between the leading and actions widgets. When it's also centered it may // also be start or end justified if it doesn't fit in the overall center. @@ -470,7 +469,7 @@ void main() { expect(tester.getSize(title).width, equals(620.0)); }); - testWidgetsWithLeakTracking('AppBar with no Scaffold', (WidgetTester tester) async { + testWidgets('AppBar with no Scaffold', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: SizedBox( @@ -490,7 +489,7 @@ void main() { expect(find.text('A2'), findsOneWidget); }); - testWidgetsWithLeakTracking('AppBar render at zero size', (WidgetTester tester) async { + testWidgets('AppBar render at zero size', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -509,7 +508,7 @@ void main() { expect(tester.getSize(title).isEmpty, isTrue); }); - testWidgetsWithLeakTracking('AppBar actions are vertically centered', (WidgetTester tester) async { + testWidgets('AppBar actions are vertically centered', (WidgetTester tester) async { final UniqueKey appBarKey = UniqueKey(); final UniqueKey leadingKey = UniqueKey(); final UniqueKey titleKey = UniqueKey(); @@ -541,7 +540,7 @@ void main() { expect(yCenter(appBarKey), equals(yCenter(action1Key))); }); - testWidgetsWithLeakTracking('AppBar drawer icon has default size', (WidgetTester tester) async { + testWidgets('AppBar drawer icon has default size', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -559,7 +558,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - AppBar drawer icon has default color', (WidgetTester tester) async { + testWidgets('Material2 - AppBar drawer icon has default color', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: false, @@ -579,7 +578,7 @@ void main() { expect(_iconStyle(tester, Icons.menu)?.color, themeData.colorScheme.onPrimary); }); - testWidgetsWithLeakTracking('Material3 - AppBar drawer icon has default color', (WidgetTester tester) async { + testWidgets('Material3 - AppBar drawer icon has default color', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: true, @@ -599,7 +598,7 @@ void main() { expect(_iconStyle(tester, Icons.menu)?.color, themeData.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('AppBar drawer icon is sized by iconTheme', (WidgetTester tester) async { + testWidgets('AppBar drawer icon is sized by iconTheme', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -617,7 +616,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AppBar drawer icon is colored by iconTheme', (WidgetTester tester) async { + testWidgets('AppBar drawer icon is colored by iconTheme', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from(colorScheme: const ColorScheme.light()); const Color color = Color(0xFF2196F3); @@ -637,7 +636,7 @@ void main() { expect(_iconStyle(tester, Icons.menu)?.color, color); }); - testWidgetsWithLeakTracking('AppBar endDrawer icon has default size', (WidgetTester tester) async { + testWidgets('AppBar endDrawer icon has default size', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -656,7 +655,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - AppBar endDrawer icon has default color', (WidgetTester tester) async { + testWidgets('Material2 - AppBar endDrawer icon has default color', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: false, @@ -676,7 +675,7 @@ void main() { expect(_iconStyle(tester, Icons.menu)?.color, themeData.colorScheme.onPrimary); }); - testWidgetsWithLeakTracking('Material3 - AppBar endDrawer icon has default color', (WidgetTester tester) async { + testWidgets('Material3 - AppBar endDrawer icon has default color', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: true, @@ -696,7 +695,7 @@ void main() { expect(_iconStyle(tester, Icons.menu)?.color, themeData.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('AppBar endDrawer icon is sized by iconTheme', (WidgetTester tester) async { + testWidgets('AppBar endDrawer icon is sized by iconTheme', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -714,7 +713,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AppBar endDrawer icon is colored by iconTheme', (WidgetTester tester) async { + testWidgets('AppBar endDrawer icon is colored by iconTheme', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from(colorScheme: const ColorScheme.light()); const Color color = Color(0xFF2196F3); @@ -734,7 +733,7 @@ void main() { expect(_iconStyle(tester, Icons.menu)?.color, color); }); - testWidgetsWithLeakTracking('Material2 - leading widget extends to edge and is square', (WidgetTester tester) async { + testWidgets('Material2 - leading widget extends to edge and is square', (WidgetTester tester) async { final ThemeData themeData = ThemeData( platform: TargetPlatform.android, useMaterial3: false, @@ -792,7 +791,7 @@ void main() { expect(tester.getSize(leading), const Size(56.0, 56.0)); }); - testWidgetsWithLeakTracking('Material3 - leading widget extends to edge and is square', (WidgetTester tester) async { + testWidgets('Material3 - leading widget extends to edge and is square', (WidgetTester tester) async { final ThemeData themeData = ThemeData( platform: TargetPlatform.android, useMaterial3: true, @@ -850,7 +849,7 @@ void main() { expect(tester.getSize(leading), const Size(56.0, 56.0)); }); - testWidgetsWithLeakTracking('Material2 - Action is 4dp from edge and 48dp min', (WidgetTester tester) async { + testWidgets('Material2 - Action is 4dp from edge and 48dp min', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, useMaterial3: false, @@ -890,7 +889,7 @@ void main() { expect(tester.getSize(shareButton), const Size(48.0, 56.0)); }); - testWidgetsWithLeakTracking('Material3 - Action is 4dp from edge and 48dp min', (WidgetTester tester) async { + testWidgets('Material3 - Action is 4dp from edge and 48dp min', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, useMaterial3: true, @@ -930,7 +929,7 @@ void main() { expect(tester.getSize(shareButton), const Size(48.0, 48.0)); }); - testWidgetsWithLeakTracking('SliverAppBar default configuration', (WidgetTester tester) async { + testWidgets('SliverAppBar default configuration', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp()); final ScrollController controller = primaryScrollController(tester); @@ -962,7 +961,7 @@ void main() { expect(tabBarHeight(tester), initialTabBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar expandedHeight, pinned', (WidgetTester tester) async { + testWidgets('SliverAppBar expandedHeight, pinned', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp( pinned: true, expandedHeight: 128.0, @@ -993,7 +992,7 @@ void main() { expect(tabBarHeight(tester), initialTabBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar expandedHeight, pinned and floating', (WidgetTester tester) async { + testWidgets('SliverAppBar expandedHeight, pinned and floating', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp( floating: true, pinned: true, @@ -1025,7 +1024,7 @@ void main() { expect(tabBarHeight(tester), initialTabBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar expandedHeight, floating with snap:true', (WidgetTester tester) async { + testWidgets('SliverAppBar expandedHeight, floating with snap:true', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp( floating: true, snap: true, @@ -1105,7 +1104,7 @@ void main() { expect(appBarBottom(tester), lessThanOrEqualTo(0.0)); }); - testWidgetsWithLeakTracking('SliverAppBar expandedHeight, floating and pinned with snap:true', (WidgetTester tester) async { + testWidgets('SliverAppBar expandedHeight, floating and pinned with snap:true', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp( floating: true, pinned: true, @@ -1191,7 +1190,7 @@ void main() { expect(appBarBottom(tester), kTextTabBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar expandedHeight, collapsedHeight', (WidgetTester tester) async { + testWidgets('SliverAppBar expandedHeight, collapsedHeight', (WidgetTester tester) async { const double expandedAppBarHeight = 400.0; const double collapsedAppBarHeight = 200.0; @@ -1229,7 +1228,7 @@ void main() { expect(tabBarHeight(tester), initialTabBarHeight); }); - testWidgetsWithLeakTracking('Material3 - SliverAppBar.medium defaults', (WidgetTester tester) async { + testWidgets('Material3 - SliverAppBar.medium defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 112; @@ -1318,7 +1317,7 @@ void main() { expect(tester.getSize(expandedTitleClip).height, expandedAppBarHeight - collapsedAppBarHeight); }); - testWidgetsWithLeakTracking('Material3 - SliverAppBar.large defaults', (WidgetTester tester) async { + testWidgets('Material3 - SliverAppBar.large defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 152; @@ -1411,7 +1410,7 @@ void main() { expect(tester.getSize(expandedTitleClip).height, expandedAppBarHeight - collapsedAppBarHeight); }); - testWidgetsWithLeakTracking('Material2 - AppBar uses the specified elevation or defaults to 4.0', (WidgetTester tester) async { + testWidgets('Material2 - AppBar uses the specified elevation or defaults to 4.0', (WidgetTester tester) async { Widget buildAppBar([double? elevation]) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1435,7 +1434,7 @@ void main() { expect(getMaterial().elevation, 8.0); }); - testWidgetsWithLeakTracking('Material3 - AppBar uses the specified elevation or defaults to 0', (WidgetTester tester) async { + testWidgets('Material3 - AppBar uses the specified elevation or defaults to 0', (WidgetTester tester) async { Widget buildAppBar([double? elevation]) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1459,7 +1458,7 @@ void main() { expect(getMaterial().elevation, 8.0); }); - testWidgetsWithLeakTracking('scrolledUnderElevation', (WidgetTester tester) async { + testWidgets('scrolledUnderElevation', (WidgetTester tester) async { Widget buildAppBar({double? elevation, double? scrolledUnderElevation}) { return MaterialApp( home: Scaffold( @@ -1492,7 +1491,7 @@ void main() { expect(getMaterial().elevation, 10); }); - testWidgetsWithLeakTracking('Material3 - scrolledUnderElevation with nested scroll view', (WidgetTester tester) async { + testWidgets('Material3 - scrolledUnderElevation with nested scroll view', (WidgetTester tester) async { Widget buildAppBar({double? scrolledUnderElevation}) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1561,7 +1560,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Respects forceElevated parameter', (WidgetTester tester) async { + testWidgets('Respects forceElevated parameter', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/59158. AppBar getAppBar() => tester.widget<AppBar>(find.byType(AppBar)); Material getMaterial() => tester.widget<Material>(find.byType(Material)); @@ -1584,7 +1583,7 @@ void main() { expect(getMaterial().elevation, 8.0); }); - testWidgetsWithLeakTracking('Uses elevation of AppBarTheme by default', (WidgetTester tester) async { + testWidgets('Uses elevation of AppBarTheme by default', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/73525. Material getMaterial() => tester.widget<Material>(find.byType(Material)); @@ -1652,7 +1651,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( 'forceMaterialTransparency == true allows gestures beneath the app bar', (WidgetTester tester) async { bool buttonWasPressed = false; final (ScrollController controller, Widget widget) = buildWidget( @@ -1672,7 +1671,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'forceMaterialTransparency == false does not allow gestures beneath the app bar', (WidgetTester tester) async { // Set this, and tester.tap(warnIfMissed:false), to suppress // errors/warning that the button is not hittable (which is expected). @@ -1697,7 +1696,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('AppBar dimensions, with and without bottom, primary', (WidgetTester tester) async { + testWidgets('AppBar dimensions, with and without bottom, primary', (WidgetTester tester) async { const MediaQueryData topPadding100 = MediaQueryData(padding: EdgeInsets.only(top: 100.0)); await tester.pumpWidget( @@ -1822,7 +1821,7 @@ void main() { expect(tester.getTopLeft(find.text('title')).dy, lessThan(100.0)); }); - testWidgetsWithLeakTracking('AppBar in body excludes bottom SafeArea padding', (WidgetTester tester) async { + testWidgets('AppBar in body excludes bottom SafeArea padding', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/26163 await tester.pumpWidget( Localizations( @@ -1852,7 +1851,7 @@ void main() { expect(appBarHeight(tester), kToolbarHeight + 100.0); }); - testWidgetsWithLeakTracking('AppBar.title sees the correct padding from MediaQuery', (WidgetTester tester) async { + testWidgets('AppBar.title sees the correct padding from MediaQuery', (WidgetTester tester) async { bool titleBuilt = false; await tester.pumpWidget( Localizations( @@ -1882,7 +1881,7 @@ void main() { expect(titleBuilt, isTrue); }); - testWidgetsWithLeakTracking('AppBar updates when you add a drawer', (WidgetTester tester) async { + testWidgets('AppBar updates when you add a drawer', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1902,7 +1901,7 @@ void main() { expect(find.byIcon(Icons.menu), findsOneWidget); }); - testWidgetsWithLeakTracking('AppBar does not draw menu for drawer if automaticallyImplyLeading is false', (WidgetTester tester) async { + testWidgets('AppBar does not draw menu for drawer if automaticallyImplyLeading is false', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1916,7 +1915,7 @@ void main() { expect(find.byIcon(Icons.menu), findsNothing); }); - testWidgetsWithLeakTracking('AppBar does not update the leading if a route is popped case 1', (WidgetTester tester) async { + testWidgets('AppBar does not update the leading if a route is popped case 1', (WidgetTester tester) async { final Page<void> page1 = MaterialPage<void>( key: const ValueKey<String>('1'), child: Scaffold( @@ -1954,7 +1953,7 @@ void main() { expect(find.byType(BackButton), findsNothing); }); - testWidgetsWithLeakTracking('AppBar does not update the leading if a route is popped case 2', (WidgetTester tester) async { + testWidgets('AppBar does not update the leading if a route is popped case 2', (WidgetTester tester) async { final Page<void> page1 = MaterialPage<void>( key: const ValueKey<String>('1'), child: Scaffold( @@ -2007,7 +2006,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - AppBar ink splash draw on the correct canvas', (WidgetTester tester) async { + testWidgets('Material2 - AppBar ink splash draw on the correct canvas', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/58665 final Key key = UniqueKey(); await tester.pumpWidget( @@ -2054,7 +2053,7 @@ void main() { expect(painter, paints..save()..translate()..save()..translate()..circle(x: 24.0, y: 28.0)); }); - testWidgetsWithLeakTracking('Material3 - AppBar ink splash draw on the correct canvas', (WidgetTester tester) async { + testWidgets('Material3 - AppBar ink splash draw on the correct canvas', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/58665 final Key key = UniqueKey(); await tester.pumpWidget( @@ -2101,7 +2100,7 @@ void main() { expect(painter, paints..save()..translate()..save()..translate()..circle(x: 20.0, y: 20.0)); }); - testWidgetsWithLeakTracking('AppBar handles loose children 0', (WidgetTester tester) async { + testWidgets('AppBar handles loose children 0', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -2122,7 +2121,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(key)).size, const Size(56.0, 56.0)); }); - testWidgetsWithLeakTracking('AppBar handles loose children 1', (WidgetTester tester) async { + testWidgets('AppBar handles loose children 1', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -2152,7 +2151,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(key)).size, const Size(56.0, 56.0)); }); - testWidgetsWithLeakTracking('AppBar handles loose children 2', (WidgetTester tester) async { + testWidgets('AppBar handles loose children 2', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -2192,7 +2191,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(key)).size, const Size(56.0, 56.0)); }); - testWidgetsWithLeakTracking('AppBar handles loose children 3', (WidgetTester tester) async { + testWidgets('AppBar handles loose children 3', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -2223,7 +2222,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(key)).size, const Size(56.0, 56.0)); }); - testWidgetsWithLeakTracking('AppBar positioning of leading and trailing widgets with top padding', (WidgetTester tester) async { + testWidgets('AppBar positioning of leading and trailing widgets with top padding', (WidgetTester tester) async { const MediaQueryData topPadding100 = MediaQueryData(padding: EdgeInsets.only(top: 100)); final Key leadingKey = UniqueKey(); final Key titleKey = UniqueKey(); @@ -2266,7 +2265,7 @@ void main() { expect(tester.getTopLeft(find.byKey(titleKey)), const Offset(10 + NavigationToolbar.kMiddleSpacing, 72)); }); - testWidgetsWithLeakTracking('SliverAppBar positioning of leading and trailing widgets with top padding', (WidgetTester tester) async { + testWidgets('SliverAppBar positioning of leading and trailing widgets with top padding', (WidgetTester tester) async { const MediaQueryData topPadding100 = MediaQueryData(padding: EdgeInsets.only(top: 100.0)); final Key leadingKey = UniqueKey(); final Key titleKey = UniqueKey(); @@ -2303,7 +2302,7 @@ void main() { expect(tester.getTopLeft(find.byKey(trailingKey)), const Offset(0.0, 100.0)); }); - testWidgetsWithLeakTracking('SliverAppBar positioning of leading and trailing widgets with bottom padding', (WidgetTester tester) async { + testWidgets('SliverAppBar positioning of leading and trailing widgets with bottom padding', (WidgetTester tester) async { const MediaQueryData topPadding100 = MediaQueryData(padding: EdgeInsets.only(top: 100.0, bottom: 50.0)); final Key leadingKey = UniqueKey(); final Key titleKey = UniqueKey(); @@ -2339,7 +2338,7 @@ void main() { expect(tester.getRect(find.byKey(trailingKey)), const Rect.fromLTRB(0.0, 100.0, 400.0, 100.0 + 56.0)); }); - testWidgetsWithLeakTracking('SliverAppBar provides correct semantics in LTR', (WidgetTester tester) async { + testWidgets('SliverAppBar provides correct semantics in LTR', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2420,7 +2419,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SliverAppBar provides correct semantics in RTL', (WidgetTester tester) async { + testWidgets('SliverAppBar provides correct semantics in RTL', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2512,7 +2511,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('AppBar excludes header semantics correctly', (WidgetTester tester) async { + testWidgets('AppBar excludes header semantics correctly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2568,7 +2567,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SliverAppBar excludes header semantics correctly', (WidgetTester tester) async { + testWidgets('SliverAppBar excludes header semantics correctly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2637,7 +2636,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SliverAppBar with flexible space has correct semantics order', (WidgetTester tester) async { + testWidgets('SliverAppBar with flexible space has correct semantics order', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/64922. final SemanticsTester semantics = SemanticsTester(tester); @@ -2714,7 +2713,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material2 - AppBar draws a light system bar for a dark background', (WidgetTester tester) async { + testWidgets('Material2 - AppBar draws a light system bar for a dark background', (WidgetTester tester) async { final ThemeData darkTheme = ThemeData.dark(useMaterial3: false); await tester.pumpWidget(MaterialApp( theme: darkTheme, @@ -2732,7 +2731,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material3 - AppBar draws a light system bar for a dark background', (WidgetTester tester) async { + testWidgets('Material3 - AppBar draws a light system bar for a dark background', (WidgetTester tester) async { final ThemeData darkTheme = ThemeData.dark(useMaterial3: true); await tester.pumpWidget(MaterialApp( theme: darkTheme, @@ -2751,7 +2750,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material2 - AppBar draws a dark system bar for a light background', (WidgetTester tester) async { + testWidgets('Material2 - AppBar draws a dark system bar for a light background', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData(primarySwatch: Colors.lightBlue, useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -2771,7 +2770,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material3 - AppBar draws a dark system bar for a light background', (WidgetTester tester) async { + testWidgets('Material3 - AppBar draws a dark system bar for a light background', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -2792,7 +2791,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material2 - Default system bar brightness based on AppBar background color brightness.', (WidgetTester tester) async { + testWidgets('Material2 - Default system bar brightness based on AppBar background color brightness.', (WidgetTester tester) async { Widget buildAppBar(ThemeData theme) { return MaterialApp( theme: theme, @@ -2843,7 +2842,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material3 - Default system bar brightness based on AppBar background color brightness.', (WidgetTester tester) async { + testWidgets('Material3 - Default system bar brightness based on AppBar background color brightness.', (WidgetTester tester) async { Widget buildAppBar(ThemeData theme) { return MaterialApp( theme: theme, @@ -2896,7 +2895,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material2 - Default status bar color', (WidgetTester tester) async { + testWidgets('Material2 - Default status bar color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( key: GlobalKey(), @@ -2915,7 +2914,7 @@ void main() { expect(SystemChrome.latestStyle!.statusBarColor, null); }); - testWidgetsWithLeakTracking('Material3 - Default status bar color', (WidgetTester tester) async { + testWidgets('Material3 - Default status bar color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( key: GlobalKey(), @@ -2934,7 +2933,7 @@ void main() { expect(SystemChrome.latestStyle!.statusBarColor, Colors.transparent); }); - testWidgetsWithLeakTracking('AppBar systemOverlayStyle is use to style status bar and navigation bar', (WidgetTester tester) async { + testWidgets('AppBar systemOverlayStyle is use to style status bar and navigation bar', (WidgetTester tester) async { final SystemUiOverlayStyle systemOverlayStyle = SystemUiOverlayStyle.light.copyWith( statusBarColor: Colors.red, systemNavigationBarColor: Colors.green, @@ -2954,7 +2953,7 @@ void main() { expect(SystemChrome.latestStyle!.systemNavigationBarColor, Colors.green); }); - testWidgetsWithLeakTracking('Changing SliverAppBar snap from true to false', (WidgetTester tester) async { + testWidgets('Changing SliverAppBar snap from true to false', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17598 const double appBarHeight = 256.0; bool snap = true; @@ -3015,7 +3014,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('AppBar shape default', (WidgetTester tester) async { + testWidgets('AppBar shape default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: AppBar( @@ -3035,7 +3034,7 @@ void main() { expect(getMaterialWidget(materialFinder).shape, null); }); - testWidgetsWithLeakTracking('AppBar with shape', (WidgetTester tester) async { + testWidgets('AppBar with shape', (WidgetTester tester) async { const RoundedRectangleBorder roundedRectangleBorder = RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(15.0)), ); @@ -3059,7 +3058,7 @@ void main() { expect(getMaterialWidget(materialFinder).shape, roundedRectangleBorder); }); - testWidgetsWithLeakTracking('SliverAppBar shape default', (WidgetTester tester) async { + testWidgets('SliverAppBar shape default', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: CustomScrollView( @@ -3083,7 +3082,7 @@ void main() { expect(getMaterialWidget(materialFinder).shape, null); }); - testWidgetsWithLeakTracking('SliverAppBar with shape', (WidgetTester tester) async { + testWidgets('SliverAppBar with shape', (WidgetTester tester) async { const RoundedRectangleBorder roundedRectangleBorder = RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(15.0)), ); @@ -3111,7 +3110,7 @@ void main() { expect(getMaterialWidget(materialFinder).shape, roundedRectangleBorder); }); - testWidgetsWithLeakTracking('AppBars title has upper limit on text scaling, textScaleFactor = 1, 1.34, 2', (WidgetTester tester) async { + testWidgets('AppBars title has upper limit on text scaling, textScaleFactor = 1, 1.34, 2', (WidgetTester tester) async { late double textScaleFactor; Widget buildFrame() { @@ -3149,7 +3148,7 @@ void main() { expect(tester.getRect(appBarTitle).height, 24); }); - testWidgetsWithLeakTracking('AppBars with jumbo titles, textScaleFactor = 3, 3.5, 4', (WidgetTester tester) async { + testWidgets('AppBars with jumbo titles, textScaleFactor = 3, 3.5, 4', (WidgetTester tester) async { double textScaleFactor = 1.0; TextDirection textDirection = TextDirection.ltr; bool centerTitle = false; @@ -3219,7 +3218,7 @@ void main() { expect(tester.getCenter(appBarTitle).dy, tester.getCenter(toolbar).dy); }); - testWidgetsWithLeakTracking('SliverAppBar configures the delegate properly', (WidgetTester tester) async { + testWidgets('SliverAppBar configures the delegate properly', (WidgetTester tester) async { Future<void> buildAndVerifyDelegate({ required bool pinned, required bool floating, required bool snap }) async { await tester.pumpWidget( MaterialApp( @@ -3255,7 +3254,7 @@ void main() { await buildAndVerifyDelegate(pinned: true, floating: true, snap: true); }); - testWidgetsWithLeakTracking('AppBar respects toolbarHeight', (WidgetTester tester) async { + testWidgets('AppBar respects toolbarHeight', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -3271,7 +3270,7 @@ void main() { expect(appBarHeight(tester), 48); }); - testWidgetsWithLeakTracking('SliverAppBar default collapsedHeight with respect to toolbarHeight', (WidgetTester tester) async { + testWidgets('SliverAppBar default collapsedHeight with respect to toolbarHeight', (WidgetTester tester) async { const double toolbarHeight = 100.0; await tester.pumpWidget(buildSliverAppBarApp( @@ -3290,7 +3289,7 @@ void main() { expect(appBarHeight(tester), toolbarHeight + initialTabBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar collapsedHeight with toolbarHeight', (WidgetTester tester) async { + testWidgets('SliverAppBar collapsedHeight with toolbarHeight', (WidgetTester tester) async { const double toolbarHeight = 100.0; const double collapsedHeight = 150.0; @@ -3309,7 +3308,7 @@ void main() { expect(appBarHeight(tester), collapsedHeight + initialTabBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar collapsedHeight', (WidgetTester tester) async { + testWidgets('SliverAppBar collapsedHeight', (WidgetTester tester) async { const double collapsedHeight = 56.0; await tester.pumpWidget(buildSliverAppBarApp( @@ -3326,7 +3325,7 @@ void main() { expect(appBarHeight(tester), collapsedHeight + initialTabBarHeight); }); - testWidgetsWithLeakTracking('AppBar respects leadingWidth', (WidgetTester tester) async { + testWidgets('AppBar respects leadingWidth', (WidgetTester tester) async { const Key key = Key('leading'); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -3342,7 +3341,7 @@ void main() { expect(tester.getRect(find.byKey(key)), const Rect.fromLTRB(0, 0, 100, 56)); }); - testWidgetsWithLeakTracking('SliverAppBar respects leadingWidth', (WidgetTester tester) async { + testWidgets('SliverAppBar respects leadingWidth', (WidgetTester tester) async { const Key key = Key('leading'); await tester.pumpWidget(const MaterialApp( home: CustomScrollView( @@ -3360,7 +3359,7 @@ void main() { expect(tester.getRect(find.byKey(key)), const Rect.fromLTRB(0, 0, 100, 56)); }); - testWidgetsWithLeakTracking("AppBar with EndDrawer doesn't have leading", (WidgetTester tester) async { + testWidgets("AppBar with EndDrawer doesn't have leading", (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( appBar: AppBar(), @@ -3377,7 +3376,7 @@ void main() { expect(getAppBarWidget(appBarFinder).leading, null); }); - testWidgetsWithLeakTracking('AppBar.titleSpacing defaults to NavigationToolbar.kMiddleSpacing', (WidgetTester tester) async { + testWidgets('AppBar.titleSpacing defaults to NavigationToolbar.kMiddleSpacing', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( appBar: AppBar( @@ -3390,14 +3389,14 @@ void main() { expect(navToolBar.middleSpacing, NavigationToolbar.kMiddleSpacing); }); - testWidgetsWithLeakTracking('SliverAppBar.titleSpacing defaults to NavigationToolbar.kMiddleSpacing', (WidgetTester tester) async { + testWidgets('SliverAppBar.titleSpacing defaults to NavigationToolbar.kMiddleSpacing', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp()); final NavigationToolbar navToolBar = tester.widget(find.byType(NavigationToolbar)); expect(navToolBar.middleSpacing, NavigationToolbar.kMiddleSpacing); }); - testWidgetsWithLeakTracking('AppBar foregroundColor and backgroundColor', (WidgetTester tester) async { + testWidgets('AppBar foregroundColor and backgroundColor', (WidgetTester tester) async { const Color foregroundColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff00ffff); final Key leadingIconKey = UniqueKey(); @@ -3448,7 +3447,7 @@ void main() { expect(actionIconColor(), foregroundColor); }); - testWidgetsWithLeakTracking('Leading, title, and actions show correct default colors', (WidgetTester tester) async { + testWidgets('Leading, title, and actions show correct default colors', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light( onPrimary: Colors.blue, @@ -3486,7 +3485,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/107305 group('Material3 - Icons are colored correctly by IconTheme and ActionIconTheme', () { - testWidgetsWithLeakTracking('Material3 - Icons and IconButtons are colored by IconTheme', (WidgetTester tester) async { + testWidgets('Material3 - Icons and IconButtons are colored by IconTheme', (WidgetTester tester) async { const Color iconColor = Color(0xff00ff00); final Key leadingIconKey = UniqueKey(); final Key actionIconKey = UniqueKey(); @@ -3518,7 +3517,7 @@ void main() { expect(actionIconButtonColor(), iconColor); }); - testWidgetsWithLeakTracking('Material3 - Action icons and IconButtons are colored by ActionIconTheme', (WidgetTester tester) async { + testWidgets('Material3 - Action icons and IconButtons are colored by ActionIconTheme', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: true, @@ -3554,7 +3553,7 @@ void main() { expect(actionIconButtonColor(), actionsIconColor); }); - testWidgetsWithLeakTracking('Material3 - The actionIconTheme property overrides iconTheme', (WidgetTester tester) async { + testWidgets('Material3 - The actionIconTheme property overrides iconTheme', (WidgetTester tester) async { final ThemeData themeData = ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: true, @@ -3592,7 +3591,7 @@ void main() { expect(actionIconButtonColor(), actionsIconColor); }); - testWidgetsWithLeakTracking('Material3 - AppBar.iconTheme should override any IconButtonTheme present in the theme', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.iconTheme should override any IconButtonTheme present in the theme', (WidgetTester tester) async { final ThemeData themeData = ThemeData( iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom( @@ -3631,7 +3630,7 @@ void main() { expect(actionIconButtonSize(), 30.0); }); - testWidgetsWithLeakTracking('Material3 - AppBar.iconTheme should override any IconButtonTheme present in the theme for widgets containing an iconButton', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.iconTheme should override any IconButtonTheme present in the theme for widgets containing an iconButton', (WidgetTester tester) async { final ThemeData themeData = ThemeData( iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom( @@ -3664,7 +3663,7 @@ void main() { }); - testWidgetsWithLeakTracking('Material3 - AppBar.actionsIconTheme should override any IconButtonTheme present in the theme', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.actionsIconTheme should override any IconButtonTheme present in the theme', (WidgetTester tester) async { final ThemeData themeData = ThemeData( iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom( @@ -3704,7 +3703,7 @@ void main() { expect(actionIconButtonSize(), 30.0); }); - testWidgetsWithLeakTracking('Material3 - AppBar.actionsIconTheme should override any IconButtonTheme present in the theme for widgets containing an iconButton', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.actionsIconTheme should override any IconButtonTheme present in the theme for widgets containing an iconButton', (WidgetTester tester) async { final ThemeData themeData = ThemeData( iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom( @@ -3738,7 +3737,7 @@ void main() { expect(actionIconButtonSize(), 30.0); }); - testWidgetsWithLeakTracking('Material3 - The foregroundColor property of the AppBar overrides any IconButtonTheme present in the theme', (WidgetTester tester) async { + testWidgets('Material3 - The foregroundColor property of the AppBar overrides any IconButtonTheme present in the theme', (WidgetTester tester) async { final ThemeData themeData = ThemeData( iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom( @@ -3772,7 +3771,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/130485. - testWidgetsWithLeakTracking('Material3 - AppBar.iconTheme is correctly applied in dark mode', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.iconTheme is correctly applied in dark mode', (WidgetTester tester) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.dark().copyWith(onSurfaceVariant: Colors.red), useMaterial3: true, @@ -3800,7 +3799,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/130485. - testWidgetsWithLeakTracking('Material3 - AppBar.foregroundColor is correctly applied in dark mode', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.foregroundColor is correctly applied in dark mode', (WidgetTester tester) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.dark().copyWith(onSurfaceVariant: Colors.red), useMaterial3: true, @@ -3828,7 +3827,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/130485. - testWidgetsWithLeakTracking('Material3 - AppBar.iconTheme is correctly applied in light mode', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.iconTheme is correctly applied in light mode', (WidgetTester tester) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.light().copyWith(onSurfaceVariant: Colors.red), useMaterial3: true, @@ -3856,7 +3855,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/130485. - testWidgetsWithLeakTracking('Material3 - AppBar.foregroundColor is correctly applied in light mode', (WidgetTester tester) async { + testWidgets('Material3 - AppBar.foregroundColor is correctly applied in light mode', (WidgetTester tester) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.light().copyWith(onSurfaceVariant: Colors.red), useMaterial3: true, @@ -3935,7 +3934,7 @@ void main() { ); } - testWidgetsWithLeakTracking('backgroundColor', (WidgetTester tester) async { + testWidgets('backgroundColor', (WidgetTester tester) async { await tester.pumpWidget( buildSliverApp(contentHeight: 1200.0) ); @@ -3960,7 +3959,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, expandedHeight); }); - testWidgetsWithLeakTracking('backgroundColor with FlexibleSpace', (WidgetTester tester) async { + testWidgets('backgroundColor with FlexibleSpace', (WidgetTester tester) async { await tester.pumpWidget( buildSliverApp(contentHeight: 1200.0, includeFlexibleSpace: true) ); @@ -3985,7 +3984,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, expandedHeight); }); - testWidgetsWithLeakTracking('backgroundColor - reverse', (WidgetTester tester) async { + testWidgets('backgroundColor - reverse', (WidgetTester tester) async { await tester.pumpWidget( buildSliverApp(contentHeight: 1200.0, reverse: true) ); @@ -4010,7 +4009,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, expandedHeight); }); - testWidgetsWithLeakTracking('backgroundColor with FlexibleSpace - reverse', (WidgetTester tester) async { + testWidgets('backgroundColor with FlexibleSpace - reverse', (WidgetTester tester) async { await tester.pumpWidget( buildSliverApp( contentHeight: 1200.0, @@ -4039,7 +4038,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, expandedHeight); }); - testWidgetsWithLeakTracking('backgroundColor - not triggered in reverse for short content', (WidgetTester tester) async { + testWidgets('backgroundColor - not triggered in reverse for short content', (WidgetTester tester) async { await tester.pumpWidget( buildSliverApp(contentHeight: 200, reverse: true) ); @@ -4058,7 +4057,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, expandedHeight); }); - testWidgetsWithLeakTracking('backgroundColor with FlexibleSpace - not triggered in reverse for short content', (WidgetTester tester) async { + testWidgets('backgroundColor with FlexibleSpace - not triggered in reverse for short content', (WidgetTester tester) async { await tester.pumpWidget( buildSliverApp( contentHeight: 200, @@ -4112,7 +4111,7 @@ void main() { ); } - testWidgetsWithLeakTracking('backgroundColor for horizontal scrolling', (WidgetTester tester) async { + testWidgets('backgroundColor for horizontal scrolling', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -4170,7 +4169,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, kToolbarHeight); }); - testWidgetsWithLeakTracking('backgroundColor', (WidgetTester tester) async { + testWidgets('backgroundColor', (WidgetTester tester) async { await tester.pumpWidget( buildAppBar(contentHeight: 1200.0) ); @@ -4195,7 +4194,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, kToolbarHeight); }); - testWidgetsWithLeakTracking('backgroundColor with FlexibleSpace', (WidgetTester tester) async { + testWidgets('backgroundColor with FlexibleSpace', (WidgetTester tester) async { await tester.pumpWidget( buildAppBar(contentHeight: 1200.0, includeFlexibleSpace: true) ); @@ -4220,7 +4219,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, kToolbarHeight); }); - testWidgetsWithLeakTracking('backgroundColor - reverse', (WidgetTester tester) async { + testWidgets('backgroundColor - reverse', (WidgetTester tester) async { await tester.pumpWidget( buildAppBar(contentHeight: 1200.0, reverse: true) ); @@ -4248,7 +4247,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, kToolbarHeight); }); - testWidgetsWithLeakTracking('backgroundColor with FlexibleSpace - reverse', (WidgetTester tester) async { + testWidgets('backgroundColor with FlexibleSpace - reverse', (WidgetTester tester) async { await tester.pumpWidget( buildAppBar( contentHeight: 1200.0, @@ -4280,7 +4279,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, kToolbarHeight); }); - testWidgetsWithLeakTracking('_handleScrollNotification safely calls setState()', (WidgetTester tester) async { + testWidgets('_handleScrollNotification safely calls setState()', (WidgetTester tester) async { // Regression test for failures found in Google internal issue b/185192049. final ScrollController controller = ScrollController(initialScrollOffset: 400); await tester.pumpWidget( @@ -4308,7 +4307,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('does not trigger on horizontal scroll', (WidgetTester tester) async { + testWidgets('does not trigger on horizontal scroll', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -4348,7 +4347,7 @@ void main() { expect(getAppBarBackgroundColor(tester), defaultColor); }); - testWidgetsWithLeakTracking('backgroundColor - not triggered in reverse for short content', (WidgetTester tester) async { + testWidgets('backgroundColor - not triggered in reverse for short content', (WidgetTester tester) async { await tester.pumpWidget( buildAppBar( contentHeight: 200.0, @@ -4371,7 +4370,7 @@ void main() { expect(tester.getSize(findAppBarMaterial()).height, kToolbarHeight); }); - testWidgetsWithLeakTracking('backgroundColor with FlexibleSpace - not triggered in reverse for short content', (WidgetTester tester) async { + testWidgets('backgroundColor with FlexibleSpace - not triggered in reverse for short content', (WidgetTester tester) async { await tester.pumpWidget( buildAppBar( contentHeight: 200.0, @@ -4398,7 +4397,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/80256 - testWidgetsWithLeakTracking('The second page should have a back button even it has a end drawer', (WidgetTester tester) async { + testWidgets('The second page should have a back button even it has a end drawer', (WidgetTester tester) async { final Page<void> page1 = MaterialPage<void>( key: const ValueKey<String>('1'), child: Scaffold( @@ -4435,7 +4434,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Only local entries that imply app bar dismissal will introduce an back button', (WidgetTester tester) async { + testWidgets('Only local entries that imply app bar dismissal will introduce an back button', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -4462,7 +4461,7 @@ void main() { expect(find.byType(BackButton), findsOneWidget); }); - testWidgetsWithLeakTracking('AppBar.preferredHeightFor', (WidgetTester tester) async { + testWidgets('AppBar.preferredHeightFor', (WidgetTester tester) async { late double preferredHeight; late Size preferredSize; @@ -4515,7 +4514,7 @@ void main() { expect(preferredSize.height, 64); }); - testWidgetsWithLeakTracking('AppBar title with actions should have the same position regardless of centerTitle', (WidgetTester tester) async { + testWidgets('AppBar title with actions should have the same position regardless of centerTitle', (WidgetTester tester) async { final Key titleKey = UniqueKey(); bool centerTitle = false; @@ -4545,7 +4544,7 @@ void main() { expect(tester.getTopLeft(title).dx, 16.0); }); - testWidgetsWithLeakTracking('AppBar leading widget can take up arbitrary space', (WidgetTester tester) async { + testWidgets('AppBar leading widget can take up arbitrary space', (WidgetTester tester) async { final Key leadingKey = UniqueKey(); final Key titleKey = UniqueKey(); late double leadingWidth; @@ -4575,7 +4574,7 @@ void main() { expect(tester.getSize(find.byKey(leadingKey)).width, leadingWidth); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverAppBar.medium collapsed title does not overlap with leading/actions widgets', (WidgetTester tester) async { const String title = 'Medium SliverAppBar Very Long Title'; @@ -4627,7 +4626,7 @@ void main() { expect(titleOffset.dx, lessThan(searchOffset.dx)); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverAppBar.large collapsed title does not overlap with leading/actions widgets', (WidgetTester tester) async { const String title = 'Large SliverAppBar Very Long Title'; @@ -4679,7 +4678,7 @@ void main() { expect(titleOffset.dx, lessThan(searchOffset.dx)); }); - testWidgetsWithLeakTracking('SliverAppBar.medium respects title spacing', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium respects title spacing', (WidgetTester tester) async { const String title = 'Medium SliverAppBar Very Long Title'; const double titleSpacing = 16.0; @@ -4772,7 +4771,7 @@ void main() { expect(titleOffset.dx, iconButtonOffset.dx); }); - testWidgetsWithLeakTracking('SliverAppBar.large respects title spacing', (WidgetTester tester) async { + testWidgets('SliverAppBar.large respects title spacing', (WidgetTester tester) async { const String title = 'Large SliverAppBar Very Long Title'; const double titleSpacing = 16.0; @@ -4864,7 +4863,7 @@ void main() { expect(titleOffset.dx, iconButtonOffset.dx); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverAppBar.medium without the leading widget updates collapsed title padding', (WidgetTester tester) async { const String title = 'Medium SliverAppBar Title'; @@ -4926,7 +4925,7 @@ void main() { expect(titleOffset.dx, titleSpacing); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverAppBar.large without the leading widget updates collapsed title padding', (WidgetTester tester) async { const String title = 'Large SliverAppBar Title'; @@ -4988,7 +4987,7 @@ void main() { expect(titleOffset.dx, titleSpacing); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverAppBar large & medium title respects automaticallyImplyLeading', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/121511 @@ -5046,7 +5045,7 @@ void main() { expect(titleOffset.dx, backButtonOffset.dx + titleSpacing); }); - testWidgetsWithLeakTracking('SliverAppBar.medium with bottom widget', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium with bottom widget', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/115091 const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 112; @@ -5106,7 +5105,7 @@ void main() { expect(appBarHeight(tester), collapsedAppBarHeight + bottomHeight); }); - testWidgetsWithLeakTracking('SliverAppBar.large with bottom widget', (WidgetTester tester) async { + testWidgets('SliverAppBar.large with bottom widget', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/115091 const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 152; @@ -5166,7 +5165,7 @@ void main() { expect(appBarHeight(tester), collapsedAppBarHeight + bottomHeight); }); - testWidgetsWithLeakTracking('SliverAppBar.medium expanded title has upper limit on text scaling', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium expanded title has upper limit on text scaling', (WidgetTester tester) async { const String title = 'Medium AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( @@ -5207,7 +5206,7 @@ void main() { _verifyTextNotClipped(expandedTitle, tester); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('SliverAppBar.large expanded title has upper limit on text scaling', (WidgetTester tester) async { + testWidgets('SliverAppBar.large expanded title has upper limit on text scaling', (WidgetTester tester) async { const String title = 'Large AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( @@ -5245,7 +5244,7 @@ void main() { expect(tester.getRect(expandedTitle).height, closeTo(48.0, 0.1)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('SliverAppBar.medium expanded title position is adjusted with textScaleFactor', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium expanded title position is adjusted with textScaleFactor', (WidgetTester tester) async { const String title = 'Medium AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( @@ -5286,7 +5285,7 @@ void main() { _verifyTextNotClipped(expandedTitle, tester); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('SliverAppBar.large expanded title position is adjusted with textScaleFactor', (WidgetTester tester) async { + testWidgets('SliverAppBar.large expanded title position is adjusted with textScaleFactor', (WidgetTester tester) async { const String title = 'Large AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( @@ -5370,7 +5369,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( 'forceMaterialTransparency == true allows gestures beneath the app bar', (WidgetTester tester) async { bool buttonWasPressed = false; final Widget widget = buildWidget( @@ -5388,7 +5387,7 @@ void main() { expect(buttonWasPressed, isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'forceMaterialTransparency == false does not allow gestures beneath the app bar', (WidgetTester tester) async { // Set this, and tester.tap(warnIfMissed:false), to suppress @@ -5417,7 +5416,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - SliverAppBar.medium defaults', (WidgetTester tester) async { + testWidgets('Material2 - SliverAppBar.medium defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 112; @@ -5501,7 +5500,7 @@ void main() { expect(tester.getSize(expandedTitleClip).height, expandedAppBarHeight - collapsedAppBarHeight); }); - testWidgetsWithLeakTracking('Material2 - SliverAppBar.large defaults', (WidgetTester tester) async { + testWidgets('Material2 - SliverAppBar.large defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 152; diff --git a/packages/flutter/test/material/app_bar_theme_test.dart b/packages/flutter/test/material/app_bar_theme_test.dart index f73bd9f12dc..3f1c076fb3b 100644 --- a/packages/flutter/test/material/app_bar_theme_test.dart +++ b/packages/flutter/test/material/app_bar_theme_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { const AppBarTheme appBarTheme = AppBarTheme( @@ -43,7 +42,7 @@ void main() { expect(identical(AppBarTheme.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Material2 - Passing no AppBarTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material2 - Passing no AppBarTheme returns defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -78,7 +77,7 @@ void main() { expect(tester.getSize(find.byType(AppBar)).width, 800); }); - testWidgetsWithLeakTracking('Material3 - Passing no AppBarTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material3 - Passing no AppBarTheme returns defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -118,7 +117,7 @@ void main() { expect(tester.getSize(find.byType(AppBar)).width, 800); }); - testWidgetsWithLeakTracking('AppBar uses values from AppBarTheme', (WidgetTester tester) async { + testWidgets('AppBar uses values from AppBarTheme', (WidgetTester tester) async { final AppBarTheme appBarTheme = _appBarTheme(); await tester.pumpWidget( @@ -155,7 +154,7 @@ void main() { expect(tester.getSize(find.byType(AppBar)).width, 800); }); - testWidgetsWithLeakTracking('AppBar widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('AppBar widget properties take priority over theme', (WidgetTester tester) async { const Brightness brightness = Brightness.dark; const SystemUiOverlayStyle systemOverlayStyle = SystemUiOverlayStyle.light; const Color color = Colors.orange; @@ -211,7 +210,7 @@ void main() { expect(text.style, toolbarTextStyle); }); - testWidgetsWithLeakTracking('AppBar icon color takes priority over everything', (WidgetTester tester) async { + testWidgets('AppBar icon color takes priority over everything', (WidgetTester tester) async { const Color color = Colors.lime; const IconThemeData iconThemeData = IconThemeData(color: Colors.green); const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.lightBlue); @@ -231,7 +230,7 @@ void main() { expect(actionIconText.text.style!.color, color); }); - testWidgetsWithLeakTracking('AppBarTheme properties take priority over ThemeData properties', (WidgetTester tester) async { + testWidgets('AppBarTheme properties take priority over ThemeData properties', (WidgetTester tester) async { final AppBarTheme appBarTheme = _appBarTheme(); await tester.pumpWidget( @@ -265,7 +264,7 @@ void main() { expect(text.style, appBarTheme.toolbarTextStyle); }); - testWidgetsWithLeakTracking('Material2 - ThemeData colorScheme is used when no AppBarTheme is set', (WidgetTester tester) async { + testWidgets('Material2 - ThemeData colorScheme is used when no AppBarTheme is set', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: false); final ThemeData darkTheme = ThemeData.from(colorScheme: const ColorScheme.dark(), useMaterial3: false); Widget buildFrame(ThemeData appTheme) { @@ -339,7 +338,7 @@ void main() { expect(text.style, Typography.material2014().englishLike.bodyMedium!.merge(Typography.material2014().black.bodyMedium).copyWith(color: darkTheme.colorScheme.onSurface)); }); - testWidgetsWithLeakTracking('Material3 - ThemeData colorScheme is used when no AppBarTheme is set', (WidgetTester tester) async { + testWidgets('Material3 - ThemeData colorScheme is used when no AppBarTheme is set', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true); final ThemeData darkTheme = ThemeData.from(colorScheme: const ColorScheme.dark(), useMaterial3: true); Widget buildFrame(ThemeData appTheme) { @@ -413,7 +412,7 @@ void main() { expect(text.style, Typography.material2021().englishLike.bodyMedium!.merge(Typography.material2021().black.bodyMedium).copyWith(color: darkTheme.colorScheme.onSurface, decorationColor: darkTheme.colorScheme.onSurface)); }); - testWidgetsWithLeakTracking('AppBar iconTheme with color=null defers to outer IconTheme', (WidgetTester tester) async { + testWidgets('AppBar iconTheme with color=null defers to outer IconTheme', (WidgetTester tester) async { // Verify claim made in https://github.com/flutter/flutter/pull/71184#issuecomment-737419215 Widget buildFrame({ Color? appIconColor, Color? appBarIconColor }) { @@ -453,7 +452,7 @@ void main() { expect(getIconText().text.style!.color, Colors.purple); }); - testWidgetsWithLeakTracking('AppBar uses AppBarTheme.centerTitle when centerTitle is null', (WidgetTester tester) async { + testWidgets('AppBar uses AppBarTheme.centerTitle when centerTitle is null', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(centerTitle: true)), home: Scaffold(appBar: AppBar( @@ -465,7 +464,7 @@ void main() { expect(navToolBar.centerMiddle, true); }); - testWidgetsWithLeakTracking('AppBar.centerTitle takes priority over AppBarTheme.centerTitle', (WidgetTester tester) async { + testWidgets('AppBar.centerTitle takes priority over AppBarTheme.centerTitle', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(centerTitle: true)), home: Scaffold( @@ -481,7 +480,7 @@ void main() { expect(navToolBar.centerMiddle, false); }); - testWidgetsWithLeakTracking('AppBar.centerTitle adapts to TargetPlatform when AppBarTheme.centerTitle is null', (WidgetTester tester) async{ + testWidgets('AppBar.centerTitle adapts to TargetPlatform when AppBarTheme.centerTitle is null', (WidgetTester tester) async{ await tester.pumpWidget(MaterialApp( theme: ThemeData(platform: TargetPlatform.iOS), home: Scaffold(appBar: AppBar( @@ -495,7 +494,7 @@ void main() { expect(navToolBar.centerMiddle, true); }); - testWidgetsWithLeakTracking('AppBar.shadowColor takes priority over AppBarTheme.shadowColor', (WidgetTester tester) async { + testWidgets('AppBar.shadowColor takes priority over AppBarTheme.shadowColor', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(shadowColor: Colors.red)), home: Scaffold( @@ -511,7 +510,7 @@ void main() { expect(appBar.shadowColor, Colors.yellow); }); - testWidgetsWithLeakTracking('AppBar.surfaceTintColor takes priority over AppBarTheme.surfaceTintColor', (WidgetTester tester) async { + testWidgets('AppBar.surfaceTintColor takes priority over AppBarTheme.surfaceTintColor', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(surfaceTintColor: Colors.red)), home: Scaffold( @@ -527,7 +526,7 @@ void main() { expect(appBar.surfaceTintColor, Colors.yellow); }); - testWidgetsWithLeakTracking('Material3 - AppBarTheme.iconTheme.color takes priority over IconButtonTheme.foregroundColor', (WidgetTester tester) async { + testWidgets('Material3 - AppBarTheme.iconTheme.color takes priority over IconButtonTheme.foregroundColor', (WidgetTester tester) async { const IconThemeData overallIconTheme = IconThemeData(color: Colors.yellow); await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -553,7 +552,7 @@ void main() { expect(actionIconButtonColor, overallIconTheme.color); }); - testWidgetsWithLeakTracking('Material3 - AppBarTheme.iconTheme.size takes priority over IconButtonTheme.iconSize', (WidgetTester tester) async { + testWidgets('Material3 - AppBarTheme.iconTheme.size takes priority over IconButtonTheme.iconSize', (WidgetTester tester) async { const IconThemeData overallIconTheme = IconThemeData(size: 30.0); await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -580,7 +579,7 @@ void main() { }); - testWidgetsWithLeakTracking('Material3 - AppBarTheme.actionsIconTheme.color takes priority over IconButtonTheme.foregroundColor', (WidgetTester tester) async { + testWidgets('Material3 - AppBarTheme.actionsIconTheme.color takes priority over IconButtonTheme.foregroundColor', (WidgetTester tester) async { const IconThemeData actionsIconTheme = IconThemeData(color: Colors.yellow); final IconButtonThemeData iconButtonTheme = IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red), @@ -608,7 +607,7 @@ void main() { expect(actionIconButtonColor, actionsIconTheme.color); }); - testWidgetsWithLeakTracking('Material3 - AppBarTheme.actionsIconTheme.size takes priority over IconButtonTheme.iconSize', (WidgetTester tester) async { + testWidgets('Material3 - AppBarTheme.actionsIconTheme.size takes priority over IconButtonTheme.iconSize', (WidgetTester tester) async { const IconThemeData actionsIconTheme = IconThemeData(size: 30.0); final IconButtonThemeData iconButtonTheme = IconButtonThemeData( style: IconButton.styleFrom(iconSize: 32.0), @@ -635,7 +634,7 @@ void main() { expect(actionIconButtonSize, actionsIconTheme.size); }); - testWidgetsWithLeakTracking('Material3 - AppBarTheme.foregroundColor takes priority over IconButtonTheme.foregroundColor', (WidgetTester tester) async { + testWidgets('Material3 - AppBarTheme.foregroundColor takes priority over IconButtonTheme.foregroundColor', (WidgetTester tester) async { final IconButtonThemeData iconButtonTheme = IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red), ); @@ -670,7 +669,7 @@ void main() { expect(actionIconButtonColor, appBarTheme.foregroundColor); }); - testWidgetsWithLeakTracking('AppBar uses AppBarTheme.titleSpacing', (WidgetTester tester) async { + testWidgets('AppBar uses AppBarTheme.titleSpacing', (WidgetTester tester) async { const double kTitleSpacing = 10; await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(titleSpacing: kTitleSpacing)), @@ -685,7 +684,7 @@ void main() { expect(navToolBar.middleSpacing, kTitleSpacing); }); - testWidgetsWithLeakTracking('AppBar.titleSpacing takes priority over AppBarTheme.titleSpacing', (WidgetTester tester) async { + testWidgets('AppBar.titleSpacing takes priority over AppBarTheme.titleSpacing', (WidgetTester tester) async { const double kTitleSpacing = 10; await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(titleSpacing: kTitleSpacing)), @@ -701,7 +700,7 @@ void main() { expect(navToolBar.middleSpacing, 40); }); - testWidgetsWithLeakTracking('SliverAppBar uses AppBarTheme.titleSpacing', (WidgetTester tester) async { + testWidgets('SliverAppBar uses AppBarTheme.titleSpacing', (WidgetTester tester) async { const double kTitleSpacing = 10; await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(titleSpacing: kTitleSpacing)), @@ -718,7 +717,7 @@ void main() { expect(navToolBar.middleSpacing, kTitleSpacing); }); - testWidgetsWithLeakTracking('SliverAppBar.titleSpacing takes priority over AppBarTheme.titleSpacing ', (WidgetTester tester) async { + testWidgets('SliverAppBar.titleSpacing takes priority over AppBarTheme.titleSpacing ', (WidgetTester tester) async { const double kTitleSpacing = 10; await tester.pumpWidget(MaterialApp( theme: ThemeData(appBarTheme: const AppBarTheme(titleSpacing: kTitleSpacing)), @@ -736,7 +735,7 @@ void main() { expect(navToolbar.middleSpacing, 40); }); - testWidgetsWithLeakTracking('SliverAppBar.medium uses AppBarTheme properties', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium uses AppBarTheme properties', (WidgetTester tester) async { const String title = 'Medium App Bar'; await tester.pumpWidget(MaterialApp( @@ -792,7 +791,7 @@ void main() { expect(titleOffset.dx, iconOffset.dx + appBarTheme.titleSpacing!); }); - testWidgetsWithLeakTracking('SliverAppBar.medium properties take priority over AppBarTheme properties', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium properties take priority over AppBarTheme properties', (WidgetTester tester) async { const String title = 'Medium App Bar'; const Color backgroundColor = Color(0xff000099); const Color foregroundColor = Color(0xff00ff98); @@ -869,7 +868,7 @@ void main() { expect(titleOffset.dx, iconOffset.dx + titleSpacing); }); - testWidgetsWithLeakTracking('SliverAppBar.large uses AppBarTheme properties', (WidgetTester tester) async { + testWidgets('SliverAppBar.large uses AppBarTheme properties', (WidgetTester tester) async { const String title = 'Large App Bar'; await tester.pumpWidget(MaterialApp( @@ -925,7 +924,7 @@ void main() { expect(titleOffset.dx, iconOffset.dx + appBarTheme.titleSpacing!); }); - testWidgetsWithLeakTracking('SliverAppBar.large properties take priority over AppBarTheme properties', (WidgetTester tester) async { + testWidgets('SliverAppBar.large properties take priority over AppBarTheme properties', (WidgetTester tester) async { const String title = 'Large App Bar'; const Color backgroundColor = Color(0xff000099); const Color foregroundColor = Color(0xff00ff98); @@ -1002,7 +1001,7 @@ void main() { expect(titleOffset.dx, iconOffset.dx + titleSpacing); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverAppBar medium & large supports foregroundColor', (WidgetTester tester) async { const String title = 'AppBar title'; const AppBarTheme appBarTheme = AppBarTheme(foregroundColor: Color(0xff00ff20)); @@ -1046,7 +1045,7 @@ void main() { expect(largeTitle.text.style!.color, foregroundColor); }); - testWidgetsWithLeakTracking('Default AppBarTheme debugFillProperties', (WidgetTester tester) async { + testWidgets('Default AppBarTheme debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const AppBarTheme().debugFillProperties(builder); @@ -1058,7 +1057,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('AppBarTheme implements debugFillProperties', (WidgetTester tester) async { + testWidgets('AppBarTheme implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const AppBarTheme( backgroundColor: Color(0xff000000), @@ -1113,7 +1112,7 @@ void main() { }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87364 // This is a regression test for https://github.com/flutter/flutter/issues/130485. - testWidgetsWithLeakTracking('Material3 - AppBarTheme.iconTheme correctly applies custom white color in dark mode', (WidgetTester tester) async { + testWidgets('Material3 - AppBarTheme.iconTheme correctly applies custom white color in dark mode', (WidgetTester tester) async { final ThemeData themeData = ThemeData( useMaterial3: true, brightness: Brightness.dark, diff --git a/packages/flutter/test/material/app_builder_test.dart b/packages/flutter/test/material/app_builder_test.dart index f5b6500ac56..cc28307f406 100644 --- a/packages/flutter/test/material/app_builder_test.dart +++ b/packages/flutter/test/material/app_builder_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking("builder doesn't get called if app doesn't change", (WidgetTester tester) async { + testWidgets("builder doesn't get called if app doesn't change", (WidgetTester tester) async { final List<String> log = <String>[]; final Widget app = MaterialApp( home: const Placeholder(), @@ -34,7 +33,7 @@ void main() { expect(log, <String>['build']); }); - testWidgetsWithLeakTracking("builder doesn't get called if app doesn't change", (WidgetTester tester) async { + testWidgets("builder doesn't get called if app doesn't change", (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index e7d3e748604..353b2eab5d1 100644 --- a/packages/flutter/test/material/app_test.dart +++ b/packages/flutter/test/material/app_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class StateMarker extends StatefulWidget { const StateMarker({ super.key, this.child }); @@ -32,7 +31,7 @@ class StateMarkerState extends State<StateMarker> { } void main() { - testWidgetsWithLeakTracking('Can nest apps', (WidgetTester tester) async { + testWidgets('Can nest apps', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: MaterialApp( @@ -44,7 +43,7 @@ void main() { expect(find.text('Home sweet home'), findsOneWidget); }); - testWidgetsWithLeakTracking('Focus handling', (WidgetTester tester) async { + testWidgets('Focus handling', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget(MaterialApp( home: Material( @@ -57,7 +56,7 @@ void main() { expect(focusNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Can place app inside FocusScope', (WidgetTester tester) async { + testWidgets('Can place app inside FocusScope', (WidgetTester tester) async { final FocusScopeNode focusScopeNode = FocusScopeNode(); await tester.pumpWidget(FocusScope( @@ -72,7 +71,7 @@ void main() { focusScopeNode.dispose(); }); - testWidgetsWithLeakTracking('Can show grid without losing sync', (WidgetTester tester) async { + testWidgets('Can show grid without losing sync', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: StateMarker(), @@ -94,7 +93,7 @@ void main() { expect(state2.marker, equals('original')); }); - testWidgetsWithLeakTracking('Do not rebuild page during a route transition', (WidgetTester tester) async { + testWidgets('Do not rebuild page during a route transition', (WidgetTester tester) async { int buildCounter = 0; await tester.pumpWidget( MaterialApp( @@ -139,7 +138,7 @@ void main() { expect(find.text('Y'), findsOneWidget); }); - testWidgetsWithLeakTracking('Do rebuild the home page if it changes', (WidgetTester tester) async { + testWidgets('Do rebuild the home page if it changes', (WidgetTester tester) async { int buildCounter = 0; await tester.pumpWidget( MaterialApp( @@ -167,7 +166,7 @@ void main() { expect(find.text('B'), findsOneWidget); }); - testWidgetsWithLeakTracking('Do not rebuild the home page if it does not actually change', (WidgetTester tester) async { + testWidgets('Do not rebuild the home page if it does not actually change', (WidgetTester tester) async { int buildCounter = 0; final Widget home = Builder( builder: (BuildContext context) { @@ -189,7 +188,7 @@ void main() { expect(buildCounter, 1); }); - testWidgetsWithLeakTracking('Do rebuild pages that come from the routes table if the MaterialApp changes', (WidgetTester tester) async { + testWidgets('Do rebuild pages that come from the routes table if the MaterialApp changes', (WidgetTester tester) async { int buildCounter = 0; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) { @@ -211,7 +210,7 @@ void main() { expect(buildCounter, 2); }); - testWidgetsWithLeakTracking('Cannot pop the initial route', (WidgetTester tester) async { + testWidgets('Cannot pop the initial route', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: Text('Home'))); expect(find.text('Home'), findsOneWidget); @@ -224,7 +223,7 @@ void main() { expect(find.text('Home'), findsOneWidget); }); - testWidgetsWithLeakTracking('Default initialRoute', (WidgetTester tester) async { + testWidgets('Default initialRoute', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(routes: <String, WidgetBuilder>{ '/': (BuildContext context) => const Text('route "/"'), })); @@ -232,7 +231,7 @@ void main() { expect(find.text('route "/"'), findsOneWidget); }); - testWidgetsWithLeakTracking('One-step initial route', (WidgetTester tester) async { + testWidgets('One-step initial route', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( initialRoute: '/a', @@ -251,7 +250,7 @@ void main() { expect(find.text('route "/b"', skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('Return value from pop is correct', (WidgetTester tester) async { + testWidgets('Return value from pop is correct', (WidgetTester tester) async { late Future<Object?> result; await tester.pumpWidget( MaterialApp( @@ -291,7 +290,7 @@ void main() { expect(await result, equals('all done')); }); - testWidgetsWithLeakTracking('Two-step initial route', (WidgetTester tester) async { + testWidgets('Two-step initial route', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const Text('route "/"'), '/a': (BuildContext context) => const Text('route "/a"'), @@ -311,7 +310,7 @@ void main() { expect(find.text('route "/b"', skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('Initial route with missing step', (WidgetTester tester) async { + testWidgets('Initial route with missing step', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const Text('route "/"'), '/a': (BuildContext context) => const Text('route "/a"'), @@ -336,7 +335,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Make sure initialRoute is only used the first time', (WidgetTester tester) async { + testWidgets('Make sure initialRoute is only used the first time', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const Text('route "/"'), '/a': (BuildContext context) => const Text('route "/a"'), @@ -371,7 +370,7 @@ void main() { expect(find.text('route "/b"', skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('onGenerateRoute / onUnknownRoute', (WidgetTester tester) async { + testWidgets('onGenerateRoute / onUnknownRoute', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( MaterialApp( @@ -393,7 +392,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('MaterialApp with builder and no route information works.', (WidgetTester tester) async { + testWidgets('MaterialApp with builder and no route information works.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/18904 await tester.pumpWidget( MaterialApp( @@ -404,7 +403,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("WidgetsApp doesn't rebuild routes when MediaQuery updates", (WidgetTester tester) async { + testWidgets("WidgetsApp doesn't rebuild routes when MediaQuery updates", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/37878 addTearDown(tester.platformDispatcher.clearAllTestValues); addTearDown(tester.view.reset); @@ -464,7 +463,7 @@ void main() { expect(dependentBuildCount, equals(5)); }); - testWidgetsWithLeakTracking('Can get text scale from media query', (WidgetTester tester) async { + testWidgets('Can get text scale from media query', (WidgetTester tester) async { TextScaler? textScaler; await tester.pumpWidget(MaterialApp( home: Builder(builder:(BuildContext context) { @@ -475,7 +474,7 @@ void main() { expect(textScaler, TextScaler.noScaling); }); - testWidgetsWithLeakTracking('MaterialApp.navigatorKey', (WidgetTester tester) async { + testWidgets('MaterialApp.navigatorKey', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( navigatorKey: key, @@ -496,7 +495,7 @@ void main() { expect(key.currentState, isA<NavigatorState>()); }); - testWidgetsWithLeakTracking('Has default material and cupertino localizations', (WidgetTester tester) async { + testWidgets('Has default material and cupertino localizations', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Builder( @@ -518,7 +517,7 @@ void main() { expect(find.text('Select All'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialApp uses regular theme when themeMode is light', (WidgetTester tester) async { + testWidgets('MaterialApp uses regular theme when themeMode is light', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a light platformBrightness. @@ -566,7 +565,7 @@ void main() { expect(appliedTheme.brightness, Brightness.light); }); - testWidgetsWithLeakTracking('MaterialApp uses darkTheme when themeMode is dark', (WidgetTester tester) async { + testWidgets('MaterialApp uses darkTheme when themeMode is dark', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a light platformBrightness. @@ -614,7 +613,7 @@ void main() { expect(appliedTheme.brightness, Brightness.dark); }); - testWidgetsWithLeakTracking('MaterialApp uses regular theme when themeMode is system and platformBrightness is light', (WidgetTester tester) async { + testWidgets('MaterialApp uses regular theme when themeMode is system and platformBrightness is light', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a light platformBrightness. @@ -642,7 +641,7 @@ void main() { expect(appliedTheme.brightness, Brightness.light); }); - testWidgetsWithLeakTracking('MaterialApp uses darkTheme when themeMode is system and platformBrightness is dark', (WidgetTester tester) async { + testWidgets('MaterialApp uses darkTheme when themeMode is system and platformBrightness is dark', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a dark platformBrightness. @@ -668,7 +667,7 @@ void main() { expect(appliedTheme.brightness, Brightness.dark); }); - testWidgetsWithLeakTracking('MaterialApp uses light theme when platformBrightness is dark but no dark theme is provided', (WidgetTester tester) async { + testWidgets('MaterialApp uses light theme when platformBrightness is dark but no dark theme is provided', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a dark platformBrightness. @@ -693,7 +692,7 @@ void main() { expect(appliedTheme.brightness, Brightness.light); }); - testWidgetsWithLeakTracking('MaterialApp uses fallback light theme when platformBrightness is dark but no theme is provided at all', (WidgetTester tester) async { + testWidgets('MaterialApp uses fallback light theme when platformBrightness is dark but no theme is provided at all', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a dark platformBrightness. @@ -715,7 +714,7 @@ void main() { expect(appliedTheme.brightness, Brightness.light); }); - testWidgetsWithLeakTracking('MaterialApp uses fallback light theme when platformBrightness is light and a dark theme is provided', (WidgetTester tester) async { + testWidgets('MaterialApp uses fallback light theme when platformBrightness is light and a dark theme is provided', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a dark platformBrightness. @@ -740,7 +739,7 @@ void main() { expect(appliedTheme.brightness, Brightness.light); }); - testWidgetsWithLeakTracking('MaterialApp uses dark theme when platformBrightness is dark', (WidgetTester tester) async { + testWidgets('MaterialApp uses dark theme when platformBrightness is dark', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a dark platformBrightness. @@ -768,7 +767,7 @@ void main() { expect(appliedTheme.brightness, Brightness.dark); }); - testWidgetsWithLeakTracking('MaterialApp uses high contrast theme when appropriate', (WidgetTester tester) async { + testWidgets('MaterialApp uses high contrast theme when appropriate', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); tester.platformDispatcher.platformBrightnessTestValue = Brightness.light; @@ -796,7 +795,7 @@ void main() { expect(appliedTheme.primaryColor, Colors.blue); }); - testWidgetsWithLeakTracking('MaterialApp uses high contrast dark theme when appropriate', (WidgetTester tester) async { + testWidgets('MaterialApp uses high contrast dark theme when appropriate', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark; @@ -830,7 +829,7 @@ void main() { expect(appliedTheme.primaryColor, Colors.green); }); - testWidgetsWithLeakTracking('MaterialApp uses dark theme when no high contrast dark theme is provided', (WidgetTester tester) async { + testWidgets('MaterialApp uses dark theme when no high contrast dark theme is provided', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark; @@ -858,7 +857,7 @@ void main() { expect(appliedTheme.primaryColor, Colors.lightGreen); }); - testWidgetsWithLeakTracking('MaterialApp animates theme changes', (WidgetTester tester) async { + testWidgets('MaterialApp animates theme changes', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.light(); final ThemeData darkTheme = ThemeData.dark(); await tester.pumpWidget( @@ -898,7 +897,7 @@ void main() { expect(tester.widget<Material>(find.byType(Material)).color, halfBGColor); }); - testWidgetsWithLeakTracking('MaterialApp theme animation can be turned off', (WidgetTester tester) async { + testWidgets('MaterialApp theme animation can be turned off', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.light(); final ThemeData darkTheme = ThemeData.dark(); int scaffoldRebuilds = 0; @@ -940,7 +939,7 @@ void main() { expect(scaffoldRebuilds, 2); }); - testWidgetsWithLeakTracking('MaterialApp switches themes when the platformBrightness changes.', (WidgetTester tester) async { + testWidgets('MaterialApp switches themes when the platformBrightness changes.', (WidgetTester tester) async { addTearDown(tester.platformDispatcher.clearAllTestValues); // Mock the test to explicitly report a light platformBrightness. @@ -979,7 +978,7 @@ void main() { expect(themeAfterBrightnessChange!.brightness, Brightness.dark); }); - testWidgetsWithLeakTracking('Material2 - MaterialApp provides default overscroll color', (WidgetTester tester) async { + testWidgets('Material2 - MaterialApp provides default overscroll color', (WidgetTester tester) async { Future<void> slowDrag(WidgetTester tester, Offset start, Offset offset) async { final TestGesture gesture = await tester.startGesture(start); for (int index = 0; index < 10; index += 1) { @@ -1011,7 +1010,7 @@ void main() { expect(painter, paints..circle(color: glowSecondaryColor)); }); - testWidgetsWithLeakTracking('MaterialApp can customize initial routes', (WidgetTester tester) async { + testWidgets('MaterialApp can customize initial routes', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -1058,7 +1057,7 @@ void main() { expect(find.text('regular page two'), findsNothing); }); - testWidgetsWithLeakTracking('MaterialApp does create HeroController with the MaterialRectArcTween', (WidgetTester tester) async { + testWidgets('MaterialApp does create HeroController with the MaterialRectArcTween', (WidgetTester tester) async { final HeroController controller = MaterialApp.createMaterialHeroController(); addTearDown(controller.dispose); final Tween<Rect?> tween = controller.createRectTween!( @@ -1068,7 +1067,7 @@ void main() { expect(tween, isA<MaterialRectArcTween>()); }); - testWidgetsWithLeakTracking('MaterialApp.navigatorKey can be updated', (WidgetTester tester) async { + testWidgets('MaterialApp.navigatorKey can be updated', (WidgetTester tester) async { final GlobalKey<NavigatorState> key1 = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( navigatorKey: key1, @@ -1084,7 +1083,7 @@ void main() { expect(key1.currentState, isNull); }); - testWidgetsWithLeakTracking('MaterialApp.router works', (WidgetTester tester) async { + testWidgets('MaterialApp.router works', (WidgetTester tester) async { final PlatformRouteInformationProvider provider = PlatformRouteInformationProvider( initialRouteInformation: RouteInformation( uri: Uri.parse('initial'), @@ -1117,7 +1116,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialApp.router route information parser is optional', (WidgetTester tester) async { + testWidgets('MaterialApp.router route information parser is optional', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -1143,7 +1142,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialApp.router throw if route information provider is provided but no route information parser', (WidgetTester tester) async { + testWidgets('MaterialApp.router throw if route information provider is provided but no route information parser', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -1170,7 +1169,7 @@ void main() { provider.dispose(); }); - testWidgetsWithLeakTracking('MaterialApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async { + testWidgets('MaterialApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -1192,7 +1191,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('MaterialApp.router router config works', (WidgetTester tester) async { + testWidgets('MaterialApp.router router config works', (WidgetTester tester) async { late SimpleNavigatorRouterDelegate routerDelegate; addTearDown(() => routerDelegate.dispose()); late PlatformRouteInformationProvider provider; @@ -1229,7 +1228,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialApp.builder can build app without a Navigator', (WidgetTester tester) async { + testWidgets('MaterialApp.builder can build app without a Navigator', (WidgetTester tester) async { Widget? builderChild; await tester.pumpWidget(MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1240,7 +1239,7 @@ void main() { expect(builderChild, isNull); }); - testWidgetsWithLeakTracking('MaterialApp has correct default ScrollBehavior', (WidgetTester tester) async { + testWidgets('MaterialApp has correct default ScrollBehavior', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( MaterialApp( @@ -1255,7 +1254,7 @@ void main() { expect(ScrollConfiguration.of(capturedContext).runtimeType, MaterialScrollBehavior); }); - testWidgetsWithLeakTracking('A ScrollBehavior can be set for MaterialApp', (WidgetTester tester) async { + testWidgets('A ScrollBehavior can be set for MaterialApp', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( MaterialApp( @@ -1273,7 +1272,7 @@ void main() { expect(scrollBehavior.getScrollPhysics(capturedContext).runtimeType, NeverScrollableScrollPhysics); }); - testWidgetsWithLeakTracking('Material2 - ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { + testWidgets('Material2 - ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), scrollBehavior: const MaterialScrollBehavior(), @@ -1292,7 +1291,7 @@ void main() { expect(find.byType(GlowingOverscrollIndicator), findsOneWidget); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Material3 - ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { + testWidgets('Material3 - ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), scrollBehavior: const MaterialScrollBehavior(), @@ -1311,7 +1310,7 @@ void main() { expect(find.byType(GlowingOverscrollIndicator), findsNothing); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('MaterialScrollBehavior default stretch android overscroll indicator', (WidgetTester tester) async { + testWidgets('MaterialScrollBehavior default stretch android overscroll indicator', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: ListView( children: const <Widget>[ @@ -1328,7 +1327,7 @@ void main() { expect(find.byType(GlowingOverscrollIndicator), findsNothing); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Overscroll indicator can be set by theme', (WidgetTester tester) async { + testWidgets('Overscroll indicator can be set by theme', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( // The current default is M3 and stretch overscroll, setting via the theme should override. theme: ThemeData().copyWith(useMaterial3: false), @@ -1347,7 +1346,7 @@ void main() { expect(find.byType(StretchingOverscrollIndicator), findsNothing); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Material3 - ListView clip behavior updates overscroll indicator clip behavior', (WidgetTester tester) async { + testWidgets('Material3 - ListView clip behavior updates overscroll indicator clip behavior', (WidgetTester tester) async { Widget buildFrame(Clip clipBehavior) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1423,7 +1422,7 @@ void main() { await tester.pumpAndSettle(); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('When `useInheritedMediaQuery` is true an existing MediaQuery is used if one is available', (WidgetTester tester) async { + testWidgets('When `useInheritedMediaQuery` is true an existing MediaQuery is used if one is available', (WidgetTester tester) async { late BuildContext capturedContext; final UniqueKey uniqueKey = UniqueKey(); await tester.pumpWidget( @@ -1443,7 +1442,7 @@ void main() { expect(capturedContext.dependOnInheritedWidgetOfExactType<MediaQuery>()?.key, uniqueKey); }); - testWidgetsWithLeakTracking('Assert in buildScrollbar that controller != null when using it (vertical)', (WidgetTester tester) async { + testWidgets('Assert in buildScrollbar that controller != null when using it (vertical)', (WidgetTester tester) async { const ScrollBehavior defaultBehavior = MaterialScrollBehavior(); late BuildContext capturedContext; @@ -1488,7 +1487,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Assert in buildScrollbar that controller != null when using it (horizontal)', (WidgetTester tester) async { + testWidgets('Assert in buildScrollbar that controller != null when using it (horizontal)', (WidgetTester tester) async { const ScrollBehavior defaultBehavior = MaterialScrollBehavior(); late BuildContext capturedContext; @@ -1526,7 +1525,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Override theme animation using AnimationStyle', (WidgetTester tester) async { + testWidgets('Override theme animation using AnimationStyle', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.light(); final ThemeData darkTheme = ThemeData.dark(); @@ -1591,7 +1590,7 @@ void main() { expect(tester.widget<Material>(find.byType(Material)).color, const Color(0xfffffbfe)); }); - testWidgetsWithLeakTracking('AnimationStyle.noAnimation removes AnimatedTheme from the tree', (WidgetTester tester) async { + testWidgets('AnimationStyle.noAnimation removes AnimatedTheme from the tree', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(themeAnimationStyle: AnimationStyle())); expect(find.byType(AnimatedTheme), findsOneWidget); diff --git a/packages/flutter/test/material/autocomplete_test.dart b/packages/flutter/test/material/autocomplete_test.dart index 47c02c4e908..2113bf6387e 100644 --- a/packages/flutter/test/material/autocomplete_test.dart +++ b/packages/flutter/test/material/autocomplete_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class User { const User({ @@ -46,7 +45,7 @@ void main() { User(name: 'Charlie', email: 'charlie123@gmail.com'), ]; - testWidgetsWithLeakTracking('can filter and select a list of string options', (WidgetTester tester) async { + testWidgets('can filter and select a list of string options', (WidgetTester tester) async { late String lastSelection; await tester.pumpWidget( MaterialApp( @@ -106,7 +105,7 @@ void main() { expect(list.semanticChildCount, 6); }); - testWidgetsWithLeakTracking('can filter and select a list of custom User options', (WidgetTester tester) async { + testWidgets('can filter and select a list of custom User options', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -160,7 +159,7 @@ void main() { expect(list.semanticChildCount, 1); }); - testWidgetsWithLeakTracking('displayStringForOption is displayed in the options', (WidgetTester tester) async { + testWidgets('displayStringForOption is displayed in the options', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -203,7 +202,7 @@ void main() { expect(field.controller!.text, kOptionsUsers.first.name); }); - testWidgetsWithLeakTracking('can build a custom field', (WidgetTester tester) async { + testWidgets('can build a custom field', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -227,7 +226,7 @@ void main() { expect(find.byType(TextFormField), findsNothing); }); - testWidgetsWithLeakTracking('can build custom options', (WidgetTester tester) async { + testWidgets('can build custom options', (WidgetTester tester) async { final GlobalKey optionsKey = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -256,7 +255,7 @@ void main() { expect(find.byKey(optionsKey), findsOneWidget); }); - testWidgetsWithLeakTracking('the default Autocomplete options widget has a maximum height of 200', (WidgetTester tester) async { + testWidgets('the default Autocomplete options widget has a maximum height of 200', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(home: Scaffold( body: Autocomplete<String>( optionsBuilder: (TextEditingValue textEditingValue) { @@ -277,7 +276,7 @@ void main() { expect(resultingHeight, equals(200)); }); - testWidgetsWithLeakTracking('the options height restricts to max desired height', (WidgetTester tester) async { + testWidgets('the options height restricts to max desired height', (WidgetTester tester) async { const double desiredHeight = 150.0; await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -306,7 +305,7 @@ void main() { expect(resultingHeight, equals(desiredHeight)); }); - testWidgetsWithLeakTracking('The height of options shrinks to height of resulting items, if less than maxHeight', (WidgetTester tester) async { + testWidgets('The height of options shrinks to height of resulting items, if less than maxHeight', (WidgetTester tester) async { // Returns a Future with the height of the default [Autocomplete] options widget // after the provided text had been entered into the [Autocomplete] field. Future<double> getDefaultOptionsHeight( @@ -354,7 +353,7 @@ void main() { expect(oneItemsHeight, lessThan(twoItemsHeight)); }); - testWidgetsWithLeakTracking('initialValue sets initial text field value', (WidgetTester tester) async { + testWidgets('initialValue sets initial text field value', (WidgetTester tester) async { late String lastSelection; await tester.pumpWidget( MaterialApp( @@ -415,7 +414,7 @@ void main() { } } - testWidgetsWithLeakTracking('keyboard navigation of the options properly highlights the option', (WidgetTester tester) async { + testWidgets('keyboard navigation of the options properly highlights the option', (WidgetTester tester) async { const Color highlightColor = Color(0xFF112233); await tester.pumpWidget( MaterialApp( @@ -454,7 +453,7 @@ void main() { checkOptionHighlight(tester, 'elephant', highlightColor); }); - testWidgetsWithLeakTracking('keyboard navigation keeps the highlighted option scrolled into view', (WidgetTester tester) async { + testWidgets('keyboard navigation keeps the highlighted option scrolled into view', (WidgetTester tester) async { const Color highlightColor = Color(0xFF112233); await tester.pumpWidget( MaterialApp( @@ -518,7 +517,7 @@ void main() { }); group('optionsViewOpenDirection', () { - testWidgetsWithLeakTracking('default (down)', (WidgetTester tester) async { + testWidgets('default (down)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -533,7 +532,7 @@ void main() { expect(actual, equals(OptionsViewOpenDirection.down)); }); - testWidgetsWithLeakTracking('down', (WidgetTester tester) async { + testWidgets('down', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -549,7 +548,7 @@ void main() { expect(actual, equals(OptionsViewOpenDirection.down)); }); - testWidgetsWithLeakTracking('up', (WidgetTester tester) async { + testWidgets('up', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( diff --git a/packages/flutter/test/material/back_button_test.dart b/packages/flutter/test/material/back_button_test.dart index 164eaafee8b..afdba078a12 100644 --- a/packages/flutter/test/material/back_button_test.dart +++ b/packages/flutter/test/material/back_button_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('BackButton control test', (WidgetTester tester) async { + testWidgets('BackButton control test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: const Material(child: Text('Home')), @@ -35,7 +34,7 @@ void main() { expect(find.text('Home'), findsOneWidget); }); - testWidgetsWithLeakTracking('BackButton onPressed overrides default pop behavior', (WidgetTester tester) async { + testWidgets('BackButton onPressed overrides default pop behavior', (WidgetTester tester) async { bool customCallbackWasCalled = false; await tester.pumpWidget( MaterialApp( @@ -68,7 +67,7 @@ void main() { expect(customCallbackWasCalled, true); }); - testWidgetsWithLeakTracking('BackButton icon', (WidgetTester tester) async { + testWidgets('BackButton icon', (WidgetTester tester) async { final Key androidKey = UniqueKey(); final Key iOSKey = UniqueKey(); final Key linuxKey = UniqueKey(); @@ -116,7 +115,7 @@ void main() { expect(windowsIcon.icon == androidIcon.icon, isTrue); }); - testWidgetsWithLeakTracking('BackButton color', (WidgetTester tester) async { + testWidgets('BackButton color', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -134,7 +133,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('BackButton color with ButtonStyle', (WidgetTester tester) async { + testWidgets('BackButton color with ButtonStyle', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -155,7 +154,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('BackButton.style.iconColor parameter overrides BackButton.color', (WidgetTester tester) async { + testWidgets('BackButton.style.iconColor parameter overrides BackButton.color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -178,7 +177,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('BackButton semantics', (WidgetTester tester) async { + testWidgets('BackButton semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( MaterialApp( @@ -221,7 +220,7 @@ void main() { handle.dispose(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('CloseButton semantics', (WidgetTester tester) async { + testWidgets('CloseButton semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( MaterialApp( @@ -264,7 +263,7 @@ void main() { handle.dispose(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('CloseButton color', (WidgetTester tester) async { + testWidgets('CloseButton color', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -282,7 +281,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('CloseButton color with ButtonStyle', (WidgetTester tester) async { + testWidgets('CloseButton color with ButtonStyle', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -303,7 +302,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('CloseButton.style.iconColor parameter overrides CloseButton.color', (WidgetTester tester) async { + testWidgets('CloseButton.style.iconColor parameter overrides CloseButton.color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -326,7 +325,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('CloseButton onPressed overrides default pop behavior', (WidgetTester tester) async { + testWidgets('CloseButton onPressed overrides default pop behavior', (WidgetTester tester) async { bool customCallbackWasCalled = false; await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/badge_test.dart b/packages/flutter/test/material/badge_test.dart index b5b5b3c6581..2841525045f 100644 --- a/packages/flutter/test/material/badge_test.dart +++ b/packages/flutter/test/material/badge_test.dart @@ -6,11 +6,10 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Large Badge defaults', (WidgetTester tester) async { + testWidgets('Large Badge defaults', (WidgetTester tester) async { late final ThemeData theme; await tester.pumpWidget( @@ -56,7 +55,7 @@ void main() { expect(box, paints..rrect(rrect: rrect, color: theme.colorScheme.error)); }); - testWidgetsWithLeakTracking('Large Badge defaults with RTL', (WidgetTester tester) async { + testWidgets('Large Badge defaults with RTL', (WidgetTester tester) async { late final ThemeData theme; await tester.pumpWidget( @@ -99,7 +98,7 @@ void main() { }); // Essentially the same as 'Large Badge defaults' - testWidgetsWithLeakTracking('Badge.count', (WidgetTester tester) async { + testWidgets('Badge.count', (WidgetTester tester) async { late final ThemeData theme; Widget buildFrame(int count) { @@ -158,7 +157,7 @@ void main() { expect(find.text('999+'), findsOneWidget); }); - testWidgetsWithLeakTracking('Small Badge defaults', (WidgetTester tester) async { + testWidgets('Small Badge defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: true); await tester.pumpWidget( @@ -189,7 +188,7 @@ void main() { expect(box, paints..rrect(rrect: RRect.fromLTRBR(18, 0, 24, 6, const Radius.circular(3)), color: theme.colorScheme.error)); }); - testWidgetsWithLeakTracking('Small Badge RTL defaults', (WidgetTester tester) async { + testWidgets('Small Badge RTL defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: true); await tester.pumpWidget( @@ -222,7 +221,7 @@ void main() { expect(box, paints..rrect(rrect: RRect.fromLTRBR(0, 0, 6, 6, const Radius.circular(3)), color: theme.colorScheme.error)); }); - testWidgetsWithLeakTracking('Large Badge textStyle and colors', (WidgetTester tester) async { + testWidgets('Large Badge textStyle and colors', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: true); const Color green = Color(0xff00ff00); const Color black = Color(0xff000000); @@ -249,7 +248,7 @@ void main() { expect(tester.renderObject(find.byType(Badge)), paints..rrect(color: black)); }); - testWidgetsWithLeakTracking('isLabelVisible', (WidgetTester tester) async { + testWidgets('isLabelVisible', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.light(useMaterial3: true), @@ -273,7 +272,7 @@ void main() { expect(box, isNot(paints..rrect())); }); - testWidgetsWithLeakTracking('Large Badge alignment', (WidgetTester tester) async { + testWidgets('Large Badge alignment', (WidgetTester tester) async { const Radius badgeRadius = Radius.circular(8); Widget buildFrame(Alignment alignment, [Offset offset = Offset.zero]) { @@ -348,7 +347,7 @@ void main() { expect(box, paints..rrect(rrect: RRect.fromLTRBR(200 - 16, 200 - 16, 200, 200, badgeRadius).shift(offset))); }); - testWidgetsWithLeakTracking('Small Badge alignment', (WidgetTester tester) async { + testWidgets('Small Badge alignment', (WidgetTester tester) async { const Radius badgeRadius = Radius.circular(3); Widget buildFrame(Alignment alignment, [Offset offset = Offset.zero]) { diff --git a/packages/flutter/test/material/badge_theme_test.dart b/packages/flutter/test/material/badge_theme_test.dart index 9ab250eaab4..69317aa85fd 100644 --- a/packages/flutter/test/material/badge_theme_test.dart +++ b/packages/flutter/test/material/badge_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('BadgeThemeData copyWith, ==, hashCode basics', () { @@ -31,7 +30,7 @@ void main() { expect(themeData.offset, null); }); - testWidgetsWithLeakTracking('Default BadgeThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default BadgeThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const BadgeThemeData().debugFillProperties(builder); @@ -43,7 +42,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('BadgeThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('BadgeThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const BadgeThemeData( backgroundColor: Color(0xfffffff0), @@ -73,7 +72,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Badge uses ThemeData badge theme', (WidgetTester tester) async { + testWidgets('Badge uses ThemeData badge theme', (WidgetTester tester) async { const Color green = Color(0xff00ff00); const Color black = Color(0xff000000); const BadgeThemeData badgeTheme = BadgeThemeData( @@ -122,7 +121,7 @@ void main() { // This test is essentially the same as 'Badge uses ThemeData badge theme'. In // this case the theme is introduced with the BadgeTheme widget instead of // ThemeData.badgeTheme. - testWidgetsWithLeakTracking('Badge uses BadgeTheme', (WidgetTester tester) async { + testWidgets('Badge uses BadgeTheme', (WidgetTester tester) async { const Color green = Color(0xff00ff00); const Color black = Color(0xff000000); const BadgeThemeData badgeTheme = BadgeThemeData( diff --git a/packages/flutter/test/material/banner_test.dart b/packages/flutter/test/material/banner_test.dart index 4d766fbfc18..77e222bd303 100644 --- a/packages/flutter/test/material/banner_test.dart +++ b/packages/flutter/test/material/banner_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('MaterialBanner properties are respected', (WidgetTester tester) async { + testWidgets('MaterialBanner properties are respected', (WidgetTester tester) async { const String contentText = 'Content'; const Color backgroundColor = Colors.pink; const Color surfaceTintColor = Colors.green; @@ -48,7 +47,7 @@ void main() { expect(divider.color, dividerColor); }); - testWidgetsWithLeakTracking('MaterialBanner properties are respected when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('MaterialBanner properties are respected when presented by ScaffoldMessenger', (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); const Color backgroundColor = Colors.pink; @@ -105,7 +104,7 @@ void main() { expect(divider.color, dividerColor); }); - testWidgetsWithLeakTracking('Actions laid out below content if more than one action', (WidgetTester tester) async { + testWidgets('Actions laid out below content if more than one action', (WidgetTester tester) async { const String contentText = 'Content'; await tester.pumpWidget( @@ -132,7 +131,7 @@ void main() { expect(contentBottomLeft.dx, lessThan(actionsTopLeft.dx)); }); - testWidgetsWithLeakTracking('Actions laid out below content if more than one action when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Actions laid out below content if more than one action when presented by ScaffoldMessenger', (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( @@ -175,7 +174,7 @@ void main() { expect(contentBottomLeft.dx, lessThan(actionsTopLeft.dx)); }); - testWidgetsWithLeakTracking('Actions laid out beside content if only one action', (WidgetTester tester) async { + testWidgets('Actions laid out beside content if only one action', (WidgetTester tester) async { const String contentText = 'Content'; await tester.pumpWidget( @@ -198,7 +197,7 @@ void main() { expect(contentBottomLeft.dx, lessThan(actionsTopRight.dx)); }); - testWidgetsWithLeakTracking('Actions laid out beside content if only one action when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Actions laid out beside content if only one action when presented by ScaffoldMessenger', (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( @@ -270,7 +269,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Elevation defaults to 0', (WidgetTester tester) async { + testWidgets('Elevation defaults to 0', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); await tester.pumpWidget(buildBanner(tapTarget)); @@ -295,7 +294,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Uses elevation of MaterialBannerTheme by default', (WidgetTester tester) async { + testWidgets('Uses elevation of MaterialBannerTheme by default', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); await tester.pumpWidget(buildBanner(tapTarget, themeElevation: 6.0)); @@ -313,7 +312,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Scaffold body is pushed down if elevation is 0', (WidgetTester tester) async { + testWidgets('Scaffold body is pushed down if elevation is 0', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); await tester.pumpWidget(buildBanner(tapTarget, elevation: 0.0)); @@ -328,7 +327,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('MaterialBanner control test', (WidgetTester tester) async { + testWidgets('MaterialBanner control test', (WidgetTester tester) async { const String helloMaterialBanner = 'Hello MaterialBanner'; const Key tapTarget = Key('tap-target'); const Key dismissTarget = Key('dismiss-target'); @@ -380,7 +379,7 @@ void main() { expect(find.text(helloMaterialBanner), findsNothing); }); - testWidgetsWithLeakTracking('MaterialBanner twice test', (WidgetTester tester) async { + testWidgets('MaterialBanner twice test', (WidgetTester tester) async { int materialBannerCount = 0; const Key tapTarget = Key('tap-target'); const Key dismissTarget = Key('dismiss-target'); @@ -462,7 +461,7 @@ void main() { expect(find.text('banner2'), findsNothing); }); - testWidgetsWithLeakTracking('ScaffoldMessenger does not duplicate a MaterialBanner when presenting a SnackBar.', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger does not duplicate a MaterialBanner when presenting a SnackBar.', (WidgetTester tester) async { const Key materialBannerTapTarget = Key('materialbanner-tap-target'); const Key snackBarTapTarget = Key('snackbar-tap-target'); const String snackBarText = 'SnackBar'; @@ -520,7 +519,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/39574 - testWidgetsWithLeakTracking('Single action laid out beside content but aligned to the trailing edge', (WidgetTester tester) async { + testWidgets('Single action laid out beside content but aligned to the trailing edge', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: MaterialBanner( @@ -541,7 +540,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/39574 - testWidgetsWithLeakTracking('Single action laid out beside content but aligned to the trailing edge when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Single action laid out beside content but aligned to the trailing edge when presented by ScaffoldMessenger', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -579,7 +578,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/39574 - testWidgetsWithLeakTracking('Single action laid out beside content but aligned to the trailing edge - RTL', (WidgetTester tester) async { + testWidgets('Single action laid out beside content but aligned to the trailing edge - RTL', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -602,7 +601,7 @@ void main() { expect(actionsTopLeft.dx - 8, moreOrLessEquals(bannerTopLeft.dx)); // actions OverflowBar is padded by 8 }); - testWidgetsWithLeakTracking('Single action laid out beside content but aligned to the trailing edge when presented by ScaffoldMessenger - RTL', (WidgetTester tester) async { + testWidgets('Single action laid out beside content but aligned to the trailing edge when presented by ScaffoldMessenger - RTL', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( home: Directionality( @@ -642,7 +641,7 @@ void main() { expect(actionsTopLeft.dx - 8, moreOrLessEquals(bannerTopLeft.dx)); // actions OverflowBar is padded by 8 }); - testWidgetsWithLeakTracking('Actions laid out below content if forced override', (WidgetTester tester) async { + testWidgets('Actions laid out below content if forced override', (WidgetTester tester) async { const String contentText = 'Content'; await tester.pumpWidget( @@ -666,7 +665,7 @@ void main() { expect(contentBottomLeft.dx, lessThan(actionsTopLeft.dx)); }); - testWidgetsWithLeakTracking('Actions laid out below content if forced override when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Actions laid out below content if forced override when presented by ScaffoldMessenger', (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( @@ -706,7 +705,7 @@ void main() { expect(contentBottomLeft.dx, lessThan(actionsTopLeft.dx)); }); - testWidgetsWithLeakTracking('Action widgets layout', (WidgetTester tester) async { + testWidgets('Action widgets layout', (WidgetTester tester) async { // This regression test ensures that the action widgets layout matches what // it was, before ButtonBar was replaced by OverflowBar. Widget buildFrame(int actionCount, TextDirection textDirection) { @@ -750,7 +749,7 @@ void main() { expect(tester.getTopLeft(action2), const Offset(8, 130)); }); - testWidgetsWithLeakTracking('Action widgets layout when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Action widgets layout when presented by ScaffoldMessenger', (WidgetTester tester) async { // This regression test ensures that the action widgets layout matches what // it was, before ButtonBar was replaced by OverflowBar. @@ -837,7 +836,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Action widgets layout with overflow', (WidgetTester tester) async { + testWidgets('Action widgets layout with overflow', (WidgetTester tester) async { // This regression test ensures that the action widgets layout matches what // it was, before ButtonBar was replaced by OverflowBar. const int actionCount = 4; @@ -872,7 +871,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Action widgets layout with overflow when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Action widgets layout with overflow when presented by ScaffoldMessenger', (WidgetTester tester) async { // This regression test ensures that the action widgets layout matches what // it was, before ButtonBar was replaced by OverflowBar. @@ -943,7 +942,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('[overflowAlignment] test', (WidgetTester tester) async { + testWidgets('[overflowAlignment] test', (WidgetTester tester) async { const int actionCount = 4; Widget buildFrame(TextDirection textDirection, OverflowBarAlignment overflowAlignment) { return MaterialApp( @@ -980,7 +979,7 @@ void main() { } }); - testWidgetsWithLeakTracking('[overflowAlignment] test when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('[overflowAlignment] test when presented by ScaffoldMessenger', (WidgetTester tester) async { const int actionCount = 4; Widget buildFrame(TextDirection textDirection, OverflowBarAlignment overflowAlignment) { return MaterialApp( @@ -1055,7 +1054,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('ScaffoldMessenger will alert for MaterialBanners that cannot be presented', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger will alert for MaterialBanners that cannot be presented', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103004 await tester.pumpWidget(const MaterialApp( home: Center(), @@ -1084,7 +1083,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Custom Margin respected', (WidgetTester tester) async { + testWidgets('Custom Margin respected', (WidgetTester tester) async { const EdgeInsets margin = EdgeInsets.all(30); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/banner_theme_test.dart b/packages/flutter/test/material/banner_theme_test.dart index 1287699d39c..ca4c9022d59 100644 --- a/packages/flutter/test/material/banner_theme_test.dart +++ b/packages/flutter/test/material/banner_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('MaterialBannerThemeData copyWith, ==, hashCode basics', () { @@ -25,7 +24,7 @@ void main() { expect(bannerTheme.leadingPadding, null); }); - testWidgetsWithLeakTracking('Default MaterialBannerThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default MaterialBannerThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const MaterialBannerThemeData().debugFillProperties(builder); @@ -37,7 +36,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('MaterialBannerThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('MaterialBannerThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const MaterialBannerThemeData( backgroundColor: Color(0xfffffff0), @@ -67,7 +66,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Material3 - Passing no MaterialBannerThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Material3 - Passing no MaterialBannerThemeData returns defaults', (WidgetTester tester) async { const String contentText = 'Content'; final ThemeData theme = ThemeData(useMaterial3: true); late final ThemeData localizedTheme; @@ -116,7 +115,7 @@ void main() { expect(divider.color, theme.colorScheme.outlineVariant); }); - testWidgetsWithLeakTracking('Material3 - Passing no MaterialBannerThemeData returns defaults when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Material3 - Passing no MaterialBannerThemeData returns defaults when presented by ScaffoldMessenger', (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); final ThemeData theme = ThemeData(useMaterial3: true); @@ -179,7 +178,7 @@ void main() { expect(divider.color, theme.colorScheme.outlineVariant); }); - testWidgetsWithLeakTracking('MaterialBanner uses values from MaterialBannerThemeData', (WidgetTester tester) async { + testWidgets('MaterialBanner uses values from MaterialBannerThemeData', (WidgetTester tester) async { final MaterialBannerThemeData bannerTheme = _bannerTheme(); const String contentText = 'Content'; await tester.pumpWidget(MaterialApp( @@ -218,7 +217,7 @@ void main() { expect(find.byType(Divider), findsNothing); }); - testWidgetsWithLeakTracking('MaterialBanner uses values from MaterialBannerThemeData when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('MaterialBanner uses values from MaterialBannerThemeData when presented by ScaffoldMessenger', (WidgetTester tester) async { final MaterialBannerThemeData bannerTheme = _bannerTheme(); const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); @@ -274,7 +273,7 @@ void main() { expect(find.byType(Divider), findsNothing); }); - testWidgetsWithLeakTracking('MaterialBanner widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('MaterialBanner widget properties take priority over theme', (WidgetTester tester) async { const Color backgroundColor = Colors.purple; const Color surfaceTintColor = Colors.red; const Color shadowColor = Colors.orange; @@ -325,7 +324,7 @@ void main() { expect(find.byType(Divider), findsNothing); }); - testWidgetsWithLeakTracking('MaterialBanner widget properties take priority over theme when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('MaterialBanner widget properties take priority over theme when presented by ScaffoldMessenger', (WidgetTester tester) async { const Color backgroundColor = Colors.purple; const double elevation = 6.0; const TextStyle textStyle = TextStyle(color: Colors.green); @@ -388,7 +387,7 @@ void main() { expect(find.byType(Divider), findsNothing); }); - testWidgetsWithLeakTracking('MaterialBanner uses color scheme when necessary', (WidgetTester tester) async { + testWidgets('MaterialBanner uses color scheme when necessary', (WidgetTester tester) async { final ColorScheme colorScheme = const ColorScheme.light().copyWith(surface: Colors.purple); const String contentText = 'Content'; await tester.pumpWidget(MaterialApp( @@ -410,7 +409,7 @@ void main() { expect(material.color, colorScheme.surface); }); - testWidgetsWithLeakTracking('MaterialBanner uses color scheme when necessary when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('MaterialBanner uses color scheme when necessary when presented by ScaffoldMessenger', (WidgetTester tester) async { final ColorScheme colorScheme = const ColorScheme.light().copyWith(surface: Colors.purple); const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); @@ -454,7 +453,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - Passing no MaterialBannerThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Material2 - Passing no MaterialBannerThemeData returns defaults', (WidgetTester tester) async { const String contentText = 'Content'; await tester.pumpWidget(MaterialApp( @@ -500,7 +499,7 @@ void main() { expect(divider.color, null); }); - testWidgetsWithLeakTracking('Material2 - Passing no MaterialBannerThemeData returns defaults when presented by ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('Material2 - Passing no MaterialBannerThemeData returns defaults when presented by ScaffoldMessenger', (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); diff --git a/packages/flutter/test/material/bottom_app_bar_test.dart b/packages/flutter/test/material/bottom_app_bar_test.dart index 05f7da0b696..9d1916dcf03 100644 --- a/packages/flutter/test/material/bottom_app_bar_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_test.dart @@ -10,9 +10,8 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Material3 - Shadow effect is not doubled', (WidgetTester tester) async { + testWidgets('Material3 - Shadow effect is not doubled', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123064 debugDisableShadows = false; @@ -38,7 +37,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('Material3 - Only one layer with `color` is painted', (WidgetTester tester) async { + testWidgets('Material3 - Only one layer with `color` is painted', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/122667 const Color bottomAppBarColor = Colors.black45; @@ -76,7 +75,7 @@ void main() { } }); - testWidgetsWithLeakTracking('No overlap with floating action button', (WidgetTester tester) async { + testWidgets('No overlap with floating action button', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -107,7 +106,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Custom shape', (WidgetTester tester) async { + testWidgets('Material2 - Custom shape', (WidgetTester tester) async { final Key key = UniqueKey(); Future<void> pump(FloatingActionButtonLocation location) async { await tester.pumpWidget( @@ -151,7 +150,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/44572 - testWidgetsWithLeakTracking('Material3 - Custom shape', (WidgetTester tester) async { + testWidgets('Material3 - Custom shape', (WidgetTester tester) async { final Key key = UniqueKey(); Future<void> pump(FloatingActionButtonLocation location) async { await tester.pumpWidget( @@ -195,7 +194,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/44572 - testWidgetsWithLeakTracking('Custom Padding', (WidgetTester tester) async { + testWidgets('Custom Padding', (WidgetTester tester) async { const EdgeInsets customPadding = EdgeInsets.all(10); await tester.pumpWidget( MaterialApp( @@ -227,7 +226,7 @@ void main() { expect(babRect, const Rect.fromLTRB(240, 520, 560, 600)); }); - testWidgetsWithLeakTracking('Material2 - Color defaults to Theme.bottomAppBarColor', (WidgetTester tester) async { + testWidgets('Material2 - Color defaults to Theme.bottomAppBarColor', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -253,7 +252,7 @@ void main() { expect(physicalShape.color, const Color(0xffffff00)); }); - testWidgetsWithLeakTracking('Material2 - Color overrides theme color', (WidgetTester tester) async { + testWidgets('Material2 - Color overrides theme color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -284,7 +283,7 @@ void main() { }); - testWidgetsWithLeakTracking('Material3 - Color overrides theme color', (WidgetTester tester) async { + testWidgets('Material3 - Color overrides theme color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.light(useMaterial3: true).copyWith( @@ -312,7 +311,7 @@ void main() { expect(physicalShape.color, const Color(0xff0000ff)); }); - testWidgetsWithLeakTracking('Material3 - Shadow color is transparent', (WidgetTester tester) async { + testWidgets('Material3 - Shadow color is transparent', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true, @@ -334,7 +333,7 @@ void main() { expect(physicalShape.shadowColor, Colors.transparent); }); - testWidgetsWithLeakTracking('Material2 - Dark theme applies an elevation overlay color', (WidgetTester tester) async { + testWidgets('Material2 - Dark theme applies an elevation overlay color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from(useMaterial3: false, colorScheme: const ColorScheme.dark()), @@ -352,7 +351,7 @@ void main() { expect(physicalShape.color, const Color(0xFF2D2D2D)); }); - testWidgetsWithLeakTracking('Material3 - Dark theme applies an elevation overlay color', (WidgetTester tester) async { + testWidgets('Material3 - Dark theme applies an elevation overlay color', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.dark(); await tester.pumpWidget( MaterialApp( @@ -375,7 +374,7 @@ void main() { // This is a regression test for a bug we had where toggling the notch on/off // would crash, as the shouldReclip method of ShapeBorderClipper or // _BottomAppBarClipper would try an illegal downcast. - testWidgetsWithLeakTracking('toggle shape to null', (WidgetTester tester) async { + testWidgets('toggle shape to null', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -405,7 +404,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('no notch when notch param is null', (WidgetTester tester) async { + testWidgets('no notch when notch param is null', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -435,7 +434,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('notch no margin', (WidgetTester tester) async { + testWidgets('notch no margin', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -487,7 +486,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('notch with margin', (WidgetTester tester) async { + testWidgets('notch with margin', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -539,7 +538,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Observes safe area', (WidgetTester tester) async { + testWidgets('Material2 - Observes safe area', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -564,7 +563,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Observes safe area', (WidgetTester tester) async { + testWidgets('Material3 - Observes safe area', (WidgetTester tester) async { const double safeAreaPadding = 50.0; await tester.pumpWidget( MaterialApp( @@ -595,7 +594,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('clipBehavior is propagated', (WidgetTester tester) async { + testWidgets('clipBehavior is propagated', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -629,7 +628,7 @@ void main() { expect(physicalShape.clipBehavior, Clip.antiAliasWithSaveLayer); }); - testWidgetsWithLeakTracking('Material2 - BottomAppBar with shape when Scaffold.bottomNavigationBar == null', (WidgetTester tester) async { + testWidgets('Material2 - BottomAppBar with shape when Scaffold.bottomNavigationBar == null', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/80878 final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( @@ -665,7 +664,7 @@ void main() { expect(tester.getSize(find.byType(BottomAppBar)), const Size(800, 50)); }); - testWidgetsWithLeakTracking('Material3 - BottomAppBar with shape when Scaffold.bottomNavigationBar == null', (WidgetTester tester) async { + testWidgets('Material3 - BottomAppBar with shape when Scaffold.bottomNavigationBar == null', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/80878 final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -701,7 +700,7 @@ void main() { expect(tester.getSize(find.byType(BottomAppBar)), const Size(800, 80)); }); - testWidgetsWithLeakTracking('notch with margin and top padding, home safe area', (WidgetTester tester) async { + testWidgets('notch with margin and top padding, home safe area', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/90024 await tester.pumpWidget( const MediaQuery( @@ -762,7 +761,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('BottomAppBar does not apply custom clipper without FAB', (WidgetTester tester) async { + testWidgets('BottomAppBar does not apply custom clipper without FAB', (WidgetTester tester) async { Widget buildWidget({Widget? fab}) { return MaterialApp( home: Scaffold( @@ -787,7 +786,7 @@ void main() { expect(physicalShape.clipper.toString(), 'ShapeBorderClipper'); }); - testWidgetsWithLeakTracking('Material3 - BottomAppBar adds bottom padding to height', (WidgetTester tester) async { + testWidgets('Material3 - BottomAppBar adds bottom padding to height', (WidgetTester tester) async { const double bottomPadding = 35.0; await tester.pumpWidget( diff --git a/packages/flutter/test/material/bottom_app_bar_theme_test.dart b/packages/flutter/test/material/bottom_app_bar_theme_test.dart index e3358d1af87..371ca9e13f7 100644 --- a/packages/flutter/test/material/bottom_app_bar_theme_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_theme_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('BottomAppBarTheme lerp special cases', () { @@ -19,7 +18,7 @@ void main() { }); group('Material 2 tests', () { - testWidgetsWithLeakTracking('Material2 - BAB theme overrides color', (WidgetTester tester) async { + testWidgets('Material2 - BAB theme overrides color', (WidgetTester tester) async { const Color themedColor = Colors.black87; const BottomAppBarTheme theme = BottomAppBarTheme(color: themedColor); @@ -29,7 +28,7 @@ void main() { expect(widget.color, themedColor); }); - testWidgetsWithLeakTracking('Material2 - BAB color - Widget', (WidgetTester tester) async { + testWidgets('Material2 - BAB color - Widget', (WidgetTester tester) async { const Color themeColor = Colors.white10; const Color babThemeColor = Colors.black87; const Color babColor = Colors.pink; @@ -48,7 +47,7 @@ void main() { expect(widget.color, babColor); }); - testWidgetsWithLeakTracking('Material2 - BAB color - BabTheme', (WidgetTester tester) async { + testWidgets('Material2 - BAB color - BabTheme', (WidgetTester tester) async { const Color themeColor = Colors.white10; const Color babThemeColor = Colors.black87; const BottomAppBarTheme theme = BottomAppBarTheme(color: babThemeColor); @@ -66,7 +65,7 @@ void main() { expect(widget.color, babThemeColor); }); - testWidgetsWithLeakTracking('Material2 - BAB color - Theme', (WidgetTester tester) async { + testWidgets('Material2 - BAB color - Theme', (WidgetTester tester) async { const Color themeColor = Colors.white10; await tester.pumpWidget(MaterialApp( @@ -78,7 +77,7 @@ void main() { expect(widget.color, themeColor); }); - testWidgetsWithLeakTracking('Material2 - BAB color - Default', (WidgetTester tester) async { + testWidgets('Material2 - BAB color - Default', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold(body: BottomAppBar()), @@ -89,7 +88,7 @@ void main() { expect(widget.color, Colors.white); }); - testWidgetsWithLeakTracking('Material2 - BAB theme customizes shape', (WidgetTester tester) async { + testWidgets('Material2 - BAB theme customizes shape', (WidgetTester tester) async { const BottomAppBarTheme theme = BottomAppBarTheme( color: Colors.white30, shape: CircularNotchedRectangle(), @@ -104,7 +103,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - BAB theme does not affect defaults', (WidgetTester tester) async { + testWidgets('Material2 - BAB theme does not affect defaults', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold(body: BottomAppBar()), @@ -118,7 +117,7 @@ void main() { }); group('Material 3 tests', () { - testWidgetsWithLeakTracking('Material3 - BAB theme overrides color', (WidgetTester tester) async { + testWidgets('Material3 - BAB theme overrides color', (WidgetTester tester) async { const Color themedColor = Colors.black87; const BottomAppBarTheme theme = BottomAppBarTheme( color: themedColor, @@ -130,7 +129,7 @@ void main() { expect(widget.color, themedColor); }); - testWidgetsWithLeakTracking('Material3 - BAB color - Widget', (WidgetTester tester) async { + testWidgets('Material3 - BAB color - Widget', (WidgetTester tester) async { const Color themeColor = Colors.white10; const Color babThemeColor = Colors.black87; const Color babColor = Colors.pink; @@ -149,7 +148,7 @@ void main() { expect(widget.color, babColor); }); - testWidgetsWithLeakTracking('Material3 - BAB color - BabTheme', (WidgetTester tester) async { + testWidgets('Material3 - BAB color - BabTheme', (WidgetTester tester) async { const Color themeColor = Colors.white10; const Color babThemeColor = Colors.black87; const BottomAppBarTheme theme = BottomAppBarTheme(color: babThemeColor); @@ -167,7 +166,7 @@ void main() { expect(widget.color, babThemeColor); }); - testWidgetsWithLeakTracking('Material3 - BAB theme does not affect defaults', (WidgetTester tester) async { + testWidgets('Material3 - BAB theme does not affect defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( theme: theme, @@ -180,7 +179,7 @@ void main() { expect(widget.elevation, equals(3.0)); }); - testWidgetsWithLeakTracking('Material3 - BAB theme overrides surfaceTintColor', (WidgetTester tester) async { + testWidgets('Material3 - BAB theme overrides surfaceTintColor', (WidgetTester tester) async { const Color color = Colors.blue; // base color that the surface tint will be applied to const Color babThemeSurfaceTintColor = Colors.black87; const BottomAppBarTheme theme = BottomAppBarTheme( @@ -192,7 +191,7 @@ void main() { expect(widget.color, ElevationOverlay.applySurfaceTint(color, babThemeSurfaceTintColor, 0)); }); - testWidgetsWithLeakTracking('Material3 - BAB theme overrides shadowColor', (WidgetTester tester) async { + testWidgets('Material3 - BAB theme overrides shadowColor', (WidgetTester tester) async { const Color babThemeShadowColor = Colors.yellow; const BottomAppBarTheme theme = BottomAppBarTheme( shadowColor: babThemeShadowColor, elevation: 0 @@ -203,7 +202,7 @@ void main() { expect(widget.shadowColor, babThemeShadowColor); }); - testWidgetsWithLeakTracking('Material3 - BAB surfaceTintColor - Widget', (WidgetTester tester) async { + testWidgets('Material3 - BAB surfaceTintColor - Widget', (WidgetTester tester) async { const Color color = Colors.white10; // base color that the surface tint will be applied to const Color themeSurfaceTintColor = Colors.white10; const Color babThemeSurfaceTintColor = Colors.black87; @@ -226,7 +225,7 @@ void main() { expect(widget.color, ElevationOverlay.applySurfaceTint(color, babSurfaceTintColor, 3.0)); }); - testWidgetsWithLeakTracking('Material3 - BAB surfaceTintColor - BabTheme', (WidgetTester tester) async { + testWidgets('Material3 - BAB surfaceTintColor - BabTheme', (WidgetTester tester) async { const Color color = Colors.blue; // base color that the surface tint will be applied to const Color themeColor = Colors.white10; const Color babThemeColor = Colors.black87; diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index 568c1b0e86a..9ae041321c6 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -14,14 +14,13 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:vector_math/vector_math_64.dart' show Vector3; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; void main() { - testWidgetsWithLeakTracking('BottomNavigationBar callback test', (WidgetTester tester) async { + testWidgets('BottomNavigationBar callback test', (WidgetTester tester) async { late int mutatedIndex; await tester.pumpWidget( @@ -51,7 +50,7 @@ void main() { expect(mutatedIndex, 1); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar content test', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar content test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -78,7 +77,7 @@ void main() { expect(find.text('Alarm'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar content test', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar content test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -105,7 +104,7 @@ void main() { expect(find.text('Alarm'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - Fixed BottomNavigationBar defaults', (WidgetTester tester) async { + testWidgets('Material2 - Fixed BottomNavigationBar defaults', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000001); const Color unselectedWidgetColor = Color(0xFF000002); @@ -170,7 +169,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(8.0)); }); - testWidgetsWithLeakTracking('Material3 - Fixed BottomNavigationBar defaults', (WidgetTester tester) async { + testWidgets('Material3 - Fixed BottomNavigationBar defaults', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000001); const Color unselectedWidgetColor = Color(0xFF000002); @@ -235,7 +234,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(8.0)); }); - testWidgetsWithLeakTracking('Custom selected and unselected font styles', (WidgetTester tester) async { + testWidgets('Custom selected and unselected font styles', (WidgetTester tester) async { const TextStyle selectedTextStyle = TextStyle(fontWeight: FontWeight.w200, fontSize: 18.0); const TextStyle unselectedTextStyle = TextStyle(fontWeight: FontWeight.w600, fontSize: 12.0); @@ -272,7 +271,7 @@ void main() { expect(unselectedFontStyle.fontWeight, equals(unselectedTextStyle.fontWeight)); }); - testWidgetsWithLeakTracking('font size on text styles overrides font size params', (WidgetTester tester) async { + testWidgets('font size on text styles overrides font size params', (WidgetTester tester) async { const TextStyle selectedTextStyle = TextStyle(fontSize: 18.0); const TextStyle unselectedTextStyle = TextStyle(fontSize: 12.0); const double selectedFontSize = 17.0; @@ -310,7 +309,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Custom selected and unselected icon themes', (WidgetTester tester) async { + testWidgets('Custom selected and unselected icon themes', (WidgetTester tester) async { const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(0x00000001)); const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(0x00000002)); @@ -344,7 +343,7 @@ void main() { expect(unselectedIcon.fontSize, equals(unselectedIconTheme.size)); }); - testWidgetsWithLeakTracking('color on icon theme overrides selected and unselected item colors', (WidgetTester tester) async { + testWidgets('color on icon theme overrides selected and unselected item colors', (WidgetTester tester) async { const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(0x00000001)); const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(0x00000002)); const Color selectedItemColor = Color(0x00000003); @@ -384,7 +383,7 @@ void main() { expect(unselectedFontStyle.color, equals(unselectedItemColor)); }); - testWidgetsWithLeakTracking('Padding is calculated properly on items - all labels', (WidgetTester tester) async { + testWidgets('Padding is calculated properly on items - all labels', (WidgetTester tester) async { const double selectedFontSize = 16.0; const double selectedIconSize = 36.0; const double unselectedIconSize = 20.0; @@ -425,7 +424,7 @@ void main() { expect(unselectedItemPadding.bottom, equals(expectedUnselectedPadding)); }); - testWidgetsWithLeakTracking('Padding is calculated properly on items - selected labels only', (WidgetTester tester) async { + testWidgets('Padding is calculated properly on items - selected labels only', (WidgetTester tester) async { const double selectedFontSize = 16.0; const double selectedIconSize = 36.0; const double unselectedIconSize = 20.0; @@ -465,7 +464,7 @@ void main() { expect(unselectedItemPadding.bottom, equals((selectedIconSize - unselectedIconSize) / 2.0)); }); - testWidgetsWithLeakTracking('Padding is calculated properly on items - no labels', (WidgetTester tester) async { + testWidgets('Padding is calculated properly on items - no labels', (WidgetTester tester) async { const double selectedFontSize = 16.0; const double selectedIconSize = 36.0; const double unselectedIconSize = 20.0; @@ -505,7 +504,7 @@ void main() { expect(unselectedItemPadding.bottom, equals((selectedIconSize - unselectedIconSize) / 2.0)); }); - testWidgetsWithLeakTracking('Material2 - Shifting BottomNavigationBar defaults', (WidgetTester tester) async { + testWidgets('Material2 - Shifting BottomNavigationBar defaults', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -534,7 +533,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(8.0)); }); - testWidgetsWithLeakTracking('Material3 - Shifting BottomNavigationBar defaults', (WidgetTester tester) async { + testWidgets('Material3 - Shifting BottomNavigationBar defaults', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -563,7 +562,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(8.0)); }); - testWidgetsWithLeakTracking('Fixed BottomNavigationBar custom font size, color', (WidgetTester tester) async { + testWidgets('Fixed BottomNavigationBar custom font size, color', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedColor = Color(0xFF0004FF); @@ -628,7 +627,7 @@ void main() { }); - testWidgetsWithLeakTracking('Shifting BottomNavigationBar custom font size, color', (WidgetTester tester) async { + testWidgets('Shifting BottomNavigationBar custom font size, color', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedColor = Color(0xFF0004FF); @@ -675,7 +674,7 @@ void main() { expect(unselectedIcon.color, equals(unselectedColor)); }); - testWidgetsWithLeakTracking('label style color should override itemColor only for the label for BottomNavigationBarType.fixed', (WidgetTester tester) async { + testWidgets('label style color should override itemColor only for the label for BottomNavigationBarType.fixed', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedColor = Color(0xFF0004FF); @@ -721,7 +720,7 @@ void main() { expect(tester.renderObject<RenderParagraph>(find.text('Alarm')).text.style!.color, equals(unselectedLabelColor)); }); - testWidgetsWithLeakTracking('label style color should override itemColor only for the label for BottomNavigationBarType.shifting', (WidgetTester tester) async { + testWidgets('label style color should override itemColor only for the label for BottomNavigationBarType.shifting', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedColor = Color(0xFF0004FF); @@ -767,7 +766,7 @@ void main() { expect(tester.renderObject<RenderParagraph>(find.text('Alarm')).text.style!.color, equals(unselectedLabelColor)); }); - testWidgetsWithLeakTracking('iconTheme color should override itemColor for BottomNavigationBarType.fixed', (WidgetTester tester) async { + testWidgets('iconTheme color should override itemColor for BottomNavigationBarType.fixed', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedColor = Color(0xFF0004FF); @@ -819,7 +818,7 @@ void main() { expect(unselectedIcon.color, equals(unselectedIconThemeColor)); }); - testWidgetsWithLeakTracking('iconTheme color should override itemColor for BottomNavigationBarType.shifted', (WidgetTester tester) async { + testWidgets('iconTheme color should override itemColor for BottomNavigationBarType.shifted', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedLabelColor = Color(0xFFFF9900); @@ -867,7 +866,7 @@ void main() { expect(unselectedIcon.color, equals(unselectedIconThemeColor)); }); - testWidgetsWithLeakTracking('iconTheme color should override itemColor color for BottomNavigationBarType.fixed', (WidgetTester tester) async { + testWidgets('iconTheme color should override itemColor color for BottomNavigationBarType.fixed', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedIconThemeColor = Color(0xFF1E7723); @@ -909,7 +908,7 @@ void main() { expect(unselectedIcon.color, equals(unselectedIconThemeColor)); }); - testWidgetsWithLeakTracking('iconTheme color should override itemColor for BottomNavigationBarType.shifted', (WidgetTester tester) async { + testWidgets('iconTheme color should override itemColor for BottomNavigationBarType.shifted', (WidgetTester tester) async { const Color primaryColor = Color(0xFF000000); const Color unselectedWidgetColor = Color(0xFFD501FF); const Color selectedColor = Color(0xFF0004FF); @@ -955,7 +954,7 @@ void main() { expect(unselectedIcon.color, equals(unselectedIconThemeColor)); }); - testWidgetsWithLeakTracking('Fixed BottomNavigationBar can hide unselected labels', (WidgetTester tester) async { + testWidgets('Fixed BottomNavigationBar can hide unselected labels', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -981,7 +980,7 @@ void main() { expect(_getOpacity(tester, 'Alarm'), equals(0.0)); }); - testWidgetsWithLeakTracking('Fixed BottomNavigationBar can update background color', (WidgetTester tester) async { + testWidgets('Fixed BottomNavigationBar can update background color', (WidgetTester tester) async { const Color color = Colors.yellow; await tester.pumpWidget( @@ -1008,7 +1007,7 @@ void main() { expect(_getMaterial(tester).color, equals(color)); }); - testWidgetsWithLeakTracking('Shifting BottomNavigationBar background color is overridden by item color', (WidgetTester tester) async { + testWidgets('Shifting BottomNavigationBar background color is overridden by item color', (WidgetTester tester) async { const Color itemColor = Colors.yellow; const Color backgroundColor = Colors.blue; @@ -1037,7 +1036,7 @@ void main() { expect(_getMaterial(tester).color, equals(itemColor)); }); - testWidgetsWithLeakTracking('Specifying both selectedItemColor and fixedColor asserts', (WidgetTester tester) async { + testWidgets('Specifying both selectedItemColor and fixedColor asserts', (WidgetTester tester) async { expect( () { return BottomNavigationBar( @@ -1059,7 +1058,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Fixed BottomNavigationBar uses fixedColor when selectedItemColor not provided', (WidgetTester tester) async { + testWidgets('Fixed BottomNavigationBar uses fixedColor when selectedItemColor not provided', (WidgetTester tester) async { const Color fixedColor = Colors.black; await tester.pumpWidget( @@ -1086,7 +1085,7 @@ void main() { expect(tester.renderObject<RenderParagraph>(find.text('AC')).text.style!.color, equals(fixedColor)); }); - testWidgetsWithLeakTracking('setting selectedFontSize to zero hides all labels', (WidgetTester tester) async { + testWidgets('setting selectedFontSize to zero hides all labels', (WidgetTester tester) async { const double customElevation = 3.0; await tester.pumpWidget( @@ -1113,7 +1112,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(customElevation)); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar adds bottom padding to height', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar adds bottom padding to height', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1141,7 +1140,7 @@ void main() { expect(tester.getSize(find.byType(BottomNavigationBar)).height, expectedHeight); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar adds bottom padding to height', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar adds bottom padding to height', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: MediaQuery( @@ -1168,7 +1167,7 @@ void main() { expect(tester.getSize(find.byType(BottomNavigationBar)).height >= expectedMinHeight, isTrue); }); - testWidgetsWithLeakTracking('BottomNavigationBar adds bottom padding to height with a custom font size', (WidgetTester tester) async { + testWidgets('BottomNavigationBar adds bottom padding to height with a custom font size', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: MediaQuery( @@ -1196,7 +1195,7 @@ void main() { expect(tester.getSize(find.byType(BottomNavigationBar)).height, expectedHeight); }); - testWidgetsWithLeakTracking('BottomNavigationBar height will not change when toggle keyboard', (WidgetTester tester) async { + testWidgets('BottomNavigationBar height will not change when toggle keyboard', (WidgetTester tester) async { final Widget child = Scaffold( bottomNavigationBar: BottomNavigationBar( @@ -1248,7 +1247,7 @@ void main() { expect(tester.getSize(find.byType(BottomNavigationBar)).height, expectedHeight); }); - testWidgetsWithLeakTracking('BottomNavigationBar action size test', (WidgetTester tester) async { + testWidgets('BottomNavigationBar action size test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1303,7 +1302,7 @@ void main() { expect(actions.elementAt(1).size.width, 480.0); }); - testWidgetsWithLeakTracking('BottomNavigationBar multiple taps test', (WidgetTester tester) async { + testWidgets('BottomNavigationBar multiple taps test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1361,7 +1360,7 @@ void main() { expect(actions.elementAt(3).localToGlobal(Offset.zero), equals(originalOrigin)); }); - testWidgetsWithLeakTracking('BottomNavigationBar inherits shadowed app theme for shifting navbar', (WidgetTester tester) async { + testWidgets('BottomNavigationBar inherits shadowed app theme for shifting navbar', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(brightness: Brightness.light), @@ -1399,7 +1398,7 @@ void main() { expect(Theme.of(tester.element(find.text('Alarm'))).brightness, equals(Brightness.dark)); }); - testWidgetsWithLeakTracking('BottomNavigationBar inherits shadowed app theme for fixed navbar', (WidgetTester tester) async { + testWidgets('BottomNavigationBar inherits shadowed app theme for fixed navbar', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(brightness: Brightness.light), @@ -1437,7 +1436,7 @@ void main() { expect(Theme.of(tester.element(find.text('Alarm'))).brightness, equals(Brightness.dark)); }); - testWidgetsWithLeakTracking('BottomNavigationBar iconSize test', (WidgetTester tester) async { + testWidgets('BottomNavigationBar iconSize test', (WidgetTester tester) async { late double builderIconSize; await tester.pumpWidget( MaterialApp( @@ -1473,7 +1472,7 @@ void main() { expect(builderIconSize, 12.0); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar responds to textScaleFactor', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar responds to textScaleFactor', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1543,7 +1542,7 @@ void main() { expect(box.size.height, equals(56.0)); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar responds to textScaleFactor', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar responds to textScaleFactor', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1617,7 +1616,7 @@ void main() { expect(box.size.height, greaterThanOrEqualTo(kBottomNavigationBarHeight)); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar does not grow with textScaleFactor when labels are provided', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar does not grow with textScaleFactor when labels are provided', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1691,7 +1690,7 @@ void main() { expect(box.size.height, equals(kBottomNavigationBarHeight)); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar does not grow with textScaleFactor when labels are provided', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar does not grow with textScaleFactor when labels are provided', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1767,7 +1766,7 @@ void main() { expect(box.size.height, equals(shiftingBox.size.height)); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar shows tool tips with text scaling on long press when labels are provided', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar shows tool tips with text scaling on long press when labels are provided', (WidgetTester tester) async { const String label = 'Foo'; Widget buildApp({ required double textScaleFactor }) { @@ -1825,7 +1824,7 @@ void main() { expect(tester.getSize(find.text(label).last), equals(const Size(168.0, 56.0))); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar shows tool tips with text scaling on long press when labels are provided', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar shows tool tips with text scaling on long press when labels are provided', (WidgetTester tester) async { const String label = 'Foo'; Widget buildApp({ required double textScaleFactor }) { @@ -1882,7 +1881,7 @@ void main() { expect(tester.getSize(find.text(label).last).height, equals(80.0)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Different behaviour of tool tip in BottomNavigationBarItem', (WidgetTester tester) async { + testWidgets('Different behaviour of tool tip in BottomNavigationBarItem', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1921,7 +1920,7 @@ void main() { expect(find.byTooltip('C'), findsNothing); }); - testWidgetsWithLeakTracking('BottomNavigationBar limits width of tiles with long labels', (WidgetTester tester) async { + testWidgets('BottomNavigationBar limits width of tiles with long labels', (WidgetTester tester) async { final String longTextA = List<String>.generate(100, (int index) => 'A').toString(); final String longTextB = List<String>.generate(100, (int index) => 'B').toString(); @@ -1953,7 +1952,7 @@ void main() { expect(itemBoxB.size.width, equals(400.0)); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar paints circles', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar paints circles', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( useMaterial3: false, @@ -2025,7 +2024,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('BottomNavigationBar inactiveIcon shown', (WidgetTester tester) async { + testWidgets('BottomNavigationBar inactiveIcon shown', (WidgetTester tester) async { const Key filled = Key('filled'); const Key stroked = Key('stroked'); int selectedItem = 0; @@ -2078,7 +2077,7 @@ void main() { expect(find.byKey(stroked), findsOneWidget); }); - testWidgetsWithLeakTracking('BottomNavigationBar.fixed semantics', (WidgetTester tester) async { + testWidgets('BottomNavigationBar.fixed semantics', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( textDirection: TextDirection.ltr, @@ -2131,7 +2130,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('BottomNavigationBar.shifting semantics', (WidgetTester tester) async { + testWidgets('BottomNavigationBar.shifting semantics', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( textDirection: TextDirection.ltr, @@ -2185,7 +2184,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('BottomNavigationBar handles items.length changes', (WidgetTester tester) async { + testWidgets('BottomNavigationBar handles items.length changes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/10322 Widget buildFrame(int itemCount) { @@ -2223,7 +2222,7 @@ void main() { expect(find.text('item 3'), findsNothing); }); - testWidgetsWithLeakTracking('BottomNavigationBar change backgroundColor test', (WidgetTester tester) async { + testWidgets('BottomNavigationBar change backgroundColor test', (WidgetTester tester) async { // Regression test for: https://github.com/flutter/flutter/issues/19653 Color backgroundColor = Colors.red; @@ -2320,7 +2319,7 @@ void main() { ); } for (int pump = 1; pump < 9; pump++) { - testWidgetsWithLeakTracking('pump $pump', (WidgetTester tester) async { + testWidgets('pump $pump', (WidgetTester tester) async { await tester.pumpWidget(runTest()); await tester.tap(find.text('Green')); @@ -2373,7 +2372,7 @@ void main() { ); } for (int pump = 1; pump < 9; pump++) { - testWidgetsWithLeakTracking('pump $pump', (WidgetTester tester) async { + testWidgets('pump $pump', (WidgetTester tester) async { await tester.pumpWidget(runTest()); await tester.tap(find.text('Green')); @@ -2388,7 +2387,7 @@ void main() { } }); - testWidgetsWithLeakTracking('BottomNavigationBar item label should not be nullable', (WidgetTester tester) async { + testWidgets('BottomNavigationBar item label should not be nullable', (WidgetTester tester) async { expect(() { MaterialApp( home: Scaffold( @@ -2409,7 +2408,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking( + testWidgets( 'BottomNavigationBar [showSelectedLabels]=false and [showUnselectedLabels]=false ' 'for shifting navbar, expect that there is no rendered text', (WidgetTester tester) async { @@ -2446,7 +2445,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'BottomNavigationBar [showSelectedLabels]=false and [showUnselectedLabels]=false ' 'for fixed navbar, expect that there is no rendered text', (WidgetTester tester) async { @@ -2484,7 +2483,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('BottomNavigationBar.fixed [showSelectedLabels]=false and [showUnselectedLabels]=false semantics', (WidgetTester tester) async { + testWidgets('BottomNavigationBar.fixed [showSelectedLabels]=false and [showUnselectedLabels]=false semantics', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( textDirection: TextDirection.ltr, @@ -2526,7 +2525,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('BottomNavigationBar.shifting [showSelectedLabels]=false and [showUnselectedLabels]=false semantics', (WidgetTester tester) async { + testWidgets('BottomNavigationBar.shifting [showSelectedLabels]=false and [showUnselectedLabels]=false semantics', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( textDirection: TextDirection.ltr, @@ -2569,7 +2568,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('BottomNavigationBar changes mouse cursor when the tile is hovered over', (WidgetTester tester) async { + testWidgets('BottomNavigationBar changes mouse cursor when the tile is hovered over', (WidgetTester tester) async { // Test BottomNavigationBar() constructor await tester.pumpWidget( MaterialApp( @@ -2645,7 +2644,7 @@ void main() { ); } - testWidgetsWithLeakTracking('BottomNavigationBar with enabled feedback', (WidgetTester tester) async { + testWidgets('BottomNavigationBar with enabled feedback', (WidgetTester tester) async { const bool enableFeedback = true; await tester.pumpWidget(feedbackBoilerplate(enableFeedback: enableFeedback)); @@ -2656,7 +2655,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('BottomNavigationBar with disabled feedback', (WidgetTester tester) async { + testWidgets('BottomNavigationBar with disabled feedback', (WidgetTester tester) async { const bool enableFeedback = false; await tester.pumpWidget(feedbackBoilerplate(enableFeedback: enableFeedback)); @@ -2667,7 +2666,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('BottomNavigationBar with enabled feedback by default', (WidgetTester tester) async { + testWidgets('BottomNavigationBar with enabled feedback by default', (WidgetTester tester) async { await tester.pumpWidget(feedbackBoilerplate()); await tester.tap(find.byType(InkResponse).first); @@ -2676,7 +2675,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('BottomNavigationBar with disabled feedback using BottomNavigationBarTheme', (WidgetTester tester) async { + testWidgets('BottomNavigationBar with disabled feedback using BottomNavigationBarTheme', (WidgetTester tester) async { const bool enableFeedbackTheme = false; await tester.pumpWidget(feedbackBoilerplate(enableFeedbackTheme: enableFeedbackTheme)); @@ -2687,7 +2686,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('BottomNavigationBar.enableFeedback overrides BottomNavigationBarTheme.enableFeedback', (WidgetTester tester) async { + testWidgets('BottomNavigationBar.enableFeedback overrides BottomNavigationBarTheme.enableFeedback', (WidgetTester tester) async { const bool enableFeedbackTheme = false; const bool enableFeedback = true; @@ -2703,7 +2702,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('BottomNavigationBar excludes semantics', (WidgetTester tester) async { + testWidgets('BottomNavigationBar excludes semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2774,7 +2773,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar default layout', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar default layout', (WidgetTester tester) async { final Key icon0 = UniqueKey(); final Key icon1 = UniqueKey(); @@ -2822,7 +2821,7 @@ void main() { expect(tester.getRect(find.byKey(icon1)), const Rect.fromLTRB(500.0, 560.0, 700.0, 570.0)); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar default layout', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar default layout', (WidgetTester tester) async { final Key icon0 = UniqueKey(); final Key icon1 = UniqueKey(); const double iconHeight = 10; @@ -2889,7 +2888,7 @@ void main() { expect(tester.getRect(find.byKey(icon1)), Rect.fromLTRB(500.0, iconTop, 700.0, iconTop + iconHeight)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar centered landscape layout', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar centered landscape layout', (WidgetTester tester) async { final Key icon0 = UniqueKey(); final Key icon1 = UniqueKey(); @@ -2935,7 +2934,7 @@ void main() { expect(tester.getRect(find.byKey(icon1)), const Rect.fromLTRB(450.0, 560.0, 650.0, 570.0)); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar centered landscape layout', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar centered landscape layout', (WidgetTester tester) async { final Key icon0 = UniqueKey(); final Key icon1 = UniqueKey(); const double iconWidth = 200; @@ -3008,7 +3007,7 @@ void main() { expect(tester.getRect(find.byKey(icon1)), Rect.fromLTRB(450.0, iconTop, 650.0, iconTop + iconHeight)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Material2 - BottomNavigationBar linear landscape layout', (WidgetTester tester) async { + testWidgets('Material2 - BottomNavigationBar linear landscape layout', (WidgetTester tester) async { final Key icon0 = UniqueKey(); final Key icon1 = UniqueKey(); @@ -3049,7 +3048,7 @@ void main() { expect(tester.getRect(find.byKey(icon1)), const Rect.fromLTRB(504.0, 562.0, 604.0, 582.0)); }); - testWidgetsWithLeakTracking('Material3 - BottomNavigationBar linear landscape layout', (WidgetTester tester) async { + testWidgets('Material3 - BottomNavigationBar linear landscape layout', (WidgetTester tester) async { final Key icon0 = UniqueKey(); final Key icon1 = UniqueKey(); const double iconWidth = 100; diff --git a/packages/flutter/test/material/bottom_navigation_bar_theme_test.dart b/packages/flutter/test/material/bottom_navigation_bar_theme_test.dart index 70ae2b68337..f68c66babef 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_theme_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:vector_math/vector_math_64.dart' show Vector3; @@ -53,7 +52,7 @@ void main() { expect(themeData.mouseCursor, null); }); - testWidgetsWithLeakTracking('Default BottomNavigationBarThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default BottomNavigationBarThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const BottomNavigationBarThemeData().debugFillProperties(builder); @@ -65,7 +64,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('BottomNavigationBarThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('BottomNavigationBarThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const BottomNavigationBarThemeData( backgroundColor: Color(0xfffffff0), @@ -106,7 +105,7 @@ void main() { expect(description[11], 'mouseCursor: MaterialStateMouseCursor(clickable)'); }); - testWidgetsWithLeakTracking('BottomNavigationBar is themeable', (WidgetTester tester) async { + testWidgets('BottomNavigationBar is themeable', (WidgetTester tester) async { const Color backgroundColor = Color(0xFF000001); const Color selectedItemColor = Color(0xFF000002); const Color unselectedItemColor = Color(0xFF000003); @@ -210,7 +209,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.move); }); - testWidgetsWithLeakTracking('BottomNavigationBar properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('BottomNavigationBar properties are taken over the theme values', (WidgetTester tester) async { const Color themeBackgroundColor = Color(0xFF000001); const Color themeSelectedItemColor = Color(0xFF000002); const Color themeUnselectedItemColor = Color(0xFF000003); @@ -337,7 +336,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('BottomNavigationBarTheme can be used to hide all labels', (WidgetTester tester) async { + testWidgets('BottomNavigationBarTheme can be used to hide all labels', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66738. await tester.pumpWidget( MaterialApp( @@ -375,7 +374,7 @@ void main() { expect(tester.widget<Visibility>(findVisibility.at(1)).visible, false); }); - testWidgetsWithLeakTracking('BottomNavigationBarTheme can be used to hide selected labels', (WidgetTester tester) async { + testWidgets('BottomNavigationBarTheme can be used to hide selected labels', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66738. await tester.pumpWidget( MaterialApp( @@ -413,7 +412,7 @@ void main() { expect(tester.widget<FadeTransition>(findFadeTransition.at(1)).opacity.value, 1.0); }); - testWidgetsWithLeakTracking('BottomNavigationBarTheme can be used to hide unselected labels', (WidgetTester tester) async { + testWidgets('BottomNavigationBarTheme can be used to hide unselected labels', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( diff --git a/packages/flutter/test/material/bottom_sheet_test.dart b/packages/flutter/test/material/bottom_sheet_test.dart index 5b6aafafff2..fc0899cd813 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -7,7 +7,6 @@ import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -27,7 +26,7 @@ void main() { expect(dyDelta1, isNot(moreOrLessEquals(dyDelta2, epsilon: 0.1))); } - testWidgetsWithLeakTracking('Throw if enable drag without an animation controller', (WidgetTester tester) async { + testWidgets('Throw if enable drag without an animation controller', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/89168 await tester.pumpWidget( MaterialApp( @@ -54,7 +53,7 @@ void main() { FlutterError.onError = handler; }); - testWidgetsWithLeakTracking('Disposing app while bottom sheet is disappearing does not crash', (WidgetTester tester) async { + testWidgets('Disposing app while bottom sheet is disappearing does not crash', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget( @@ -91,7 +90,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('Swiping down a BottomSheet should dismiss it by default', (WidgetTester tester) async { + testWidgets('Swiping down a BottomSheet should dismiss it by default', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); bool showBottomSheetThenCalled = false; @@ -126,7 +125,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Swiping down a BottomSheet should not dismiss it when enableDrag is false', (WidgetTester tester) async { + testWidgets('Swiping down a BottomSheet should not dismiss it when enableDrag is false', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); bool showBottomSheetThenCalled = false; @@ -163,7 +162,7 @@ void main() { expect(find.text('BottomSheet'), findsOneWidget); }); - testWidgetsWithLeakTracking('Swiping down a BottomSheet should dismiss it when enableDrag is true', (WidgetTester tester) async { + testWidgets('Swiping down a BottomSheet should dismiss it when enableDrag is true', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); bool showBottomSheetThenCalled = false; @@ -200,7 +199,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Tapping on a BottomSheet should not trigger a rebuild when enableDrag is true', (WidgetTester tester) async { + testWidgets('Tapping on a BottomSheet should not trigger a rebuild when enableDrag is true', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126833. final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); int buildCount = 0; @@ -237,7 +236,7 @@ void main() { expect(find.text('BottomSheet'), findsOneWidget); }); - testWidgetsWithLeakTracking('Modal BottomSheet builder should only be called once', (WidgetTester tester) async { + testWidgets('Modal BottomSheet builder should only be called once', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -268,7 +267,7 @@ void main() { expect(numBuilderCalls, 1); }); - testWidgetsWithLeakTracking('Tapping on a modal BottomSheet should not dismiss it', (WidgetTester tester) async { + testWidgets('Tapping on a modal BottomSheet should not dismiss it', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget( @@ -304,7 +303,7 @@ void main() { expect(showBottomSheetThenCalled, isFalse); }); - testWidgetsWithLeakTracking('Tapping outside a modal BottomSheet should dismiss it by default', (WidgetTester tester) async { + testWidgets('Tapping outside a modal BottomSheet should dismiss it by default', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -338,7 +337,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Tapping outside a modal BottomSheet should dismiss it when isDismissible=true', (WidgetTester tester) async { + testWidgets('Tapping outside a modal BottomSheet should dismiss it when isDismissible=true', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -372,7 +371,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Verify that the BottomSheet animates non-linearly', (WidgetTester tester) async { + testWidgets('Verify that the BottomSheet animates non-linearly', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -405,7 +404,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/121098 - testWidgetsWithLeakTracking('Verify that accessibleNavigation has no impact on the BottomSheet animation', (WidgetTester tester) async { + testWidgets('Verify that accessibleNavigation has no impact on the BottomSheet animation', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( builder: (BuildContext context, Widget? child) { return MediaQuery( @@ -430,7 +429,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Tapping outside a modal BottomSheet should not dismiss it when isDismissible=false', (WidgetTester tester) async { + testWidgets('Tapping outside a modal BottomSheet should not dismiss it when isDismissible=false', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget( @@ -467,7 +466,7 @@ void main() { expect(find.text('BottomSheet'), findsOneWidget); }); - testWidgetsWithLeakTracking('Swiping down a modal BottomSheet should dismiss it by default', (WidgetTester tester) async { + testWidgets('Swiping down a modal BottomSheet should dismiss it by default', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -502,7 +501,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Swiping down a modal BottomSheet should not dismiss it when enableDrag is false', (WidgetTester tester) async { + testWidgets('Swiping down a modal BottomSheet should not dismiss it when enableDrag is false', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -538,7 +537,7 @@ void main() { expect(find.text('BottomSheet'), findsOneWidget); }); - testWidgetsWithLeakTracking('Swiping down a modal BottomSheet should dismiss it when enableDrag is true', (WidgetTester tester) async { + testWidgets('Swiping down a modal BottomSheet should dismiss it when enableDrag is true', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -573,7 +572,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Modal BottomSheet builder should only be called once', (WidgetTester tester) async { + testWidgets('Modal BottomSheet builder should only be called once', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget(MaterialApp( @@ -604,7 +603,7 @@ void main() { expect(numBuilderCalls, 1); }); - testWidgetsWithLeakTracking('Verify that a downwards fling dismisses a persistent BottomSheet', (WidgetTester tester) async { + testWidgets('Verify that a downwards fling dismisses a persistent BottomSheet', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); bool showBottomSheetThenCalled = false; @@ -661,7 +660,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('Verify that dragging past the bottom dismisses a persistent BottomSheet', (WidgetTester tester) async { + testWidgets('Verify that dragging past the bottom dismisses a persistent BottomSheet', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/5528 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -691,7 +690,7 @@ void main() { expect(find.text('BottomSheet'), findsNothing); }); - testWidgetsWithLeakTracking('modal BottomSheet has no top MediaQuery', (WidgetTester tester) async { + testWidgets('modal BottomSheet has no top MediaQuery', (WidgetTester tester) async { late BuildContext outerContext; late BuildContext innerContext; @@ -742,7 +741,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('modal BottomSheet can insert a SafeArea', (WidgetTester tester) async { + testWidgets('modal BottomSheet can insert a SafeArea', (WidgetTester tester) async { late BuildContext outerContext; late BuildContext innerContext; @@ -814,7 +813,7 @@ void main() { expect(MediaQuery.of(innerContext).padding, const EdgeInsets.fromLTRB(0, 0, 0, 50.0)); }); - testWidgetsWithLeakTracking('modal BottomSheet has semantics', (WidgetTester tester) async { + testWidgets('modal BottomSheet has semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -871,7 +870,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Verify that visual properties are passed through', (WidgetTester tester) async { + testWidgets('Verify that visual properties are passed through', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const Color color = Colors.pink; const double elevation = 9.0; @@ -911,7 +910,7 @@ void main() { expect(modalBarrier.color, barrierColor); }); - testWidgetsWithLeakTracking('Material3 - BottomSheet uses fallback values', + testWidgets('Material3 - BottomSheet uses fallback values', (WidgetTester tester) async { const Color surfaceColor = Colors.pink; const Color surfaceTintColor = Colors.blue; @@ -951,7 +950,7 @@ void main() { expect(tester.getSize(finder).width, 640); }); - testWidgetsWithLeakTracking('Material3 - BottomSheet has transparent shadow', (WidgetTester tester) async { + testWidgets('Material3 - BottomSheet has transparent shadow', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData( useMaterial3: true, @@ -975,7 +974,7 @@ void main() { expect(material.shadowColor, Colors.transparent); }); - testWidgetsWithLeakTracking('Material2 - Modal BottomSheet with ScrollController has semantics', (WidgetTester tester) async { + testWidgets('Material2 - Modal BottomSheet with ScrollController has semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -1048,7 +1047,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Modal BottomSheet with ScrollController has semantics', (WidgetTester tester) async { + testWidgets('Material3 - Modal BottomSheet with ScrollController has semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -1125,7 +1124,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Modal BottomSheet with drag handle has semantics', (WidgetTester tester) async { + testWidgets('Material3 - Modal BottomSheet with drag handle has semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -1194,7 +1193,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Drag handle color can take MaterialStateProperty', (WidgetTester tester) async { + testWidgets('Drag handle color can take MaterialStateProperty', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const Color defaultColor=Colors.blue; const Color hoveringColor=Colors.green; @@ -1256,7 +1255,7 @@ void main() { expect(boxDecoration.color, hoveringColor); }); - testWidgetsWithLeakTracking('showModalBottomSheet does not use root Navigator by default', (WidgetTester tester) async { + testWidgets('showModalBottomSheet does not use root Navigator by default', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: Navigator(onGenerateRoute: (RouteSettings settings) => MaterialPageRoute<void>(builder: (_) { @@ -1286,7 +1285,7 @@ void main() { expect(tester.getBottomLeft(find.byType(BottomSheet)).dy, 600 - tabBarHeight); }); - testWidgetsWithLeakTracking('showModalBottomSheet uses root Navigator when specified', (WidgetTester tester) async { + testWidgets('showModalBottomSheet uses root Navigator when specified', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: Navigator(onGenerateRoute: (RouteSettings settings) => MaterialPageRoute<void>(builder: (_) { @@ -1315,7 +1314,7 @@ void main() { expect(tester.getBottomLeft(find.byType(BottomSheet)).dy, 600.0); }); - testWidgetsWithLeakTracking('Verify that route settings can be set in the showModalBottomSheet', (WidgetTester tester) async { + testWidgets('Verify that route settings can be set in the showModalBottomSheet', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const RouteSettings routeSettings = RouteSettings(name: 'route_name', arguments: 'route_argument'); @@ -1343,7 +1342,7 @@ void main() { expect(retrievedRouteSettings, routeSettings); }); - testWidgetsWithLeakTracking('Verify showModalBottomSheet use AnimationController if provided.', (WidgetTester tester) async { + testWidgets('Verify showModalBottomSheet use AnimationController if provided.', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); final AnimationController controller = AnimationController( vsync: const TestVSync(), @@ -1403,7 +1402,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/87592 - testWidgetsWithLeakTracking('the framework do not dispose the transitionAnimationController provided by user.', (WidgetTester tester) async { + testWidgets('the framework do not dispose the transitionAnimationController provided by user.', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); final AnimationController controller = AnimationController( vsync: const TestVSync(), @@ -1465,7 +1464,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Verify persistence BottomSheet use AnimationController if provided.', (WidgetTester tester) async { + testWidgets('Verify persistence BottomSheet use AnimationController if provided.', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); const Key tapTargetToClose = Key('tap-target-to-close'); final AnimationController controller = AnimationController( @@ -1530,7 +1529,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/87708 - testWidgetsWithLeakTracking('Each of the internal animation controllers should be disposed by the framework.', (WidgetTester tester) async { + testWidgets('Each of the internal animation controllers should be disposed by the framework.', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey(); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -1573,7 +1572,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/99627 - testWidgetsWithLeakTracking('The old route entry should be removed when a new sheet popup', (WidgetTester tester) async { + testWidgets('The old route entry should be removed when a new sheet popup', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey(); PersistentBottomSheetController? sheetController; @@ -1617,7 +1616,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/87708 - testWidgetsWithLeakTracking('The framework does not dispose of the transitionAnimationController provided by user.', (WidgetTester tester) async { + testWidgets('The framework does not dispose of the transitionAnimationController provided by user.', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); const Key tapTargetToClose = Key('tap-target-to-close'); final AnimationController controller = AnimationController( @@ -1673,7 +1672,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Calling PersistentBottomSheetController.close does not crash when it is not the current bottom sheet', (WidgetTester tester) async { + testWidgets('Calling PersistentBottomSheetController.close does not crash when it is not the current bottom sheet', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/93717 PersistentBottomSheetController? sheetController1; await tester.pumpWidget(MaterialApp( @@ -1725,7 +1724,7 @@ void main() { expect(find.text('BottomSheet 2'), findsOneWidget); }); - testWidgetsWithLeakTracking('ModalBottomSheetRoute shows BottomSheet correctly', (WidgetTester tester) async { + testWidgets('ModalBottomSheetRoute shows BottomSheet correctly', (WidgetTester tester) async { late BuildContext savedContext; await tester.pumpWidget( @@ -1755,7 +1754,7 @@ void main() { }); group('Modal BottomSheet avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning using anchorPoint', (WidgetTester tester) async { + testWidgets('positioning using anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1793,7 +1792,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)).dx, 800); }); - testWidgetsWithLeakTracking('positioning using Directionality', (WidgetTester tester) async { + testWidgets('positioning using Directionality', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1833,7 +1832,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)).dx, 800); }); - testWidgetsWithLeakTracking('default positioning', (WidgetTester tester) async { + testWidgets('default positioning', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1872,7 +1871,7 @@ void main() { }); group('constraints', () { - testWidgetsWithLeakTracking('Material3 - Default constraints are max width 640', (WidgetTester tester) async { + testWidgets('Material3 - Default constraints are max width 640', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1888,7 +1887,7 @@ void main() { expect(tester.getSize(find.byType(Placeholder)).width, 640); }); - testWidgetsWithLeakTracking('Material2 - No constraints by default for bottomSheet property', (WidgetTester tester) async { + testWidgets('Material2 - No constraints by default for bottomSheet property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( // This test is specific to Material2 because Material3 sets constraints by default for BottomSheet. theme: ThemeData(useMaterial3: false), @@ -1904,7 +1903,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('No constraints by default for showBottomSheet', (WidgetTester tester) async { + testWidgets('No constraints by default for showBottomSheet', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( // This test is specific to Material2 because Material3 sets constraints by default for BottomSheet. theme: ThemeData(useMaterial3: false), @@ -1933,7 +1932,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('No constraints by default for showModalBottomSheet', (WidgetTester tester) async { + testWidgets('No constraints by default for showModalBottomSheet', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( // This test is specific to Material2 because Material3 sets constraints by default for BottomSheet. theme: ThemeData(useMaterial3: false), @@ -1963,7 +1962,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Theme constraints used for bottomSheet property', (WidgetTester tester) async { + testWidgets('Material3 - Theme constraints used for bottomSheet property', (WidgetTester tester) async { const double sheetMaxWidth = 80.0; await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -1991,7 +1990,7 @@ void main() { expect(iconRect.top, bottomSheetRect.top - iconRect.height / 2); }); - testWidgetsWithLeakTracking('Material2 - Theme constraints used for bottomSheet property', (WidgetTester tester) async { + testWidgets('Material2 - Theme constraints used for bottomSheet property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData( useMaterial3: false, @@ -2019,7 +2018,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Theme constraints used for showBottomSheet', (WidgetTester tester) async { + testWidgets('Theme constraints used for showBottomSheet', (WidgetTester tester) async { const double sheetMaxWidth = 80.0; await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -2053,7 +2052,7 @@ void main() { expect(bottomSheetRect.width, sheetMaxWidth); }); - testWidgetsWithLeakTracking('Theme constraints used for showModalBottomSheet', (WidgetTester tester) async { + testWidgets('Theme constraints used for showModalBottomSheet', (WidgetTester tester) async { const double sheetMaxWidth = 80.0; await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -2088,7 +2087,7 @@ void main() { expect(bottomSheetRect.width, sheetMaxWidth); }); - testWidgetsWithLeakTracking('constraints param overrides theme for showBottomSheet', (WidgetTester tester) async { + testWidgets('constraints param overrides theme for showBottomSheet', (WidgetTester tester) async { const double sheetMaxWidth = 100.0; await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -2123,7 +2122,7 @@ void main() { expect(bottomSheetRect.width, sheetMaxWidth); }); - testWidgetsWithLeakTracking('constraints param overrides theme for showModalBottomSheet', (WidgetTester tester) async { + testWidgets('constraints param overrides theme for showModalBottomSheet', (WidgetTester tester) async { const double sheetMaxWidth = 100.0; await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -2201,20 +2200,20 @@ void main() { ); } - testWidgetsWithLeakTracking('works at 9 / 16', (WidgetTester tester) { + testWidgets('works at 9 / 16', (WidgetTester tester) { return test(tester, false, 9.0 / 16.0); }); - testWidgetsWithLeakTracking('works at 8 / 16', (WidgetTester tester) { + testWidgets('works at 8 / 16', (WidgetTester tester) { return test(tester, false, 8.0 / 16.0); }); - testWidgetsWithLeakTracking('works at isScrollControlled', (WidgetTester tester) { + testWidgets('works at isScrollControlled', (WidgetTester tester) { return test(tester, true, 8.0 / 16.0); }); }); }); group('showModalBottomSheet modalBarrierDismissLabel', () { - testWidgetsWithLeakTracking('Verify that modalBarrierDismissLabel is used if provided', + testWidgets('Verify that modalBarrierDismissLabel is used if provided', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const String customLabel = 'custom label'; @@ -2240,7 +2239,7 @@ void main() { expect(modalBarrier.semanticsLabel, customLabel); }); - testWidgetsWithLeakTracking('Verify that modalBarrierDismissLabel from context is used if barrierLabel is not provided', + testWidgets('Verify that modalBarrierDismissLabel from context is used if barrierLabel is not provided', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( diff --git a/packages/flutter/test/material/bottom_sheet_theme_test.dart b/packages/flutter/test/material/bottom_sheet_theme_test.dart index 904db91fbbf..bf51ff15bf4 100644 --- a/packages/flutter/test/material/bottom_sheet_theme_test.dart +++ b/packages/flutter/test/material/bottom_sheet_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('BottomSheetThemeData copyWith, ==, hashCode basics', () { @@ -37,7 +36,7 @@ void main() { expect(bottomSheetTheme.dragHandleSize, null); }); - testWidgetsWithLeakTracking('Default BottomSheetThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default BottomSheetThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const BottomSheetThemeData().debugFillProperties(builder); @@ -49,7 +48,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('BottomSheetThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('BottomSheetThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const BottomSheetThemeData( backgroundColor: Color(0xFFFFFFFF), @@ -79,7 +78,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Material3 - Passing no BottomSheetThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Material3 - Passing no BottomSheetThemeData returns defaults', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: Scaffold( @@ -106,7 +105,7 @@ void main() { expect(material.clipBehavior, Clip.none); }); - testWidgetsWithLeakTracking('Material2 - Passing no BottomSheetThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Material2 - Passing no BottomSheetThemeData returns defaults', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: Scaffold( @@ -131,7 +130,7 @@ void main() { expect(material.clipBehavior, Clip.none); }); - testWidgetsWithLeakTracking('BottomSheet uses values from BottomSheetThemeData', (WidgetTester tester) async { + testWidgets('BottomSheet uses values from BottomSheetThemeData', (WidgetTester tester) async { final BottomSheetThemeData bottomSheetTheme = _bottomSheetTheme(); await tester.pumpWidget(MaterialApp( @@ -158,7 +157,7 @@ void main() { expect(material.clipBehavior, bottomSheetTheme.clipBehavior); }); - testWidgetsWithLeakTracking('BottomSheet widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('BottomSheet widget properties take priority over theme', (WidgetTester tester) async { const Color backgroundColor = Colors.purple; const Color shadowColor = Colors.blue; const double elevation = 7.0; @@ -197,7 +196,7 @@ void main() { expect(material.clipBehavior, clipBehavior); }); - testWidgetsWithLeakTracking('Modal bottom sheet-specific parameters are used for modal bottom sheets', (WidgetTester tester) async { + testWidgets('Modal bottom sheet-specific parameters are used for modal bottom sheets', (WidgetTester tester) async { const double modalElevation = 5.0; const double persistentElevation = 7.0; const Color modalBackgroundColor = Colors.yellow; @@ -228,7 +227,7 @@ void main() { expect(modalBarrier.color, modalBarrierColor); }); - testWidgetsWithLeakTracking('General bottom sheet parameters take priority over modal bottom sheet-specific parameters for persistent bottom sheets', (WidgetTester tester) async { + testWidgets('General bottom sheet parameters take priority over modal bottom sheet-specific parameters for persistent bottom sheets', (WidgetTester tester) async { const double modalElevation = 5.0; const double persistentElevation = 7.0; const Color modalBackgroundColor = Colors.yellow; @@ -254,7 +253,7 @@ void main() { expect(material.color, persistentBackgroundColor); }); - testWidgetsWithLeakTracking("Material3 - Modal bottom sheet-specific parameters don't apply to persistent bottom sheets", (WidgetTester tester) async { + testWidgets("Material3 - Modal bottom sheet-specific parameters don't apply to persistent bottom sheets", (WidgetTester tester) async { const double modalElevation = 5.0; const Color modalBackgroundColor = Colors.yellow; const BottomSheetThemeData bottomSheetTheme = BottomSheetThemeData( @@ -277,7 +276,7 @@ void main() { expect(material.color, theme.colorScheme.surface); }); - testWidgetsWithLeakTracking("Material2 - Modal bottom sheet-specific parameters don't apply to persistent bottom sheets", (WidgetTester tester) async { + testWidgets("Material2 - Modal bottom sheet-specific parameters don't apply to persistent bottom sheets", (WidgetTester tester) async { const double modalElevation = 5.0; const Color modalBackgroundColor = Colors.yellow; const BottomSheetThemeData bottomSheetTheme = BottomSheetThemeData( @@ -299,7 +298,7 @@ void main() { expect(material.color, null); }); - testWidgetsWithLeakTracking('Modal bottom sheets respond to theme changes', (WidgetTester tester) async { + testWidgets('Modal bottom sheets respond to theme changes', (WidgetTester tester) async { const double lightElevation = 5.0; const double darkElevation = 3.0; const Color lightBackgroundColor = Colors.green; diff --git a/packages/flutter/test/material/button_bar_test.dart b/packages/flutter/test/material/button_bar_test.dart index a04d9115de1..9207fc13953 100644 --- a/packages/flutter/test/material/button_bar_test.dart +++ b/packages/flutter/test/material/button_bar_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ButtonBar default control smoketest', (WidgetTester tester) async { + testWidgets('ButtonBar default control smoketest', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -18,7 +17,7 @@ void main() { group('alignment', () { - testWidgetsWithLeakTracking('default alignment is MainAxisAlignment.end', (WidgetTester tester) async { + testWidgets('default alignment is MainAxisAlignment.end', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: ButtonBar( @@ -35,7 +34,7 @@ void main() { expect(tester.getRect(child).right, 792.0); // bar width - default padding }); - testWidgetsWithLeakTracking('ButtonBarTheme.alignment overrides default', (WidgetTester tester) async { + testWidgets('ButtonBarTheme.alignment overrides default', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: ButtonBarTheme( @@ -57,7 +56,7 @@ void main() { expect(tester.getRect(child).right, 405.0); // (bar width - padding) / 2 - 10 / 2 + 10 }); - testWidgetsWithLeakTracking('ButtonBar.alignment overrides ButtonBarTheme.alignment and default', (WidgetTester tester) async { + testWidgets('ButtonBar.alignment overrides ButtonBarTheme.alignment and default', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: ButtonBarTheme( @@ -84,7 +83,7 @@ void main() { group('mainAxisSize', () { - testWidgetsWithLeakTracking('Default mainAxisSize is MainAxisSize.max', (WidgetTester tester) async { + testWidgets('Default mainAxisSize is MainAxisSize.max', (WidgetTester tester) async { const Key buttonBarKey = Key('row'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -131,7 +130,7 @@ void main() { expect(childRect.right, 800.0); }); - testWidgetsWithLeakTracking('ButtonBarTheme.mainAxisSize overrides default', (WidgetTester tester) async { + testWidgets('ButtonBarTheme.mainAxisSize overrides default', (WidgetTester tester) async { const Key buttonBarKey = Key('row'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -186,7 +185,7 @@ void main() { expect(childRect.left, ((800.0 - buttonBarRect.width) / 2.0) + 200.0); }); - testWidgetsWithLeakTracking('ButtonBar.mainAxisSize overrides ButtonBarTheme.mainAxisSize and default', (WidgetTester tester) async { + testWidgets('ButtonBar.mainAxisSize overrides ButtonBarTheme.mainAxisSize and default', (WidgetTester tester) async { const Key buttonBarKey = Key('row'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -241,7 +240,7 @@ void main() { group('button properties override ButtonTheme', () { - testWidgetsWithLeakTracking('default button properties override ButtonTheme properties', (WidgetTester tester) async { + testWidgets('default button properties override ButtonTheme properties', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( MaterialApp( @@ -264,7 +263,7 @@ void main() { expect(buttonTheme.layoutBehavior, equals(ButtonBarLayoutBehavior.padded)); }); - testWidgetsWithLeakTracking('ButtonBarTheme button properties override defaults and ButtonTheme properties', (WidgetTester tester) async { + testWidgets('ButtonBarTheme button properties override defaults and ButtonTheme properties', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( MaterialApp( @@ -297,7 +296,7 @@ void main() { expect(buttonTheme.layoutBehavior, equals(ButtonBarLayoutBehavior.constrained)); }); - testWidgetsWithLeakTracking('ButtonBar button properties override ButtonBarTheme, defaults and ButtonTheme properties', (WidgetTester tester) async { + testWidgets('ButtonBar button properties override ButtonBarTheme, defaults and ButtonTheme properties', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( MaterialApp( @@ -340,7 +339,7 @@ void main() { group('layoutBehavior', () { - testWidgetsWithLeakTracking('ButtonBar has a min height of 52 when using ButtonBarLayoutBehavior.constrained', (WidgetTester tester) async { + testWidgets('ButtonBar has a min height of 52 when using ButtonBarLayoutBehavior.constrained', (WidgetTester tester) async { await tester.pumpWidget( const SingleChildScrollView( child: ListBody( @@ -363,7 +362,7 @@ void main() { expect(tester.getBottomRight(buttonBar).dy - tester.getTopRight(buttonBar).dy, 52.0); }); - testWidgetsWithLeakTracking('ButtonBar has padding applied when using ButtonBarLayoutBehavior.padded', (WidgetTester tester) async { + testWidgets('ButtonBar has padding applied when using ButtonBarLayoutBehavior.padded', (WidgetTester tester) async { await tester.pumpWidget( const SingleChildScrollView( child: ListBody( @@ -388,7 +387,7 @@ void main() { }); group("ButtonBar's children wrap when they overflow horizontally", () { - testWidgetsWithLeakTracking("ButtonBar's children wrap when buttons overflow", (WidgetTester tester) async { + testWidgets("ButtonBar's children wrap when buttons overflow", (WidgetTester tester) async { final Key keyOne = UniqueKey(); final Key keyTwo = UniqueKey(); await tester.pumpWidget( @@ -410,7 +409,7 @@ void main() { expect(containerOneRect.left, containerTwoRect.left); }); - testWidgetsWithLeakTracking( + testWidgets( "ButtonBar's children overflow defaults - MainAxisAlignment.end", (WidgetTester tester) async { final Key keyOne = UniqueKey(); final Key keyTwo = UniqueKey(); @@ -438,7 +437,7 @@ void main() { }, ); - testWidgetsWithLeakTracking("ButtonBar's children overflow - MainAxisAlignment.start", (WidgetTester tester) async { + testWidgets("ButtonBar's children overflow - MainAxisAlignment.start", (WidgetTester tester) async { final Key keyOne = UniqueKey(); final Key keyTwo = UniqueKey(); await tester.pumpWidget( @@ -465,7 +464,7 @@ void main() { expect(containerOneRect.left, buttonBarRect.left); }); - testWidgetsWithLeakTracking("ButtonBar's children overflow - MainAxisAlignment.center", (WidgetTester tester) async { + testWidgets("ButtonBar's children overflow - MainAxisAlignment.center", (WidgetTester tester) async { final Key keyOne = UniqueKey(); final Key keyTwo = UniqueKey(); await tester.pumpWidget( @@ -492,7 +491,7 @@ void main() { expect(containerOneRect.center.dx, buttonBarRect.center.dx); }); - testWidgetsWithLeakTracking( + testWidgets( "ButtonBar's children default to MainAxisAlignment.start for horizontal " 'alignment when overflowing in spaceBetween, spaceAround and spaceEvenly ' 'cases when overflowing.', (WidgetTester tester) async { @@ -546,7 +545,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( "ButtonBar's children respects verticalDirection when overflowing", (WidgetTester tester) async { final Key keyOne = UniqueKey(); @@ -575,7 +574,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'ButtonBar has no spacing by default when overflowing', (WidgetTester tester) async { final Key keyOne = UniqueKey(); @@ -600,7 +599,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( "ButtonBar's children respects overflowButtonSpacing when overflowing", (WidgetTester tester) async { final Key keyOne = UniqueKey(); @@ -629,7 +628,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('_RenderButtonBarRow.constraints does not work before layout', (WidgetTester tester) async { + testWidgets('_RenderButtonBarRow.constraints does not work before layout', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp(home: ButtonBar()), Duration.zero, diff --git a/packages/flutter/test/material/button_bar_theme_test.dart b/packages/flutter/test/material/button_bar_theme_test.dart index 158c9dbb517..ab8037b1b56 100644 --- a/packages/flutter/test/material/button_bar_theme_test.dart +++ b/packages/flutter/test/material/button_bar_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -37,7 +36,7 @@ void main() { expect(const ButtonBarThemeData().hashCode, const ButtonBarThemeData().copyWith().hashCode); }); - testWidgetsWithLeakTracking('ButtonBarThemeData lerps correctly', (WidgetTester tester) async { + testWidgets('ButtonBarThemeData lerps correctly', (WidgetTester tester) async { const ButtonBarThemeData barThemePrimary = ButtonBarThemeData( alignment: MainAxisAlignment.end, mainAxisSize: MainAxisSize.min, @@ -73,7 +72,7 @@ void main() { expect(lerp.overflowDirection, equals(VerticalDirection.up)); }); - testWidgetsWithLeakTracking('Default ButtonBarThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ButtonBarThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ButtonBarThemeData().debugFillProperties(builder); @@ -85,7 +84,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ButtonBarThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ButtonBarThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ButtonBarThemeData( alignment: MainAxisAlignment.center, @@ -117,7 +116,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('ButtonBarTheme.of falls back to ThemeData.buttonBarTheme', (WidgetTester tester) async { + testWidgets('ButtonBarTheme.of falls back to ThemeData.buttonBarTheme', (WidgetTester tester) async { const ButtonBarThemeData buttonBarTheme = ButtonBarThemeData(buttonMinWidth: 42.0); late BuildContext capturedContext; await tester.pumpWidget( @@ -135,7 +134,7 @@ void main() { expect(ButtonBarTheme.of(capturedContext).buttonMinWidth, equals(42.0)); }); - testWidgetsWithLeakTracking('ButtonBarTheme overrides ThemeData.buttonBarTheme', (WidgetTester tester) async { + testWidgets('ButtonBarTheme overrides ThemeData.buttonBarTheme', (WidgetTester tester) async { const ButtonBarThemeData defaultBarTheme = ButtonBarThemeData(buttonMinWidth: 42.0); const ButtonBarThemeData buttonBarTheme = ButtonBarThemeData(buttonMinWidth: 84.0); late BuildContext capturedContext; diff --git a/packages/flutter/test/material/button_style_test.dart b/packages/flutter/test/material/button_style_test.dart index f6b096abd5d..2244c2940a7 100644 --- a/packages/flutter/test/material/button_style_test.dart +++ b/packages/flutter/test/material/button_style_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('ButtonStyle copyWith, merge, ==, hashCode basics', () { @@ -45,7 +44,7 @@ void main() { expect(style.enableFeedback, null); }); - testWidgetsWithLeakTracking('Default ButtonStyle debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ButtonStyle debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ButtonStyle().debugFillProperties(builder); @@ -57,7 +56,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ButtonStyle debugFillProperties', (WidgetTester tester) async { + testWidgets('ButtonStyle debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ButtonStyle( textStyle: MaterialStatePropertyAll<TextStyle>(TextStyle(fontSize: 10.0)), @@ -107,7 +106,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('ButtonStyle copyWith, merge', (WidgetTester tester) async { + testWidgets('ButtonStyle copyWith, merge', (WidgetTester tester) async { const MaterialStateProperty<TextStyle> textStyle = MaterialStatePropertyAll<TextStyle>(TextStyle(fontSize: 10)); const MaterialStateProperty<Color> backgroundColor = MaterialStatePropertyAll<Color>(Color(0xfffffff1)); const MaterialStateProperty<Color> foregroundColor = MaterialStatePropertyAll<Color>(Color(0xfffffff2)); diff --git a/packages/flutter/test/material/button_theme_test.dart b/packages/flutter/test/material/button_theme_test.dart index 1b8f3689e23..4657e1b5f4b 100644 --- a/packages/flutter/test/material/button_theme_test.dart +++ b/packages/flutter/test/material/button_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -68,7 +67,7 @@ void main() { expect(theme.colorScheme, const ColorScheme.dark()); }); - testWidgetsWithLeakTracking('ButtonTheme alignedDropdown', (WidgetTester tester) async { + testWidgets('ButtonTheme alignedDropdown', (WidgetTester tester) async { final Key dropdownKey = UniqueKey(); Widget buildFrame({ required bool alignedDropdown, required TextDirection textDirection }) { diff --git a/packages/flutter/test/material/calendar_date_picker_test.dart b/packages/flutter/test/material/calendar_date_picker_test.dart index 7caae93b9a7..98b95e8c427 100644 --- a/packages/flutter/test/material/calendar_date_picker_test.dart +++ b/packages/flutter/test/material/calendar_date_picker_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'feedback_tester.dart'; @@ -77,7 +76,7 @@ void main() { } group('CalendarDatePicker', () { - testWidgetsWithLeakTracking('Can select a day', (WidgetTester tester) async { + testWidgets('Can select a day', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -87,7 +86,7 @@ void main() { expect(selectedDate, equals(DateTime(2016, DateTime.january, 12))); }); - testWidgetsWithLeakTracking('Can select a day with nothing first selected', (WidgetTester tester) async { + testWidgets('Can select a day with nothing first selected', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( onDateChanged: (DateTime date) => selectedDate = date, @@ -96,7 +95,7 @@ void main() { expect(selectedDate, equals(DateTime(2016, DateTime.january, 12))); }); - testWidgetsWithLeakTracking('Can select a month', (WidgetTester tester) async { + testWidgets('Can select a month', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -121,7 +120,7 @@ void main() { expect(displayedMonth, equals(DateTime(2015, DateTime.december))); }); - testWidgetsWithLeakTracking('Can select a month with nothing first selected', (WidgetTester tester) async { + testWidgets('Can select a month with nothing first selected', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( onDisplayedMonthChanged: (DateTime date) => displayedMonth = date, @@ -145,7 +144,7 @@ void main() { expect(displayedMonth, equals(DateTime(2015, DateTime.december))); }); - testWidgetsWithLeakTracking('Can select a year', (WidgetTester tester) async { + testWidgets('Can select a year', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -160,7 +159,7 @@ void main() { expect(displayedMonth, equals(DateTime(2018))); }); - testWidgetsWithLeakTracking('Can select a year with nothing first selected', (WidgetTester tester) async { + testWidgets('Can select a year with nothing first selected', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( onDisplayedMonthChanged: (DateTime date) => displayedMonth = date, @@ -174,7 +173,7 @@ void main() { expect(displayedMonth, equals(DateTime(2018))); }); - testWidgetsWithLeakTracking('Selecting date does not change displayed month', (WidgetTester tester) async { + testWidgets('Selecting date does not change displayed month', (WidgetTester tester) async { DateTime? selectedDate; DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( @@ -197,7 +196,7 @@ void main() { expect(find.text('31'), findsNothing); }); - testWidgetsWithLeakTracking('Changing year does change selected date', (WidgetTester tester) async { + testWidgets('Changing year does change selected date', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -212,7 +211,7 @@ void main() { expect(selectedDate, equals(DateTime(2018, DateTime.january, 4))); }); - testWidgetsWithLeakTracking('Changing year for february 29th', (WidgetTester tester) async { + testWidgets('Changing year for february 29th', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2020, DateTime.february, 29), @@ -231,7 +230,7 @@ void main() { expect(selectedDate, equals(DateTime(2020, DateTime.february, 28))); }); - testWidgetsWithLeakTracking('Changing year does not change the month', (WidgetTester tester) async { + testWidgets('Changing year does not change the month', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -249,7 +248,7 @@ void main() { expect(displayedMonth, equals(DateTime(2018, DateTime.march))); }); - testWidgetsWithLeakTracking('Can select a year and then a day', (WidgetTester tester) async { + testWidgets('Can select a year and then a day', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -263,7 +262,7 @@ void main() { expect(selectedDate, equals(DateTime(2017, DateTime.january, 19))); }); - testWidgetsWithLeakTracking('Cannot select a day outside bounds', (WidgetTester tester) async { + testWidgets('Cannot select a day outside bounds', (WidgetTester tester) async { final DateTime validDate = DateTime(2017, DateTime.january, 15); DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( @@ -286,7 +285,7 @@ void main() { expect(selectedDate, validDate); }); - testWidgetsWithLeakTracking('Cannot navigate to a month outside bounds', (WidgetTester tester) async { + testWidgets('Cannot navigate to a month outside bounds', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( firstDate: DateTime(2016, DateTime.december, 15), @@ -310,7 +309,7 @@ void main() { expect(previousMonthIcon, findsNothing); }); - testWidgetsWithLeakTracking('Cannot select disabled year', (WidgetTester tester) async { + testWidgets('Cannot select disabled year', (WidgetTester tester) async { DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( firstDate: DateTime(2018, DateTime.june, 9), @@ -331,7 +330,7 @@ void main() { expect(displayedMonth, isNull); }); - testWidgetsWithLeakTracking('Selecting firstDate year respects firstDate', (WidgetTester tester) async { + testWidgets('Selecting firstDate year respects firstDate', (WidgetTester tester) async { DateTime? selectedDate; DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( @@ -351,7 +350,7 @@ void main() { expect(selectedDate, DateTime(2016, DateTime.june, 9)); }); - testWidgetsWithLeakTracking('Selecting lastDate year respects lastDate', (WidgetTester tester) async { + testWidgets('Selecting lastDate year respects lastDate', (WidgetTester tester) async { DateTime? selectedDate; DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( @@ -373,7 +372,7 @@ void main() { expect(selectedDate, DateTime(2019, DateTime.january, 4)); }); - testWidgetsWithLeakTracking('Selecting lastDate year respects lastDate', (WidgetTester tester) async { + testWidgets('Selecting lastDate year respects lastDate', (WidgetTester tester) async { DateTime? selectedDate; DateTime? displayedMonth; await tester.pumpWidget(calendarDatePicker( @@ -396,7 +395,7 @@ void main() { expect(selectedDate, DateTime(2019, DateTime.january, 4)); }); - testWidgetsWithLeakTracking('Only predicate days are selectable', (WidgetTester tester) async { + testWidgets('Only predicate days are selectable', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( firstDate: DateTime(2017, DateTime.january, 10), @@ -413,7 +412,7 @@ void main() { expect(selectedDate, DateTime(2017, DateTime.january, 10)); }); - testWidgetsWithLeakTracking('Can select initial calendar picker mode', (WidgetTester tester) async { + testWidgets('Can select initial calendar picker mode', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2014, DateTime.january, 15), initialCalendarMode: DatePickerMode.year, @@ -425,7 +424,7 @@ void main() { expect(find.text('January 2018'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - currentDate is highlighted', (WidgetTester tester) async { + testWidgets('Material2 - currentDate is highlighted', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( useMaterial3: false, initialDate: DateTime(2016, DateTime.january, 15), @@ -443,7 +442,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - currentDate is highlighted', (WidgetTester tester) async { + testWidgets('Material3 - currentDate is highlighted', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( useMaterial3: true, initialDate: DateTime(2016, DateTime.january, 15), @@ -461,7 +460,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - currentDate is highlighted even if it is disabled', (WidgetTester tester) async { + testWidgets('Material2 - currentDate is highlighted even if it is disabled', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( useMaterial3: false, firstDate: DateTime(2016, 1, 3), @@ -482,7 +481,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - currentDate is highlighted even if it is disabled', (WidgetTester tester) async { + testWidgets('Material3 - currentDate is highlighted even if it is disabled', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( useMaterial3: true, firstDate: DateTime(2016, 1, 3), @@ -503,7 +502,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Selecting date does not switch picker to year selection', (WidgetTester tester) async { + testWidgets('Selecting date does not switch picker to year selection', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2020, DateTime.may, 10), initialCalendarMode: DatePickerMode.year, @@ -517,7 +516,7 @@ void main() { expect(find.text('2017'), findsNothing); }); - testWidgetsWithLeakTracking('Selecting disabled date does not change current selection', (WidgetTester tester) async { + testWidgets('Selecting disabled date does not change current selection', (WidgetTester tester) async { DateTime day(int day) => DateTime(2020, DateTime.may, day); DateTime selection = day(2); @@ -542,7 +541,7 @@ void main() { }); for (final bool useMaterial3 in <bool>[false, true]) { - testWidgetsWithLeakTracking('Updates to initialDate parameter are not reflected in the state (useMaterial3=$useMaterial3)', (WidgetTester tester) async { + testWidgets('Updates to initialDate parameter are not reflected in the state (useMaterial3=$useMaterial3)', (WidgetTester tester) async { final Key pickerKey = UniqueKey(); final DateTime initialDate = DateTime(2020, 1, 21); final DateTime updatedDate = DateTime(1976, 2, 23); @@ -592,7 +591,7 @@ void main() { }); } - testWidgetsWithLeakTracking('Updates to initialCalendarMode parameter is not reflected in the state', (WidgetTester tester) async { + testWidgets('Updates to initialCalendarMode parameter is not reflected in the state', (WidgetTester tester) async { final Key pickerKey = UniqueKey(); await tester.pumpWidget(calendarDatePicker( @@ -619,7 +618,7 @@ void main() { expect(find.text('2016'), findsOneWidget); // 2016 in year grid }); - testWidgetsWithLeakTracking('Dragging more than half the width should not cause a jump', (WidgetTester tester) async { + testWidgets('Dragging more than half the width should not cause a jump', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), )); @@ -641,7 +640,7 @@ void main() { }); group('Keyboard navigation', () { - testWidgetsWithLeakTracking('Can toggle to year mode', (WidgetTester tester) async { + testWidgets('Can toggle to year mode', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), )); @@ -656,7 +655,7 @@ void main() { expect(find.text('January 2016'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can navigate next/previous months', (WidgetTester tester) async { + testWidgets('Can navigate next/previous months', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), )); @@ -685,7 +684,7 @@ void main() { expect(find.text('March 2016'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can navigate date grid with arrow keys', (WidgetTester tester) async { + testWidgets('Can navigate date grid with arrow keys', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -715,7 +714,7 @@ void main() { expect(selectedDate, DateTime(2016, DateTime.january, 18)); }); - testWidgetsWithLeakTracking('Navigating with arrow keys scrolls months', (WidgetTester tester) async { + testWidgets('Navigating with arrow keys scrolls months', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -756,7 +755,7 @@ void main() { expect(selectedDate, DateTime(2015, DateTime.november, 26)); }); - testWidgetsWithLeakTracking('RTL text direction reverses the horizontal arrow key navigation', (WidgetTester tester) async { + testWidgets('RTL text direction reverses the horizontal arrow key navigation', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), @@ -800,7 +799,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('Selecting date vibrates', (WidgetTester tester) async { + testWidgets('Selecting date vibrates', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), )); @@ -815,7 +814,7 @@ void main() { expect(feedback.hapticCount, 3); }); - testWidgetsWithLeakTracking('Tapping unselectable date does not vibrate', (WidgetTester tester) async { + testWidgets('Tapping unselectable date does not vibrate', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 10), selectableDayPredicate: (DateTime date) => date.day.isEven, @@ -831,7 +830,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('Changing modes and year vibrates', (WidgetTester tester) async { + testWidgets('Changing modes and year vibrates', (WidgetTester tester) async { await tester.pumpWidget(calendarDatePicker( initialDate: DateTime(2016, DateTime.january, 15), )); @@ -845,7 +844,7 @@ void main() { }); group('Semantics', () { - testWidgetsWithLeakTracking('day mode', (WidgetTester tester) async { + testWidgets('day mode', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); await tester.pumpWidget(calendarDatePicker( @@ -1061,7 +1060,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('calendar year mode', (WidgetTester tester) async { + testWidgets('calendar year mode', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); await tester.pumpWidget(calendarDatePicker( @@ -1091,12 +1090,12 @@ void main() { }); group('YearPicker', () { - testWidgetsWithLeakTracking('Current year is visible in year picker', (WidgetTester tester) async { + testWidgets('Current year is visible in year picker', (WidgetTester tester) async { await tester.pumpWidget(yearPicker()); expect(find.text('2016'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can select a year', (WidgetTester tester) async { + testWidgets('Can select a year', (WidgetTester tester) async { DateTime? selectedDate; await tester.pumpWidget(yearPicker( onChanged: (DateTime date) => selectedDate = date, @@ -1107,7 +1106,7 @@ void main() { expect(selectedDate, equals(DateTime(2018))); }); - testWidgetsWithLeakTracking('Cannot select disabled year', (WidgetTester tester) async { + testWidgets('Cannot select disabled year', (WidgetTester tester) async { DateTime? selectedYear; await tester.pumpWidget(yearPicker( firstDate: DateTime(2018, DateTime.june, 9), @@ -1126,7 +1125,7 @@ void main() { expect(selectedYear, equals(DateTime(2018, DateTime.july))); }); - testWidgetsWithLeakTracking('Selecting year with no selected month uses earliest month', (WidgetTester tester) async { + testWidgets('Selecting year with no selected month uses earliest month', (WidgetTester tester) async { DateTime? selectedYear; await tester.pumpWidget(yearPicker( firstDate: DateTime(2018, DateTime.june, 9), @@ -1145,7 +1144,7 @@ void main() { expect(selectedYear, equals(DateTime(2019, DateTime.june))); }); - testWidgetsWithLeakTracking('Selecting year with no selected month uses January', (WidgetTester tester) async { + testWidgets('Selecting year with no selected month uses January', (WidgetTester tester) async { DateTime? selectedYear; await tester.pumpWidget(yearPicker( firstDate: DateTime(2018, DateTime.june, 9), diff --git a/packages/flutter/test/material/card_test.dart b/packages/flutter/test/material/card_test.dart index 19606fc459d..64a9e456dc8 100644 --- a/packages/flutter/test/material/card_test.dart +++ b/packages/flutter/test/material/card_test.dart @@ -5,11 +5,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Material3 - Card defaults (Elevated card)', (WidgetTester tester) async { + testWidgets('Material3 - Card defaults (Elevated card)', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; await tester.pumpWidget(MaterialApp( @@ -33,7 +32,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material3 - Card.filled defaults', (WidgetTester tester) async { + testWidgets('Material3 - Card.filled defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; await tester.pumpWidget(MaterialApp( @@ -57,7 +56,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material3 - Card.outlined defaults', (WidgetTester tester) async { + testWidgets('Material3 - Card.outlined defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; await tester.pumpWidget(MaterialApp( @@ -82,7 +81,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Card can take semantic text from multiple children', (WidgetTester tester) async { + testWidgets('Card can take semantic text from multiple children', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -150,7 +149,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Card merges children when it is a semanticContainer', (WidgetTester tester) async { + testWidgets('Card merges children when it is a semanticContainer', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); debugResetSemanticsIdCounter(); @@ -189,7 +188,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Card margin', (WidgetTester tester) async { + testWidgets('Card margin', (WidgetTester tester) async { const Key contentsKey = ValueKey<String>('contents'); await tester.pumpWidget( @@ -236,7 +235,7 @@ void main() { expect(tester.getSize(find.byKey(contentsKey)), const Size(100.0, 100.0)); }); - testWidgetsWithLeakTracking('Card clipBehavior property passes through to the Material', (WidgetTester tester) async { + testWidgets('Card clipBehavior property passes through to the Material', (WidgetTester tester) async { await tester.pumpWidget(const Card()); expect(tester.widget<Material>(find.byType(Material)).clipBehavior, Clip.none); @@ -244,7 +243,7 @@ void main() { expect(tester.widget<Material>(find.byType(Material)).clipBehavior, Clip.antiAlias); }); - testWidgetsWithLeakTracking('Card clipBehavior property defers to theme when null', (WidgetTester tester) async { + testWidgets('Card clipBehavior property defers to theme when null', (WidgetTester tester) async { await tester.pumpWidget(Builder(builder: (BuildContext context) { final ThemeData themeData = Theme.of(context); return Theme( @@ -259,7 +258,7 @@ void main() { expect(tester.widget<Material>(find.byType(Material)).clipBehavior, Clip.antiAliasWithSaveLayer); }); - testWidgetsWithLeakTracking('Card shadowColor', (WidgetTester tester) async { + testWidgets('Card shadowColor', (WidgetTester tester) async { Material getCardMaterial(WidgetTester tester) { return tester.widget<Material>( find.descendant( diff --git a/packages/flutter/test/material/card_theme_test.dart b/packages/flutter/test/material/card_theme_test.dart index f9ba9ce3fe5..2e22d13132a 100644 --- a/packages/flutter/test/material/card_theme_test.dart +++ b/packages/flutter/test/material/card_theme_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('CardTheme copyWith, ==, hashCode basics', () { @@ -23,7 +22,7 @@ void main() { expect(identical(CardTheme.lerp(theme, theme, 0.5), theme), true); }); - testWidgetsWithLeakTracking('Material3 - Passing no CardTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material3 - Passing no CardTheme returns defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( theme: theme, @@ -46,7 +45,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Card uses values from CardTheme', (WidgetTester tester) async { + testWidgets('Card uses values from CardTheme', (WidgetTester tester) async { final CardTheme cardTheme = _cardTheme(); await tester.pumpWidget(MaterialApp( @@ -68,7 +67,7 @@ void main() { expect(material.shape, cardTheme.shape); }); - testWidgetsWithLeakTracking('Card widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('Card widget properties take priority over theme', (WidgetTester tester) async { const Clip clip = Clip.hardEdge; const Color color = Colors.orange; const Color shadowColor = Colors.pink; @@ -103,7 +102,7 @@ void main() { expect(material.shape, shape); }); - testWidgetsWithLeakTracking('CardTheme properties take priority over ThemeData properties', (WidgetTester tester) async { + testWidgets('CardTheme properties take priority over ThemeData properties', (WidgetTester tester) async { final CardTheme cardTheme = _cardTheme(); final ThemeData themeData = _themeData().copyWith(cardTheme: cardTheme); @@ -118,7 +117,7 @@ void main() { expect(material.color, cardTheme.color); }); - testWidgetsWithLeakTracking('Material3 - ThemeData properties are used when no CardTheme is set', (WidgetTester tester) async { + testWidgets('Material3 - ThemeData properties are used when no CardTheme is set', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( @@ -132,7 +131,7 @@ void main() { expect(material.color, themeData.colorScheme.surface); }); - testWidgetsWithLeakTracking('Material3 - CardTheme customizes shape', (WidgetTester tester) async { + testWidgets('Material3 - CardTheme customizes shape', (WidgetTester tester) async { const CardTheme cardTheme = CardTheme( color: Colors.white, shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(7))), @@ -166,7 +165,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - ThemeData properties are used when no CardTheme is set', (WidgetTester tester) async { + testWidgets('Material2 - ThemeData properties are used when no CardTheme is set', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: false); await tester.pumpWidget(MaterialApp( @@ -180,7 +179,7 @@ void main() { expect(material.color, themeData.cardColor); }); - testWidgetsWithLeakTracking('Material2 - Passing no CardTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material2 - Passing no CardTheme returns defaults', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -202,7 +201,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Material2 - CardTheme customizes shape', (WidgetTester tester) async { + testWidgets('Material2 - CardTheme customizes shape', (WidgetTester tester) async { const CardTheme cardTheme = CardTheme( color: Colors.white, shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(7))), diff --git a/packages/flutter/test/material/checkbox_list_tile_test.dart b/packages/flutter/test/material/checkbox_list_tile_test.dart index 716f8d2708d..4d97163e4cf 100644 --- a/packages/flutter/test/material/checkbox_list_tile_test.dart +++ b/packages/flutter/test/material/checkbox_list_tile_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'feedback_tester.dart'; Widget wrap({ required Widget child }) { @@ -22,7 +21,7 @@ Widget wrap({ required Widget child }) { } void main() { - testWidgetsWithLeakTracking('CheckboxListTile control test', (WidgetTester tester) async { + testWidgets('CheckboxListTile control test', (WidgetTester tester) async { final List<dynamic> log = <dynamic>[]; await tester.pumpWidget(wrap( child: CheckboxListTile( @@ -37,7 +36,7 @@ void main() { expect(log, equals(<dynamic>[false, '-', false])); }); - testWidgetsWithLeakTracking('Material2 - CheckboxListTile checkColor test', (WidgetTester tester) async { + testWidgets('Material2 - CheckboxListTile checkColor test', (WidgetTester tester) async { const Color checkBoxBorderColor = Color(0xff2196f3); Color checkBoxCheckColor = const Color(0xffFFFFFF); @@ -69,7 +68,7 @@ void main() { expect(getCheckboxListTileRenderer(), paints..path(color: checkBoxBorderColor)..path(color: checkBoxCheckColor)); }); - testWidgetsWithLeakTracking('Material3 - CheckboxListTile checkColor test', (WidgetTester tester) async { + testWidgets('Material3 - CheckboxListTile checkColor test', (WidgetTester tester) async { const Color checkBoxBorderColor = Color(0xff6750a4); Color checkBoxCheckColor = const Color(0xffFFFFFF); @@ -101,7 +100,7 @@ void main() { expect(getCheckboxListTileRenderer(), paints..path(color: checkBoxBorderColor)..path(color: checkBoxCheckColor)); }); - testWidgetsWithLeakTracking('CheckboxListTile activeColor test', (WidgetTester tester) async { + testWidgets('CheckboxListTile activeColor test', (WidgetTester tester) async { Widget buildFrame(Color? themeColor, Color? activeColor) { return wrap( child: Theme( @@ -133,7 +132,7 @@ void main() { expect(getCheckboxListTileRenderer(), paints..path(color: const Color(0xFFFFFFFF))); }); - testWidgetsWithLeakTracking('CheckboxListTile can autofocus unless disabled.', (WidgetTester tester) async { + testWidgets('CheckboxListTile can autofocus unless disabled.', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( @@ -165,7 +164,7 @@ void main() { expect(Focus.maybeOf(childKey.currentContext!)!.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('CheckboxListTile contentPadding test', (WidgetTester tester) async { + testWidgets('CheckboxListTile contentPadding test', (WidgetTester tester) async { await tester.pumpWidget( wrap( child: const Center( @@ -195,7 +194,7 @@ void main() { expect(paddingRect.bottom, tallerWidget.bottom + remainingHeight / 2 + 2); }); - testWidgetsWithLeakTracking('CheckboxListTile tristate test', (WidgetTester tester) async { + testWidgets('CheckboxListTile tristate test', (WidgetTester tester) async { bool? value = false; bool tristate = false; @@ -273,7 +272,7 @@ void main() { expect(value, false); }); - testWidgetsWithLeakTracking('CheckboxListTile respects shape', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects shape', (WidgetTester tester) async { const ShapeBorder shapeBorder = RoundedRectangleBorder( borderRadius: BorderRadius.horizontal(right: Radius.circular(100)), ); @@ -290,7 +289,7 @@ void main() { expect(tester.widget<InkWell>(find.byType(InkWell)).customBorder, shapeBorder); }); - testWidgetsWithLeakTracking('CheckboxListTile respects tileColor', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects tileColor', (WidgetTester tester) async { final Color tileColor = Colors.red.shade500; await tester.pumpWidget( @@ -309,7 +308,7 @@ void main() { expect(find.byType(Material), paints..rect(color: tileColor)); }); - testWidgetsWithLeakTracking('CheckboxListTile respects selectedTileColor', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects selectedTileColor', (WidgetTester tester) async { final Color selectedTileColor = Colors.green.shade500; await tester.pumpWidget( @@ -329,7 +328,7 @@ void main() { expect(find.byType(Material), paints..rect(color: selectedTileColor)); }); - testWidgetsWithLeakTracking('CheckboxListTile selected item text Color', (WidgetTester tester) async { + testWidgets('CheckboxListTile selected item text Color', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/76908 const Color activeColor = Color(0xff00ff00); @@ -368,7 +367,7 @@ void main() { expect(textColor('title'), activeColor); }); - testWidgetsWithLeakTracking('CheckboxListTile respects checkbox shape and side', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects checkbox shape and side', (WidgetTester tester) async { Widget buildApp(BorderSide side, OutlinedBorder shape) { return MaterialApp( home: Material( @@ -422,7 +421,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CheckboxListTile respects visualDensity', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects visualDensity', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(VisualDensity visualDensity) async { return tester.pumpWidget( @@ -446,7 +445,7 @@ void main() { expect(box.size, equals(const Size(800, 56))); }); - testWidgetsWithLeakTracking('CheckboxListTile respects focusNode', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects focusNode', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( wrap( @@ -468,7 +467,7 @@ void main() { expect(tileNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('CheckboxListTile onFocusChange callback', (WidgetTester tester) async { + testWidgets('CheckboxListTile onFocusChange callback', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'CheckboxListTile onFocusChange'); bool gotFocus = false; await tester.pumpWidget( @@ -499,7 +498,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('CheckboxListTile can be disabled', (WidgetTester tester) async { + testWidgets('CheckboxListTile can be disabled', (WidgetTester tester) async { bool? value = false; bool enabled = true; @@ -540,7 +539,7 @@ void main() { expect(tester.widget<Checkbox>(checkbox).value, true); }); - testWidgetsWithLeakTracking('CheckboxListTile respects mouseCursor when hovered', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects mouseCursor when hovered', (WidgetTester tester) async { // Test Checkbox() constructor await tester.pumpWidget( wrap( @@ -611,7 +610,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('CheckboxListTile respects fillColor in enabled/disabled states', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects fillColor in enabled/disabled states', (WidgetTester tester) async { const Color activeEnabledFillColor = Color(0xFF000001); const Color activeDisabledFillColor = Color(0xFF000002); @@ -647,7 +646,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: activeDisabledFillColor)); }); - testWidgetsWithLeakTracking('CheckboxListTile respects fillColor in hovered state', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects fillColor in hovered state', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredFillColor = Color(0xFF000001); @@ -691,7 +690,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: hoveredFillColor)); }); - testWidgetsWithLeakTracking('CheckboxListTile respects hoverColor', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects hoverColor', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp({bool enabled = true}) { @@ -743,7 +742,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - CheckboxListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('Material2 - CheckboxListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color fillColor = Color(0xFF000000); @@ -866,7 +865,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Material3 - CheckboxListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('Material3 - CheckboxListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color fillColor = Color(0xFF000000); @@ -996,7 +995,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('CheckboxListTile respects splashRadius', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects splashRadius', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double splashRadius = 30; Widget buildApp() { @@ -1025,7 +1024,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CheckboxListTile respects materialTapTargetSize', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects materialTapTargetSize', (WidgetTester tester) async { await tester.pumpWidget( wrap( child: CheckboxListTile( @@ -1051,7 +1050,7 @@ void main() { expect(tester.getSize(find.byType(Checkbox)), const Size(48.0, 48.0)); }); - testWidgetsWithLeakTracking('Material3 - CheckboxListTile respects isError', (WidgetTester tester) async { + testWidgets('Material3 - CheckboxListTile respects isError', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; @@ -1099,7 +1098,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CheckboxListTile.adaptive shows the correct checkbox platform widget', (WidgetTester tester) async { + testWidgets('CheckboxListTile.adaptive shows the correct checkbox platform widget', (WidgetTester tester) async { Widget buildApp(TargetPlatform platform) { return MaterialApp( theme: ThemeData(platform: platform), @@ -1142,7 +1141,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('CheckboxListTile respects enableFeedback', (WidgetTester tester) async { + testWidgets('CheckboxListTile respects enableFeedback', (WidgetTester tester) async { Future<void> buildTest(bool enableFeedback) async { return tester.pumpWidget( wrap( @@ -1171,7 +1170,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('CheckboxListTile has proper semantics', (WidgetTester tester) async { + testWidgets('CheckboxListTile has proper semantics', (WidgetTester tester) async { final List<dynamic> log = <dynamic>[]; final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(wrap( diff --git a/packages/flutter/test/material/checkbox_test.dart b/packages/flutter/test/material/checkbox_test.dart index d0542f4b533..74f89a0a675 100644 --- a/packages/flutter/test/material/checkbox_test.dart +++ b/packages/flutter/test/material/checkbox_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/src/gestures/constants.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -21,7 +20,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('Checkbox size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Checkbox size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme.copyWith(materialTapTargetSize: MaterialTapTargetSize.padded), @@ -61,7 +60,7 @@ void main() { expect(tester.getSize(find.byType(Checkbox)), const Size(40.0, 40.0)); }); - testWidgetsWithLeakTracking('Checkbox semantics', (WidgetTester tester) async { + testWidgets('Checkbox semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(Theme( @@ -219,7 +218,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Can wrap Checkbox with Semantics', (WidgetTester tester) async { + testWidgets('Can wrap Checkbox with Semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(Theme( @@ -248,7 +247,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Checkbox tristate: true', (WidgetTester tester) async { + testWidgets('Checkbox tristate: true', (WidgetTester tester) async { bool? checkBoxValue; await tester.pumpWidget( @@ -295,7 +294,7 @@ void main() { expect(checkBoxValue, null); }); - testWidgetsWithLeakTracking('has semantics for tristate', (WidgetTester tester) async { + testWidgets('has semantics for tristate', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Theme( @@ -371,7 +370,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('has semantic events', (WidgetTester tester) async { + testWidgets('has semantic events', (WidgetTester tester) async { dynamic semanticEvent; bool? checkboxValue = false; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { @@ -414,7 +413,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Checkbox tristate rendering, programmatic transitions', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox tristate rendering, programmatic transitions', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); Widget buildFrame(bool? checkboxValue) { return Theme( @@ -474,7 +473,7 @@ void main() { expect(getCheckboxRenderer(), paints..line()); // null is rendered as a line (a "dash") }); - testWidgetsWithLeakTracking('Material3 - Checkbox tristate rendering, programmatic transitions', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox tristate rendering, programmatic transitions', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); Widget buildFrame(bool? checkboxValue) { return Theme( @@ -534,7 +533,7 @@ void main() { expect(getCheckboxRenderer(), paints..line()); // null is rendered as a line (a "dash") }); - testWidgetsWithLeakTracking('Material2 - Checkbox color rendering', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox color rendering', (WidgetTester tester) async { ThemeData theme = ThemeData(useMaterial3: false); const Color borderColor = Color(0xff2196f3); Color checkColor = const Color(0xffFFFFFF); @@ -589,7 +588,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: activeColor)); }); - testWidgetsWithLeakTracking('Material3 - Checkbox color rendering', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox color rendering', (WidgetTester tester) async { ThemeData theme = ThemeData(useMaterial3: true); const Color borderColor = Color(0xFF6750A4); Color checkColor = const Color(0xffFFFFFF); @@ -642,7 +641,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: activeColor)); }); - testWidgetsWithLeakTracking('Material2 - Checkbox is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -713,7 +712,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Checkbox is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); final ThemeData theme = ThemeData(useMaterial3: true); @@ -785,7 +784,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Checkbox with splash radius set', (WidgetTester tester) async { + testWidgets('Checkbox with splash radius set', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double splashRadius = 30; Widget buildApp() { @@ -814,7 +813,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Checkbox starts the splash in center, even when tap is on the corner', (WidgetTester tester) async { + testWidgets('Checkbox starts the splash in center, even when tap is on the corner', (WidgetTester tester) async { Widget buildApp() { return MaterialApp( theme: theme, @@ -850,7 +849,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Material2 - Checkbox can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; final ThemeData theme = ThemeData(useMaterial3: false); @@ -907,7 +906,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Checkbox can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; final ThemeData theme = ThemeData(useMaterial3: true); @@ -964,7 +963,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Checkbox can be toggled by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('Checkbox can be toggled by keyboard shortcuts', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp({bool enabled = true}) { @@ -1005,7 +1004,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('Checkbox responds to density changes.', (WidgetTester tester) async { + testWidgets('Checkbox responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(VisualDensity visualDensity) async { return tester.pumpWidget( @@ -1043,7 +1042,7 @@ void main() { expect(box.size, equals(const Size(60, 36))); }); - testWidgetsWithLeakTracking('Checkbox stops hover animation when removed from the tree.', (WidgetTester tester) async { + testWidgets('Checkbox stops hover animation when removed from the tree.', (WidgetTester tester) async { const Key checkboxKey = Key('checkbox'); bool? checkboxVal = true; @@ -1097,7 +1096,7 @@ void main() { }); - testWidgetsWithLeakTracking('Checkbox changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Checkbox changes mouse cursor when hovered', (WidgetTester tester) async { // Test Checkbox() constructor await tester.pumpWidget( MaterialApp( @@ -1202,7 +1201,7 @@ void main() { }); - testWidgetsWithLeakTracking('Checkbox fill color resolves in enabled/disabled states', (WidgetTester tester) async { + testWidgets('Checkbox fill color resolves in enabled/disabled states', (WidgetTester tester) async { const Color activeEnabledFillColor = Color(0xFF000001); const Color activeDisabledFillColor = Color(0xFF000002); @@ -1246,7 +1245,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: activeDisabledFillColor)); }); - testWidgetsWithLeakTracking('Checkbox fill color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Checkbox fill color resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'checkbox'); addTearDown(focusNode.dispose); @@ -1304,7 +1303,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: hoveredFillColor)); }); - testWidgetsWithLeakTracking('Checkbox respects shape and side', (WidgetTester tester) async { + testWidgets('Checkbox respects shape and side', (WidgetTester tester) async { const RoundedRectangleBorder roundedRectangleBorder = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))); @@ -1347,7 +1346,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Checkbox default overlay color in active/pressed/focused/hovered states', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox default overlay color in active/pressed/focused/hovered states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1420,7 +1419,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Material3 - Checkbox default overlay color in active/pressed/focused/hovered states', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox default overlay color in active/pressed/focused/hovered states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1491,7 +1490,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Checkbox overlay color resolves in active/pressed/focused/hovered states', (WidgetTester tester) async { + testWidgets('Checkbox overlay color resolves in active/pressed/focused/hovered states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1635,7 +1634,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Tristate Checkbox overlay color resolves in pressed active/inactive states', (WidgetTester tester) async { + testWidgets('Tristate Checkbox overlay color resolves in pressed active/inactive states', (WidgetTester tester) async { const Color activePressedOverlayColor = Color(0xFF000001); const Color inactivePressedOverlayColor = Color(0xFF000002); @@ -1742,7 +1741,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { + testWidgets('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { Widget buildCheckbox(bool show) { return MaterialApp( theme: theme, @@ -1766,7 +1765,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Checkbox BorderSide side only applies when unselected in M2', (WidgetTester tester) async { + testWidgets('Checkbox BorderSide side only applies when unselected in M2', (WidgetTester tester) async { const Color borderColor = Color(0xfff44336); const Color activeColor = Color(0xff123456); const BorderSide side = BorderSide( @@ -1830,7 +1829,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: activeColor)); // checkbox fill }); - testWidgetsWithLeakTracking('Material2 - Checkbox MaterialStateBorderSide applies unconditionally', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox MaterialStateBorderSide applies unconditionally', (WidgetTester tester) async { const Color borderColor = Color(0xfff44336); const BorderSide side = BorderSide( width: 4, @@ -1884,7 +1883,7 @@ void main() { expectBorder(); }); - testWidgetsWithLeakTracking('Material3 - Checkbox MaterialStateBorderSide applies unconditionally', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox MaterialStateBorderSide applies unconditionally', (WidgetTester tester) async { const Color borderColor = Color(0xfff44336); const BorderSide side = BorderSide( width: 4, @@ -1938,7 +1937,7 @@ void main() { expectBorder(); }); - testWidgetsWithLeakTracking('disabled checkbox shows tooltip', (WidgetTester tester) async { + testWidgets('disabled checkbox shows tooltip', (WidgetTester tester) async { const String longPressTooltip = 'long press tooltip'; const String tapTooltip = 'tap tooltip'; await tester.pumpWidget( @@ -1992,7 +1991,7 @@ void main() { expect(find.text(tapTooltip), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - Checkbox has default error color when isError is set to true', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox has default error color when isError is set to true', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); final ThemeData themeData = ThemeData(useMaterial3: true); @@ -2065,7 +2064,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('Material3 - Checkbox MaterialStateBorderSide applies in error states', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox MaterialStateBorderSide applies in error states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); final ThemeData themeData = ThemeData(useMaterial3: true); @@ -2145,7 +2144,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('Material3 - Checkbox has correct default shape', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox has correct default shape', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); Widget buildApp() { @@ -2179,7 +2178,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Checkbox.adaptive shows the correct platform widget', (WidgetTester tester) async { + testWidgets('Checkbox.adaptive shows the correct platform widget', (WidgetTester tester) async { Widget buildApp(TargetPlatform platform) { return MaterialApp( theme: ThemeData(platform: platform), @@ -2211,7 +2210,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material2 - Checkbox respects fillColor when it is unchecked', (WidgetTester tester) async { + testWidgets('Material2 - Checkbox respects fillColor when it is unchecked', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); const Color activeBackgroundColor = Color(0xff123456); const Color inactiveBackgroundColor = Color(0xff654321); @@ -2264,7 +2263,7 @@ void main() { expect(getCheckboxRenderer(), paints..path(color: inactiveBackgroundColor)); }); - testWidgetsWithLeakTracking('Material3 - Checkbox respects fillColor when it is unchecked', (WidgetTester tester) async { + testWidgets('Material3 - Checkbox respects fillColor when it is unchecked', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const Color activeBackgroundColor = Color(0xff123456); const Color inactiveBackgroundColor = Color(0xff654321); diff --git a/packages/flutter/test/material/checkbox_theme_test.dart b/packages/flutter/test/material/checkbox_theme_test.dart index 6d2e6a6b41d..f0da2458971 100644 --- a/packages/flutter/test/material/checkbox_theme_test.dart +++ b/packages/flutter/test/material/checkbox_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('CheckboxThemeData copyWith, ==, hashCode basics', () { @@ -40,7 +39,7 @@ void main() { expect(theme.data.visualDensity, null); }); - testWidgetsWithLeakTracking('Default CheckboxThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default CheckboxThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const CheckboxThemeData().debugFillProperties(builder); @@ -52,7 +51,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('CheckboxThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('CheckboxThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const CheckboxThemeData( mouseCursor: MaterialStatePropertyAll<MouseCursor?>(SystemMouseCursors.click), @@ -83,7 +82,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Checkbox is themeable', (WidgetTester tester) async { + testWidgets('Checkbox is themeable', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const MouseCursor mouseCursor = SystemMouseCursors.text; @@ -165,7 +164,7 @@ void main() { expect(_getCheckboxMaterial(tester), paints..path(color: selectedFillColor)..path(color: focusedCheckColor)); }); - testWidgetsWithLeakTracking('Checkbox properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('Checkbox properties are taken over the theme values', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const MouseCursor themeMouseCursor = SystemMouseCursors.click; @@ -263,7 +262,7 @@ void main() { expect(_getCheckboxMaterial(tester), paints..circle(color: focusColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Checkbox activeColor property is taken over the theme', (WidgetTester tester) async { + testWidgets('Checkbox activeColor property is taken over the theme', (WidgetTester tester) async { const Color themeSelectedFillColor = Color(0xfffffff1); const Color themeDefaultFillColor = Color(0xfffffff0); const Color selectedFillColor = Color(0xfffffff6); @@ -301,7 +300,7 @@ void main() { expect(_getCheckboxMaterial(tester), paints..path(color: selectedFillColor)); }); - testWidgetsWithLeakTracking('Checkbox theme overlay color resolves in active/pressed states', (WidgetTester tester) async { + testWidgets('Checkbox theme overlay color resolves in active/pressed states', (WidgetTester tester) async { const Color activePressedOverlayColor = Color(0xFF000001); const Color inactivePressedOverlayColor = Color(0xFF000002); @@ -367,7 +366,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Local CheckboxTheme can override global CheckboxTheme', (WidgetTester tester) async { + testWidgets('Local CheckboxTheme can override global CheckboxTheme', (WidgetTester tester) async { const Color globalThemeFillColor = Color(0xfffffff1); const Color globalThemeCheckColor = Color(0xff000000); const Color localThemeFillColor = Color(0xffff0000); diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index d263ee8c1e6..41abf4bc317 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -12,7 +12,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -220,7 +219,7 @@ Finder findTooltipContainer(String tooltipText) { } void main() { - testWidgetsWithLeakTracking('M2 Chip defaults', (WidgetTester tester) async { + testWidgets('M2 Chip defaults', (WidgetTester tester) async { late TextTheme textTheme; Widget buildFrame(Brightness brightness) { @@ -297,7 +296,7 @@ void main() { expect(labelStyle.wordSpacing, textTheme.bodyLarge?.wordSpacing); }); - testWidgetsWithLeakTracking('M3 Chip defaults', (WidgetTester tester) async { + testWidgets('M3 Chip defaults', (WidgetTester tester) async { late TextTheme textTheme; final ThemeData lightTheme = ThemeData.light(useMaterial3: true); final ThemeData darkTheme = ThemeData.dark(useMaterial3: true); @@ -378,7 +377,7 @@ void main() { expect(labelStyle.wordSpacing, textTheme.labelLarge?.wordSpacing); }); - testWidgetsWithLeakTracking('Chip control test', (WidgetTester tester) async { + testWidgets('Chip control test', (WidgetTester tester) async { final FeedbackTester feedback = FeedbackTester(); final List<String> deletedChipLabels = <String>[]; await tester.pumpWidget( @@ -427,7 +426,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'Chip does not constrain size of label widget if it does not exceed ' 'the available space', (WidgetTester tester) async { @@ -463,7 +462,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Chip constrains the size of the label widget when it exceeds the ' 'available space', (WidgetTester tester) async { @@ -471,7 +470,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Chip constrains the size of the label widget when it exceeds the ' 'available space and the avatar is present', (WidgetTester tester) async { @@ -482,7 +481,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Chip constrains the size of the label widget when it exceeds the ' 'available space and the delete icon is present', (WidgetTester tester) async { @@ -493,7 +492,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Chip constrains the size of the label widget when it exceeds the ' 'available space and both avatar and delete icons are present', (WidgetTester tester) async { @@ -505,7 +504,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Chip constrains the avatar, label, and delete icons to the bounds of ' 'the chip when it exceeds the available space', (WidgetTester tester) async { @@ -580,7 +579,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Chip in row works ok', (WidgetTester tester) async { + testWidgets('Chip in row works ok', (WidgetTester tester) async { const TextStyle style = TextStyle(fontSize: 10.0); await tester.pumpWidget( wrapForChip( @@ -618,7 +617,7 @@ void main() { expect(tester.getSize(find.byType(Chip)), const Size(800.0, 48.0)); }); - testWidgetsWithLeakTracking('Chip responds to materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Chip responds to materialTapTargetSize', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( useMaterial3: false, @@ -641,7 +640,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Delete button tap target is the right proportion of the chip', (WidgetTester tester) async { + testWidgets('Delete button tap target is the right proportion of the chip', (WidgetTester tester) async { final UniqueKey deleteKey = UniqueKey(); bool calledDelete = false; await tester.pumpWidget( @@ -703,7 +702,7 @@ void main() { expect(calledDelete, isFalse); }); - testWidgetsWithLeakTracking('Chip elements are ordered horizontally for locale', (WidgetTester tester) async { + testWidgets('Chip elements are ordered horizontally for locale', (WidgetTester tester) async { final UniqueKey iconKey = UniqueKey(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -740,7 +739,7 @@ void main() { expect(tester.getCenter(find.text('ABC')).dx, lessThan(tester.getCenter(find.byKey(iconKey)).dx)); }); - testWidgetsWithLeakTracking('Chip responds to textScaleFactor', (WidgetTester tester) async { + testWidgets('Chip responds to textScaleFactor', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( useMaterial3: false, @@ -817,7 +816,7 @@ void main() { expect(tester.getSize(find.byType(Chip).last), const Size(132.0, 48.0)); }); - testWidgetsWithLeakTracking('Labels can be non-text widgets', (WidgetTester tester) async { + testWidgets('Labels can be non-text widgets', (WidgetTester tester) async { final Key keyA = GlobalKey(); final Key keyB = GlobalKey(); await tester.pumpWidget( @@ -844,7 +843,7 @@ void main() { expect(tester.getSize(find.byType(Chip).last), const Size(58.0, 48.0)); }); - testWidgetsWithLeakTracking('Avatars can be non-circle avatar widgets', (WidgetTester tester) async { + testWidgets('Avatars can be non-circle avatar widgets', (WidgetTester tester) async { final Key keyA = GlobalKey(); await tester.pumpWidget( wrapForChip( @@ -862,7 +861,7 @@ void main() { expect(tester.getSize(find.byKey(keyA)), equals(const Size(20.0, 20.0))); }); - testWidgetsWithLeakTracking('Delete icons can be non-icon widgets', (WidgetTester tester) async { + testWidgets('Delete icons can be non-icon widgets', (WidgetTester tester) async { final Key keyA = GlobalKey(); await tester.pumpWidget( wrapForChip( @@ -881,7 +880,7 @@ void main() { expect(tester.getSize(find.byKey(keyA)), equals(const Size(20.0, 20.0))); }); - testWidgetsWithLeakTracking('Chip padding - LTR', (WidgetTester tester) async { + testWidgets('Chip padding - LTR', (WidgetTester tester) async { final GlobalKey keyA = GlobalKey(); final GlobalKey keyB = GlobalKey(); @@ -920,7 +919,7 @@ void main() { expect(tester.getBottomRight(find.byType(Icon)), const Offset(457.0, 309.0)); }); - testWidgetsWithLeakTracking('Chip padding - RTL', (WidgetTester tester) async { + testWidgets('Chip padding - RTL', (WidgetTester tester) async { final GlobalKey keyA = GlobalKey(); final GlobalKey keyB = GlobalKey(); @@ -962,7 +961,7 @@ void main() { expect(tester.getBottomRight(find.byType(Icon)), const Offset(361.0, 309.0)); }); - testWidgetsWithLeakTracking('Avatar drawer works as expected on RawChip', (WidgetTester tester) async { + testWidgets('Avatar drawer works as expected on RawChip', (WidgetTester tester) async { final GlobalKey labelKey = GlobalKey(); Future<void> pushChip({ Widget? avatar }) async { return tester.pumpWidget( @@ -1075,7 +1074,7 @@ void main() { expect(find.byKey(avatarKey), findsNothing); }); - testWidgetsWithLeakTracking('Delete button drawer works as expected on RawChip', (WidgetTester tester) async { + testWidgets('Delete button drawer works as expected on RawChip', (WidgetTester tester) async { const Key labelKey = Key('label'); const Key deleteButtonKey = Key('delete'); bool wasDeleted = false; @@ -1192,7 +1191,7 @@ void main() { expect(find.byKey(deleteButtonKey), findsNothing); }); - testWidgetsWithLeakTracking('Delete button takes up at most half of the chip', (WidgetTester tester) async { + testWidgets('Delete button takes up at most half of the chip', (WidgetTester tester) async { final UniqueKey chipKey = UniqueKey(); bool chipPressed = false; bool deletePressed = false; @@ -1228,7 +1227,7 @@ void main() { expect(deletePressed, isTrue); }); - testWidgetsWithLeakTracking('Chip creates centered, unique ripple when label is tapped', (WidgetTester tester) async { + testWidgets('Chip creates centered, unique ripple when label is tapped', (WidgetTester tester) async { final UniqueKey labelKey = UniqueKey(); final UniqueKey deleteButtonKey = UniqueKey(); @@ -1278,7 +1277,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Delete button is focusable', (WidgetTester tester) async { + testWidgets('Delete button is focusable', (WidgetTester tester) async { final GlobalKey labelKey = GlobalKey(); final GlobalKey deleteButtonKey = GlobalKey(); @@ -1311,7 +1310,7 @@ void main() { expect(Focus.of(labelKey.currentContext!).hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Delete button creates non-centered, unique ripple when tapped', (WidgetTester tester) async { + testWidgets('Delete button creates non-centered, unique ripple when tapped', (WidgetTester tester) async { final UniqueKey labelKey = UniqueKey(); final UniqueKey deleteButtonKey = UniqueKey(); @@ -1365,7 +1364,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Delete button in a chip with null onPressed creates ripple when tapped', (WidgetTester tester) async { + testWidgets('Delete button in a chip with null onPressed creates ripple when tapped', (WidgetTester tester) async { final UniqueKey labelKey = UniqueKey(); final UniqueKey deleteButtonKey = UniqueKey(); @@ -1420,7 +1419,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('RTL delete button responds to tap on the left of the chip', (WidgetTester tester) async { + testWidgets('RTL delete button responds to tap on the left of the chip', (WidgetTester tester) async { // Creates an RTL chip with a delete button. final UniqueKey labelKey = UniqueKey(); final UniqueKey deleteButtonKey = UniqueKey(); @@ -1450,7 +1449,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Chip without delete button creates correct ripple', (WidgetTester tester) async { + testWidgets('Chip without delete button creates correct ripple', (WidgetTester tester) async { // Creates a chip with a delete button. final UniqueKey labelKey = UniqueKey(); @@ -1505,7 +1504,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Selection with avatar works as expected on RawChip', (WidgetTester tester) async { + testWidgets('Selection with avatar works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = UniqueKey(); Future<void> pushChip({ Widget? avatar, bool selectable = false }) async { @@ -1586,7 +1585,7 @@ void main() { expect(getDeleteDrawerProgress(tester), equals(0.0)); }); - testWidgetsWithLeakTracking('Selection without avatar works as expected on RawChip', (WidgetTester tester) async { + testWidgets('Selection without avatar works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = UniqueKey(); Future<void> pushChip({ bool selectable = false }) async { @@ -1660,7 +1659,7 @@ void main() { expect(getDeleteDrawerProgress(tester), equals(0.0)); }); - testWidgetsWithLeakTracking('Activation works as expected on RawChip', (WidgetTester tester) async { + testWidgets('Activation works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = UniqueKey(); Future<void> pushChip({ Widget? avatar, bool selectable = false }) async { @@ -1717,7 +1716,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Chip uses ThemeData chip theme if present', (WidgetTester tester) async { + testWidgets('Chip uses ThemeData chip theme if present', (WidgetTester tester) async { final ThemeData theme = ThemeData( useMaterial3: false, platform: TargetPlatform.android, @@ -1748,7 +1747,7 @@ void main() { expect(materialBox, paints..rrect(color: chipTheme.disabledColor)); }); - testWidgetsWithLeakTracking('Chip merges ChipThemeData label style with the provided label style', (WidgetTester tester) async { + testWidgets('Chip merges ChipThemeData label style with the provided label style', (WidgetTester tester) async { // The font family should be preserved even if the chip overrides some label style properties final ThemeData theme = ThemeData( fontFamily: 'MyFont', @@ -1774,7 +1773,7 @@ void main() { expect(labelStyle.fontWeight, FontWeight.w200); }); - testWidgetsWithLeakTracking('ChipTheme labelStyle with inherit:true', (WidgetTester tester) async { + testWidgets('ChipTheme labelStyle with inherit:true', (WidgetTester tester) async { Widget buildChip() { return wrapForChip( child: Theme( @@ -1794,7 +1793,7 @@ void main() { expect(labelStyle.height, 4); }); - testWidgetsWithLeakTracking('Chip does not merge inherit:false label style with the theme label style', (WidgetTester tester) async { + testWidgets('Chip does not merge inherit:false label style with the theme label style', (WidgetTester tester) async { Widget buildChip() { return wrapForChip( child: Theme( @@ -1818,7 +1817,7 @@ void main() { expect(labelStyle.fontWeight, FontWeight.w200); }); - testWidgetsWithLeakTracking('Chip size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Chip size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { final Key key1 = UniqueKey(); await tester.pumpWidget( wrapForChip( @@ -1854,7 +1853,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(80.0, 32.0)); }); - testWidgetsWithLeakTracking('Chip uses the right theme colors for the right components', (WidgetTester tester) async { + testWidgets('Chip uses the right theme colors for the right components', (WidgetTester tester) async { final ThemeData themeData = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, @@ -1978,7 +1977,7 @@ void main() { }); group('Chip semantics', () { - testWidgetsWithLeakTracking('label only', (WidgetTester tester) async { + testWidgets('label only', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(const MaterialApp( @@ -2026,7 +2025,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('delete', (WidgetTester tester) async { + testWidgets('delete', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -2086,7 +2085,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('with onPressed', (WidgetTester tester) async { + testWidgets('with onPressed', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -2140,7 +2139,7 @@ void main() { }); - testWidgetsWithLeakTracking('with onSelected', (WidgetTester tester) async { + testWidgets('with onSelected', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); bool selected = false; @@ -2250,7 +2249,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('disabled', (WidgetTester tester) async { + testWidgets('disabled', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -2302,7 +2301,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('tapEnabled explicitly false', (WidgetTester tester) async { + testWidgets('tapEnabled explicitly false', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(const MaterialApp( @@ -2350,7 +2349,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('enabled when tapEnabled and canTap', (WidgetTester tester) async { + testWidgets('enabled when tapEnabled and canTap', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); // These settings make a Chip which can be tapped, both in general and at this moment. @@ -2404,7 +2403,7 @@ void main() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('disabled when tapEnabled but not canTap', (WidgetTester tester) async { + testWidgets('disabled when tapEnabled but not canTap', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); // These settings make a Chip which _could_ be tapped, but not currently (ensures `canTap == false`). await tester.pumpWidget(const MaterialApp( @@ -2454,7 +2453,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('can be tapped outside of chip delete icon', (WidgetTester tester) async { + testWidgets('can be tapped outside of chip delete icon', (WidgetTester tester) async { bool deleted = false; await tester.pumpWidget( wrapForChip( @@ -2480,7 +2479,7 @@ void main() { expect(deleted, true); }); - testWidgetsWithLeakTracking('Chips can be tapped', (WidgetTester tester) async { + testWidgets('Chips can be tapped', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -2495,7 +2494,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Chip elevation and shadow color work correctly', (WidgetTester tester) async { + testWidgets('Chip elevation and shadow color work correctly', (WidgetTester tester) async { final ThemeData theme = ThemeData( useMaterial3: false, platform: TargetPlatform.android, @@ -2546,7 +2545,7 @@ void main() { expect(material.shadowColor, Colors.blue); }); - testWidgetsWithLeakTracking('can be tapped outside of chip body', (WidgetTester tester) async { + testWidgets('can be tapped outside of chip body', (WidgetTester tester) async { bool pressed = false; await tester.pumpWidget( wrapForChip( @@ -2571,7 +2570,7 @@ void main() { expect(pressed, true); }); - testWidgetsWithLeakTracking('is hitTestable', (WidgetTester tester) async { + testWidgets('is hitTestable', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( child: InputChip( @@ -2592,7 +2591,7 @@ void main() { expect(materials.last.clipBehavior, clipBehavior); } - testWidgetsWithLeakTracking('Chip clipBehavior properly passes through to the Material', (WidgetTester tester) async { + testWidgets('Chip clipBehavior properly passes through to the Material', (WidgetTester tester) async { const Text label = Text('label'); await tester.pumpWidget(wrapForChip(child: const Chip(label: label))); checkChipMaterialClipBehavior(tester, Clip.none); @@ -2601,7 +2600,7 @@ void main() { checkChipMaterialClipBehavior(tester, Clip.antiAlias); }); - testWidgetsWithLeakTracking('selected chip and avatar draw darkened layer within avatar circle', (WidgetTester tester) async { + testWidgets('selected chip and avatar draw darkened layer within avatar circle', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( useMaterial3: false, @@ -2629,7 +2628,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('Chips should use InkWell instead of InkResponse.', (WidgetTester tester) async { + testWidgets('Chips should use InkWell instead of InkResponse.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28646 await tester.pumpWidget( MaterialApp( @@ -2644,7 +2643,7 @@ void main() { expect(find.byType(InkWell), findsOneWidget); }); - testWidgetsWithLeakTracking('Chip uses stateful color for text color in different states', (WidgetTester tester) async { + testWidgets('Chip uses stateful color for text color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2733,7 +2732,7 @@ void main() { expect(textColor(), disabledColor); }); - testWidgetsWithLeakTracking('Chip uses stateful border side color in different states', (WidgetTester tester) async { + testWidgets('Chip uses stateful border side color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2814,7 +2813,7 @@ void main() { expect(find.byType(RawChip), paints..rrect()..rrect(color: disabledColor)); }); - testWidgetsWithLeakTracking('Chip uses stateful border side color from resolveWith', (WidgetTester tester) async { + testWidgets('Chip uses stateful border side color from resolveWith', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2896,7 +2895,7 @@ void main() { }); - testWidgetsWithLeakTracking('Chip uses stateful nullable border side color from resolveWith', (WidgetTester tester) async { + testWidgets('Chip uses stateful nullable border side color from resolveWith', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2986,7 +2985,7 @@ void main() { expect(find.byType(RawChip), paints..rrect()..rrect(color: disabledColor)); }); - testWidgetsWithLeakTracking('Chip uses stateful shape in different states', (WidgetTester tester) async { + testWidgets('Chip uses stateful shape in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); OutlinedBorder? getShape(Set<MaterialState> states) { @@ -3058,7 +3057,7 @@ void main() { expect(getMaterial(tester).shape, isA<BeveledRectangleBorder>()); }); - testWidgetsWithLeakTracking('Chip defers to theme, if shape and side resolves to null', (WidgetTester tester) async { + testWidgets('Chip defers to theme, if shape and side resolves to null', (WidgetTester tester) async { const OutlinedBorder themeShape = StadiumBorder(); const OutlinedBorder selectedShape = RoundedRectangleBorder(); const BorderSide themeBorderSide = BorderSide(color: Color(0x00000001)); @@ -3110,7 +3109,7 @@ void main() { expect(find.byType(RawChip), paints..rect()..drrect(color: selectedBorderSide.color)); }); - testWidgetsWithLeakTracking('Chip responds to density changes.', (WidgetTester tester) async { + testWidgets('Chip responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key textKey = Key('test text'); const Key iconKey = Key('test icon'); @@ -3216,7 +3215,7 @@ void main() { expect(box.size, equals(const Size(128, 24.0 + 16.0))); }); - testWidgetsWithLeakTracking('Chip delete button tooltip is disabled if deleteButtonTooltipMessage is empty', (WidgetTester tester) async { + testWidgets('Chip delete button tooltip is disabled if deleteButtonTooltipMessage is empty', (WidgetTester tester) async { final UniqueKey deleteButtonKey = UniqueKey(); await tester.pumpWidget( chipWithOptionalDeleteButton( @@ -3241,7 +3240,7 @@ void main() { expect(findTooltipContainer(''), findsNothing); }); - testWidgetsWithLeakTracking('Disabling delete button tooltip does not disable chip tooltip', (WidgetTester tester) async { + testWidgets('Disabling delete button tooltip does not disable chip tooltip', (WidgetTester tester) async { final UniqueKey deleteButtonKey = UniqueKey(); await tester.pumpWidget( chipWithOptionalDeleteButton( @@ -3269,7 +3268,7 @@ void main() { expect(findTooltipContainer('Chip Tooltip'), findsOneWidget); }); - testWidgetsWithLeakTracking('Triggering delete button tooltip does not trigger Chip tooltip', (WidgetTester tester) async { + testWidgets('Triggering delete button tooltip does not trigger Chip tooltip', (WidgetTester tester) async { final UniqueKey deleteButtonKey = UniqueKey(); await tester.pumpWidget( chipWithOptionalDeleteButton( @@ -3296,7 +3295,7 @@ void main() { expect(findTooltipContainer('Delete'), findsOneWidget); }); - testWidgetsWithLeakTracking('intrinsicHeight implementation meets constraints', (WidgetTester tester) async { + testWidgets('intrinsicHeight implementation meets constraints', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/49478. await tester.pumpWidget(wrapForChip( child: const Chip( @@ -3308,7 +3307,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Chip background color and shape are drawn on Ink', (WidgetTester tester) async { + testWidgets('Chip background color and shape are drawn on Ink', (WidgetTester tester) async { const Color backgroundColor = Color(0xff00ff00); const OutlinedBorder shape = ContinuousRectangleBorder(); @@ -3330,7 +3329,7 @@ void main() { expect(decoration.shape, shape); }); - testWidgetsWithLeakTracking('Chip highlight color is drawn on top of the backgroundColor', (WidgetTester tester) async { + testWidgets('Chip highlight color is drawn on top of the backgroundColor', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'RawChip'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -3359,7 +3358,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RawChip.color resolves material states', (WidgetTester tester) async { + testWidgets('RawChip.color resolves material states', (WidgetTester tester) async { const Color disabledSelectedColor = Color(0xffffff00); const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); @@ -3415,7 +3414,7 @@ void main() { expect(getMaterialBox(tester), paints..rrect(color: disabledSelectedColor)); }); - testWidgetsWithLeakTracking('RawChip uses provided state color properties', (WidgetTester tester) async { + testWidgets('RawChip uses provided state color properties', (WidgetTester tester) async { const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); const Color selectedColor = Color(0xffff0000); @@ -3454,7 +3453,7 @@ void main() { expect(getMaterialBox(tester), paints..rrect(color: selectedColor)); }); - testWidgetsWithLeakTracking('Delete button tap target area does not include label', (WidgetTester tester) async { + testWidgets('Delete button tap target area does not include label', (WidgetTester tester) async { bool calledDelete = false; await tester.pumpWidget( wrapForChip( @@ -3497,7 +3496,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/pull/133615. - testWidgetsWithLeakTracking('Material3 - Custom shape without provided side uses default side', (WidgetTester tester) async { + testWidgets('Material3 - Custom shape without provided side uses default side', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -3521,7 +3520,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("Material3 - RawChip.shape's side is used when provided", (WidgetTester tester) async { + testWidgets("Material3 - RawChip.shape's side is used when provided", (WidgetTester tester) async { Widget buildChip({ OutlinedBorder? shape, BorderSide? side }) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -3575,7 +3574,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Chip.iconTheme respects default iconTheme.size', (WidgetTester tester) async { + testWidgets('Material3 - Chip.iconTheme respects default iconTheme.size', (WidgetTester tester) async { Widget buildChip({ IconThemeData? iconTheme }) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -3610,7 +3609,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/138287. - testWidgetsWithLeakTracking("Enabling and disabling Chip with Tooltip doesn't throw an exception", (WidgetTester tester) async { + testWidgets("Enabling and disabling Chip with Tooltip doesn't throw an exception", (WidgetTester tester) async { bool isEnabled = true; await tester.pumpWidget(MaterialApp( @@ -3658,7 +3657,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Delete button is visible RawChip is disabled', (WidgetTester tester) async { + testWidgets('Delete button is visible RawChip is disabled', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( child: RawChip( @@ -3678,7 +3677,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('M2 Chip defaults', (WidgetTester tester) async { + testWidgets('M2 Chip defaults', (WidgetTester tester) async { late TextTheme textTheme; Widget buildFrame(Brightness brightness) { @@ -3755,7 +3754,7 @@ void main() { expect(labelStyle.wordSpacing, textTheme.bodyLarge?.wordSpacing); }); - testWidgetsWithLeakTracking('Chip uses the right theme colors for the right components', (WidgetTester tester) async { + testWidgets('Chip uses the right theme colors for the right components', (WidgetTester tester) async { final ThemeData themeData = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, diff --git a/packages/flutter/test/material/chip_theme_test.dart b/packages/flutter/test/material/chip_theme_test.dart index 82658d6b442..876cc353cc7 100644 --- a/packages/flutter/test/material/chip_theme_test.dart +++ b/packages/flutter/test/material/chip_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; RenderBox getMaterialBox(WidgetTester tester) { return tester.firstRenderObject<RenderBox>( @@ -82,7 +81,7 @@ void main() { expect(themeData.iconTheme, null); }); - testWidgetsWithLeakTracking('Default ChipThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ChipThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ChipThemeData().debugFillProperties(builder); @@ -94,7 +93,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ChipThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ChipThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ChipThemeData( color: MaterialStatePropertyAll<Color>(Color(0xfffffff0)), @@ -150,7 +149,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('Material3 - Chip uses ThemeData chip theme', (WidgetTester tester) async { + testWidgets('Material3 - Chip uses ThemeData chip theme', (WidgetTester tester) async { const ChipThemeData chipTheme = ChipThemeData( backgroundColor: Color(0xff112233), elevation: 4, @@ -192,7 +191,7 @@ void main() { expect(getIconData(tester).color, chipTheme.iconTheme!.color); }); - testWidgetsWithLeakTracking('Material2 - Chip uses ThemeData chip theme', (WidgetTester tester) async { + testWidgets('Material2 - Chip uses ThemeData chip theme', (WidgetTester tester) async { const ChipThemeData chipTheme = ChipThemeData( backgroundColor: Color(0xff112233), elevation: 4, @@ -230,7 +229,7 @@ void main() { expect(getIconData(tester).color, chipTheme.iconTheme!.color); }); - testWidgetsWithLeakTracking('Material3 - Chip uses local ChipTheme', (WidgetTester tester) async { + testWidgets('Material3 - Chip uses local ChipTheme', (WidgetTester tester) async { const ChipThemeData chipTheme = ChipThemeData( backgroundColor: Color(0xff112233), elevation: 4, @@ -279,7 +278,7 @@ void main() { expect(getIconData(tester).color, chipTheme.iconTheme!.color); }); - testWidgetsWithLeakTracking('Material2 - Chip uses local ChipTheme', (WidgetTester tester) async { + testWidgets('Material2 - Chip uses local ChipTheme', (WidgetTester tester) async { const ChipThemeData chipTheme = ChipThemeData( backgroundColor: Color(0xff112233), elevation: 4, @@ -324,7 +323,7 @@ void main() { expect(getIconData(tester).color, chipTheme.iconTheme!.color); }); - testWidgetsWithLeakTracking('Chip properties overrides ChipTheme', (WidgetTester tester) async { + testWidgets('Chip properties overrides ChipTheme', (WidgetTester tester) async { const ChipThemeData chipTheme = ChipThemeData( backgroundColor: Color(0xff112233), elevation: 4, @@ -381,7 +380,7 @@ void main() { expect(getIconData(tester).color, iconTheme.color); }); - testWidgetsWithLeakTracking('Material3 - Chip uses constructor parameters', (WidgetTester tester) async { + testWidgets('Material3 - Chip uses constructor parameters', (WidgetTester tester) async { const Color backgroundColor = Color(0xff332211); const double elevation = 3; const double fontSize = 32; @@ -426,7 +425,7 @@ void main() { expect(getIconData(tester).color, iconTheme.color); }); - testWidgetsWithLeakTracking('Material2 - Chip uses constructor parameters', (WidgetTester tester) async { + testWidgets('Material2 - Chip uses constructor parameters', (WidgetTester tester) async { const Color backgroundColor = Color(0xff332211); const double elevation = 3; const double fontSize = 32; @@ -471,7 +470,7 @@ void main() { expect(getIconData(tester).color, iconTheme.color); }); - testWidgetsWithLeakTracking('ChipTheme.fromDefaults', (WidgetTester tester) async { + testWidgets('ChipTheme.fromDefaults', (WidgetTester tester) async { const TextStyle labelStyle = TextStyle(); ChipThemeData chipTheme = ChipThemeData.fromDefaults( brightness: Brightness.light, @@ -523,7 +522,7 @@ void main() { expect(chipTheme.pressElevation, 8.0); }); - testWidgetsWithLeakTracking('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async { + testWidgets('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async { const Color customColor1 = Color(0xcafefeed); const Color customColor2 = Color(0xdeadbeef); final TextStyle customStyle = ThemeData.fallback().textTheme.bodyLarge!.copyWith(color: customColor2); @@ -586,7 +585,7 @@ void main() { expect(customTheme.brightness, equals(Brightness.light)); }); - testWidgetsWithLeakTracking('ChipThemeData lerps correctly', (WidgetTester tester) async { + testWidgets('ChipThemeData lerps correctly', (WidgetTester tester) async { final ChipThemeData chipThemeBlack = ChipThemeData.fromDefaults( secondaryColor: Colors.black, brightness: Brightness.dark, @@ -734,7 +733,7 @@ void main() { expect(lerp.iconTheme, isNull); }); - testWidgetsWithLeakTracking('Chip uses stateful color from chip theme', (WidgetTester tester) async { + testWidgets('Chip uses stateful color from chip theme', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); const Color pressedColor = Color(0x00000001); @@ -832,7 +831,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Chip uses stateful border side from resolveWith pattern', (WidgetTester tester) async { + testWidgets('Chip uses stateful border side from resolveWith pattern', (WidgetTester tester) async { const Color selectedColor = Color(0x00000001); const Color defaultColor = Color(0x00000002); @@ -873,7 +872,7 @@ void main() { expect(find.byType(RawChip), paints..rrect()..rrect(color: selectedColor)); }); - testWidgetsWithLeakTracking('Chip uses stateful border side from chip theme', (WidgetTester tester) async { + testWidgets('Chip uses stateful border side from chip theme', (WidgetTester tester) async { const Color selectedColor = Color(0x00000001); const Color defaultColor = Color(0x00000002); @@ -915,7 +914,7 @@ void main() { expect(find.byType(RawChip), paints..rrect()..rrect(color: selectedColor)); }); - testWidgetsWithLeakTracking('Chip uses stateful shape from chip theme', (WidgetTester tester) async { + testWidgets('Chip uses stateful shape from chip theme', (WidgetTester tester) async { OutlinedBorder? getShape(Set<MaterialState> states) { if (states.contains(MaterialState.selected)) { return const RoundedRectangleBorder(); @@ -955,7 +954,7 @@ void main() { expect(getMaterial(tester).shape, isA<RoundedRectangleBorder>()); }); - testWidgetsWithLeakTracking('RawChip uses material state color from ChipTheme', (WidgetTester tester) async { + testWidgets('RawChip uses material state color from ChipTheme', (WidgetTester tester) async { const Color disabledSelectedColor = Color(0xffffff00); const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); @@ -1019,7 +1018,7 @@ void main() { expect(getMaterialBox(tester), paints..rrect(color: disabledSelectedColor)); }); - testWidgetsWithLeakTracking('RawChip uses state colors from ChipTheme', (WidgetTester tester) async { + testWidgets('RawChip uses state colors from ChipTheme', (WidgetTester tester) async { const ChipThemeData chipTheme = ChipThemeData( disabledColor: Color(0xadfefafe), backgroundColor: Color(0xcafefeed), @@ -1061,7 +1060,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/119163. - testWidgetsWithLeakTracking('RawChip respects checkmark properties from ChipTheme', (WidgetTester tester) async { + testWidgets('RawChip respects checkmark properties from ChipTheme', (WidgetTester tester) async { Widget buildRawChip({ChipThemeData? chipTheme}) { return MaterialApp( theme: ThemeData.light(useMaterial3: false).copyWith( @@ -1117,7 +1116,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("Material3 - RawChip.shape's side is used when provided", (WidgetTester tester) async { + testWidgets("Material3 - RawChip.shape's side is used when provided", (WidgetTester tester) async { Widget buildChip({ OutlinedBorder? shape, BorderSide? side }) { return MaterialApp( theme: ThemeData( @@ -1175,7 +1174,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - ChipThemeData.iconTheme respects default iconTheme.size', (WidgetTester tester) async { + testWidgets('Material3 - ChipThemeData.iconTheme respects default iconTheme.size', (WidgetTester tester) async { Widget buildChip({ IconThemeData? iconTheme }) { return MaterialApp( theme: ThemeData(useMaterial3: true, chipTheme: ChipThemeData(iconTheme: iconTheme)), diff --git a/packages/flutter/test/material/choice_chip_test.dart b/packages/flutter/test/material/choice_chip_test.dart index faad789a14f..97fed08f9a1 100644 --- a/packages/flutter/test/material/choice_chip_test.dart +++ b/packages/flutter/test/material/choice_chip_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; RenderBox getMaterialBox(WidgetTester tester, Finder type) { return tester.firstRenderObject<RenderBox>( @@ -73,7 +72,7 @@ void checkChipMaterialClipBehavior(WidgetTester tester, Clip clipBehavior) { } void main() { - testWidgetsWithLeakTracking('ChoiceChip defaults', (WidgetTester tester) async { + testWidgets('ChoiceChip defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const String label = 'choice chip'; @@ -208,7 +207,7 @@ void main() { expect(decoration.color, theme.colorScheme.onSurface.withOpacity(0.12)); }); - testWidgetsWithLeakTracking('ChoiceChip.elevated defaults', (WidgetTester tester) async { + testWidgets('ChoiceChip.elevated defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const String label = 'choice chip'; @@ -343,7 +342,7 @@ void main() { expect(decoration.color, theme.colorScheme.onSurface.withOpacity(0.12)); }); - testWidgetsWithLeakTracking('ChoiceChip.color resolves material states', (WidgetTester tester) async { + testWidgets('ChoiceChip.color resolves material states', (WidgetTester tester) async { const Color disabledSelectedColor = Color(0xffffff00); const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); @@ -442,7 +441,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ChoiceChip uses provided state color properties', (WidgetTester tester) async { + testWidgets('ChoiceChip uses provided state color properties', (WidgetTester tester) async { const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); const Color selectedColor = Color(0xffff0000); @@ -517,7 +516,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ChoiceChip can be tapped', (WidgetTester tester) async { + testWidgets('ChoiceChip can be tapped', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -533,7 +532,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('ChoiceChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { + testWidgets('ChoiceChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { const Text label = Text('label'); await tester.pumpWidget(wrapForChip(child: const ChoiceChip(label: label, selected: false))); checkChipMaterialClipBehavior(tester, Clip.none); @@ -542,7 +541,7 @@ void main() { checkChipMaterialClipBehavior(tester, Clip.antiAlias); }); - testWidgetsWithLeakTracking('ChoiceChip passes iconTheme property to RawChip', (WidgetTester tester) async { + testWidgets('ChoiceChip passes iconTheme property to RawChip', (WidgetTester tester) async { const IconThemeData iconTheme = IconThemeData(color: Colors.red); await tester.pumpWidget(wrapForChip( child: const ChoiceChip( @@ -554,7 +553,7 @@ void main() { expect(rawChip.iconTheme, iconTheme); }); - testWidgetsWithLeakTracking('ChoiceChip passes showCheckmark from ChipTheme to RawChip', (WidgetTester tester) async { + testWidgets('ChoiceChip passes showCheckmark from ChipTheme to RawChip', (WidgetTester tester) async { const bool showCheckmark = false; await tester.pumpWidget(wrapForChip( child: const ChipTheme( @@ -570,7 +569,7 @@ void main() { expect(rawChip.showCheckmark, showCheckmark); }); - testWidgetsWithLeakTracking('ChoiceChip passes checkmark properties to RawChip', (WidgetTester tester) async { + testWidgets('ChoiceChip passes checkmark properties to RawChip', (WidgetTester tester) async { const bool showCheckmark = false; const Color checkmarkColor = Color(0xff0000ff); await tester.pumpWidget(wrapForChip( @@ -585,7 +584,7 @@ void main() { expect(rawChip.checkmarkColor, checkmarkColor); }); - testWidgetsWithLeakTracking('ChoiceChip uses provided iconTheme', (WidgetTester tester) async { + testWidgets('ChoiceChip uses provided iconTheme', (WidgetTester tester) async { Widget buildChip({ IconThemeData? iconTheme }) { return MaterialApp( home: Material( @@ -616,7 +615,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('ChoiceChip defaults', (WidgetTester tester) async { + testWidgets('ChoiceChip defaults', (WidgetTester tester) async { Widget buildFrame(Brightness brightness) { return MaterialApp( theme: ThemeData(useMaterial3: false, brightness: brightness), diff --git a/packages/flutter/test/material/circle_avatar_test.dart b/packages/flutter/test/material/circle_avatar_test.dart index fde6909596e..38ff90fd767 100644 --- a/packages/flutter/test/material/circle_avatar_test.dart +++ b/packages/flutter/test/material/circle_avatar_test.dart @@ -12,12 +12,11 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import '../painting/mocks_for_image_cache.dart'; void main() { - testWidgetsWithLeakTracking('CircleAvatar with dark background color', (WidgetTester tester) async { + testWidgets('CircleAvatar with dark background color', (WidgetTester tester) async { final Color backgroundColor = Colors.blue.shade900; await tester.pumpWidget( wrap( @@ -39,7 +38,7 @@ void main() { expect(paragraph.text.style!.color, equals(ThemeData.fallback().primaryColorLight)); }); - testWidgetsWithLeakTracking('CircleAvatar with light background color', (WidgetTester tester) async { + testWidgets('CircleAvatar with light background color', (WidgetTester tester) async { final Color backgroundColor = Colors.blue.shade100; await tester.pumpWidget( wrap( @@ -61,7 +60,7 @@ void main() { expect(paragraph.text.style!.color, equals(ThemeData.fallback().primaryColorDark)); }); - testWidgetsWithLeakTracking('CircleAvatar with image background', (WidgetTester tester) async { + testWidgets('CircleAvatar with image background', (WidgetTester tester) async { await tester.pumpWidget( wrap( child: CircleAvatar( @@ -78,7 +77,7 @@ void main() { expect(decoration.image!.fit, equals(BoxFit.cover)); }); - testWidgetsWithLeakTracking('CircleAvatar with image foreground', (WidgetTester tester) async { + testWidgets('CircleAvatar with image foreground', (WidgetTester tester) async { await tester.pumpWidget( wrap( child: CircleAvatar( @@ -95,7 +94,7 @@ void main() { expect(decoration.image!.fit, equals(BoxFit.cover)); }); - testWidgetsWithLeakTracking('CircleAvatar backgroundImage is used as a fallback for foregroundImage', (WidgetTester tester) async { + testWidgets('CircleAvatar backgroundImage is used as a fallback for foregroundImage', (WidgetTester tester) async { final ErrorImageProvider errorImage = ErrorImageProvider(); bool caughtForegroundImageError = false; await tester.pumpWidget( @@ -123,7 +122,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CircleAvatar with foreground color', (WidgetTester tester) async { + testWidgets('CircleAvatar with foreground color', (WidgetTester tester) async { final Color foregroundColor = Colors.red.shade100; await tester.pumpWidget( wrap( @@ -146,7 +145,7 @@ void main() { expect(paragraph.text.style!.color, equals(foregroundColor)); }); - testWidgetsWithLeakTracking('Material3 - CircleAvatar default colors', (WidgetTester tester) async { + testWidgets('Material3 - CircleAvatar default colors', (WidgetTester tester) async { final ThemeData theme = ThemeData(); await tester.pumpWidget( wrap( @@ -168,7 +167,7 @@ void main() { expect(paragraph.text.style!.color, equals(theme.colorScheme.onPrimaryContainer)); }); - testWidgetsWithLeakTracking('CircleAvatar text does not expand with textScaleFactor', (WidgetTester tester) async { + testWidgets('CircleAvatar text does not expand with textScaleFactor', (WidgetTester tester) async { final Color foregroundColor = Colors.red.shade100; await tester.pumpWidget( wrap( @@ -212,7 +211,7 @@ void main() { expect(tester.getSize(find.text('Z')), equals(const Size(16.0, 16.0))); }); - testWidgetsWithLeakTracking('CircleAvatar respects minRadius', (WidgetTester tester) async { + testWidgets('CircleAvatar respects minRadius', (WidgetTester tester) async { final Color backgroundColor = Colors.blue.shade900; await tester.pumpWidget( wrap( @@ -236,7 +235,7 @@ void main() { expect(paragraph.text.style!.color, equals(ThemeData.fallback().primaryColorLight)); }); - testWidgetsWithLeakTracking('CircleAvatar respects maxRadius', (WidgetTester tester) async { + testWidgets('CircleAvatar respects maxRadius', (WidgetTester tester) async { final Color backgroundColor = Colors.blue.shade900; await tester.pumpWidget( wrap( @@ -258,7 +257,7 @@ void main() { expect(paragraph.text.style!.color, equals(ThemeData.fallback().primaryColorLight)); }); - testWidgetsWithLeakTracking('CircleAvatar respects setting both minRadius and maxRadius', (WidgetTester tester) async { + testWidgets('CircleAvatar respects setting both minRadius and maxRadius', (WidgetTester tester) async { final Color backgroundColor = Colors.blue.shade900; await tester.pumpWidget( wrap( @@ -286,7 +285,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - CircleAvatar default colors with light theme', (WidgetTester tester) async { + testWidgets('Material2 - CircleAvatar default colors with light theme', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false, primaryColor: Colors.grey.shade100); await tester.pumpWidget( wrap( @@ -308,7 +307,7 @@ void main() { expect(paragraph.text.style!.color, equals(theme.primaryTextTheme.titleLarge!.color)); }); - testWidgetsWithLeakTracking('Material2 - CircleAvatar default colors with dark theme', (WidgetTester tester) async { + testWidgets('Material2 - CircleAvatar default colors with dark theme', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false, primaryColor: Colors.grey.shade800); await tester.pumpWidget( wrap( diff --git a/packages/flutter/test/material/color_scheme_test.dart b/packages/flutter/test/material/color_scheme_test.dart index d830ac92de7..9b5df33cdc5 100644 --- a/packages/flutter/test/material/color_scheme_test.dart +++ b/packages/flutter/test/material/color_scheme_test.dart @@ -6,7 +6,6 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; @@ -444,7 +443,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('generated scheme "on" colors meet a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('generated scheme "on" colors meet a11y contrast guidelines', (WidgetTester tester) async { final ColorScheme colors = ColorScheme.fromSeed(seedColor: Colors.teal); Widget label(String text, Color textColor, Color background) { diff --git a/packages/flutter/test/material/data_table_test.dart b/packages/flutter/test/material/data_table_test.dart index 561fede1e82..50afdbf4302 100644 --- a/packages/flutter/test/material/data_table_test.dart +++ b/packages/flutter/test/material/data_table_test.dart @@ -11,13 +11,12 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:vector_math/vector_math_64.dart' show Matrix3; import 'data_table_test_utils.dart'; void main() { - testWidgetsWithLeakTracking('DataTable control test', (WidgetTester tester) async { + testWidgets('DataTable control test', (WidgetTester tester) async { final List<String> log = <String>[]; Widget buildTable({ int? sortColumnIndex, bool sortAscending = true }) { @@ -160,7 +159,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('DataTable control test - tristate', (WidgetTester tester) async { + testWidgets('DataTable control test - tristate', (WidgetTester tester) async { final List<String> log = <String>[]; const int numItems = 3; Widget buildTable(List<bool> selected, {int? disabledIndex}) { @@ -230,7 +229,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('DataTable control test - no checkboxes', (WidgetTester tester) async { + testWidgets('DataTable control test - no checkboxes', (WidgetTester tester) async { final List<String> log = <String>[]; Widget buildTable({ bool checkboxes = false }) { @@ -296,7 +295,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('DataTable overflow test - header', (WidgetTester tester) async { + testWidgets('DataTable overflow test - header', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -329,7 +328,7 @@ void main() { expect(tester.takeException(), isNull); // column overflows table, but text doesn't overflow cell }); - testWidgetsWithLeakTracking('DataTable overflow test - header with spaces', (WidgetTester tester) async { + testWidgets('DataTable overflow test - header with spaces', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -357,7 +356,7 @@ void main() { expect(tester.takeException(), isNull); // column overflows table, but text doesn't overflow cell }, skip: true); // https://github.com/flutter/flutter/issues/13512 - testWidgetsWithLeakTracking('DataTable overflow test', (WidgetTester tester) async { + testWidgets('DataTable overflow test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -385,7 +384,7 @@ void main() { expect(tester.takeException(), isNull); // cell overflows table, but text doesn't overflow cell }); - testWidgetsWithLeakTracking('DataTable overflow test', (WidgetTester tester) async { + testWidgets('DataTable overflow test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -413,7 +412,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('DataTable column onSort test', (WidgetTester tester) async { + testWidgets('DataTable column onSort test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -441,7 +440,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('DataTable sort indicator orientation', (WidgetTester tester) async { + testWidgets('DataTable sort indicator orientation', (WidgetTester tester) async { Widget buildTable({ bool sortAscending = true }) { return DataTable( sortColumnIndex: 0, @@ -493,7 +492,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataTable sort indicator orientation does not change on state update', (WidgetTester tester) async { + testWidgets('DataTable sort indicator orientation does not change on state update', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/43724 Widget buildTable({String title = 'Name1'}) { return DataTable( @@ -545,7 +544,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataTable sort indicator orientation does not change on state update - reverse', (WidgetTester tester) async { + testWidgets('DataTable sort indicator orientation does not change on state update - reverse', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/43724 Widget buildTable({String title = 'Name1'}) { return DataTable( @@ -598,7 +597,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataTable row onSelectChanged test', (WidgetTester tester) async { + testWidgets('DataTable row onSelectChanged test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -626,7 +625,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('DataTable custom row height', (WidgetTester tester) async { + testWidgets('DataTable custom row height', (WidgetTester tester) async { Widget buildCustomTable({ int? sortColumnIndex, bool sortAscending = true, @@ -739,7 +738,7 @@ void main() { expect(tester.getSize(findFirstContainerFor('Frozen yogurt')).height, greaterThan(0.0)); }); - testWidgetsWithLeakTracking('DataTable custom row height one row taller than others', (WidgetTester tester) async { + testWidgets('DataTable custom row height one row taller than others', (WidgetTester tester) async { const String multilineText = 'Line one.\nLine two.\nLine three.\nLine four.'; Widget buildCustomTable({ @@ -780,7 +779,7 @@ void main() { expect(multilineRowHeight, greaterThan(singleLineRowHeight)); }); - testWidgetsWithLeakTracking('DataTable custom row height - separate test for deprecated dataRowHeight', (WidgetTester tester) async { + testWidgets('DataTable custom row height - separate test for deprecated dataRowHeight', (WidgetTester tester) async { Widget buildCustomTable({ double dataRowHeight = 48.0, }) { @@ -830,7 +829,7 @@ void main() { expect(tester.getSize(findFirstContainerFor('Frozen yogurt')).height, 30.0); }); - testWidgetsWithLeakTracking('DataTable custom horizontal padding - checkbox', (WidgetTester tester) async { + testWidgets('DataTable custom horizontal padding - checkbox', (WidgetTester tester) async { const double defaultHorizontalMargin = 24.0; const double defaultColumnSpacing = 56.0; const double customHorizontalMargin = 10.0; @@ -1053,7 +1052,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataTable custom horizontal padding - no checkbox', (WidgetTester tester) async { + testWidgets('DataTable custom horizontal padding - no checkbox', (WidgetTester tester) async { const double defaultHorizontalMargin = 24.0; const double defaultColumnSpacing = 56.0; const double customHorizontalMargin = 10.0; @@ -1247,7 +1246,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataTable set border width test', (WidgetTester tester) async { + testWidgets('DataTable set border width test', (WidgetTester tester) async { const List<DataColumn> columns = <DataColumn>[ DataColumn(label: Text('column1')), DataColumn(label: Text('column2')), @@ -1299,7 +1298,7 @@ void main() { expect(boxDecoration.border!.top.width, thickness); }); - testWidgetsWithLeakTracking('DataTable set show bottom border', (WidgetTester tester) async { + testWidgets('DataTable set show bottom border', (WidgetTester tester) async { const List<DataColumn> columns = <DataColumn>[ DataColumn(label: Text('column1')), DataColumn(label: Text('column2')), @@ -1348,7 +1347,7 @@ void main() { expect(boxDecoration.border!.bottom.width, 0.0); }); - testWidgetsWithLeakTracking('DataTable column heading cell - with and without sorting', (WidgetTester tester) async { + testWidgets('DataTable column heading cell - with and without sorting', (WidgetTester tester) async { Widget buildTable({ int? sortColumnIndex, bool sortEnabled = true }) { return DataTable( sortColumnIndex: sortColumnIndex, @@ -1412,7 +1411,7 @@ void main() { } }); - testWidgetsWithLeakTracking('DataTable correctly renders with a mouse', (WidgetTester tester) async { + testWidgets('DataTable correctly renders with a mouse', (WidgetTester tester) async { // Regression test for a bug described in // https://github.com/flutter/flutter/pull/43735#issuecomment-589459947 // Filed at https://github.com/flutter/flutter/issues/51152 @@ -1460,7 +1459,7 @@ void main() { await tester.pumpAndSettle(const Duration(seconds: 1)); }); - testWidgetsWithLeakTracking('DataRow renders default selected row colors', (WidgetTester tester) async { + testWidgets('DataRow renders default selected row colors', (WidgetTester tester) async { final ThemeData themeData = ThemeData.light(); Widget buildTable({bool selected = false}) { return MaterialApp( @@ -1502,7 +1501,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataRow renders checkbox with colors from CheckboxTheme', (WidgetTester tester) async { + testWidgets('DataRow renders checkbox with colors from CheckboxTheme', (WidgetTester tester) async { const Color fillColor = Color(0xFF00FF00); const Color checkColor = Color(0xFF0000FF); @@ -1547,7 +1546,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataRow renders custom colors when selected', (WidgetTester tester) async { + testWidgets('DataRow renders custom colors when selected', (WidgetTester tester) async { const Color selectedColor = Colors.green; const Color defaultColor = Colors.red; @@ -1596,7 +1595,7 @@ void main() { expect(lastTableRowBoxDecoration().color, selectedColor); }); - testWidgetsWithLeakTracking('DataRow renders custom colors when disabled', (WidgetTester tester) async { + testWidgets('DataRow renders custom colors when disabled', (WidgetTester tester) async { const Color disabledColor = Colors.grey; const Color defaultColor = Colors.red; @@ -1651,7 +1650,7 @@ void main() { expect(lastTableRowBoxDecoration().color, disabledColor); }); - testWidgetsWithLeakTracking('Material2 - DataRow renders custom colors when pressed', (WidgetTester tester) async { + testWidgets('Material2 - DataRow renders custom colors when pressed', (WidgetTester tester) async { const Color pressedColor = Color(0xff4caf50); Widget buildTable() { return DataTable( @@ -1691,7 +1690,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Material3 - DataRow renders custom colors when pressed', (WidgetTester tester) async { + testWidgets('Material3 - DataRow renders custom colors when pressed', (WidgetTester tester) async { const Color pressedColor = Color(0xff4caf50); Widget buildTable() { return DataTable( @@ -1738,7 +1737,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('DataTable can render inside an AlertDialog', (WidgetTester tester) async { + testWidgets('DataTable can render inside an AlertDialog', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1760,7 +1759,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('DataTable renders with border and background decoration', (WidgetTester tester) async { + testWidgets('DataTable renders with border and background decoration', (WidgetTester tester) async { const double width = 800; const double height = 600; const double borderHorizontal = 5.0; @@ -1809,7 +1808,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('checkboxHorizontalMargin properly applied', (WidgetTester tester) async { + testWidgets('checkboxHorizontalMargin properly applied', (WidgetTester tester) async { const double customCheckboxHorizontalMargin = 15.0; const double customHorizontalMargin = 10.0; Finder cellContent; @@ -1898,7 +1897,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DataRow is disabled when onSelectChanged is not set', (WidgetTester tester) async { + testWidgets('DataRow is disabled when onSelectChanged is not set', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1933,7 +1932,7 @@ void main() { expect(find.widgetWithText(TableRowInkWell, 'GitHub'), findsNothing); }); - testWidgetsWithLeakTracking('DataTable set interior border test', (WidgetTester tester) async { + testWidgets('DataTable set interior border test', (WidgetTester tester) async { const List<DataColumn> columns = <DataColumn>[ DataColumn(label: Text('column1')), DataColumn(label: Text('column2')), @@ -1999,7 +1998,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/100952 - testWidgetsWithLeakTracking('Do not crashes when paint borders in a narrow space', (WidgetTester tester) async { + testWidgets('Do not crashes when paint borders in a narrow space', (WidgetTester tester) async { const List<DataColumn> columns = <DataColumn>[ DataColumn(label: Text('column1')), DataColumn(label: Text('column2')), @@ -2036,7 +2035,7 @@ void main() { }); - testWidgetsWithLeakTracking('DataTable clip behavior', (WidgetTester tester) async { + testWidgets('DataTable clip behavior', (WidgetTester tester) async { const Color selectedColor = Colors.green; const Color defaultColor = Colors.red; const BorderRadius borderRadius = BorderRadius.all(Radius.circular(30)); @@ -2085,7 +2084,7 @@ void main() { expect(material.borderRadius, borderRadius); }); - testWidgetsWithLeakTracking('DataTable dataRowMinHeight smaller or equal dataRowMaxHeight validation', (WidgetTester tester) async { + testWidgets('DataTable dataRowMinHeight smaller or equal dataRowMaxHeight validation', (WidgetTester tester) async { DataTable createDataTable() => DataTable( columns: const <DataColumn>[DataColumn(label: Text('Column1'))], @@ -2098,7 +2097,7 @@ void main() { e.toString().contains('dataRowMaxHeight >= dataRowMinHeight')))); }); - testWidgetsWithLeakTracking('DataTable dataRowHeight is not used together with dataRowMinHeight or dataRowMaxHeight', (WidgetTester tester) async { + testWidgets('DataTable dataRowHeight is not used together with dataRowMinHeight or dataRowMaxHeight', (WidgetTester tester) async { DataTable createDataTable({double? dataRowHeight, double? dataRowMinHeight, double? dataRowMaxHeight}) => DataTable( columns: const <DataColumn>[DataColumn(label: Text('Column1'))], @@ -2119,7 +2118,7 @@ void main() { }); group('TableRowInkWell', () { - testWidgetsWithLeakTracking('can handle secondary taps', (WidgetTester tester) async { + testWidgets('can handle secondary taps', (WidgetTester tester) async { bool secondaryTapped = false; bool secondaryTappedDown = false; @@ -2163,7 +2162,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Heading cell cursor resolves MaterialStateMouseCursor correctly', (WidgetTester tester) async { + testWidgets('Heading cell cursor resolves MaterialStateMouseCursor correctly', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -2224,7 +2223,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.forbidden); }); - testWidgetsWithLeakTracking('DataRow cursor resolves MaterialStateMouseCursor correctly', (WidgetTester tester) async { + testWidgets('DataRow cursor resolves MaterialStateMouseCursor correctly', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -2285,7 +2284,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.copy); }); - testWidgetsWithLeakTracking("DataRow cursor doesn't update checkbox cursor", (WidgetTester tester) async { + testWidgets("DataRow cursor doesn't update checkbox cursor", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -2328,7 +2327,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/114470. - testWidgetsWithLeakTracking('DataTable text styles are merged with default text style', (WidgetTester tester) async { + testWidgets('DataTable text styles are merged with default text style', (WidgetTester tester) async { late DefaultTextStyle defaultTextStyle; await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/data_table_theme_test.dart b/packages/flutter/test/material/data_table_theme_test.dart index ea5d19235ce..e08169cdd46 100644 --- a/packages/flutter/test/material/data_table_theme_test.dart +++ b/packages/flutter/test/material/data_table_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('DataTableThemeData copyWith, ==, hashCode basics', () { @@ -65,7 +64,7 @@ void main() { expect(theme.data.dataRowCursor, null); }); - testWidgetsWithLeakTracking('Default DataTableThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default DataTableThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DataTableThemeData().debugFillProperties(builder); @@ -77,7 +76,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('DataTableThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('DataTableThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); DataTableThemeData( decoration: const BoxDecoration(color: Color(0xfffffff0)), @@ -121,7 +120,7 @@ void main() { expect(description[13], 'dataRowCursor: MaterialStatePropertyAll(SystemMouseCursor(forbidden))'); }); - testWidgetsWithLeakTracking('DataTable is themeable', (WidgetTester tester) async { + testWidgets('DataTable is themeable', (WidgetTester tester) async { const BoxDecoration decoration = BoxDecoration(color: Color(0xfffffff0)); const MaterialStateProperty<Color> dataRowColor = MaterialStatePropertyAll<Color>(Color(0xfffffff1)); const double minMaxDataRowHeight = 41.0; @@ -208,7 +207,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.forbidden); }); - testWidgetsWithLeakTracking('DataTable is themeable - separate test for deprecated dataRowHeight', (WidgetTester tester) async { + testWidgets('DataTable is themeable - separate test for deprecated dataRowHeight', (WidgetTester tester) async { const double dataRowHeight = 51.0; await tester.pumpWidget( @@ -242,7 +241,7 @@ void main() { expect(tester.getSize(_findFirstContainerFor('Data')).height, dataRowHeight); }); - testWidgetsWithLeakTracking('DataTable properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('DataTable properties are taken over the theme values', (WidgetTester tester) async { const BoxDecoration themeDecoration = BoxDecoration(color: Color(0xfffffff1)); const MaterialStateProperty<Color> themeDataRowColor = MaterialStatePropertyAll<Color>(Color(0xfffffff0)); const double minMaxThemeDataRowHeight = 50.0; @@ -355,7 +354,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), dataRowCursor.resolve(<MaterialState>{})); }); - testWidgetsWithLeakTracking('DataTable properties are taken over the theme values - separate test for deprecated dataRowHeight', (WidgetTester tester) async { + testWidgets('DataTable properties are taken over the theme values - separate test for deprecated dataRowHeight', (WidgetTester tester) async { const double themeDataRowHeight = 50.0; const double dataRowHeight = 51.0; @@ -391,7 +390,7 @@ void main() { expect(tester.getSize(_findFirstContainerFor('Data')).height, dataRowHeight); }); - testWidgetsWithLeakTracking('Local DataTableTheme can override global DataTableTheme', (WidgetTester tester) async { + testWidgets('Local DataTableTheme can override global DataTableTheme', (WidgetTester tester) async { const BoxDecoration globalThemeDecoration = BoxDecoration(color: Color(0xfffffff1)); const MaterialStateProperty<Color> globalThemeDataRowColor = MaterialStatePropertyAll<Color>(Color(0xfffffff0)); const double minMaxGlobalThemeDataRowHeight = 50.0; @@ -508,7 +507,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), localDataRowCursor.resolve(<MaterialState>{})); }); - testWidgetsWithLeakTracking('Local DataTableTheme can override global DataTableTheme - separate test for deprecated dataRowHeight', (WidgetTester tester) async { + testWidgets('Local DataTableTheme can override global DataTableTheme - separate test for deprecated dataRowHeight', (WidgetTester tester) async { const double globalThemeDataRowHeight = 50.0; const double localThemeDataRowHeight = 51.0; diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index 5965054e30f..6d2fe1d1b6b 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -13,7 +13,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -132,7 +131,7 @@ void main() { } group('showDatePicker Dialog', () { - testWidgetsWithLeakTracking('Default dialog size', (WidgetTester tester) async { + testWidgets('Default dialog size', (WidgetTester tester) async { Future<void> showPicker(WidgetTester tester, Size size) async { tester.view.physicalSize = size; tester.view.devicePixelRatio = 1.0; @@ -159,7 +158,7 @@ void main() { expect(dialogContainerSize, calendarPortraitDialogSizeM3); }); - testWidgetsWithLeakTracking('Default dialog properties', (WidgetTester tester) async { + testWidgets('Default dialog properties', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await prepareDatePicker(tester, (Future<DateTime?> date) async { final Material dialogMaterial = tester.widget<Material>( @@ -182,13 +181,13 @@ void main() { }, useMaterial3: theme.useMaterial3); }); - testWidgetsWithLeakTracking('Material3 uses sentence case labels', (WidgetTester tester) async { + testWidgets('Material3 uses sentence case labels', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.text('Select date'), findsOneWidget); }, useMaterial3: true); }); - testWidgetsWithLeakTracking('Cancel, confirm, and help text is used', (WidgetTester tester) async { + testWidgets('Cancel, confirm, and help text is used', (WidgetTester tester) async { cancelText = 'nope'; confirmText = 'yep'; helpText = 'help'; @@ -199,21 +198,21 @@ void main() { }); }); - testWidgetsWithLeakTracking('Initial date is the default', (WidgetTester tester) async { + testWidgets('Initial date is the default', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('OK')); expect(await date, DateTime(2016, DateTime.january, 15)); }); }); - testWidgetsWithLeakTracking('Can cancel', (WidgetTester tester) async { + testWidgets('Can cancel', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('CANCEL')); expect(await date, isNull); }); }); - testWidgetsWithLeakTracking('Can switch from calendar to input entry mode', (WidgetTester tester) async { + testWidgets('Can switch from calendar to input entry mode', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsNothing); await tester.tap(find.byIcon(Icons.edit)); @@ -222,7 +221,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can switch from input to calendar entry mode', (WidgetTester tester) async { + testWidgets('Can switch from input to calendar entry mode', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.input; await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsOneWidget); @@ -232,7 +231,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can not switch out of calendarOnly mode', (WidgetTester tester) async { + testWidgets('Can not switch out of calendarOnly mode', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.calendarOnly; await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsNothing); @@ -240,7 +239,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can not switch out of inputOnly mode', (WidgetTester tester) async { + testWidgets('Can not switch out of inputOnly mode', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.inputOnly; await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsOneWidget); @@ -248,7 +247,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Switching to input mode keeps selected date', (WidgetTester tester) async { + testWidgets('Switching to input mode keeps selected date', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('12')); await tester.tap(find.byIcon(Icons.edit)); @@ -258,7 +257,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Input only mode should validate date', (WidgetTester tester) async { + testWidgets('Input only mode should validate date', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.inputOnly; await prepareDatePicker(tester, (Future<DateTime?> date) async { // Enter text input mode and type an invalid date to get error. @@ -269,7 +268,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Switching to input mode resets input error state', (WidgetTester tester) async { + testWidgets('Switching to input mode resets input error state', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { // Enter text input mode and type an invalid date to get error. await tester.tap(find.byIcon(Icons.edit)); @@ -293,7 +292,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('builder parameter', (WidgetTester tester) async { + testWidgets('builder parameter', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( home: Material( @@ -350,7 +349,7 @@ void main() { rootObserver = _DatePickerObserver(); }); - testWidgetsWithLeakTracking('Barrier is dismissible with default parameter', (WidgetTester tester) async { + testWidgets('Barrier is dismissible with default parameter', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( navigatorObservers: <NavigatorObserver>[rootObserver], @@ -388,7 +387,7 @@ void main() { expect(rootObserver.datePickerCount, 0); }); - testWidgetsWithLeakTracking('Barrier is not dismissible with barrierDismissible is false', (WidgetTester tester) async { + testWidgets('Barrier is not dismissible with barrierDismissible is false', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( navigatorObservers: <NavigatorObserver>[rootObserver], @@ -428,7 +427,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Barrier color', (WidgetTester tester) async { + testWidgets('Barrier color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -494,7 +493,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, Colors.pink); }); - testWidgetsWithLeakTracking('Barrier Label', (WidgetTester tester) async { + testWidgets('Barrier Label', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -527,7 +526,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).semanticsLabel, 'Custom Label'); }); - testWidgetsWithLeakTracking('uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final _DatePickerObserver rootObserver = _DatePickerObserver(); final _DatePickerObserver nestedObserver = _DatePickerObserver(); @@ -564,7 +563,7 @@ void main() { expect(nestedObserver.datePickerCount, 1); }); - testWidgetsWithLeakTracking('honors DialogTheme for shape and elevation', (WidgetTester tester) async { + testWidgets('honors DialogTheme for shape and elevation', (WidgetTester tester) async { // Test that the defaults work const DialogTheme datePickerDefaultDialogTheme = DialogTheme( shape: RoundedRectangleBorder( @@ -637,7 +636,7 @@ void main() { expect(themeDialogMaterial.elevation, customDialogTheme.elevation); }); - testWidgetsWithLeakTracking('OK Cancel button layout', (WidgetTester tester) async { + testWidgets('OK Cancel button layout', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -713,7 +712,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('honors switchToInputEntryModeIcon', (WidgetTester tester) async { + testWidgets('honors switchToInputEntryModeIcon', (WidgetTester tester) async { Widget buildApp({bool? useMaterial3, Icon? switchToInputEntryModeIcon}) { return MaterialApp( theme: ThemeData( @@ -769,7 +768,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('honors switchToCalendarEntryModeIcon', (WidgetTester tester) async { + testWidgets('honors switchToCalendarEntryModeIcon', (WidgetTester tester) async { Widget buildApp({bool? useMaterial3, Icon? switchToCalendarEntryModeIcon}) { return MaterialApp( theme: ThemeData( @@ -828,7 +827,7 @@ void main() { }); group('Calendar mode', () { - testWidgetsWithLeakTracking('Default Calendar mode layout (Landscape)', (WidgetTester tester) async { + testWidgets('Default Calendar mode layout (Landscape)', (WidgetTester tester) async { final Finder helpText = find.text('Select date'); final Finder headerText = find.text('Fri, Jan 15'); final Finder subHeaderText = find.text('January 2016'); @@ -927,7 +926,7 @@ void main() { expect(cancelButtonTopRight.dx, okButtonTopLeft.dx - 8); }); - testWidgetsWithLeakTracking('Default Calendar mode layout (Portrait)', (WidgetTester tester) async { + testWidgets('Default Calendar mode layout (Portrait)', (WidgetTester tester) async { final Finder helpText = find.text('Select date'); final Finder headerText = find.text('Fri, Jan 15'); final Finder subHeaderText = find.text('January 2016'); @@ -1026,7 +1025,7 @@ void main() { expect(cancelButtonTopRight.dx, okButtonTopLeft.dx - 8); }); - testWidgetsWithLeakTracking('Can select a day', (WidgetTester tester) async { + testWidgets('Can select a day', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('12')); await tester.tap(find.text('OK')); @@ -1034,7 +1033,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select a month', (WidgetTester tester) async { + testWidgets('Can select a month', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(previousMonthIcon); await tester.pumpAndSettle(const Duration(seconds: 1)); @@ -1044,7 +1043,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select a year', (WidgetTester tester) async { + testWidgets('Can select a year', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('January 2016')); // Switch to year mode. await tester.pump(); @@ -1054,7 +1053,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select a day with no initial date', (WidgetTester tester) async { + testWidgets('Can select a day with no initial date', (WidgetTester tester) async { initialDate = null; await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('12')); @@ -1063,7 +1062,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select a month with no initial date', (WidgetTester tester) async { + testWidgets('Can select a month with no initial date', (WidgetTester tester) async { initialDate = null; await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(previousMonthIcon); @@ -1074,7 +1073,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select a year with no initial date', (WidgetTester tester) async { + testWidgets('Can select a year with no initial date', (WidgetTester tester) async { initialDate = null; await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('January 2016')); // Switch to year mode. @@ -1085,7 +1084,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Selecting date does not change displayed month', (WidgetTester tester) async { + testWidgets('Selecting date does not change displayed month', (WidgetTester tester) async { initialDate = DateTime(2020, DateTime.march, 15); await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(nextMonthIcon); @@ -1099,7 +1098,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Changing year does change selected date', (WidgetTester tester) async { + testWidgets('Changing year does change selected date', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('January 2016')); await tester.pump(); @@ -1110,7 +1109,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Changing year does not change the month', (WidgetTester tester) async { + testWidgets('Changing year does not change the month', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(nextMonthIcon); await tester.pumpAndSettle(); @@ -1124,7 +1123,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select a year and then a day', (WidgetTester tester) async { + testWidgets('Can select a year and then a day', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('January 2016')); // Switch to year mode. await tester.pump(); @@ -1136,7 +1135,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Current year is visible in year picker', (WidgetTester tester) async { + testWidgets('Current year is visible in year picker', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('January 2016')); // Switch to year mode. await tester.pump(); @@ -1144,7 +1143,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Cannot select a day outside bounds', (WidgetTester tester) async { + testWidgets('Cannot select a day outside bounds', (WidgetTester tester) async { initialDate = DateTime(2017, DateTime.january, 15); firstDate = initialDate!; lastDate = initialDate!; @@ -1159,7 +1158,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Cannot select a month past last date', (WidgetTester tester) async { + testWidgets('Cannot select a month past last date', (WidgetTester tester) async { initialDate = DateTime(2017, DateTime.january, 15); firstDate = initialDate!; lastDate = DateTime(2017, DateTime.february, 20); @@ -1171,7 +1170,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Cannot select a month before first date', (WidgetTester tester) async { + testWidgets('Cannot select a month before first date', (WidgetTester tester) async { initialDate = DateTime(2017, DateTime.january, 15); firstDate = DateTime(2016, DateTime.december, 10); lastDate = initialDate!; @@ -1183,7 +1182,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Cannot select disabled year', (WidgetTester tester) async { + testWidgets('Cannot select disabled year', (WidgetTester tester) async { initialDate = DateTime(2018, DateTime.july, 4); firstDate = DateTime(2018, DateTime.june, 9); lastDate = DateTime(2018, DateTime.december, 15); @@ -1198,7 +1197,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Selecting firstDate year respects firstDate', (WidgetTester tester) async { + testWidgets('Selecting firstDate year respects firstDate', (WidgetTester tester) async { initialDate = DateTime(2018, DateTime.may, 4); firstDate = DateTime(2016, DateTime.june, 9); lastDate = DateTime(2019, DateTime.january, 15); @@ -1212,7 +1211,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Selecting lastDate year respects lastDate', (WidgetTester tester) async { + testWidgets('Selecting lastDate year respects lastDate', (WidgetTester tester) async { initialDate = DateTime(2018, DateTime.may, 4); firstDate = DateTime(2016, DateTime.june, 9); lastDate = DateTime(2019, DateTime.january, 15); @@ -1226,7 +1225,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Only predicate days are selectable', (WidgetTester tester) async { + testWidgets('Only predicate days are selectable', (WidgetTester tester) async { initialDate = DateTime(2017, DateTime.january, 16); firstDate = DateTime(2017, DateTime.january, 10); lastDate = DateTime(2017, DateTime.january, 20); @@ -1240,7 +1239,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select initial calendar picker mode', (WidgetTester tester) async { + testWidgets('Can select initial calendar picker mode', (WidgetTester tester) async { initialDate = DateTime(2014, DateTime.january, 15); initialCalendarMode = DatePickerMode.year; await prepareDatePicker(tester, (Future<DateTime?> date) async { @@ -1253,7 +1252,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('currentDate is highlighted', (WidgetTester tester) async { + testWidgets('currentDate is highlighted', (WidgetTester tester) async { today = DateTime(2016, 1, 2); await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.pump(); @@ -1266,7 +1265,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Date picker dayOverlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('Date picker dayOverlayColor resolves pressed state', (WidgetTester tester) async { today = DateTime(2023, 5, 4); final ThemeData theme = ThemeData(); final bool material3 = theme.useMaterial3; @@ -1298,7 +1297,7 @@ void main() { }, theme: theme); }); - testWidgetsWithLeakTracking('Selecting date does not switch picker to year selection', (WidgetTester tester) async { + testWidgets('Selecting date does not switch picker to year selection', (WidgetTester tester) async { initialDate = DateTime(2020, DateTime.may, 10); initialCalendarMode = DatePickerMode.year; await prepareDatePicker(tester, (Future<DateTime?> date) async { @@ -1322,7 +1321,7 @@ void main() { initialEntryMode = DatePickerEntryMode.input; }); - testWidgetsWithLeakTracking('Default InputDecoration', (WidgetTester tester) async { + testWidgets('Default InputDecoration', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { final InputDecoration decoration = tester.widget<TextField>( find.byType(TextField)).decoration!; @@ -1334,13 +1333,13 @@ void main() { }, useMaterial3: true); }); - testWidgetsWithLeakTracking('Initial entry mode is used', (WidgetTester tester) async { + testWidgets('Initial entry mode is used', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsOneWidget); }); }); - testWidgetsWithLeakTracking('Hint, label, and help text is used', (WidgetTester tester) async { + testWidgets('Hint, label, and help text is used', (WidgetTester tester) async { cancelText = 'nope'; confirmText = 'yep'; fieldHintText = 'hint'; @@ -1355,7 +1354,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('KeyboardType is used', (WidgetTester tester) async { + testWidgets('KeyboardType is used', (WidgetTester tester) async { keyboardType = TextInputType.text; await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); @@ -1363,14 +1362,14 @@ void main() { }); }); - testWidgetsWithLeakTracking('Initial date is the default', (WidgetTester tester) async { + testWidgets('Initial date is the default', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.text('OK')); expect(await date, DateTime(2016, DateTime.january, 15)); }); }); - testWidgetsWithLeakTracking('Can toggle to calendar entry mode', (WidgetTester tester) async { + testWidgets('Can toggle to calendar entry mode', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsOneWidget); await tester.tap(find.byIcon(Icons.calendar_today)); @@ -1379,7 +1378,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Toggle to calendar mode keeps selected date', (WidgetTester tester) async { + testWidgets('Toggle to calendar mode keeps selected date', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); field.controller!.clear(); @@ -1392,7 +1391,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Entered text returns date', (WidgetTester tester) async { + testWidgets('Entered text returns date', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); field.controller!.clear(); @@ -1403,7 +1402,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Too short entered text shows error', (WidgetTester tester) async { + testWidgets('Too short entered text shows error', (WidgetTester tester) async { errorFormatText = 'oops'; await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); @@ -1419,7 +1418,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Bad format entered text shows error', (WidgetTester tester) async { + testWidgets('Bad format entered text shows error', (WidgetTester tester) async { errorFormatText = 'oops'; await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); @@ -1436,7 +1435,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Invalid entered text shows error', (WidgetTester tester) async { + testWidgets('Invalid entered text shows error', (WidgetTester tester) async { errorInvalidText = 'oops'; await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); @@ -1452,7 +1451,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Invalid entered text shows error on autovalidate', (WidgetTester tester) async { + testWidgets('Invalid entered text shows error on autovalidate', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/126397. await prepareDatePicker(tester, (Future<DateTime?> date) async { final TextField field = textField(tester); @@ -1481,7 +1480,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/131989. - testWidgetsWithLeakTracking('Dialog contents do not overflow when resized during orientation change', + testWidgets('Dialog contents do not overflow when resized during orientation change', (WidgetTester tester) async { addTearDown(tester.view.reset); // Initial window size is wide for landscape mode. @@ -1497,7 +1496,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/139120. - testWidgetsWithLeakTracking('Dialog contents are visible - textScaler 0.88, 1.0, 2.0', + testWidgets('Dialog contents are visible - textScaler 0.88, 1.0, 2.0', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(400, 800); @@ -1528,7 +1527,7 @@ void main() { }); group('Semantics', () { - testWidgetsWithLeakTracking('calendar mode', (WidgetTester tester) async { + testWidgets('calendar mode', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); await prepareDatePicker(tester, (Future<DateTime?> date) async { @@ -1577,7 +1576,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('input mode', (WidgetTester tester) async { + testWidgets('input mode', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); initialEntryMode = DatePickerEntryMode.input; @@ -1622,7 +1621,7 @@ void main() { }); group('Keyboard navigation', () { - testWidgetsWithLeakTracking('Can toggle to calendar entry mode', (WidgetTester tester) async { + testWidgets('Can toggle to calendar entry mode', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.byType(TextField), findsNothing); // Navigate to the entry toggle button and activate it @@ -1638,7 +1637,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can toggle to year mode', (WidgetTester tester) async { + testWidgets('Can toggle to year mode', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.text('2016'), findsNothing); // Navigate to the year selector and activate it @@ -1650,7 +1649,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can navigate next/previous months', (WidgetTester tester) async { + testWidgets('Can navigate next/previous months', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { expect(find.text('January 2016'), findsOneWidget); // Navigate to the previous month button and activate it twice @@ -1678,7 +1677,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can navigate date grid with arrow keys', (WidgetTester tester) async { + testWidgets('Can navigate date grid with arrow keys', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { // Navigate to the grid await tester.sendKeyEvent(LogicalKeyboardKey.tab); @@ -1714,7 +1713,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Navigating with arrow keys scrolls months', (WidgetTester tester) async { + testWidgets('Navigating with arrow keys scrolls months', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { // Navigate to the grid await tester.sendKeyEvent(LogicalKeyboardKey.tab); @@ -1762,7 +1761,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('RTL text direction reverses the horizontal arrow key navigation', (WidgetTester tester) async { + testWidgets('RTL text direction reverses the horizontal arrow key navigation', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { // Navigate to the grid await tester.sendKeyEvent(LogicalKeyboardKey.tab); @@ -1827,49 +1826,49 @@ void main() { await tester.pumpAndSettle(); } - testWidgetsWithLeakTracking('common screen size - portrait', (WidgetTester tester) async { + testWidgets('common screen size - portrait', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizePortrait); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('common screen size - landscape', (WidgetTester tester) async { + testWidgets('common screen size - landscape', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizeLandscape); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('common screen size - portrait - textScale 1.3', (WidgetTester tester) async { + testWidgets('common screen size - portrait - textScale 1.3', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizePortrait, 1.3); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('common screen size - landscape - textScale 1.3', (WidgetTester tester) async { + testWidgets('common screen size - landscape - textScale 1.3', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizeLandscape, 1.3); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('small screen size - portrait', (WidgetTester tester) async { + testWidgets('small screen size - portrait', (WidgetTester tester) async { await showPicker(tester, kSmallScreenSizePortrait); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('small screen size - landscape', (WidgetTester tester) async { + testWidgets('small screen size - landscape', (WidgetTester tester) async { await showPicker(tester, kSmallScreenSizeLandscape); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('small screen size - portrait -textScale 1.3', (WidgetTester tester) async { + testWidgets('small screen size - portrait -textScale 1.3', (WidgetTester tester) async { await showPicker(tester, kSmallScreenSizePortrait, 1.3); expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('small screen size - landscape - textScale 1.3', (WidgetTester tester) async { + testWidgets('small screen size - landscape - textScale 1.3', (WidgetTester tester) async { await showPicker(tester, kSmallScreenSizeLandscape, 1.3); expect(tester.takeException(), isNull); }); }); group('showDatePicker avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning with anchorPoint', (WidgetTester tester) async { + testWidgets('positioning with anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1907,7 +1906,7 @@ void main() { expect(tester.getBottomRight(find.byType(DatePickerDialog)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with Directionality', (WidgetTester tester) async { + testWidgets('positioning with Directionality', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1947,7 +1946,7 @@ void main() { expect(tester.getBottomRight(find.byType(DatePickerDialog)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with defaults', (WidgetTester tester) async { + testWidgets('positioning with defaults', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1985,7 +1984,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('DatePickerDialog is state restorable', (WidgetTester tester) async { + testWidgets('DatePickerDialog is state restorable', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', @@ -2038,7 +2037,7 @@ void main() { expect(find.text('30/7/2021'), findsOneWidget); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('DatePickerDialog state restoration - DatePickerEntryMode', (WidgetTester tester) async { + testWidgets('DatePickerDialog state restoration - DatePickerEntryMode', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', @@ -2087,7 +2086,7 @@ void main() { expect(find.byIcon(Icons.edit), findsNothing); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('Test Callback on Toggle of DatePicker Mode', (WidgetTester tester) async { + testWidgets('Test Callback on Toggle of DatePicker Mode', (WidgetTester tester) async { prepareDatePicker(tester, (Future<DateTime?> date) async { await tester.tap(find.byIcon(Icons.edit)); expect(currentMode, DatePickerEntryMode.input); @@ -2115,14 +2114,14 @@ void main() { await prepareDatePicker(tester, (Future<DateTime?> date) async { }, useMaterial3: true); } - testWidgetsWithLeakTracking('portrait', (WidgetTester tester) async { + testWidgets('portrait', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizePortrait); expect(tester.widget<Text>(find.text('Fri, Jan 15')).style?.fontSize, 32); await tester.tap(find.text('Cancel')); await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('landscape', (WidgetTester tester) async { + testWidgets('landscape', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizeLandscape); expect(tester.widget<Text>(find.text('Fri, Jan 15')).style?.fontSize, 24); await tester.tap(find.text('Cancel')); @@ -2136,7 +2135,7 @@ void main() { // can be deleted. group('showDatePicker Dialog', () { - testWidgetsWithLeakTracking('Default dialog size', (WidgetTester tester) async { + testWidgets('Default dialog size', (WidgetTester tester) async { Future<void> showPicker(WidgetTester tester, Size size) async { tester.view.physicalSize = size; tester.view.devicePixelRatio = 1.0; @@ -2165,7 +2164,7 @@ void main() { expect(dialogContainerSize, calendarPortraitDialogSizeM2); }); - testWidgetsWithLeakTracking('Default dialog properties', (WidgetTester tester) async { + testWidgets('Default dialog properties', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await prepareDatePicker(tester, (Future<DateTime?> date) async { final Material dialogMaterial = tester.widget<Material>( @@ -2197,7 +2196,7 @@ void main() { initialEntryMode = DatePickerEntryMode.input; }); - testWidgetsWithLeakTracking('Default InputDecoration', (WidgetTester tester) async { + testWidgets('Default InputDecoration', (WidgetTester tester) async { await prepareDatePicker(tester, (Future<DateTime?> date) async { final InputDecoration decoration = tester.widget<TextField>( find.byType(TextField)).decoration!; diff --git a/packages/flutter/test/material/date_picker_theme_test.dart b/packages/flutter/test/material/date_picker_theme_test.dart index c093b1f0a90..58bb87aed2b 100644 --- a/packages/flutter/test/material/date_picker_theme_test.dart +++ b/packages/flutter/test/material/date_picker_theme_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { const DatePickerThemeData datePickerTheme = DatePickerThemeData( @@ -137,7 +136,7 @@ void main() { expect(theme.confirmButtonStyle, null); }); - testWidgetsWithLeakTracking('DatePickerTheme.defaults M3 defaults', (WidgetTester tester) async { + testWidgets('DatePickerTheme.defaults M3 defaults', (WidgetTester tester) async { late final DatePickerThemeData m3; // M3 Defaults late final ThemeData theme; late final ColorScheme colorScheme; @@ -214,7 +213,7 @@ void main() { expect(m3.confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString())); }); - testWidgetsWithLeakTracking('DatePickerTheme.defaults M2 defaults', (WidgetTester tester) async { + testWidgets('DatePickerTheme.defaults M2 defaults', (WidgetTester tester) async { late final DatePickerThemeData m2; // M2 defaults late final ThemeData theme; late final ColorScheme colorScheme; @@ -283,7 +282,7 @@ void main() { expect(m2.confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString())); }); - testWidgetsWithLeakTracking('Default DatePickerThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default DatePickerThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DatePickerThemeData().debugFillProperties(builder); @@ -295,7 +294,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('DatePickerThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('DatePickerThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); datePickerTheme.debugFillProperties(builder); @@ -345,7 +344,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('DatePickerDialog uses ThemeData datePicker theme (calendar mode)', (WidgetTester tester) async { + testWidgets('DatePickerDialog uses ThemeData datePicker theme (calendar mode)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -446,7 +445,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(datePickerTheme.confirmButtonStyle.toString())); }); - testWidgetsWithLeakTracking('DatePickerDialog uses ThemeData datePicker theme (input mode)', (WidgetTester tester) async { + testWidgets('DatePickerDialog uses ThemeData datePicker theme (input mode)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -493,7 +492,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(datePickerTheme.confirmButtonStyle.toString())); }); - testWidgetsWithLeakTracking('DateRangePickerDialog uses ThemeData datePicker theme', (WidgetTester tester) async { + testWidgets('DateRangePickerDialog uses ThemeData datePicker theme', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -554,7 +553,7 @@ void main() { expect(inkFeatures, paints..circle(color: datePickerTheme.rangeSelectionOverlayColor?.resolve(<MaterialState>{}))); }); - testWidgetsWithLeakTracking('Dividers use DatePickerThemeData.dividerColor', (WidgetTester tester) async { + testWidgets('Dividers use DatePickerThemeData.dividerColor', (WidgetTester tester) async { Future<void> showPicker(WidgetTester tester, Size size) async { tester.view.physicalSize = size; tester.view.devicePixelRatio = 1.0; @@ -595,7 +594,7 @@ void main() { expect(horizontalDivider.color, datePickerTheme.dividerColor); }); - testWidgetsWithLeakTracking( + testWidgets( 'DatePicker uses ThemeData.inputDecorationTheme properties ' 'which are null in DatePickerThemeData.inputDecorationTheme', (WidgetTester tester) async { @@ -651,7 +650,7 @@ void main() { expect(inputDecoration.border , const OutlineInputBorder()); }); - testWidgetsWithLeakTracking('DatePickerDialog resolves DatePickerTheme.dayOverlayColor states', (WidgetTester tester) async { + testWidgets('DatePickerDialog resolves DatePickerTheme.dayOverlayColor states', (WidgetTester tester) async { final MaterialStateProperty<Color> dayOverlayColor = MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) { if (states.contains(MaterialState.hovered)) { return const Color(0xff00ff00); @@ -743,7 +742,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DatePickerDialog resolves DatePickerTheme.yearOverlayColor states', (WidgetTester tester) async { + testWidgets('DatePickerDialog resolves DatePickerTheme.yearOverlayColor states', (WidgetTester tester) async { final MaterialStateProperty<Color> yearOverlayColor = MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) { if (states.contains(MaterialState.hovered)) { return const Color(0xff00ff00); @@ -825,7 +824,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DateRangePickerDialog resolves DatePickerTheme.rangeSelectionOverlayColor states', (WidgetTester tester) async { + testWidgets('DateRangePickerDialog resolves DatePickerTheme.rangeSelectionOverlayColor states', (WidgetTester tester) async { final MaterialStateProperty<Color> rangeSelectionOverlayColor = MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) { if (states.contains(MaterialState.hovered)) { return const Color(0xff00ff00); diff --git a/packages/flutter/test/material/date_range_picker_test.dart b/packages/flutter/test/material/date_range_picker_test.dart index 980f91e6c93..eb5b71f311e 100644 --- a/packages/flutter/test/material/date_range_picker_test.dart +++ b/packages/flutter/test/material/date_range_picker_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'feedback_tester.dart'; void main() { @@ -112,7 +111,7 @@ void main() { await callback(range); } - testWidgetsWithLeakTracking('Default layout (calendar mode)', (WidgetTester tester) async { + testWidgets('Default layout (calendar mode)', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { final Finder helpText = find.text('Select range'); final Finder firstDateHeaderText = find.text('Jan 15'); @@ -174,7 +173,7 @@ void main() { }, useMaterial3: true); }); - testWidgetsWithLeakTracking('Default Dialog properties (calendar mode)', (WidgetTester tester) async { + testWidgets('Default Dialog properties (calendar mode)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Material dialogMaterial = tester.widget<Material>( @@ -194,7 +193,7 @@ void main() { }, useMaterial3: theme.useMaterial3); }); - testWidgetsWithLeakTracking('Default Dialog properties (input mode)', (WidgetTester tester) async { + testWidgets('Default Dialog properties (input mode)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Material dialogMaterial = tester.widget<Material>( @@ -214,7 +213,7 @@ void main() { }, useMaterial3: theme.useMaterial3); }); - testWidgetsWithLeakTracking('Scaffold and AppBar defaults', (WidgetTester tester) async { + testWidgets('Scaffold and AppBar defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Scaffold scaffold = tester.widget<Scaffold>(find.byType(Scaffold)); @@ -245,14 +244,14 @@ void main() { await preparePicker(tester, (Future<DateTimeRange?> range) async { }, useMaterial3: true); } - testWidgetsWithLeakTracking('portrait', (WidgetTester tester) async { + testWidgets('portrait', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizePortrait); expect(tester.widget<Text>(find.text('Jan 15 – Jan 25, 2016')).style?.fontSize, 32); await tester.tap(find.text('Cancel')); await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('landscape', (WidgetTester tester) async { + testWidgets('landscape', (WidgetTester tester) async { await showPicker(tester, kCommonScreenSizeLandscape); expect(tester.widget<Text>(find.text('Jan 15 – Jan 25, 2016')).style?.fontSize, 24); await tester.tap(find.text('Cancel')); @@ -260,7 +259,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Save and help text is used', (WidgetTester tester) async { + testWidgets('Save and help text is used', (WidgetTester tester) async { helpText = 'help'; saveText = 'make it so'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -269,14 +268,14 @@ void main() { }); }); - testWidgetsWithLeakTracking('Material3 has sentence case labels', (WidgetTester tester) async { + testWidgets('Material3 has sentence case labels', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.text('Save'), findsOneWidget); expect(find.text('Select range'), findsOneWidget); }, useMaterial3: true); }); - testWidgetsWithLeakTracking('Initial date is the default', (WidgetTester tester) async { + testWidgets('Initial date is the default', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('SAVE')); expect( @@ -289,7 +288,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Last month header should be visible if last date is selected', (WidgetTester tester) async { + testWidgets('Last month header should be visible if last date is selected', (WidgetTester tester) async { firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); initialDateRange = DateTimeRange( @@ -303,7 +302,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('First month header should be visible if first date is selected', (WidgetTester tester) async { + testWidgets('First month header should be visible if first date is selected', (WidgetTester tester) async { firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); initialDateRange = DateTimeRange( @@ -318,7 +317,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Current month header should be visible if no date is selected', (WidgetTester tester) async { + testWidgets('Current month header should be visible if no date is selected', (WidgetTester tester) async { firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); currentDate = DateTime(2016, DateTime.september); @@ -332,14 +331,14 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can cancel', (WidgetTester tester) async { + testWidgets('Can cancel', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.byIcon(Icons.close)); expect(await range, isNull); }); }); - testWidgetsWithLeakTracking('Can select a range', (WidgetTester tester) async { + testWidgets('Can select a range', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('12').first); await tester.tap(find.text('14').first); @@ -351,7 +350,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Tapping earlier date resets selected range', (WidgetTester tester) async { + testWidgets('Tapping earlier date resets selected range', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('12').first); await tester.tap(find.text('11').first); @@ -364,7 +363,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can select single day range', (WidgetTester tester) async { + testWidgets('Can select single day range', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('12').first); await tester.tap(find.text('12').first); @@ -376,7 +375,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Cannot select a day outside bounds', (WidgetTester tester) async { + testWidgets('Cannot select a day outside bounds', (WidgetTester tester) async { initialDateRange = DateTimeRange( start: DateTime(2017, DateTime.january, 13), end: DateTime(2017, DateTime.january, 15), @@ -394,7 +393,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can switch from calendar to input entry mode', (WidgetTester tester) async { + testWidgets('Can switch from calendar to input entry mode', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNothing); await tester.tap(find.byIcon(Icons.edit)); @@ -403,7 +402,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can switch from input to calendar entry mode', (WidgetTester tester) async { + testWidgets('Can switch from input to calendar entry mode', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.input; await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNWidgets(2)); @@ -413,7 +412,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can not switch out of calendarOnly mode', (WidgetTester tester) async { + testWidgets('Can not switch out of calendarOnly mode', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.calendarOnly; await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNothing); @@ -421,7 +420,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can not switch out of inputOnly mode', (WidgetTester tester) async { + testWidgets('Can not switch out of inputOnly mode', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.inputOnly; await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNWidgets(2)); @@ -429,7 +428,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Input only mode should validate date', (WidgetTester tester) async { + testWidgets('Input only mode should validate date', (WidgetTester tester) async { initialEntryMode = DatePickerEntryMode.inputOnly; errorInvalidText = 'oops'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -443,7 +442,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Switching to input mode keeps selected date', (WidgetTester tester) async { + testWidgets('Switching to input mode keeps selected date', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('12').first); await tester.tap(find.text('14').first); @@ -462,7 +461,7 @@ void main() { initialEntryMode = DatePickerEntryMode.input; }); - testWidgetsWithLeakTracking('Invalid start date', (WidgetTester tester) async { + testWidgets('Invalid start date', (WidgetTester tester) async { // Invalid start date should have neither a start nor end date selected in // calendar mode await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -476,7 +475,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Invalid end date', (WidgetTester tester) async { + testWidgets('Invalid end date', (WidgetTester tester) async { // Invalid end date should only have a start date selected await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.enterText(find.byType(TextField).at(0), '12/24/2016'); @@ -489,7 +488,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Invalid range', (WidgetTester tester) async { + testWidgets('Invalid range', (WidgetTester tester) async { // Start date after end date should just use the start date await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.enterText(find.byType(TextField).at(0), '12/25/2016'); @@ -503,7 +502,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('OK Cancel button layout', (WidgetTester tester) async { + testWidgets('OK Cancel button layout', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -578,7 +577,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('Selecting dates vibrates', (WidgetTester tester) async { + testWidgets('Selecting dates vibrates', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('10').first); await tester.pump(hapticFeedbackInterval); @@ -592,7 +591,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Tapping unselectable date does not vibrate', (WidgetTester tester) async { + testWidgets('Tapping unselectable date does not vibrate', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('8').first); await tester.pump(hapticFeedbackInterval); @@ -602,7 +601,7 @@ void main() { }); group('Keyboard navigation', () { - testWidgetsWithLeakTracking('Can toggle to calendar entry mode', (WidgetTester tester) async { + testWidgets('Can toggle to calendar entry mode', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNothing); // Navigate to the entry toggle button and activate it @@ -615,7 +614,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can navigate date grid with arrow keys', (WidgetTester tester) async { + testWidgets('Can navigate date grid with arrow keys', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { // Navigate to the grid await tester.sendKeyEvent(LogicalKeyboardKey.tab); @@ -667,7 +666,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Navigating with arrow keys scrolls as needed', (WidgetTester tester) async { + testWidgets('Navigating with arrow keys scrolls as needed', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { // Jan and Feb headers should be showing, but no March expect(find.text('January 2016'), findsOneWidget); @@ -732,7 +731,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('RTL text direction reverses the horizontal arrow key navigation', (WidgetTester tester) async { + testWidgets('RTL text direction reverses the horizontal arrow key navigation', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { // Navigate to the grid await tester.sendKeyEvent(LogicalKeyboardKey.tab); @@ -791,7 +790,7 @@ void main() { initialEntryMode = DatePickerEntryMode.input; }); - testWidgetsWithLeakTracking('Default Dialog properties (input mode)', (WidgetTester tester) async { + testWidgets('Default Dialog properties (input mode)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Material dialogMaterial = tester.widget<Material>( @@ -814,7 +813,7 @@ void main() { }, useMaterial3: theme.useMaterial3); }); - testWidgetsWithLeakTracking('Default InputDecoration', (WidgetTester tester) async { + testWidgets('Default InputDecoration', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { final InputDecoration startDateDecoration = tester.widget<TextField>( find.byType(TextField).first).decoration!; @@ -834,13 +833,13 @@ void main() { }, useMaterial3: true); }); - testWidgetsWithLeakTracking('Initial entry mode is used', (WidgetTester tester) async { + testWidgets('Initial entry mode is used', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNWidgets(2)); }); }); - testWidgetsWithLeakTracking('All custom strings are used', (WidgetTester tester) async { + testWidgets('All custom strings are used', (WidgetTester tester) async { initialDateRange = null; cancelText = 'nope'; confirmText = 'yep'; @@ -860,7 +859,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Initial date is the default', (WidgetTester tester) async { + testWidgets('Initial date is the default', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.tap(find.text('OK')); expect(await range, DateTimeRange( @@ -870,7 +869,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can toggle to calendar entry mode', (WidgetTester tester) async { + testWidgets('Can toggle to calendar entry mode', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { expect(find.byType(TextField), findsNWidgets(2)); await tester.tap(find.byIcon(Icons.calendar_today)); @@ -879,7 +878,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Toggle to calendar mode keeps selected date', (WidgetTester tester) async { + testWidgets('Toggle to calendar mode keeps selected date', (WidgetTester tester) async { initialDateRange = null; await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.enterText(find.byType(TextField).at(0), '12/25/2016'); @@ -895,7 +894,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Entered text returns range', (WidgetTester tester) async { + testWidgets('Entered text returns range', (WidgetTester tester) async { initialDateRange = null; await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.enterText(find.byType(TextField).at(0), '12/25/2016'); @@ -909,7 +908,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Too short entered text shows error', (WidgetTester tester) async { + testWidgets('Too short entered text shows error', (WidgetTester tester) async { initialDateRange = null; errorFormatText = 'oops'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -923,7 +922,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Bad format entered text shows error', (WidgetTester tester) async { + testWidgets('Bad format entered text shows error', (WidgetTester tester) async { initialDateRange = null; errorFormatText = 'oops'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -937,7 +936,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Invalid entered text shows error', (WidgetTester tester) async { + testWidgets('Invalid entered text shows error', (WidgetTester tester) async { initialDateRange = null; errorInvalidText = 'oops'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -951,7 +950,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('End before start date shows error', (WidgetTester tester) async { + testWidgets('End before start date shows error', (WidgetTester tester) async { initialDateRange = null; errorInvalidRangeText = 'oops'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -965,7 +964,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Error text only displayed for invalid date', (WidgetTester tester) async { + testWidgets('Error text only displayed for invalid date', (WidgetTester tester) async { initialDateRange = null; errorInvalidText = 'oops'; await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -979,7 +978,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('End before start date does not get passed to calendar mode', (WidgetTester tester) async { + testWidgets('End before start date does not get passed to calendar mode', (WidgetTester tester) async { initialDateRange = null; await preparePicker(tester, (Future<DateTimeRange?> range) async { await tester.enterText(find.byType(TextField).at(0), '12/27/2016'); @@ -997,7 +996,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('InputDecorationTheme is honored', (WidgetTester tester) async { + testWidgets('InputDecorationTheme is honored', (WidgetTester tester) async { // Given a custom paint for an input decoration, extract the border and // fill color and test them against the expected values. @@ -1063,7 +1062,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/131989. - testWidgetsWithLeakTracking('Dialog contents do not overflow when resized from landscape to portrait', + testWidgets('Dialog contents do not overflow when resized from landscape to portrait', (WidgetTester tester) async { addTearDown(tester.view.reset); // Initial window size is wide for landscape mode. @@ -1079,7 +1078,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('DatePickerDialog is state restorable', (WidgetTester tester) async { + testWidgets('DatePickerDialog is state restorable', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1135,7 +1134,7 @@ void main() { expect(find.text('12/1/2021 to 14/1/2021'), findsOneWidget); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('DateRangePickerDialog state restoration - DatePickerEntryMode', (WidgetTester tester) async { + testWidgets('DateRangePickerDialog state restoration - DatePickerEntryMode', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', @@ -1185,7 +1184,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 group('showDateRangePicker avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning with anchorPoint', (WidgetTester tester) async { + testWidgets('positioning with anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1222,7 +1221,7 @@ void main() { expect(tester.getBottomRight(find.byType(DateRangePickerDialog)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with Directionality', (WidgetTester tester) async { + testWidgets('positioning with Directionality', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1262,7 +1261,7 @@ void main() { expect(tester.getBottomRight(find.byType(DateRangePickerDialog)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with defaults', (WidgetTester tester) async { + testWidgets('positioning with defaults', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1300,7 +1299,7 @@ void main() { }); group('Semantics', () { - testWidgetsWithLeakTracking('calendar mode', (WidgetTester tester) async { + testWidgets('calendar mode', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); currentDate = DateTime(2016, DateTime.january, 30); await preparePicker(tester, (Future<DateTimeRange?> range) async { @@ -1318,7 +1317,7 @@ void main() { }); for (final TextInputType? keyboardType in <TextInputType?>[null, TextInputType.emailAddress]) { - testWidgetsWithLeakTracking('DateRangePicker takes keyboardType $keyboardType', (WidgetTester tester) async { + testWidgets('DateRangePicker takes keyboardType $keyboardType', (WidgetTester tester) async { late BuildContext buttonContext; const InputBorder border = InputBorder.none; await tester.pumpWidget(MaterialApp( @@ -1371,7 +1370,7 @@ void main() { }); } - testWidgetsWithLeakTracking('honors switchToInputEntryModeIcon', (WidgetTester tester) async { + testWidgets('honors switchToInputEntryModeIcon', (WidgetTester tester) async { Widget buildApp({bool? useMaterial3, Icon? switchToInputEntryModeIcon}) { return MaterialApp( theme: ThemeData( @@ -1426,7 +1425,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('honors switchToCalendarEntryModeIcon', (WidgetTester tester) async { + testWidgets('honors switchToCalendarEntryModeIcon', (WidgetTester tester) async { Widget buildApp({bool? useMaterial3, Icon? switchToCalendarEntryModeIcon}) { return MaterialApp( theme: ThemeData( @@ -1489,7 +1488,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Default layout (calendar mode)', (WidgetTester tester) async { + testWidgets('Default layout (calendar mode)', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { final Finder helpText = find.text('SELECT RANGE'); final Finder firstDateHeaderText = find.text('Jan 15'); @@ -1545,7 +1544,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Default Dialog properties (calendar mode)', (WidgetTester tester) async { + testWidgets('Default Dialog properties (calendar mode)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Material dialogMaterial = tester.widget<Material>( @@ -1565,7 +1564,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Scaffold and AppBar defaults', (WidgetTester tester) async { + testWidgets('Scaffold and AppBar defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Scaffold scaffold = tester.widget<Scaffold>(find.byType(Scaffold)); @@ -1592,7 +1591,7 @@ void main() { initialEntryMode = DatePickerEntryMode.input; }); - testWidgetsWithLeakTracking('Default Dialog properties (input mode)', (WidgetTester tester) async { + testWidgets('Default Dialog properties (input mode)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await preparePicker(tester, (Future<DateTimeRange?> range) async { final Material dialogMaterial = tester.widget<Material>( @@ -1615,7 +1614,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Default InputDecoration', (WidgetTester tester) async { + testWidgets('Default InputDecoration', (WidgetTester tester) async { await preparePicker(tester, (Future<DateTimeRange?> range) async { final InputDecoration startDateDecoration = tester.widget<TextField>( find.byType(TextField).first).decoration!; diff --git a/packages/flutter/test/material/debug_test.dart b/packages/flutter/test/material/debug_test.dart index 45d7ff879d5..3438646e800 100644 --- a/packages/flutter/test/material/debug_test.dart +++ b/packages/flutter/test/material/debug_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('debugCheckHasMaterial control test', (WidgetTester tester) async { + testWidgets('debugCheckHasMaterial control test', (WidgetTester tester) async { await tester.pumpWidget(const Center(child: Chip(label: Text('label')))); final dynamic exception = tester.takeException(); expect(exception, isFlutterError); @@ -48,7 +47,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('debugCheckHasMaterialLocalizations control test', (WidgetTester tester) async { + testWidgets('debugCheckHasMaterialLocalizations control test', (WidgetTester tester) async { await tester.pumpWidget(const Center(child: BackButton())); final dynamic exception = tester.takeException(); expect(exception, isFlutterError); @@ -85,7 +84,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('debugCheckHasScaffold control test', (WidgetTester tester) async { + testWidgets('debugCheckHasScaffold control test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -137,7 +136,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('debugCheckHasScaffoldMessenger control test', (WidgetTester tester) async { + testWidgets('debugCheckHasScaffoldMessenger control test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>(); final SnackBar snackBar = SnackBar( diff --git a/packages/flutter/test/material/desktop_text_selection_toolbar_button_test.dart b/packages/flutter/test/material/desktop_text_selection_toolbar_button_test.dart index e025948ea09..80a82acaa25 100644 --- a/packages/flutter/test/material/desktop_text_selection_toolbar_button_test.dart +++ b/packages/flutter/test/material/desktop_text_selection_toolbar_button_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('can press', (WidgetTester tester) async { + testWidgets('can press', (WidgetTester tester) async { bool pressed = false; await tester.pumpWidget( MaterialApp( @@ -30,7 +29,7 @@ void main() { expect(pressed, true); }); - testWidgetsWithLeakTracking('passing null to onPressed disables the button', (WidgetTester tester) async { + testWidgets('passing null to onPressed disables the button', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( diff --git a/packages/flutter/test/material/desktop_text_selection_toolbar_test.dart b/packages/flutter/test/material/desktop_text_selection_toolbar_test.dart index 3a0652b7b33..3052356febf 100644 --- a/packages/flutter/test/material/desktop_text_selection_toolbar_test.dart +++ b/packages/flutter/test/material/desktop_text_selection_toolbar_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('positions itself at the anchor', (WidgetTester tester) async { + testWidgets('positions itself at the anchor', (WidgetTester tester) async { // An arbitrary point on the screen to position at. const Offset anchor = Offset(30.0, 40.0); diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index be12f2af742..d3b47c87040 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; MaterialApp _buildAppWithDialog( @@ -69,7 +68,7 @@ void main() { final ThemeData material3Theme = ThemeData(useMaterial3: true, brightness: Brightness.dark); final ThemeData material2Theme = ThemeData(useMaterial3: false, brightness: Brightness.dark); - testWidgetsWithLeakTracking('Dialog is scrollable', (WidgetTester tester) async { + testWidgets('Dialog is scrollable', (WidgetTester tester) async { bool didPressOk = false; final AlertDialog dialog = AlertDialog( content: Container( @@ -96,7 +95,7 @@ void main() { expect(didPressOk, true); }); - testWidgetsWithLeakTracking('Dialog background color from AlertDialog', (WidgetTester tester) async { + testWidgets('Dialog background color from AlertDialog', (WidgetTester tester) async { const Color customColor = Colors.pink; const AlertDialog dialog = AlertDialog( backgroundColor: customColor, @@ -111,7 +110,7 @@ void main() { expect(materialWidget.color, customColor); }); - testWidgetsWithLeakTracking('Material2 - Dialog Defaults', (WidgetTester tester) async { + testWidgets('Material2 - Dialog Defaults', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( title: Text('Title'), content: Text('Y'), @@ -133,7 +132,7 @@ void main() { expect(bottomLeft.dy, 360.0); }); - testWidgetsWithLeakTracking('Material3 - Dialog Defaults', (WidgetTester tester) async { + testWidgets('Material3 - Dialog Defaults', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( title: Text('Title'), content: Text('Y'), @@ -150,7 +149,7 @@ void main() { expect(material3Widget.elevation, 6.0); }); - testWidgetsWithLeakTracking('Material2 - Dialog.fullscreen Defaults', (WidgetTester tester) async { + testWidgets('Material2 - Dialog.fullscreen Defaults', (WidgetTester tester) async { const String dialogTextM2 = 'Fullscreen Dialog - M2'; await tester.pumpWidget(_buildAppWithDialog( @@ -175,7 +174,7 @@ void main() { expect(find.text(dialogTextM2), findsNothing); }); - testWidgetsWithLeakTracking('Material3 - Dialog.fullscreen Defaults', (WidgetTester tester) async { + testWidgets('Material3 - Dialog.fullscreen Defaults', (WidgetTester tester) async { const String dialogTextM3 = 'Fullscreen Dialog - M3'; await tester.pumpWidget(_buildAppWithDialog( @@ -200,7 +199,7 @@ void main() { expect(find.text(dialogTextM3), findsNothing); }); - testWidgetsWithLeakTracking('Custom dialog elevation', (WidgetTester tester) async { + testWidgets('Custom dialog elevation', (WidgetTester tester) async { const double customElevation = 12.0; const Color shadowColor = Color(0xFF000001); const Color surfaceTintColor = Color(0xFF000002); @@ -221,7 +220,7 @@ void main() { expect(materialWidget.surfaceTintColor, surfaceTintColor); }); - testWidgetsWithLeakTracking('Custom Title Text Style', (WidgetTester tester) async { + testWidgets('Custom Title Text Style', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog( @@ -238,7 +237,7 @@ void main() { expect(title.text.style, titleTextStyle); }); - testWidgetsWithLeakTracking('Custom Content Text Style', (WidgetTester tester) async { + testWidgets('Custom Content Text Style', (WidgetTester tester) async { const String contentText = 'Content'; const TextStyle contentTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog( @@ -255,7 +254,7 @@ void main() { expect(content.text.style, contentTextStyle); }); - testWidgetsWithLeakTracking('AlertDialog custom clipBehavior', (WidgetTester tester) async { + testWidgets('AlertDialog custom clipBehavior', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( actions: <Widget>[], clipBehavior: Clip.antiAlias, @@ -269,7 +268,7 @@ void main() { expect(materialWidget.clipBehavior, Clip.antiAlias); }); - testWidgetsWithLeakTracking('SimpleDialog custom clipBehavior', (WidgetTester tester) async { + testWidgets('SimpleDialog custom clipBehavior', (WidgetTester tester) async { const SimpleDialog dialog = SimpleDialog( clipBehavior: Clip.antiAlias, children: <Widget>[], @@ -283,7 +282,7 @@ void main() { expect(materialWidget.clipBehavior, Clip.antiAlias); }); - testWidgetsWithLeakTracking('Custom dialog shape', (WidgetTester tester) async { + testWidgets('Custom dialog shape', (WidgetTester tester) async { const RoundedRectangleBorder customBorder = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))); const AlertDialog dialog = AlertDialog( @@ -299,7 +298,7 @@ void main() { expect(materialWidget.shape, customBorder); }); - testWidgetsWithLeakTracking('Null dialog shape', (WidgetTester tester) async { + testWidgets('Null dialog shape', (WidgetTester tester) async { final ThemeData theme = ThemeData(); const AlertDialog dialog = AlertDialog( actions: <Widget>[ ], @@ -313,7 +312,7 @@ void main() { expect(materialWidget.shape, theme.useMaterial3 ? _defaultM3DialogShape : _defaultM2DialogShape); }); - testWidgetsWithLeakTracking('Rectangular dialog shape', (WidgetTester tester) async { + testWidgets('Rectangular dialog shape', (WidgetTester tester) async { const ShapeBorder customBorder = Border(); const AlertDialog dialog = AlertDialog( actions: <Widget>[ ], @@ -328,7 +327,7 @@ void main() { expect(materialWidget.shape, customBorder); }); - testWidgetsWithLeakTracking('Custom dialog alignment', (WidgetTester tester) async { + testWidgets('Custom dialog alignment', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( actions: <Widget>[ ], alignment: Alignment.bottomLeft, @@ -345,7 +344,7 @@ void main() { expect(bottomLeft.dy, 576.0); }); - testWidgetsWithLeakTracking('Simple dialog control test', (WidgetTester tester) async { + testWidgets('Simple dialog control test', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -388,7 +387,7 @@ void main() { expect(await result, equals(42)); }); - testWidgetsWithLeakTracking('Can show dialog using navigator global key', (WidgetTester tester) async { + testWidgets('Can show dialog using navigator global key', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -428,7 +427,7 @@ void main() { expect(await result, equals(42)); }); - testWidgetsWithLeakTracking('Custom padding on SimpleDialogOption', (WidgetTester tester) async { + testWidgets('Custom padding on SimpleDialogOption', (WidgetTester tester) async { const EdgeInsets customPadding = EdgeInsets.fromLTRB(4, 10, 8, 6); final SimpleDialog dialog = SimpleDialog( title: const Text('Title'), @@ -454,7 +453,7 @@ void main() { expect(textRect.bottom, dialogRect.bottom - customPadding.bottom); }); - testWidgetsWithLeakTracking('Barrier dismissible', (WidgetTester tester) async { + testWidgets('Barrier dismissible', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -515,7 +514,7 @@ void main() { }); - testWidgetsWithLeakTracking('Barrier color', (WidgetTester tester) async { + testWidgets('Barrier color', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center(child: Text('Test')), @@ -546,7 +545,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, Colors.pink); }); - testWidgetsWithLeakTracking('Dialog hides underlying semantics tree', (WidgetTester tester) async { + testWidgets('Dialog hides underlying semantics tree', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const String buttonText = 'A button covered by dialog overlay'; await tester.pumpWidget( @@ -582,7 +581,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('AlertDialog.actionsPadding defaults', (WidgetTester tester) async { + testWidgets('AlertDialog.actionsPadding defaults', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( title: const Text('title'), content: const Text('content'), @@ -615,7 +614,7 @@ void main() { expect(actionsSize.width, dialogSize.width); }); - testWidgetsWithLeakTracking('AlertDialog.actionsPadding surrounds actions with padding', (WidgetTester tester) async { + testWidgets('AlertDialog.actionsPadding surrounds actions with padding', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( title: const Text('title'), content: const Text('content'), @@ -651,7 +650,7 @@ void main() { expect(actionsSize.width, dialogSize.width - (30.0 * 2)); }); - testWidgetsWithLeakTracking('Material2 - AlertDialog.buttonPadding defaults', (WidgetTester tester) async { + testWidgets('Material2 - AlertDialog.buttonPadding defaults', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -709,7 +708,7 @@ void main() { ); // right }); - testWidgetsWithLeakTracking('Material3 - AlertDialog.buttonPadding defaults', (WidgetTester tester) async { + testWidgets('Material3 - AlertDialog.buttonPadding defaults', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -767,7 +766,7 @@ void main() { ); // right }); - testWidgetsWithLeakTracking('AlertDialog.buttonPadding custom values', (WidgetTester tester) async { + testWidgets('AlertDialog.buttonPadding custom values', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -969,7 +968,7 @@ void main() { ]; for (final double textScaleFactor in textScaleFactors) { - testWidgetsWithLeakTracking('AlertDialog padding is correct when only icon and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('AlertDialog padding is correct when only icon and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( icon: icon, actions: actions, @@ -1021,7 +1020,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AlertDialog padding is correct when only icon, title and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('AlertDialog padding is correct when only icon, title and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( icon: icon, title: title, @@ -1093,7 +1092,7 @@ void main() { }); for (final bool isM3 in <bool>[true, false]) { - testWidgetsWithLeakTracking('AlertDialog padding is correct when only icon, content and actions are specified [textScaleFactor]=$textScaleFactor [isM3]=$isM3', (WidgetTester tester) async { + testWidgets('AlertDialog padding is correct when only icon, content and actions are specified [textScaleFactor]=$textScaleFactor [isM3]=$isM3', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( icon: icon, content: content, @@ -1165,7 +1164,7 @@ void main() { }); } - testWidgetsWithLeakTracking('AlertDialog padding is correct when only title and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('AlertDialog padding is correct when only title and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( title: title, actions: actions, @@ -1217,7 +1216,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AlertDialog padding is correct when only content and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('AlertDialog padding is correct when only content and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( content: content, actions: actions, @@ -1269,7 +1268,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AlertDialog padding is correct when title, content, and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('AlertDialog padding is correct when title, content, and actions are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog( title: title, content: content, @@ -1340,7 +1339,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SimpleDialog padding is correct when only children are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('SimpleDialog padding is correct when only children are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final SimpleDialog dialog = SimpleDialog( children: children, ); @@ -1373,7 +1372,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SimpleDialog padding is correct when title and children are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { + testWidgets('SimpleDialog padding is correct when title and children are specified [textScaleFactor]=$textScaleFactor', (WidgetTester tester) async { final SimpleDialog dialog = SimpleDialog( title: title, children: children, @@ -1427,7 +1426,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Dialogs can set the vertical direction of overflowing actions', (WidgetTester tester) async { + testWidgets('Dialogs can set the vertical direction of overflowing actions', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -1462,7 +1461,7 @@ void main() { expect(buttonTwoRect.bottom, lessThanOrEqualTo(buttonOneRect.top)); }); - testWidgetsWithLeakTracking('Dialogs have no spacing by default for overflowing actions', (WidgetTester tester) async { + testWidgets('Dialogs have no spacing by default for overflowing actions', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -1495,7 +1494,7 @@ void main() { expect(buttonOneRect.bottom, buttonTwoRect.top); }); - testWidgetsWithLeakTracking('Dialogs can set the button spacing of overflowing actions', (WidgetTester tester) async { + testWidgets('Dialogs can set the button spacing of overflowing actions', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -1529,7 +1528,7 @@ void main() { expect(buttonOneRect.bottom, buttonTwoRect.top - 10.0); }); - testWidgetsWithLeakTracking('Dialogs can set the alignment of the OverflowBar', (WidgetTester tester) async { + testWidgets('Dialogs can set the alignment of the OverflowBar', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -1563,7 +1562,7 @@ void main() { expect(buttonOneRect.center.dx, buttonTwoRect.center.dx); }); - testWidgetsWithLeakTracking('Dialogs removes MediaQuery padding and view insets', (WidgetTester tester) async { + testWidgets('Dialogs removes MediaQuery padding and view insets', (WidgetTester tester) async { late BuildContext outerContext; late BuildContext routeContext; late BuildContext dialogContext; @@ -1618,7 +1617,7 @@ void main() { expect(MediaQuery.of(dialogContext).viewInsets, EdgeInsets.zero); }); - testWidgetsWithLeakTracking('Dialog widget insets by viewInsets', (WidgetTester tester) async { + testWidgets('Dialog widget insets by viewInsets', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData( @@ -1652,7 +1651,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dialog insetPadding added to outside of dialog', (WidgetTester tester) async { + testWidgets('Dialog insetPadding added to outside of dialog', (WidgetTester tester) async { // The default testing screen (800, 600) const Rect screenRect = Rect.fromLTRB(0.0, 0.0, 800.0, 600.0); @@ -1692,7 +1691,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/78229. - testWidgetsWithLeakTracking('AlertDialog has correct semantics for content in iOS', (WidgetTester tester) async { + testWidgets('AlertDialog has correct semantics for content in iOS', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1757,7 +1756,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('AlertDialog widget always contains alert route semantics for android', (WidgetTester tester) async { + testWidgets('AlertDialog widget always contains alert route semantics for android', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1813,7 +1812,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SimpleDialog does not introduce additional node', (WidgetTester tester) async { + testWidgets('SimpleDialog does not introduce additional node', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1856,7 +1855,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/78229. - testWidgetsWithLeakTracking('SimpleDialog has correct semantics for title in iOS', (WidgetTester tester) async { + testWidgets('SimpleDialog has correct semantics for title in iOS', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1929,7 +1928,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Dismissible.confirmDismiss defers to an AlertDialog', (WidgetTester tester) async { + testWidgets('Dismissible.confirmDismiss defers to an AlertDialog', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final List<int> dismissedItems = <int>[]; @@ -2060,7 +2059,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/28505. - testWidgetsWithLeakTracking('showDialog only gets Theme from context on the first call', (WidgetTester tester) async { + testWidgets('showDialog only gets Theme from context on the first call', (WidgetTester tester) async { Widget buildFrame(Key builderKey) { return MaterialApp( home: Center( @@ -2097,7 +2096,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('showDialog safe area', (WidgetTester tester) async { + testWidgets('showDialog safe area', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -2138,7 +2137,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('showDialog uses root navigator by default', (WidgetTester tester) async { + testWidgets('showDialog uses root navigator by default', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); final DialogObserver nestedObserver = DialogObserver(); @@ -2173,7 +2172,7 @@ void main() { expect(nestedObserver.dialogCount, 0); }); - testWidgetsWithLeakTracking('showDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('showDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); final DialogObserver nestedObserver = DialogObserver(); @@ -2209,7 +2208,7 @@ void main() { expect(nestedObserver.dialogCount, 1); }); - testWidgetsWithLeakTracking('showDialog throws a friendly user message when context is not active', (WidgetTester tester) async { + testWidgets('showDialog throws a friendly user message when context is not active', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/12467 await tester.pumpWidget( const MaterialApp( @@ -2245,7 +2244,7 @@ void main() { }); group('showDialog avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning with anchorPoint', (WidgetTester tester) async { + testWidgets('positioning with anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -2283,7 +2282,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with Directionality', (WidgetTester tester) async { + testWidgets('positioning with Directionality', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -2323,7 +2322,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning by default', (WidgetTester tester) async { + testWidgets('positioning by default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -2362,7 +2361,7 @@ void main() { }); group('AlertDialog.scrollable: ', () { - testWidgetsWithLeakTracking('Title is scrollable', (WidgetTester tester) async { + testWidgets('Title is scrollable', (WidgetTester tester) async { final Key titleKey = UniqueKey(); final AlertDialog dialog = AlertDialog( title: Container( @@ -2382,7 +2381,7 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(originalOffset.translate(0.0, -200.0))); }); - testWidgetsWithLeakTracking('Content is scrollable', (WidgetTester tester) async { + testWidgets('Content is scrollable', (WidgetTester tester) async { final Key contentKey = UniqueKey(); final AlertDialog dialog = AlertDialog( content: Container( @@ -2402,7 +2401,7 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(originalOffset.translate(0.0, -200.0))); }); - testWidgetsWithLeakTracking('Title and content are scrollable', (WidgetTester tester) async { + testWidgets('Title and content are scrollable', (WidgetTester tester) async { final Key titleKey = UniqueKey(); final Key contentKey = UniqueKey(); final AlertDialog dialog = AlertDialog( @@ -2441,7 +2440,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Dialog with RouteSettings', (WidgetTester tester) async { + testWidgets('Dialog with RouteSettings', (WidgetTester tester) async { late RouteSettings currentRouteSetting; await tester.pumpWidget( @@ -2495,7 +2494,7 @@ void main() { expect(currentRouteSetting.name, '/'); }); - testWidgetsWithLeakTracking('showDialog - custom barrierLabel', (WidgetTester tester) async { + testWidgets('showDialog - custom barrierLabel', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2535,7 +2534,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('DialogRoute is state restorable', (WidgetTester tester) async { + testWidgets('DialogRoute is state restorable', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', @@ -2565,7 +2564,7 @@ void main() { expect(find.byType(AlertDialog), findsOneWidget); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('AlertDialog.actionsAlignment', (WidgetTester tester) async { + testWidgets('AlertDialog.actionsAlignment', (WidgetTester tester) async { final Key actionKey = UniqueKey(); Widget buildFrame(MainAxisAlignment? alignment) { @@ -2618,7 +2617,7 @@ void main() { expect(tester.getTopRight(find.byKey(actionKey)).dx, (800 - 20) / 2 + 20); }); - testWidgetsWithLeakTracking('Uses closed loop focus traversal', (WidgetTester tester) async { + testWidgets('Uses closed loop focus traversal', (WidgetTester tester) async { final FocusNode okNode = FocusNode(); final FocusNode cancelNode = FocusNode(); @@ -2689,7 +2688,7 @@ void main() { okNode.dispose(); }); - testWidgetsWithLeakTracking('Adaptive AlertDialog shows correct widget on each platform', (WidgetTester tester) async { + testWidgets('Adaptive AlertDialog shows correct widget on each platform', (WidgetTester tester) async { final AlertDialog dialog = AlertDialog.adaptive( content: Container( height: 5000.0, @@ -2731,7 +2730,7 @@ void main() { } }); - testWidgetsWithLeakTracking('showAdaptiveDialog should not allow dismiss on barrier on iOS by default', (WidgetTester tester) async { + testWidgets('showAdaptiveDialog should not allow dismiss on barrier on iOS by default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: TargetPlatform.iOS), @@ -2791,7 +2790,7 @@ void main() { expect(find.text('Dialog2'), findsOneWidget); }); - testWidgetsWithLeakTracking('Uses open focus traversal when overridden', (WidgetTester tester) async { + testWidgets('Uses open focus traversal when overridden', (WidgetTester tester) async { final FocusNode okNode = FocusNode(); addTearDown(okNode.dispose); final FocusNode cancelNode = FocusNode(); diff --git a/packages/flutter/test/material/dialog_theme_test.dart b/packages/flutter/test/material/dialog_theme_test.dart index e327542e005..0d41077d0c8 100644 --- a/packages/flutter/test/material/dialog_theme_test.dart +++ b/packages/flutter/test/material/dialog_theme_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; MaterialApp _appWithDialog(WidgetTester tester, Widget dialog, { ThemeData? theme }) { return MaterialApp( @@ -55,7 +54,7 @@ void main() { expect(identical(DialogTheme.lerp(theme, theme, 0.5), theme), true); }); - testWidgetsWithLeakTracking('Dialog Theme implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Dialog Theme implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DialogTheme( backgroundColor: Color(0xff123456), @@ -84,7 +83,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Dialog background color', (WidgetTester tester) async { + testWidgets('Dialog background color', (WidgetTester tester) async { const Color customColor = Colors.pink; const AlertDialog dialog = AlertDialog( title: Text('Title'), @@ -100,7 +99,7 @@ void main() { expect(materialWidget.color, customColor); }); - testWidgetsWithLeakTracking('Custom dialog elevation', (WidgetTester tester) async { + testWidgets('Custom dialog elevation', (WidgetTester tester) async { const double customElevation = 12.0; const Color shadowColor = Color(0xFF000001); const Color surfaceTintColor = Color(0xFF000002); @@ -128,7 +127,7 @@ void main() { expect(materialWidget.surfaceTintColor, surfaceTintColor); }); - testWidgetsWithLeakTracking('Custom dialog shape', (WidgetTester tester) async { + testWidgets('Custom dialog shape', (WidgetTester tester) async { const RoundedRectangleBorder customBorder = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))); const AlertDialog dialog = AlertDialog( @@ -147,7 +146,7 @@ void main() { expect(materialWidget.shape, customBorder); }); - testWidgetsWithLeakTracking('Custom dialog alignment', (WidgetTester tester) async { + testWidgets('Custom dialog alignment', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( title: Text('Title'), actions: <Widget>[ ], @@ -167,7 +166,7 @@ void main() { expect(bottomLeft.dy, 576.0); }); - testWidgetsWithLeakTracking('Material3 - Dialog alignment takes priority over theme', (WidgetTester tester) async { + testWidgets('Material3 - Dialog alignment takes priority over theme', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( title: Text('Title'), actions: <Widget>[ ], @@ -193,7 +192,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material2 - Dialog alignment takes priority over theme', (WidgetTester tester) async { + testWidgets('Material2 - Dialog alignment takes priority over theme', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( title: Text('Title'), actions: <Widget>[ ], @@ -214,7 +213,7 @@ void main() { expect(bottomLeft.dy, 104.0); }); - testWidgetsWithLeakTracking('Material3 - Custom dialog shape matches golden', (WidgetTester tester) async { + testWidgets('Material3 - Custom dialog shape matches golden', (WidgetTester tester) async { const RoundedRectangleBorder customBorder = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))); const AlertDialog dialog = AlertDialog( @@ -236,7 +235,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Custom dialog shape matches golden', (WidgetTester tester) async { + testWidgets('Material2 - Custom dialog shape matches golden', (WidgetTester tester) async { const RoundedRectangleBorder customBorder = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))); const AlertDialog dialog = AlertDialog( @@ -255,7 +254,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Custom Icon Color - Constructor Param - highest preference', (WidgetTester tester) async { + testWidgets('Custom Icon Color - Constructor Param - highest preference', (WidgetTester tester) async { const Color iconColor = Colors.pink, dialogThemeColor = Colors.green, iconThemeColor = Colors.yellow; final ThemeData theme = ThemeData( iconTheme: const IconThemeData(color: iconThemeColor), @@ -276,7 +275,7 @@ void main() { expect(text.text.style!.color, iconColor); }); - testWidgetsWithLeakTracking('Custom Icon Color - Dialog Theme - preference over Theme', (WidgetTester tester) async { + testWidgets('Custom Icon Color - Dialog Theme - preference over Theme', (WidgetTester tester) async { const Color dialogThemeColor = Colors.green, iconThemeColor = Colors.yellow; final ThemeData theme = ThemeData( iconTheme: const IconThemeData(color: iconThemeColor), @@ -296,7 +295,7 @@ void main() { expect(text.text.style!.color, dialogThemeColor); }); - testWidgetsWithLeakTracking('Material3 - Custom Icon Color - Theme - lowest preference', (WidgetTester tester) async { + testWidgets('Material3 - Custom Icon Color - Theme - lowest preference', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const AlertDialog dialog = AlertDialog( icon: Icon(Icons.ac_unit), @@ -312,7 +311,7 @@ void main() { expect(text.text.style!.color, theme.colorScheme.secondary); }); - testWidgetsWithLeakTracking('Material2 - Custom Icon Color - Theme - lowest preference', (WidgetTester tester) async { + testWidgets('Material2 - Custom Icon Color - Theme - lowest preference', (WidgetTester tester) async { const Color iconThemeColor = Colors.yellow; final ThemeData theme = ThemeData(useMaterial3: false, iconTheme: const IconThemeData(color: iconThemeColor)); const AlertDialog dialog = AlertDialog( @@ -329,7 +328,7 @@ void main() { expect(text.text.style!.color, iconThemeColor); }); - testWidgetsWithLeakTracking('Custom Title Text Style - Constructor Param', (WidgetTester tester) async { + testWidgets('Custom Title Text Style - Constructor Param', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog( @@ -346,7 +345,7 @@ void main() { expect(title.text.style, titleTextStyle); }); - testWidgetsWithLeakTracking('Custom Title Text Style - Dialog Theme', (WidgetTester tester) async { + testWidgets('Custom Title Text Style - Dialog Theme', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog( @@ -363,7 +362,7 @@ void main() { expect(title.text.style, titleTextStyle); }); - testWidgetsWithLeakTracking('Material3 - Custom Title Text Style - Theme', (WidgetTester tester) async { + testWidgets('Material3 - Custom Title Text Style - Theme', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog(title: Text(titleText)); @@ -377,7 +376,7 @@ void main() { expect(title.text.style!.color, titleTextStyle.color); }); - testWidgetsWithLeakTracking('Material2 - Custom Title Text Style - Theme', (WidgetTester tester) async { + testWidgets('Material2 - Custom Title Text Style - Theme', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog(title: Text(titleText)); @@ -391,7 +390,7 @@ void main() { expect(title.text.style!.color, titleTextStyle.color); }); - testWidgetsWithLeakTracking('Simple Dialog - Custom Title Text Style - Constructor Param', (WidgetTester tester) async { + testWidgets('Simple Dialog - Custom Title Text Style - Constructor Param', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const SimpleDialog dialog = SimpleDialog( @@ -407,7 +406,7 @@ void main() { expect(title.text.style, titleTextStyle); }); - testWidgetsWithLeakTracking('Simple Dialog - Custom Title Text Style - Dialog Theme', (WidgetTester tester) async { + testWidgets('Simple Dialog - Custom Title Text Style - Dialog Theme', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const SimpleDialog dialog = SimpleDialog( @@ -423,7 +422,7 @@ void main() { expect(title.text.style, titleTextStyle); }); - testWidgetsWithLeakTracking('Simple Dialog - Custom Title Text Style - Theme', (WidgetTester tester) async { + testWidgets('Simple Dialog - Custom Title Text Style - Theme', (WidgetTester tester) async { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const SimpleDialog dialog = SimpleDialog( @@ -439,7 +438,7 @@ void main() { expect(title.text.style!.color, titleTextStyle.color); }); - testWidgetsWithLeakTracking('Custom Content Text Style - Constructor Param', (WidgetTester tester) async { + testWidgets('Custom Content Text Style - Constructor Param', (WidgetTester tester) async { const String contentText = 'Content'; const TextStyle contentTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog( @@ -456,7 +455,7 @@ void main() { expect(content.text.style, contentTextStyle); }); - testWidgetsWithLeakTracking('Custom Content Text Style - Dialog Theme', (WidgetTester tester) async { + testWidgets('Custom Content Text Style - Dialog Theme', (WidgetTester tester) async { const String contentText = 'Content'; const TextStyle contentTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog( @@ -473,7 +472,7 @@ void main() { expect(content.text.style, contentTextStyle); }); - testWidgetsWithLeakTracking('Material3 - Custom Content Text Style - Theme', (WidgetTester tester) async { + testWidgets('Material3 - Custom Content Text Style - Theme', (WidgetTester tester) async { const String contentText = 'Content'; const TextStyle contentTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog(content: Text(contentText),); @@ -487,7 +486,7 @@ void main() { expect(content.text.style!.color, contentTextStyle.color); }); - testWidgetsWithLeakTracking('Material2 - Custom Content Text Style - Theme', (WidgetTester tester) async { + testWidgets('Material2 - Custom Content Text Style - Theme', (WidgetTester tester) async { const String contentText = 'Content'; const TextStyle contentTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog(content: Text(contentText)); diff --git a/packages/flutter/test/material/divider_test.dart b/packages/flutter/test/material/divider_test.dart index 35cd3118883..9249ea6112a 100644 --- a/packages/flutter/test/material/divider_test.dart +++ b/packages/flutter/test/material/divider_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Material3 - Divider control test', (WidgetTester tester) async { + testWidgets('Material3 - Divider control test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -21,7 +20,7 @@ void main() { expect(decoration.border!.bottom.width, 1.0); }); - testWidgetsWithLeakTracking('Material2 - Divider control test', (WidgetTester tester) async { + testWidgets('Material2 - Divider control test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -35,7 +34,7 @@ void main() { expect(decoration.border!.bottom.width, 0.0); }); - testWidgetsWithLeakTracking('Divider custom thickness', (WidgetTester tester) async { + testWidgets('Divider custom thickness', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -47,7 +46,7 @@ void main() { expect(decoration.border!.bottom.width, 5.0); }); - testWidgetsWithLeakTracking('Horizontal divider custom indentation', (WidgetTester tester) async { + testWidgets('Horizontal divider custom indentation', (WidgetTester tester) async { const double customIndent = 10.0; Rect dividerRect; Rect lineRect; @@ -92,7 +91,7 @@ void main() { expect(lineRect.right, dividerRect.right - customIndent); }); - testWidgetsWithLeakTracking('Material3 - Vertical Divider Test', (WidgetTester tester) async { + testWidgets('Material3 - Vertical Divider Test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -107,7 +106,7 @@ void main() { expect(border.left.width, 1.0); }); - testWidgetsWithLeakTracking('Material2 - Vertical Divider Test', (WidgetTester tester) async { + testWidgets('Material2 - Vertical Divider Test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -122,7 +121,7 @@ void main() { expect(border.left.width, 0.0); }); - testWidgetsWithLeakTracking('Divider custom thickness', (WidgetTester tester) async { + testWidgets('Divider custom thickness', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -135,7 +134,7 @@ void main() { expect(border.left.width, 5.0); }); - testWidgetsWithLeakTracking('Vertical Divider Test 2', (WidgetTester tester) async { + testWidgets('Vertical Divider Test 2', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -160,7 +159,7 @@ void main() { expect(find.byType(VerticalDivider), paints..path(strokeWidth: 0.0)); }); - testWidgetsWithLeakTracking('Vertical divider custom indentation', (WidgetTester tester) async { + testWidgets('Vertical divider custom indentation', (WidgetTester tester) async { const double customIndent = 10.0; Rect dividerRect; Rect lineRect; @@ -206,7 +205,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/39533 - testWidgetsWithLeakTracking('createBorderSide does not throw exception with null context', (WidgetTester tester) async { + testWidgets('createBorderSide does not throw exception with null context', (WidgetTester tester) async { // Passing a null context used to throw an exception but no longer does. expect(() => Divider.createBorderSide(null), isNot(throwsAssertionError)); expect(() => Divider.createBorderSide(null), isNot(throwsNoSuchMethodError)); diff --git a/packages/flutter/test/material/divider_theme_test.dart b/packages/flutter/test/material/divider_theme_test.dart index 6611d6bc750..6928a792d49 100644 --- a/packages/flutter/test/material/divider_theme_test.dart +++ b/packages/flutter/test/material/divider_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('DividerThemeData copyWith, ==, hashCode basics', () { @@ -22,7 +21,7 @@ void main() { expect(dividerTheme.endIndent, null); }); - testWidgetsWithLeakTracking('Default DividerThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default DividerThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DividerThemeData().debugFillProperties(builder); @@ -34,7 +33,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('DividerThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('DividerThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DividerThemeData( color: Color(0xFFFFFFFF), @@ -59,7 +58,7 @@ void main() { }); group('Material3 - Horizontal Divider', () { - testWidgetsWithLeakTracking('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( theme: theme, @@ -83,7 +82,7 @@ void main() { expect(lineRect.right, dividerRect.right); }); - testWidgetsWithLeakTracking('Uses values from DividerThemeData', (WidgetTester tester) async { + testWidgets('Uses values from DividerThemeData', (WidgetTester tester) async { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true, dividerTheme: dividerTheme), @@ -106,7 +105,7 @@ void main() { expect(lineRect.right, dividerRect.right - dividerTheme.endIndent!); }); - testWidgetsWithLeakTracking('DividerTheme overrides defaults', (WidgetTester tester) async { + testWidgets('DividerTheme overrides defaults', (WidgetTester tester) async { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), @@ -124,7 +123,7 @@ void main() { expect(decoration.border!.bottom.color, dividerTheme.color); }); - testWidgetsWithLeakTracking('Widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('Widget properties take priority over theme', (WidgetTester tester) async { const Color color = Colors.purple; const double height = 10.0; const double thickness = 5.0; @@ -161,7 +160,7 @@ void main() { }); group('Material3 - Vertical Divider', () { - testWidgetsWithLeakTracking('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( theme: theme, @@ -186,7 +185,7 @@ void main() { expect(lineRect.bottom, dividerRect.bottom); }); - testWidgetsWithLeakTracking('Uses values from DividerThemeData', (WidgetTester tester) async { + testWidgets('Uses values from DividerThemeData', (WidgetTester tester) async { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget(MaterialApp( theme: ThemeData(dividerTheme: dividerTheme), @@ -210,7 +209,7 @@ void main() { expect(lineRect.bottom, dividerRect.bottom - dividerTheme.endIndent!); }); - testWidgetsWithLeakTracking('DividerTheme overrides defaults', (WidgetTester tester) async { + testWidgets('DividerTheme overrides defaults', (WidgetTester tester) async { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), @@ -229,7 +228,7 @@ void main() { expect(border.left.color, dividerTheme.color); }); - testWidgetsWithLeakTracking('Widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('Widget properties take priority over theme', (WidgetTester tester) async { const Color color = Colors.purple; const double width = 10.0; const double thickness = 5.0; @@ -272,7 +271,7 @@ void main() { // can be deleted. group('Material2 - Horizontal Divider', () { - testWidgetsWithLeakTracking('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -296,7 +295,7 @@ void main() { expect(lineRect.right, dividerRect.right); }); - testWidgetsWithLeakTracking('DividerTheme overrides defaults', (WidgetTester tester) async { + testWidgets('DividerTheme overrides defaults', (WidgetTester tester) async { final DividerThemeData theme = _dividerTheme(); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -315,7 +314,7 @@ void main() { }); group('Material2 - Vertical Divider', () { - testWidgetsWithLeakTracking('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( diff --git a/packages/flutter/test/material/drawer_button_test.dart b/packages/flutter/test/material/drawer_button_test.dart index f65557d8c27..2979788ed50 100644 --- a/packages/flutter/test/material/drawer_button_test.dart +++ b/packages/flutter/test/material/drawer_button_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('DrawerButton control test', (WidgetTester tester) async { + testWidgets('DrawerButton control test', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -29,7 +28,7 @@ void main() { expect(find.byType(Drawer), findsOneWidget); }); - testWidgetsWithLeakTracking('DrawerButton onPressed overrides default end drawer open behaviour', + testWidgets('DrawerButton onPressed overrides default end drawer open behaviour', (WidgetTester tester) async { bool customCallbackWasCalled = false; await tester.pumpWidget( @@ -58,7 +57,7 @@ void main() { expect(customCallbackWasCalled, true); }); - testWidgetsWithLeakTracking('DrawerButton icon', (WidgetTester tester) async { + testWidgets('DrawerButton icon', (WidgetTester tester) async { final Key androidKey = UniqueKey(); final Key iOSKey = UniqueKey(); final Key linuxKey = UniqueKey(); @@ -112,7 +111,7 @@ void main() { expect(windowsIcon.icon == androidIcon.icon, isTrue); }); - testWidgetsWithLeakTracking('DrawerButton color', (WidgetTester tester) async { + testWidgets('DrawerButton color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -133,7 +132,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('DrawerButton semantics', (WidgetTester tester) async { + testWidgets('DrawerButton semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( const MaterialApp( @@ -170,7 +169,7 @@ void main() { handle.dispose(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('EndDrawerButton control test', (WidgetTester tester) async { + testWidgets('EndDrawerButton control test', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -191,7 +190,7 @@ void main() { expect(find.byType(Drawer), findsOneWidget); }); - testWidgetsWithLeakTracking('EndDrawerButton semantics', (WidgetTester tester) async { + testWidgets('EndDrawerButton semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( const MaterialApp( @@ -227,7 +226,7 @@ void main() { handle.dispose(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('EndDrawerButton color', (WidgetTester tester) async { + testWidgets('EndDrawerButton color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -248,7 +247,7 @@ void main() { expect(iconText.text.style!.color, Colors.red); }); - testWidgetsWithLeakTracking('EndDrawerButton onPressed overrides default end drawer open behaviour', + testWidgets('EndDrawerButton onPressed overrides default end drawer open behaviour', (WidgetTester tester) async { bool customCallbackWasCalled = false; await tester.pumpWidget( diff --git a/packages/flutter/test/material/drawer_test.dart b/packages/flutter/test/material/drawer_test.dart index 7595f7aabca..67dd2ce5be0 100644 --- a/packages/flutter/test/material/drawer_test.dart +++ b/packages/flutter/test/material/drawer_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Material2 - Drawer control test', (WidgetTester tester) async { + testWidgets('Material2 - Drawer control test', (WidgetTester tester) async { const Key containerKey = Key('container'); await tester.pumpWidget( @@ -58,7 +57,7 @@ void main() { expect(find.text('header'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - Drawer control test', (WidgetTester tester) async { + testWidgets('Material3 - Drawer control test', (WidgetTester tester) async { const Key containerKey = Key('container'); await tester.pumpWidget( @@ -106,7 +105,7 @@ void main() { expect(find.text('header'), findsOneWidget); }); - testWidgetsWithLeakTracking('Drawer dismiss barrier has label', (WidgetTester tester) async { + testWidgets('Drawer dismiss barrier has label', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( const MaterialApp( @@ -130,7 +129,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Drawer dismiss barrier has no label', (WidgetTester tester) async { + testWidgets('Drawer dismiss barrier has no label', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( const MaterialApp( @@ -154,7 +153,7 @@ void main() { semantics.dispose(); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Scaffold drawerScrimColor', (WidgetTester tester) async { + testWidgets('Scaffold drawerScrimColor', (WidgetTester tester) async { // The scrim is a Container within a Semantics node labeled "Dismiss", // within a DrawerController. Sorry. Container getScrim() { @@ -216,7 +215,7 @@ void main() { expect(find.byType(Drawer), findsNothing); }); - testWidgetsWithLeakTracking('Open/close drawers by flinging', (WidgetTester tester) async { + testWidgets('Open/close drawers by flinging', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -261,7 +260,7 @@ void main() { expect(state.isEndDrawerOpen, equals(false)); }); - testWidgetsWithLeakTracking('Scaffold.drawer - null restorationId ', (WidgetTester tester) async { + testWidgets('Scaffold.drawer - null restorationId ', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -284,7 +283,7 @@ void main() { expect(find.text('drawer'), findsNothing); }); - testWidgetsWithLeakTracking('Scaffold.endDrawer - null restorationId ', (WidgetTester tester) async { + testWidgets('Scaffold.endDrawer - null restorationId ', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -307,7 +306,7 @@ void main() { expect(find.text('endDrawer'), findsNothing); }); - testWidgetsWithLeakTracking('Scaffold.drawer state restoration test', (WidgetTester tester) async { + testWidgets('Scaffold.drawer state restoration test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -338,7 +337,7 @@ void main() { expect(find.text('drawer'), findsOneWidget); }); - testWidgetsWithLeakTracking('Scaffold.endDrawer state restoration test', (WidgetTester tester) async { + testWidgets('Scaffold.endDrawer state restoration test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -369,7 +368,7 @@ void main() { expect(find.text('endDrawer'), findsOneWidget); }); - testWidgetsWithLeakTracking('Both drawer and endDrawer state restoration test', (WidgetTester tester) async { + testWidgets('Both drawer and endDrawer state restoration test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -430,7 +429,7 @@ void main() { expect(find.text('endDrawer'), findsOneWidget); }); - testWidgetsWithLeakTracking('ScaffoldState close drawer', (WidgetTester tester) async { + testWidgets('ScaffoldState close drawer', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -453,7 +452,7 @@ void main() { expect(find.text('Drawer'), findsNothing); }); - testWidgetsWithLeakTracking('ScaffoldState close drawer do not crash if drawer is already closed', (WidgetTester tester) async { + testWidgets('ScaffoldState close drawer do not crash if drawer is already closed', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -472,7 +471,7 @@ void main() { expect(find.text('Drawer'), findsNothing); }); - testWidgetsWithLeakTracking('Disposing drawer does not crash if drawer is open and framework is locked', (WidgetTester tester) async { + testWidgets('Disposing drawer does not crash if drawer is open and framework is locked', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/34978 addTearDown(tester.view.reset); tester.view.physicalSize = const Size(1800.0, 2400.0); @@ -513,7 +512,7 @@ void main() { expect(find.byType(BackButton), findsNothing); }); - testWidgetsWithLeakTracking('Disposing endDrawer does not crash if endDrawer is open and framework is locked', (WidgetTester tester) async { + testWidgets('Disposing endDrawer does not crash if endDrawer is open and framework is locked', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/34978 addTearDown(tester.view.reset); tester.view.physicalSize = const Size(1800.0, 2400.0); @@ -554,7 +553,7 @@ void main() { expect(find.byType(BackButton), findsNothing); }); - testWidgetsWithLeakTracking('ScaffoldState close end drawer', (WidgetTester tester) async { + testWidgets('ScaffoldState close end drawer', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -577,7 +576,7 @@ void main() { expect(find.text('endDrawer'), findsNothing); }); - testWidgetsWithLeakTracking('Drawer width defaults to Material spec', (WidgetTester tester) async { + testWidgets('Drawer width defaults to Material spec', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -596,7 +595,7 @@ void main() { expect(box.size.width, equals(304.0)); }); - testWidgetsWithLeakTracking('Drawer width can be customized by parameter', (WidgetTester tester) async { + testWidgets('Drawer width can be customized by parameter', (WidgetTester tester) async { const double smallWidth = 200; await tester.pumpWidget( @@ -618,7 +617,7 @@ void main() { expect(box.size.width, equals(smallWidth)); }); - testWidgetsWithLeakTracking('Material3 - Drawer default shape (ltr)', (WidgetTester tester) async { + testWidgets('Material3 - Drawer default shape (ltr)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -678,7 +677,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Drawer default shape (rtl)', (WidgetTester tester) async { + testWidgets('Material3 - Drawer default shape (rtl)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -738,7 +737,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Drawer clip behavior', (WidgetTester tester) async { + testWidgets('Material3 - Drawer clip behavior', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -794,7 +793,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - Drawer default shape', (WidgetTester tester) async { + testWidgets('Material2 - Drawer default shape', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -835,7 +834,7 @@ void main() { expect(material.shape, null); }); - testWidgetsWithLeakTracking('Material2 - Drawer clip behavior', (WidgetTester tester) async { + testWidgets('Material2 - Drawer clip behavior', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), diff --git a/packages/flutter/test/material/drawer_theme_test.dart b/packages/flutter/test/material/drawer_theme_test.dart index 80aaccf5d85..c7a24d2d483 100644 --- a/packages/flutter/test/material/drawer_theme_test.dart +++ b/packages/flutter/test/material/drawer_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('copyWith, ==, hashCode basics', () { @@ -19,7 +18,7 @@ void main() { expect(identical(DrawerThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Default debugFillProperties', (WidgetTester tester) async { + testWidgets('Default debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DrawerThemeData().debugFillProperties(builder); @@ -31,7 +30,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('Custom debugFillProperties', (WidgetTester tester) async { + testWidgets('Custom debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DrawerThemeData( backgroundColor: Color(0x00000099), @@ -59,7 +58,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Material2 - Default values are used when no Drawer or DrawerThemeData properties are specified', (WidgetTester tester) async { + testWidgets('Material2 - Default values are used when no Drawer or DrawerThemeData properties are specified', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( @@ -83,7 +82,7 @@ void main() { expect(_drawerRenderBox(tester).size.width, 304.0); }); - testWidgetsWithLeakTracking('Material3 - Default values are used when no Drawer or DrawerThemeData properties are specified', (WidgetTester tester) async { + testWidgets('Material3 - Default values are used when no Drawer or DrawerThemeData properties are specified', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -110,7 +109,7 @@ void main() { expect(_drawerRenderBox(tester).size.width, 304.0); }); - testWidgetsWithLeakTracking('Material2 - Default values are used when no Drawer or DrawerThemeData properties are specified in end drawer', (WidgetTester tester) async { + testWidgets('Material2 - Default values are used when no Drawer or DrawerThemeData properties are specified in end drawer', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( @@ -134,7 +133,7 @@ void main() { expect(_drawerRenderBox(tester).size.width, 304.0); }); - testWidgetsWithLeakTracking('Material3 - Default values are used when no Drawer or DrawerThemeData properties are specified in end drawer', (WidgetTester tester) async { + testWidgets('Material3 - Default values are used when no Drawer or DrawerThemeData properties are specified in end drawer', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -161,7 +160,7 @@ void main() { expect(_drawerRenderBox(tester).size.width, 304.0); }); - testWidgetsWithLeakTracking('DrawerThemeData values are used when no Drawer properties are specified', (WidgetTester tester) async { + testWidgets('DrawerThemeData values are used when no Drawer properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0x00000001); const Color scrimColor = Color(0x00000002); const double elevation = 7.0; @@ -202,7 +201,7 @@ void main() { expect(_drawerRenderBox(tester).size.width, width); }); - testWidgetsWithLeakTracking('Drawer values take priority over DrawerThemeData values when both properties are specified', (WidgetTester tester) async { + testWidgets('Drawer values take priority over DrawerThemeData values when both properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0x00000001); const Color scrimColor = Color(0x00000002); const double elevation = 7.0; @@ -249,7 +248,7 @@ void main() { expect(_drawerRenderBox(tester).size.width, width); }); - testWidgetsWithLeakTracking('DrawerTheme values take priority over ThemeData.drawerTheme values when both properties are specified', (WidgetTester tester) async { + testWidgets('DrawerTheme values take priority over ThemeData.drawerTheme values when both properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0x00000001); const Color scrimColor = Color(0x00000002); const double elevation = 7.0; diff --git a/packages/flutter/test/material/dropdown_form_field_test.dart b/packages/flutter/test/material/dropdown_form_field_test.dart index a686f011a60..7d564717333 100644 --- a/packages/flutter/test/material/dropdown_form_field_test.dart +++ b/packages/flutter/test/material/dropdown_form_field_test.dart @@ -7,7 +7,6 @@ import 'dart:math' as math; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const List<String> menuItems = <String>['one', 'two', 'three', 'four']; void onChanged<T>(T _) { } @@ -149,7 +148,7 @@ void verifyPaintedShadow(Finder customPaint, int elevation) { void main() { // Regression test for https://github.com/flutter/flutter/issues/87102 - testWidgetsWithLeakTracking('label position test - show hint', (WidgetTester tester) async { + testWidgets('label position test - show hint', (WidgetTester tester) async { int? value; await tester.pumpWidget( @@ -200,7 +199,7 @@ void main() { expect(hintEmptyLabel, oneValueLabel); }); - testWidgetsWithLeakTracking('label position test - show disabledHint: disable', (WidgetTester tester) async { + testWidgets('label position test - show disabledHint: disable', (WidgetTester tester) async { int? value; await tester.pumpWidget( @@ -238,7 +237,7 @@ void main() { expect(hintEmptyLabel, const Offset(0.0, 12.0)); }); - testWidgetsWithLeakTracking('label position test - show disabledHint: enable + null item', (WidgetTester tester) async { + testWidgets('label position test - show disabledHint: enable + null item', (WidgetTester tester) async { int? value; await tester.pumpWidget( @@ -263,7 +262,7 @@ void main() { expect(hintEmptyLabel, const Offset(0.0, 12.0)); }); - testWidgetsWithLeakTracking('label position test - show disabledHint: enable + empty item', (WidgetTester tester) async { + testWidgets('label position test - show disabledHint: enable + empty item', (WidgetTester tester) async { int? value; await tester.pumpWidget( @@ -288,7 +287,7 @@ void main() { expect(hintEmptyLabel, const Offset(0.0, 12.0)); }); - testWidgetsWithLeakTracking('label position test - show hint: enable + empty item', (WidgetTester tester) async { + testWidgets('label position test - show hint: enable + empty item', (WidgetTester tester) async { int? value; await tester.pumpWidget( @@ -313,7 +312,7 @@ void main() { expect(hintEmptyLabel, const Offset(0.0, 12.0)); }); - testWidgetsWithLeakTracking('label position test - no hint shown: enable + no selected + disabledHint', (WidgetTester tester) async { + testWidgets('label position test - no hint shown: enable + no selected + disabledHint', (WidgetTester tester) async { int? value; await tester.pumpWidget( @@ -351,7 +350,7 @@ void main() { expect(hintEmptyLabel, const Offset(0.0, 24.0)); }); - testWidgetsWithLeakTracking('label position test - show selected item: disabled + hint + disabledHint', (WidgetTester tester) async { + testWidgets('label position test - show selected item: disabled + hint + disabledHint', (WidgetTester tester) async { const int value = 1; await tester.pumpWidget( @@ -391,7 +390,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/82910 - testWidgetsWithLeakTracking('null value test', (WidgetTester tester) async { + testWidgets('null value test', (WidgetTester tester) async { int? value = 1; await tester.pumpWidget( @@ -443,7 +442,7 @@ void main() { expect(nonEmptyLabel, nullValueLabel); }); - testWidgetsWithLeakTracking('DropdownButtonFormField with autovalidation test', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField with autovalidation test', (WidgetTester tester) async { String? value = 'one'; int validateCalled = 0; @@ -492,7 +491,7 @@ void main() { expect(value, equals('three')); }); - testWidgetsWithLeakTracking('DropdownButtonFormField arrow icon aligns with the edge of button when expanded', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField arrow icon aligns with the edge of button when expanded', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); // There shouldn't be overflow when expanded although list contains longer items. @@ -527,7 +526,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DropdownButtonFormField with isDense:true aligns selected menu item', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField with isDense:true aligns selected menu item', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); await tester.pumpWidget( @@ -567,7 +566,7 @@ void main() { } }); - testWidgetsWithLeakTracking('DropdownButtonFormField with isDense:true does not clip large scale text', + testWidgets('DropdownButtonFormField with isDense:true does not clip large scale text', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); const String value = 'two'; @@ -606,7 +605,7 @@ void main() { expect(box.size.height, 72.0); }); - testWidgetsWithLeakTracking('DropdownButtonFormField.isDense is true by default', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField.isDense is true by default', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/46844 final Key buttonKey = UniqueKey(); const String value = 'two'; @@ -637,7 +636,7 @@ void main() { expect(box.size.height, 48.0); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - custom text style', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - custom text style', (WidgetTester tester) async { const String value = 'foo'; final UniqueKey itemKey = UniqueKey(); @@ -675,7 +674,7 @@ void main() { expect(richText.text.style!.fontSize, 20.0); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - disabledHint displays when the items list is empty, when items is null', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - disabledHint displays when the items list is empty, when items is null', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items }) { @@ -698,7 +697,7 @@ void main() { expect(find.text('disabled'), findsOneWidget); }); - testWidgetsWithLeakTracking( + testWidgets( 'DropdownButtonFormField - hint displays when the items list is ' 'empty, items is null, and disabledHint is null', (WidgetTester tester) async { @@ -722,7 +721,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('DropdownButtonFormField - disabledHint is null by default', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - disabledHint is null by default', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items }) { @@ -742,7 +741,7 @@ void main() { expect(find.text('hint used when disabled'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - disabledHint is null by default', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - disabledHint is null by default', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items }) { @@ -762,7 +761,7 @@ void main() { expect(find.text('hint used when disabled'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - disabledHint displays when onChanged is null', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - disabledHint displays when onChanged is null', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items, ValueChanged<String?>? onChanged }) { @@ -780,7 +779,7 @@ void main() { expect(find.text('disabled'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - disabled hint should be of same size as enabled hint', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - disabled hint should be of same size as enabled hint', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items}) { @@ -805,7 +804,7 @@ void main() { expect(enabledHintBox.size, equals(disabledHintBox.size)); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - Custom icon size and colors', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - Custom icon size and colors', (WidgetTester tester) async { final Key iconKey = UniqueKey(); final Icon customIcon = Icon(Icons.assessment, key: iconKey); @@ -838,7 +837,7 @@ void main() { expect(disabledRichText.text.style!.color, Colors.orange); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - default elevation', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - default elevation', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget(buildFormFrame( @@ -858,7 +857,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('DropdownButtonFormField - custom elevation', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - custom elevation', (WidgetTester tester) async { debugDisableShadows = false; final Key buttonKeyOne = UniqueKey(); final Key buttonKeyTwo = UniqueKey(); @@ -895,7 +894,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('DropdownButtonFormField does not allow duplicate item values', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField does not allow duplicate item values', (WidgetTester tester) async { final List<DropdownMenuItem<String>> itemsWithDuplicateValues = <String>['a', 'b', 'c', 'c'] .map<DropdownMenuItem<String>>((String value) { return DropdownMenuItem<String>( @@ -924,7 +923,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DropdownButtonFormField value should only appear in one menu item', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField value should only appear in one menu item', (WidgetTester tester) async { final List<DropdownMenuItem<String>> itemsWithDuplicateValues = <String>['a', 'b', 'c', 'd'] .map<DropdownMenuItem<String>>((String value) { return DropdownMenuItem<String>( @@ -953,7 +952,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - selectedItemBuilder builds custom buttons', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - selectedItemBuilder builds custom buttons', (WidgetTester tester) async { const List<String> items = <String>[ 'One', 'Two', @@ -997,7 +996,7 @@ void main() { expect(find.text('Two as an Arabic numeral: 2'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButton onTap callback is called when defined', (WidgetTester tester) async { + testWidgets('DropdownButton onTap callback is called when defined', (WidgetTester tester) async { int dropdownButtonTapCounter = 0; String? value = 'one'; void onChanged(String? newValue) { @@ -1043,7 +1042,7 @@ void main() { expect(dropdownButtonTapCounter, 2); // Should not change. }); - testWidgetsWithLeakTracking('DropdownButtonFormField should re-render if value param changes', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField should re-render if value param changes', (WidgetTester tester) async { String currentValue = 'two'; await tester.pumpWidget( @@ -1089,7 +1088,7 @@ void main() { expect(find.text(currentValue), findsOneWidget); }); - testWidgetsWithLeakTracking('autovalidateMode is passed to super', (WidgetTester tester) async { + testWidgets('autovalidateMode is passed to super', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -1118,7 +1117,7 @@ void main() { expect(validateCalled, 1); }); - testWidgetsWithLeakTracking('DropdownButtonFormField - Custom button alignment', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField - Custom button alignment', (WidgetTester tester) async { await tester.pumpWidget(buildFormFrame( buttonAlignment: AlignmentDirectional.center, items: <String>['one'], @@ -1135,7 +1134,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('InputDecoration borders are used for clipping', (WidgetTester tester) async { + testWidgets('InputDecoration borders are used for clipping', (WidgetTester tester) async { const BorderRadius errorBorderRadius = BorderRadius.all(Radius.circular(5.0)); const BorderRadius focusedErrorBorderRadius = BorderRadius.all(Radius.circular(6.0)); const BorderRadius focusedBorder = BorderRadius.all(Radius.circular(7.0)); @@ -1232,7 +1231,7 @@ void main() { expect(inkWell.borderRadius, errorBorderRadius); }); - testWidgetsWithLeakTracking('DropdownButtonFormField onChanged is called when the form is reset', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField onChanged is called when the form is reset', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123009. final GlobalKey<FormFieldState<String>> stateKey = GlobalKey<FormFieldState<String>>(); final GlobalKey<FormState> formKey = GlobalKey<FormState>(); diff --git a/packages/flutter/test/material/dropdown_menu_test.dart b/packages/flutter/test/material/dropdown_menu_test.dart index e95fe1b10b1..e800005cb10 100644 --- a/packages/flutter/test/material/dropdown_menu_test.dart +++ b/packages/flutter/test/material/dropdown_menu_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { const String longText = 'one two three four five six seven eight nine ten eleven twelve'; @@ -35,7 +34,7 @@ void main() { ); } - testWidgetsWithLeakTracking('DropdownMenu defaults', (WidgetTester tester) async { + testWidgets('DropdownMenu defaults', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(buildTest(themeData, menuChildren)); @@ -83,7 +82,7 @@ void main() { expect(material.textStyle?.height, 1.43); }); - testWidgetsWithLeakTracking('DropdownMenu can be disabled', (WidgetTester tester) async { + testWidgets('DropdownMenu can be disabled', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -116,7 +115,7 @@ void main() { expect(updatedMenuMaterial, findsNothing); }); - testWidgetsWithLeakTracking('Material2 - The width of the text field should always be the same as the menu view', + testWidgets('Material2 - The width of the text field should always be the same as the menu view', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: false); @@ -166,7 +165,7 @@ void main() { expect(updatedMenuWidth, 200.0); }); - testWidgetsWithLeakTracking('Material3 - The width of the text field should always be the same as the menu view', + testWidgets('Material3 - The width of the text field should always be the same as the menu view', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -215,7 +214,7 @@ void main() { expect(updatedMenuWidth, 200.0); }); - testWidgetsWithLeakTracking('The width property can customize the width of the dropdown menu', (WidgetTester tester) async { + testWidgets('The width property can customize the width of the dropdown menu', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); final List<DropdownMenuEntry<ShortMenu>> shortMenuItems = <DropdownMenuEntry<ShortMenu>>[]; @@ -249,7 +248,7 @@ void main() { expect(buttonSize.width, customSmallWidth); }); - testWidgetsWithLeakTracking('The width property update test', (WidgetTester tester) async { + testWidgets('The width property update test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/120567 final ThemeData themeData = ThemeData(); final List<DropdownMenuEntry<ShortMenu>> shortMenuItems = <DropdownMenuEntry<ShortMenu>>[]; @@ -271,7 +270,7 @@ void main() { expect(box.size.width, customWidth); }); - testWidgetsWithLeakTracking('The width of MenuAnchor respects MenuAnchor.expandedInsets', (WidgetTester tester) async { + testWidgets('The width of MenuAnchor respects MenuAnchor.expandedInsets', (WidgetTester tester) async { const double parentWidth = 500.0; final List<DropdownMenuEntry<ShortMenu>> shortMenuItems = <DropdownMenuEntry<ShortMenu>>[]; for (final ShortMenu value in ShortMenu.values) { @@ -335,7 +334,7 @@ void main() { expect(buttonSize.width, parentWidth - 35.0 - 20.0); }); - testWidgetsWithLeakTracking('Material2 - The menuHeight property can be used to show a shorter scrollable menu list instead of the complete list', + testWidgets('Material2 - The menuHeight property can be used to show a shorter scrollable menu list instead of the complete list', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: false); await tester.pumpWidget(buildTest(themeData, menuChildren)); @@ -376,7 +375,7 @@ void main() { expect(updatedMenuSize, const Size(180.0, 100.0)); }); - testWidgetsWithLeakTracking('Material3 - The menuHeight property can be used to show a shorter scrollable menu list instead of the complete list', + testWidgets('Material3 - The menuHeight property can be used to show a shorter scrollable menu list instead of the complete list', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); await tester.pumpWidget(buildTest(themeData, menuChildren)); @@ -419,7 +418,7 @@ void main() { expect(updatedMenuSize.height, equals(100.0)); }); - testWidgetsWithLeakTracking('The text in the menu button should be aligned with the text of ' + testWidgets('The text in the menu button should be aligned with the text of ' 'the text field - LTR', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); // Default text field (without leading icon). @@ -480,7 +479,7 @@ void main() { expect(updatedLabelTopLeft1.dx, equals(largeIconWidth)); }); - testWidgetsWithLeakTracking('The text in the menu button should be aligned with the text of ' + testWidgets('The text in the menu button should be aligned with the text of ' 'the text field - RTL', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); // Default text field (without leading icon). @@ -572,7 +571,7 @@ void main() { expect(updatedLabelTopRight1.dx, equals(updatedDropdownMenuTopRight.dx - largeIconWidth)); }); - testWidgetsWithLeakTracking('DropdownMenu has default trailing icon button', (WidgetTester tester) async { + testWidgets('DropdownMenu has default trailing icon button', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(buildTest(themeData, menuChildren)); await tester.pump(); @@ -590,7 +589,7 @@ void main() { expect(menuMaterial, findsOneWidget); }); - testWidgetsWithLeakTracking('Leading IconButton status test', (WidgetTester tester) async { + testWidgets('Leading IconButton status test', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); await tester.pumpWidget(buildTest(themeData, menuChildren, width: 100.0, menuHeight: 100.0)); await tester.pump(); @@ -618,7 +617,7 @@ void main() { expect(iconButton, findsOneWidget); }); - testWidgetsWithLeakTracking('Do not crash when resize window during menu opening', (WidgetTester tester) async { + testWidgets('Do not crash when resize window during menu opening', (WidgetTester tester) async { addTearDown(tester.view.reset); final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( @@ -654,7 +653,7 @@ void main() { // Go without throw. }); - testWidgetsWithLeakTracking('DropdownMenu can customize trailing icon button', (WidgetTester tester) async { + testWidgets('DropdownMenu can customize trailing icon button', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -680,7 +679,7 @@ void main() { expect(menuMaterial, findsOneWidget); }); - testWidgetsWithLeakTracking('Down key can highlight the menu item on desktop platforms', (WidgetTester tester) async { + testWidgets('Down key can highlight the menu item on desktop platforms', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -722,7 +721,7 @@ void main() { expect(item0material.color, Colors.transparent); // the previous item should not be highlighted. }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Up key can highlight the menu item on desktop platforms', (WidgetTester tester) async { + testWidgets('Up key can highlight the menu item on desktop platforms', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -764,7 +763,7 @@ void main() { expect(item5material.color, Colors.transparent); // the previous item should not be highlighted. }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('The text input should match the label of the menu item ' + testWidgets('The text input should match the label of the menu item ' 'while pressing down key on desktop platforms', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( @@ -795,7 +794,7 @@ void main() { expect(find.widgetWithText(TextField, 'Item 2'), findsOneWidget); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('The text input should match the label of the menu item ' + testWidgets('The text input should match the label of the menu item ' 'while pressing up key on desktop platforms', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( @@ -826,7 +825,7 @@ void main() { expect(find.widgetWithText(TextField, 'Item 3'), findsOneWidget); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Disabled button will be skipped while pressing up/down key on desktop platforms', (WidgetTester tester) async { + testWidgets('Disabled button will be skipped while pressing up/down key on desktop platforms', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); final List<DropdownMenuEntry<TestMenu>> menuWithDisabledItems = <DropdownMenuEntry<TestMenu>>[ const DropdownMenuEntry<TestMenu>(value: TestMenu.mainMenu0, label: 'Item 0'), @@ -870,7 +869,7 @@ void main() { expect(item3Material.color, themeData.colorScheme.onSurface.withOpacity(0.12)); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Searching is enabled by default on mobile platforms if initialSelection is non null', (WidgetTester tester) async { + testWidgets('Searching is enabled by default on mobile platforms if initialSelection is non null', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -893,7 +892,7 @@ void main() { expect(itemMaterial.color, themeData.colorScheme.onSurface.withOpacity(0.12)); // Menu 1 button is highlighted. }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('Searching is enabled by default on desktop platform', (WidgetTester tester) async { + testWidgets('Searching is enabled by default on desktop platform', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -917,7 +916,7 @@ void main() { expect(itemMaterial.color, themeData.colorScheme.onSurface.withOpacity(0.12)); // Menu 1 button is highlighted. }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Highlight can move up/down starting from the searching result on desktop platforms', (WidgetTester tester) async { + testWidgets('Highlight can move up/down starting from the searching result on desktop platforms', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -963,7 +962,7 @@ void main() { expect(item5Material.color, themeData.colorScheme.onSurface.withOpacity(0.12)); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Filtering is disabled by default', (WidgetTester tester) async { + testWidgets('Filtering is disabled by default', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -987,7 +986,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Enable filtering', (WidgetTester tester) async { + testWidgets('Enable filtering', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp( theme: themeData, @@ -1018,7 +1017,7 @@ void main() { } }); - testWidgetsWithLeakTracking('The controller can access the value in the input field', (WidgetTester tester) async { + testWidgets('The controller can access the value in the input field', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -1052,7 +1051,7 @@ void main() { expect(controller.text, 'New Item'); }); - testWidgetsWithLeakTracking('The menu should be closed after text editing is complete', (WidgetTester tester) async { + testWidgets('The menu should be closed after text editing is complete', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -1082,7 +1081,7 @@ void main() { expect(menuAnchor.controller!.isOpen, false); }); - testWidgetsWithLeakTracking('The onSelected gets called only when a selection is made', (WidgetTester tester) async { + testWidgets('The onSelected gets called only when a selection is made', (WidgetTester tester) async { int selectionCount = 0; final ThemeData themeData = ThemeData(); @@ -1181,7 +1180,7 @@ void main() { }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('The selectedValue gives an initial text and highlights the according item', (WidgetTester tester) async { + testWidgets('The selectedValue gives an initial text and highlights the according item', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -1217,7 +1216,7 @@ void main() { expect(itemMaterial.color, themeData.colorScheme.onSurface.withOpacity(0.12)); }); - testWidgetsWithLeakTracking('The default text input field should not be focused on mobile platforms ' + testWidgets('The default text input field should not be focused on mobile platforms ' 'when it is tapped', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); @@ -1243,7 +1242,7 @@ void main() { expect(result.canRequestFocus, false); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('The text input field should be focused on desktop platforms ' + testWidgets('The text input field should be focused on desktop platforms ' 'when it is tapped', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); @@ -1268,7 +1267,7 @@ void main() { expect(result.canRequestFocus, true); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('If requestFocusOnTap is true, the text input field can request focus, ' + testWidgets('If requestFocusOnTap is true, the text input field can request focus, ' 'otherwise it cannot request focus', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); @@ -1318,7 +1317,7 @@ void main() { expect(find.widgetWithText(TextField, 'Item 0'), findsOneWidget); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('If requestFocusOnTap is false, the mouse cursor should be clickable when hovered', (WidgetTester tester) async { + testWidgets('If requestFocusOnTap is false, the mouse cursor should be clickable when hovered', (WidgetTester tester) async { Widget buildDropdownMenu() => MaterialApp( home: Scaffold( body: Column( @@ -1344,7 +1343,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('The menu has the same width as the input field in ListView', (WidgetTester tester) async { + testWidgets('The menu has the same width as the input field in ListView', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123631 await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -1396,7 +1395,7 @@ void main() { expect(menu1.width, 200); }); - testWidgetsWithLeakTracking('Semantics does not include hint when input is not empty', (WidgetTester tester) async { + testWidgets('Semantics does not include hint when input is not empty', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); const String hintText = 'I am hintText'; TestMenu? selectedValue; @@ -1440,7 +1439,7 @@ void main() { expect(node.value, 'Item 3'); }); - testWidgetsWithLeakTracking('helperText is not visible when errorText is not null', (WidgetTester tester) async { + testWidgets('helperText is not visible when errorText is not null', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); const String helperText = 'I am helperText'; const String errorText = 'I am errorText'; @@ -1470,7 +1469,7 @@ void main() { expect(find.text(errorText), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownMenu can respect helperText when helperText is not null', (WidgetTester tester) async { + testWidgets('DropdownMenu can respect helperText when helperText is not null', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); const String helperText = 'I am helperText'; @@ -1492,7 +1491,7 @@ void main() { expect(find.text(helperText), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownMenu can respect errorText when errorText is not null', (WidgetTester tester) async { + testWidgets('DropdownMenu can respect errorText when errorText is not null', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); const String errorText = 'I am errorText'; @@ -1514,7 +1513,7 @@ void main() { expect(find.text(errorText), findsOneWidget); }); - testWidgetsWithLeakTracking('Can scroll to the highlighted item', (WidgetTester tester) async { + testWidgets('Can scroll to the highlighted item', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: DropdownMenu<TestMenu>( @@ -1537,7 +1536,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/131676. - testWidgetsWithLeakTracking('Material3 - DropdownMenu uses correct text styles', (WidgetTester tester) async { + testWidgets('Material3 - DropdownMenu uses correct text styles', (WidgetTester tester) async { const TextStyle inputTextThemeStyle = TextStyle( fontSize: 18.5, fontStyle: FontStyle.italic, @@ -1583,7 +1582,7 @@ void main() { expect(material.textStyle?.decoration, menuItemTextThemeStyle.decoration); }); - testWidgetsWithLeakTracking('DropdownMenuEntries do not overflow when width is specified', (WidgetTester tester) async { + testWidgets('DropdownMenuEntries do not overflow when width is specified', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126882 final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -1630,7 +1629,7 @@ void main() { expect(controller.text, 'Item 0 $longText'); }); - testWidgetsWithLeakTracking('DropdownMenuEntry.labelWidget is Text that specifies maxLines 1 or 2', (WidgetTester tester) async { + testWidgets('DropdownMenuEntry.labelWidget is Text that specifies maxLines 1 or 2', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126882 final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -1694,7 +1693,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/131350. - testWidgetsWithLeakTracking('DropdownMenuEntry.leadingIcon default layout', (WidgetTester tester) async { + testWidgets('DropdownMenuEntry.leadingIcon default layout', (WidgetTester tester) async { // The DropdownMenu should not get extra padding in DropdownMenuEntry items // when both text field and DropdownMenuEntry have leading icons. await tester.pumpWidget(const MaterialApp( @@ -1727,7 +1726,7 @@ void main() { expect(tester.getTopLeft(find.text('Item 1').last).dx, 48.0); }); - testWidgetsWithLeakTracking('DropdownMenu can have customized search algorithm', (WidgetTester tester) async { + testWidgets('DropdownMenu can have customized search algorithm', (WidgetTester tester) async { final ThemeData theme = ThemeData(); Widget dropdownMenu({ SearchCallback<int>? searchCallback }) { return MaterialApp( @@ -1806,7 +1805,7 @@ void main() { checkExpectedHighlight(searchResult: 'Read', otherItems: <String>['All', 'Unread']); }); - testWidgetsWithLeakTracking('onSelected gets called when a selection is made in a nested menu', + testWidgets('onSelected gets called when a selection is made in a nested menu', (WidgetTester tester) async { int selectionCount = 0; @@ -1857,7 +1856,7 @@ void main() { expect(selectionCount, 1); }); - testWidgetsWithLeakTracking('When onSelected is called and menu is closed, no textEditingController exception is thrown', + testWidgets('When onSelected is called and menu is closed, no textEditingController exception is thrown', (WidgetTester tester) async { int selectionCount = 0; diff --git a/packages/flutter/test/material/dropdown_menu_theme_test.dart b/packages/flutter/test/material/dropdown_menu_theme_test.dart index 6224440f57e..2c02c78684f 100644 --- a/packages/flutter/test/material/dropdown_menu_theme_test.dart +++ b/packages/flutter/test/material/dropdown_menu_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('DropdownMenuThemeData copyWith, ==, hashCode basics', () { @@ -31,7 +30,7 @@ void main() { expect(identical(DropdownMenuThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Default DropdownMenuThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default DropdownMenuThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const DropdownMenuThemeData().debugFillProperties(builder); @@ -43,7 +42,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('With no other configuration, defaults are used', (WidgetTester tester) async { + testWidgets('With no other configuration, defaults are used', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -100,7 +99,7 @@ void main() { expect(material.textStyle?.color, themeData.colorScheme.onSurface); }); - testWidgetsWithLeakTracking('ThemeData.dropdownMenuTheme overrides defaults', (WidgetTester tester) async { + testWidgets('ThemeData.dropdownMenuTheme overrides defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData( dropdownMenuTheme: DropdownMenuThemeData( textStyle: TextStyle( @@ -179,7 +178,7 @@ void main() { expect(material.textStyle?.color, theme.colorScheme.onSurface); }); - testWidgetsWithLeakTracking('DropdownMenuTheme overrides ThemeData and defaults', (WidgetTester tester) async { + testWidgets('DropdownMenuTheme overrides ThemeData and defaults', (WidgetTester tester) async { final DropdownMenuThemeData global = DropdownMenuThemeData( textStyle: TextStyle( color: Colors.orange, @@ -282,7 +281,7 @@ void main() { expect(material.textStyle?.color, theme.colorScheme.onSurface); }); - testWidgetsWithLeakTracking('Widget parameters overrides DropdownMenuTheme, ThemeData and defaults', (WidgetTester tester) async { + testWidgets('Widget parameters overrides DropdownMenuTheme, ThemeData and defaults', (WidgetTester tester) async { final DropdownMenuThemeData global = DropdownMenuThemeData( textStyle: TextStyle( color: Colors.orange, diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index d58acd2414f..7240b8003a1 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -22,7 +22,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -340,7 +339,7 @@ Future<void> checkDropdownColor(WidgetTester tester, {Color? color, bool isFormF } void main() { - testWidgetsWithLeakTracking('Default dropdown golden', (WidgetTester tester) async { + testWidgets('Default dropdown golden', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build() => buildFrame(buttonKey: buttonKey, onChanged: onChanged, useMaterial3: false); await tester.pumpWidget(build()); @@ -352,7 +351,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Expanded dropdown golden', (WidgetTester tester) async { + testWidgets('Expanded dropdown golden', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build() => buildFrame(buttonKey: buttonKey, isExpanded: true, onChanged: onChanged, useMaterial3: false); await tester.pumpWidget(build()); @@ -364,7 +363,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dropdown button control test', (WidgetTester tester) async { + testWidgets('Dropdown button control test', (WidgetTester tester) async { String? value = 'one'; void didChangeValue(String? newValue) { value = newValue; @@ -403,7 +402,7 @@ void main() { expect(value, equals('two')); }); - testWidgetsWithLeakTracking('Dropdown button with no app', (WidgetTester tester) async { + testWidgets('Dropdown button with no app', (WidgetTester tester) async { String? value = 'one'; void didChangeValue(String? newValue) { value = newValue; @@ -462,7 +461,7 @@ void main() { expect(value, equals('two')); }); - testWidgetsWithLeakTracking('DropdownButton does not allow duplicate item values', (WidgetTester tester) async { + testWidgets('DropdownButton does not allow duplicate item values', (WidgetTester tester) async { final List<DropdownMenuItem<String>> itemsWithDuplicateValues = <String>['a', 'b', 'c', 'c'] .map<DropdownMenuItem<String>>((String value) { return DropdownMenuItem<String>( @@ -491,7 +490,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DropdownButton value should only appear in one menu item', (WidgetTester tester) async { + testWidgets('DropdownButton value should only appear in one menu item', (WidgetTester tester) async { final List<DropdownMenuItem<String>> itemsWithDuplicateValues = <String>['a', 'b', 'c', 'd'] .map<DropdownMenuItem<String>>((String value) { return DropdownMenuItem<String>( @@ -520,7 +519,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dropdown form field uses form field state', (WidgetTester tester) async { + testWidgets('Dropdown form field uses form field state', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); final GlobalKey<FormState> formKey = GlobalKey<FormState>(); String? value; @@ -577,7 +576,7 @@ void main() { expect(value, equals('three')); }); - testWidgetsWithLeakTracking('Dropdown in ListView', (WidgetTester tester) async { + testWidgets('Dropdown in ListView', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/12053 // Positions a DropdownButton at the left and right edges of the screen, // forcing it to be sized down to the viewport width @@ -612,7 +611,7 @@ void main() { expect(itemBoxes[1].size.width, equals(800.0 - 16.0 * 2)); }); - testWidgetsWithLeakTracking('Dropdown menu can position correctly inside a nested navigator', (WidgetTester tester) async { + testWidgets('Dropdown menu can position correctly inside a nested navigator', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66870 await tester.pumpWidget( MaterialApp( @@ -658,7 +657,7 @@ void main() { expect(secondItem.localToGlobal(Offset.zero).dy, equals(176.0)); }); - testWidgetsWithLeakTracking('Dropdown screen edges', (WidgetTester tester) async { + testWidgets('Dropdown screen edges', (WidgetTester tester) async { int? value = 4; final List<DropdownMenuItem<int>> items = <DropdownMenuItem<int>>[ for (int i = 0; i < 20; ++i) DropdownMenuItem<int>(value: i, child: Text('$i')), @@ -702,7 +701,7 @@ void main() { }); for (final TextDirection textDirection in TextDirection.values) { - testWidgetsWithLeakTracking('Dropdown button aligns selected menu item ($textDirection)', (WidgetTester tester) async { + testWidgets('Dropdown button aligns selected menu item ($textDirection)', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build() => buildFrame(buttonKey: buttonKey, textDirection: textDirection, onChanged: onChanged, useMaterial3: false); @@ -746,7 +745,7 @@ void main() { }); } - testWidgetsWithLeakTracking('Arrow icon aligns with the edge of button when expanded', (WidgetTester tester) async { + testWidgets('Arrow icon aligns with the edge of button when expanded', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build() => buildFrame(buttonKey: buttonKey, isExpanded: true, onChanged: onChanged); @@ -765,7 +764,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dropdown button icon will accept widgets as icons', (WidgetTester tester) async { + testWidgets('Dropdown button icon will accept widgets as icons', (WidgetTester tester) async { final Widget customWidget = Container( decoration: ShapeDecoration( shape: CircleBorder( @@ -794,7 +793,7 @@ void main() { expect(find.byIcon(Icons.arrow_drop_down), findsNothing); }); - testWidgetsWithLeakTracking('Dropdown button icon should have default size and colors when not defined', (WidgetTester tester) async { + testWidgets('Dropdown button icon should have default size and colors when not defined', (WidgetTester tester) async { final Key iconKey = UniqueKey(); final Icon customIcon = Icon(Icons.assessment, key: iconKey); @@ -820,7 +819,7 @@ void main() { expect(disabledRichText.text.style!.color, Colors.grey.shade400); }); - testWidgetsWithLeakTracking('Dropdown button icon should have the passed in size and color instead of defaults', (WidgetTester tester) async { + testWidgets('Dropdown button icon should have the passed in size and color instead of defaults', (WidgetTester tester) async { final Key iconKey = UniqueKey(); final Icon customIcon = Icon(Icons.assessment, key: iconKey); @@ -852,7 +851,7 @@ void main() { expect(disabledRichText.text.style!.color, Colors.orange); }); - testWidgetsWithLeakTracking('Dropdown button should use its own size and color properties over those defined by the theme', (WidgetTester tester) async { + testWidgets('Dropdown button should use its own size and color properties over those defined by the theme', (WidgetTester tester) async { final Key iconKey = UniqueKey(); final Icon customIcon = Icon( @@ -890,7 +889,7 @@ void main() { expect(disabledRichText.text.style!.color, Colors.yellow); }); - testWidgetsWithLeakTracking('Dropdown button with isDense:true aligns selected menu item', (WidgetTester tester) async { + testWidgets('Dropdown button with isDense:true aligns selected menu item', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build() => buildFrame(buttonKey: buttonKey, isDense: true, onChanged: onChanged); @@ -926,7 +925,7 @@ void main() { checkSelectedItemTextGeometry(tester, 'two'); }); - testWidgetsWithLeakTracking('Dropdown button can have a text style with no fontSize specified', (WidgetTester tester) async { + testWidgets('Dropdown button can have a text style with no fontSize specified', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/33425 const String value = 'foo'; final UniqueKey itemKey = UniqueKey(); @@ -953,7 +952,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Dropdown menu scrolls to first item in long lists', (WidgetTester tester) async { + testWidgets('Dropdown menu scrolls to first item in long lists', (WidgetTester tester) async { // Open the dropdown menu final Key buttonKey = UniqueKey(); await tester.pumpWidget(buildFrame( @@ -982,7 +981,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dropdown menu aligns selected item with button in long lists', (WidgetTester tester) async { + testWidgets('Dropdown menu aligns selected item with button in long lists', (WidgetTester tester) async { // Open the dropdown menu final Key buttonKey = UniqueKey(); await tester.pumpWidget(buildFrame( @@ -1007,7 +1006,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dropdown menu scrolls to last item in long lists', (WidgetTester tester) async { + testWidgets('Dropdown menu scrolls to last item in long lists', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); await tester.pumpWidget(buildFrame( buttonKey: buttonKey, @@ -1043,7 +1042,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Size of DropdownButton with null value', (WidgetTester tester) async { + testWidgets('Size of DropdownButton with null value', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); String? value; @@ -1064,7 +1063,7 @@ void main() { expect(buttonBox.size, equals(buttonBoxNullValue.size)); }); - testWidgetsWithLeakTracking('Size of DropdownButton with no items', (WidgetTester tester) async { + testWidgets('Size of DropdownButton with no items', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/26419 final Key buttonKey = UniqueKey(); List<String>? items; @@ -1091,7 +1090,7 @@ void main() { expect(buttonBox.size, equals(buttonBoxNullItems.size)); }); - testWidgetsWithLeakTracking('Layout of a DropdownButton with null value', (WidgetTester tester) async { + testWidgets('Layout of a DropdownButton with null value', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); String? value; @@ -1119,7 +1118,7 @@ void main() { expect(value, equals('one')); }); - testWidgetsWithLeakTracking('Size of DropdownButton with null value and a hint', (WidgetTester tester) async { + testWidgets('Size of DropdownButton with null value and a hint', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); String? value; @@ -1142,7 +1141,7 @@ void main() { expect(buttonBox.size, equals(buttonBoxHintValue.size)); }); - testWidgetsWithLeakTracking('Dropdown menus must fit within the screen', (WidgetTester tester) async { + testWidgets('Dropdown menus must fit within the screen', (WidgetTester tester) async { // The dropdown menu isn't readily accessible. To find it we're assuming that it // contains a ListView and that it's an instance of _DropdownMenu. @@ -1249,7 +1248,7 @@ void main() { expect(menuRect.bottomRight, const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('Dropdown menus are dismissed on screen orientation changes, but not on keyboard hide', (WidgetTester tester) async { + testWidgets('Dropdown menus are dismissed on screen orientation changes, but not on keyboard hide', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(onChanged: onChanged, mediaSize: const Size(800, 600))); await tester.tap(find.byType(dropdownButtonType)); await tester.pumpAndSettle(); @@ -1271,7 +1270,7 @@ void main() { expect(find.byType(ListView, skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('Semantics Tree contains only selected element', (WidgetTester tester) async { + testWidgets('Semantics Tree contains only selected element', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(buildFrame(onChanged: onChanged)); @@ -1283,7 +1282,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Dropdown button includes semantics', (WidgetTester tester) async { + testWidgets('Dropdown button includes semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); const Key key = Key('test'); await tester.pumpWidget(buildFrame( @@ -1318,7 +1317,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Dropdown menu includes semantics', (WidgetTester tester) async { + testWidgets('Dropdown menu includes semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const Key key = Key('test'); await tester.pumpWidget(buildFrame( @@ -1394,7 +1393,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('disabledHint displays on empty items or onChanged', (WidgetTester tester) async { + testWidgets('disabledHint displays on empty items or onChanged', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items, ValueChanged<String?>? onChanged }) => buildFrame( @@ -1433,7 +1432,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/70177 - testWidgetsWithLeakTracking('disabledHint behavior test', (WidgetTester tester) async { + testWidgets('disabledHint behavior test', (WidgetTester tester) async { Widget build({ List<String>? items, ValueChanged<String?>? onChanged, String? value, Widget? hint, Widget? disabledHint }) => buildFrame( items: items, onChanged: onChanged, @@ -1490,7 +1489,7 @@ void main() { expect(getIndex(), null); }); - testWidgetsWithLeakTracking('DropdownButton selected item color test', (WidgetTester tester) async { + testWidgets('DropdownButton selected item color test', (WidgetTester tester) async { Widget build({ ValueChanged<String?>? onChanged, String? value, Widget? hint, Widget? disabledHint }) { return MaterialApp( theme: ThemeData( @@ -1544,7 +1543,7 @@ void main() { expect(textColor('two'), Colors.pink); }); - testWidgetsWithLeakTracking( + testWidgets( 'DropdownButton hint displays when the items list is empty, ' 'items is null, and disabledHint is null', (WidgetTester tester) async { @@ -1568,7 +1567,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('DropdownButton disabledHint is null by default', (WidgetTester tester) async { + testWidgets('DropdownButton disabledHint is null by default', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget build({ List<String>? items }) { @@ -1588,7 +1587,7 @@ void main() { expect(find.text('hint used when disabled'), findsOneWidget); }); - testWidgetsWithLeakTracking('Size of largest widget is used DropdownButton when selectedItemBuilder is non-null', (WidgetTester tester) async { + testWidgets('Size of largest widget is used DropdownButton when selectedItemBuilder is non-null', (WidgetTester tester) async { final List<String> items = <String>['25', '50', '100']; const String selectedItem = '25'; @@ -1620,7 +1619,7 @@ void main() { expect(dropdownButtonRenderBox.size.width, 100 + 24.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'Enabled button - Size of largest widget is used DropdownButton when selectedItemBuilder ' 'is non-null and hint is defined, but smaller than largest selected item widget', (WidgetTester tester) async { @@ -1658,7 +1657,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Enabled button - Size of largest widget is used DropdownButton when selectedItemBuilder ' 'is non-null and hint is defined, but larger than largest selected item widget', (WidgetTester tester) async { @@ -1700,7 +1699,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Disabled button - Size of largest widget is used DropdownButton when selectedItemBuilder ' 'is non-null, and hint is defined, but smaller than largest selected item widget', (WidgetTester tester) async { @@ -1737,7 +1736,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Disabled button - Size of largest widget is used DropdownButton when selectedItemBuilder ' 'is non-null and hint is defined, but larger than largest selected item widget', (WidgetTester tester) async { @@ -1774,7 +1773,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Disabled button - Size of largest widget is used DropdownButton when selectedItemBuilder ' 'is non-null, and disabledHint is defined, but smaller than largest selected item widget', (WidgetTester tester) async { @@ -1811,7 +1810,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Disabled button - Size of largest widget is used DropdownButton when selectedItemBuilder ' 'is non-null and disabledHint is defined, but larger than largest selected item widget', (WidgetTester tester) async { @@ -1848,7 +1847,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Dropdown in middle showing middle item', (WidgetTester tester) async { + testWidgets('Dropdown in middle showing middle item', (WidgetTester tester) async { final List<DropdownMenuItem<int>> items = List<DropdownMenuItem<int>>.generate( 100, (int i) => DropdownMenuItem<int>(value: i, child: Text('$i')), @@ -1882,7 +1881,7 @@ void main() { expect(getMenuScroll(), 2180.0); }); - testWidgetsWithLeakTracking('Dropdown in top showing bottom item', (WidgetTester tester) async { + testWidgets('Dropdown in top showing bottom item', (WidgetTester tester) async { final List<DropdownMenuItem<int>> items = List<DropdownMenuItem<int>>.generate( 100, (int i) => DropdownMenuItem<int>(value: i, child: Text('$i')), @@ -1917,7 +1916,7 @@ void main() { expect(getMenuScroll(), 4312.0); }); - testWidgetsWithLeakTracking('Dropdown in bottom showing top item', (WidgetTester tester) async { + testWidgets('Dropdown in bottom showing top item', (WidgetTester tester) async { final List<DropdownMenuItem<int>> items = List<DropdownMenuItem<int>>.generate( 100, (int i) => DropdownMenuItem<int>(value: i, child: Text('$i')), @@ -1952,7 +1951,7 @@ void main() { expect(getMenuScroll(), 0.0); }); - testWidgetsWithLeakTracking('Dropdown in center showing bottom item', (WidgetTester tester) async { + testWidgets('Dropdown in center showing bottom item', (WidgetTester tester) async { final List<DropdownMenuItem<int>> items = List<DropdownMenuItem<int>>.generate( 100, (int i) => DropdownMenuItem<int>(value: i, child: Text('$i')), @@ -1986,7 +1985,7 @@ void main() { expect(getMenuScroll(), 4312.0); }); - testWidgetsWithLeakTracking('Dropdown menu respects parent size limits', (WidgetTester tester) async { + testWidgets('Dropdown menu respects parent size limits', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/24417 int? selectedIndex; await tester.pumpWidget( @@ -2032,7 +2031,7 @@ void main() { expect(selectedIndex, 13); }); - testWidgetsWithLeakTracking('Dropdown button will accept widgets as its underline', (WidgetTester tester) async { + testWidgets('Dropdown button will accept widgets as its underline', (WidgetTester tester) async { const BoxDecoration decoration = BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xFFCCBB00), width: 4.0)), ); @@ -2059,7 +2058,7 @@ void main() { expect(tester.widgetList<DecoratedBox>(decoratedBox).last.decoration, defaultDecoration); }); - testWidgetsWithLeakTracking('DropdownButton selectedItemBuilder builds custom buttons', (WidgetTester tester) async { + testWidgets('DropdownButton selectedItemBuilder builds custom buttons', (WidgetTester tester) async { const List<String> items = <String>[ 'One', 'Two', @@ -2105,19 +2104,19 @@ void main() { expect(find.text('Two as an Arabic numeral: 2'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButton uses default color when expanded', (WidgetTester tester) async { + testWidgets('DropdownButton uses default color when expanded', (WidgetTester tester) async { await checkDropdownColor(tester); }); - testWidgetsWithLeakTracking('DropdownButton uses dropdownColor when expanded', (WidgetTester tester) async { + testWidgets('DropdownButton uses dropdownColor when expanded', (WidgetTester tester) async { await checkDropdownColor(tester, color: const Color.fromRGBO(120, 220, 70, 0.8)); }); - testWidgetsWithLeakTracking('DropdownButtonFormField uses dropdownColor when expanded', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField uses dropdownColor when expanded', (WidgetTester tester) async { await checkDropdownColor(tester, color: const Color.fromRGBO(120, 220, 70, 0.8), isFormField: true); }); - testWidgetsWithLeakTracking('DropdownButton hint displays properly when selectedItemBuilder is defined', (WidgetTester tester) async { + testWidgets('DropdownButton hint displays properly when selectedItemBuilder is defined', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/42340 final List<String> items = <String>['1', '2', '3']; String? selectedItem; @@ -2163,7 +2162,7 @@ void main() { expect(find.text('You have selected: 1'), findsOneWidget); }); - testWidgetsWithLeakTracking('Variable size and oversized menu items', (WidgetTester tester) async { + testWidgets('Variable size and oversized menu items', (WidgetTester tester) async { final List<double> itemHeights = <double>[30, 40, 50, 60]; double? dropdownValue = itemHeights[0]; @@ -2262,7 +2261,7 @@ void main() { expect(tester.getCenter(item40.first).dy, tester.getCenter(item40.last).dy); }); - testWidgetsWithLeakTracking('DropdownButton menu items do not resize when its route is popped', (WidgetTester tester) async { + testWidgets('DropdownButton menu items do not resize when its route is popped', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/44877. const List<String> items = <String>[ 'one', @@ -2318,7 +2317,7 @@ void main() { expect(find.text('two'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButton hint is selected item', (WidgetTester tester) async { + testWidgets('DropdownButton hint is selected item', (WidgetTester tester) async { const double hintPaddingOffset = 8; const List<String> itemValues = <String>['item0', 'item1', 'item2', 'item3']; String? selectedItem = 'item0'; @@ -2386,7 +2385,7 @@ void main() { expect(tester.getTopLeft(find.text('-item0-')).dx, 8); }); - testWidgetsWithLeakTracking('DropdownButton can be focused, and has focusColor', (WidgetTester tester) async { + testWidgets('DropdownButton can be focused, and has focusColor', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final UniqueKey buttonKey = UniqueKey(); final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); @@ -2402,7 +2401,7 @@ void main() { expect(find.byType(Material), paints..rect(rect: const Rect.fromLTRB(348.0, 276.0, 452.0, 324.0), color: const Color(0x1f00ff00))); }); - testWidgetsWithLeakTracking('DropdownButtonFormField can be focused, and has focusColor', (WidgetTester tester) async { + testWidgets('DropdownButtonFormField can be focused, and has focusColor', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final UniqueKey buttonKey = UniqueKey(); final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButtonFormField'); @@ -2418,7 +2417,7 @@ void main() { expect(find.byType(Material), paints ..rect(rect: const Rect.fromLTRB(0.0, 264.0, 800.0, 336.0), color: const Color(0x1f00ff00))); }); - testWidgetsWithLeakTracking("DropdownButton won't be focused if not enabled", (WidgetTester tester) async { + testWidgets("DropdownButton won't be focused if not enabled", (WidgetTester tester) async { final UniqueKey buttonKey = UniqueKey(); final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); @@ -2429,7 +2428,7 @@ void main() { expect(find.byKey(buttonKey), isNot(paints ..rrect(rrect: const RRect.fromLTRBXY(0.0, 0.0, 104.0, 48.0, 4.0, 4.0), color: const Color(0xff00ff00)))); }); - testWidgetsWithLeakTracking('DropdownButton is activated with the enter key', (WidgetTester tester) async { + testWidgets('DropdownButton is activated with the enter key', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); String? value = 'one'; @@ -2486,7 +2485,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/77655. - testWidgetsWithLeakTracking('DropdownButton selecting a null valued item should be selected', (WidgetTester tester) async { + testWidgets('DropdownButton selecting a null valued item should be selected', (WidgetTester tester) async { final List<MapEntry<String?, String>> items = <MapEntry<String?, String>>[ const MapEntry<String?, String>(null, 'None'), const MapEntry<String?, String>('one', 'One'), @@ -2526,7 +2525,7 @@ void main() { expect(find.text('None'), findsOneWidget); }); - testWidgetsWithLeakTracking('DropdownButton is activated with the space key', (WidgetTester tester) async { + testWidgets('DropdownButton is activated with the space key', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); String? value = 'one'; @@ -2582,7 +2581,7 @@ void main() { expect(value, equals('two')); }); - testWidgetsWithLeakTracking('Selected element is focused when dropdown is opened', (WidgetTester tester) async { + testWidgets('Selected element is focused when dropdown is opened', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); String? value = 'one'; @@ -2643,7 +2642,7 @@ void main() { expect(node.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Selected element is correctly focused with dropdown that more items than fit on the screen', (WidgetTester tester) async { + testWidgets('Selected element is correctly focused with dropdown that more items than fit on the screen', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); int? value = 1; @@ -2707,7 +2706,7 @@ void main() { expect(node.hasFocus, isTrue); }); - testWidgetsWithLeakTracking("Having a focused element doesn't interrupt scroll when flung by touch", (WidgetTester tester) async { + testWidgets("Having a focused element doesn't interrupt scroll when flung by touch", (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); int? value = 1; @@ -2783,7 +2782,7 @@ void main() { expect(Focus.of(tester.element(find.byKey(const ValueKey<int>(91), skipOffstage: false).last)).hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('DropdownButton onTap callback can request focus', (WidgetTester tester) async { + testWidgets('DropdownButton onTap callback can request focus', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton')..addListener(() { }); addTearDown(focusNode.dispose); int? value = 1; @@ -2832,7 +2831,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('DropdownButton changes selected item with arrow keys', (WidgetTester tester) async { + testWidgets('DropdownButton changes selected item with arrow keys', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'DropdownButton'); addTearDown(focusNode.dispose); String? value = 'one'; @@ -2892,7 +2891,7 @@ void main() { expect(value, equals('two')); }); - testWidgetsWithLeakTracking('DropdownButton onTap callback is called when defined', (WidgetTester tester) async { + testWidgets('DropdownButton onTap callback is called when defined', (WidgetTester tester) async { int dropdownButtonTapCounter = 0; String? value = 'one'; @@ -2937,7 +2936,7 @@ void main() { expect(dropdownButtonTapCounter, 2); // Should not change. }); - testWidgetsWithLeakTracking('DropdownMenuItem onTap callback is called when defined', (WidgetTester tester) async { + testWidgets('DropdownMenuItem onTap callback is called when defined', (WidgetTester tester) async { String? value = 'one'; final List<int> menuItemTapCounters = <int>[0, 0, 0, 0]; void onChanged(String? newValue) { value = newValue; } @@ -3022,7 +3021,7 @@ void main() { expect(menuItemTapCounters, <int>[0, 2, 1, 0]); }); - testWidgetsWithLeakTracking('Does not crash when option is selected without waiting for opening animation to complete', (WidgetTester tester) async { + testWidgets('Does not crash when option is selected without waiting for opening animation to complete', (WidgetTester tester) async { // Regression test for b/171846624. final List<String> options = <String>['first', 'second', 'third']; @@ -3070,7 +3069,7 @@ void main() { expect(find.text('second').hitTestable(), findsNothing); }); - testWidgetsWithLeakTracking('Dropdown menu should persistently show a scrollbar if it is scrollable', (WidgetTester tester) async { + testWidgets('Dropdown menu should persistently show a scrollbar if it is scrollable', (WidgetTester tester) async { await tester.pumpWidget(buildFrame( value: '0', // menu is short enough to fit onto the screen. @@ -3102,7 +3101,7 @@ void main() { expect(find.byType(Scrollbar), paints..rect()); }); - testWidgetsWithLeakTracking("Dropdown menu's maximum height should be influenced by DropdownButton.menuMaxHeight.", (WidgetTester tester) async { + testWidgets("Dropdown menu's maximum height should be influenced by DropdownButton.menuMaxHeight.", (WidgetTester tester) async { await tester.pumpWidget(buildFrame( value: '0', items: List<String>.generate(/*length=*/64, (int index) => index.toString()), @@ -3156,7 +3155,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/89029 - testWidgetsWithLeakTracking('menu position test with `menuMaxHeight`', (WidgetTester tester) async { + testWidgets('menu position test with `menuMaxHeight`', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); await tester.pumpWidget(buildFrame( buttonKey: buttonKey, @@ -3179,7 +3178,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/76614 - testWidgetsWithLeakTracking('Do not crash if used in very short screen', (WidgetTester tester) async { + testWidgets('Do not crash if used in very short screen', (WidgetTester tester) async { // The default item height is 48.0 pixels and needs two items padding since // the menu requires empty space surrounding the menu. Finally, the constraint height // is 47.0 pixels for the menu rendering. @@ -3235,7 +3234,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tapping a disabled item should not close DropdownButton', (WidgetTester tester) async { + testWidgets('Tapping a disabled item should not close DropdownButton', (WidgetTester tester) async { String? value = 'first'; await tester.pumpWidget( @@ -3281,7 +3280,7 @@ void main() { expect(find.text('second').hitTestable(), findsOneWidget); }); - testWidgetsWithLeakTracking('Disabled item should not be focusable', (WidgetTester tester) async { + testWidgets('Disabled item should not be focusable', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -3312,7 +3311,7 @@ void main() { expect(Focus.maybeOf(disabledItem), null, reason: 'Disabled menu item should not be able to request focus'); }); - testWidgetsWithLeakTracking('alignment test', (WidgetTester tester) async { + testWidgets('alignment test', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); Widget buildFrame({AlignmentGeometry? buttonAlignment, AlignmentGeometry? menuAlignment}) { return MaterialApp( @@ -3416,7 +3415,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Dropdown with enabled feedback', (WidgetTester tester) async { + testWidgets('Dropdown with enabled feedback', (WidgetTester tester) async { const bool enableFeedback = true; await tester.pumpWidget(feedbackBoilerplate(enableFeedback: enableFeedback)); @@ -3429,7 +3428,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('Dropdown with disabled feedback', (WidgetTester tester) async { + testWidgets('Dropdown with disabled feedback', (WidgetTester tester) async { const bool enableFeedback = false; await tester.pumpWidget(feedbackBoilerplate(enableFeedback: enableFeedback)); @@ -3442,7 +3441,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('Dropdown with enabled feedback by default', (WidgetTester tester) async { + testWidgets('Dropdown with enabled feedback by default', (WidgetTester tester) async { await tester.pumpWidget(feedbackBoilerplate()); await tester.tap(find.text('One')); @@ -3454,7 +3453,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('DropdownButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('DropdownButton changes mouse cursor when hovered', (WidgetTester tester) async { const Key key = Key('testDropdownButton'); await tester.pumpWidget( MaterialApp( @@ -3512,7 +3511,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('Conflicting scrollbars are not applied by ScrollBehavior to Dropdown', (WidgetTester tester) async { + testWidgets('Conflicting scrollbars are not applied by ScrollBehavior to Dropdown', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/83819 // Open the dropdown menu final Key buttonKey = UniqueKey(); @@ -3535,7 +3534,7 @@ void main() { }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('borderRadius property works properly', (WidgetTester tester) async { + testWidgets('borderRadius property works properly', (WidgetTester tester) async { const double radius = 20.0; await tester.pumpWidget( @@ -3578,7 +3577,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/88574 - testWidgetsWithLeakTracking("specifying itemHeight affects popup menu items' height", (WidgetTester tester) async { + testWidgets("specifying itemHeight affects popup menu items' height", (WidgetTester tester) async { const String value = 'One'; const double itemHeight = 80; final List<DropdownMenuItem<String>> menuItems = <String>[ @@ -3619,7 +3618,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/92438 - testWidgetsWithLeakTracking('Do not throw due to the double precision', (WidgetTester tester) async { + testWidgets('Do not throw due to the double precision', (WidgetTester tester) async { const String value = 'One'; const double itemHeight = 77.701; final List<DropdownMenuItem<String>> menuItems = <String>[ @@ -3653,7 +3652,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('BorderRadius property works properly for DropdownButtonFormField', (WidgetTester tester) async { + testWidgets('BorderRadius property works properly for DropdownButtonFormField', (WidgetTester tester) async { const double radius = 20.0; await tester.pumpWidget( @@ -3694,7 +3693,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DropdownButton hint alignment', (WidgetTester tester) async { + testWidgets('DropdownButton hint alignment', (WidgetTester tester) async { const String hintText = 'hint'; // AlignmentDirectional.centerStart (default) @@ -3799,7 +3798,7 @@ void main() { expect(tester.getBottomRight(find.text(hintText,skipOffstage: false)).dy, 350.0); }); - testWidgetsWithLeakTracking('DropdownButton hint alignment with selectedItemBuilder', (WidgetTester tester) async { + testWidgets('DropdownButton hint alignment with selectedItemBuilder', (WidgetTester tester) async { const String hintText = 'hint'; // AlignmentDirectional.centerStart (default) @@ -3918,7 +3917,7 @@ void main() { expect(tester.getBottomRight(find.text(hintText,skipOffstage: false)).dy, 350.0); }); - testWidgetsWithLeakTracking('BorderRadius property clips dropdown button and dropdown menu', (WidgetTester tester) async { + testWidgets('BorderRadius property clips dropdown button and dropdown menu', (WidgetTester tester) async { const double radius = 20.0; await tester.pumpWidget( @@ -3957,7 +3956,7 @@ void main() { expect(renderClip.borderRadius, BorderRadius.circular(radius)); }); - testWidgetsWithLeakTracking('Size of DropdownButton with padding', (WidgetTester tester) async { + testWidgets('Size of DropdownButton with padding', (WidgetTester tester) async { const double padVertical = 5; const double padHorizontal = 10; final Key buttonKey = UniqueKey(); diff --git a/packages/flutter/test/material/elevated_button_test.dart b/packages/flutter/test/material/elevated_button_test.dart index a9fcdf465c6..5d5ea42c78a 100644 --- a/packages/flutter/test/material/elevated_button_test.dart +++ b/packages/flutter/test/material/elevated_button_test.dart @@ -7,11 +7,10 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('ElevatedButton, ElevatedButton.icon defaults', (WidgetTester tester) async { + testWidgets('ElevatedButton, ElevatedButton.icon defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: colorScheme); final bool material3 = theme.useMaterial3; @@ -160,7 +159,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Default ElevatedButton meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('Default ElevatedButton meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -200,7 +199,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('ElevatedButton default overlayColor and elevation resolve pressed state', (WidgetTester tester) async { + testWidgets('ElevatedButton default overlayColor and elevation resolve pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -263,7 +262,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ElevatedButton uses stateful color for text color in different states', (WidgetTester tester) async { + testWidgets('ElevatedButton uses stateful color for text color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); const Color pressedColor = Color(0x00000001); @@ -341,7 +340,7 @@ void main() { }); - testWidgetsWithLeakTracking('ElevatedButton uses stateful color for icon color in different states', (WidgetTester tester) async { + testWidgets('ElevatedButton uses stateful color for icon color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final Key buttonKey = UniqueKey(); @@ -418,7 +417,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ElevatedButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { + testWidgets('ElevatedButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { bool wasPressed; Finder elevatedButton; @@ -461,7 +460,7 @@ void main() { expect(tester.widget<ElevatedButton>(elevatedButton).enabled, false); }); - testWidgetsWithLeakTracking('ElevatedButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { + testWidgets('ElevatedButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { bool didPressButton = false; bool didLongPressButton = false; @@ -492,7 +491,7 @@ void main() { expect(didLongPressButton, isTrue); }); - testWidgetsWithLeakTracking("ElevatedButton response doesn't hover when disabled", (WidgetTester tester) async { + testWidgets("ElevatedButton response doesn't hover when disabled", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'ElevatedButton Focus'); final GlobalKey childKey = GlobalKey(); @@ -544,7 +543,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('disabled and hovered ElevatedButton responds to mouse-exit', (WidgetTester tester) async { + testWidgets('disabled and hovered ElevatedButton responds to mouse-exit', (WidgetTester tester) async { int onHoverCount = 0; late bool hover; @@ -606,7 +605,7 @@ void main() { expect(hover, false); }); - testWidgetsWithLeakTracking('Can set ElevatedButton focus and Can set unFocus.', (WidgetTester tester) async { + testWidgets('Can set ElevatedButton focus and Can set unFocus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -637,7 +636,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('When ElevatedButton disable, Can not set ElevatedButton focus.', (WidgetTester tester) async { + testWidgets('When ElevatedButton disable, Can not set ElevatedButton focus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -663,7 +662,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('Does ElevatedButton work with hover', (WidgetTester tester) async { + testWidgets('Does ElevatedButton work with hover', (WidgetTester tester) async { const Color hoverColor = Color(0xff001122); await tester.pumpWidget( @@ -690,7 +689,7 @@ void main() { expect(inkFeatures, paints..rect(color: hoverColor)); }); - testWidgetsWithLeakTracking('Does ElevatedButton work with focus', (WidgetTester tester) async { + testWidgets('Does ElevatedButton work with focus', (WidgetTester tester) async { const Color focusColor = Color(0xff001122); final FocusNode focusNode = FocusNode(debugLabel: 'ElevatedButton Node'); @@ -720,7 +719,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does ElevatedButton work with autofocus', (WidgetTester tester) async { + testWidgets('Does ElevatedButton work with autofocus', (WidgetTester tester) async { const Color focusColor = Color(0xff001122); Color? getOverlayColor(Set<MaterialState> states) { @@ -752,7 +751,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does ElevatedButton contribute semantics', (WidgetTester tester) async { + testWidgets('Does ElevatedButton contribute semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Theme( @@ -800,7 +799,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ElevatedButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('ElevatedButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { const ButtonStyle style = ButtonStyle( // Specifying minimumSize to mimic the original minimumSize for // RaisedButton so that the corresponding button size matches @@ -834,7 +833,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); }); - testWidgetsWithLeakTracking('ElevatedButton has no clip by default', (WidgetTester tester) async { + testWidgets('ElevatedButton has no clip by default', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -851,7 +850,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ElevatedButton responds to density changes.', (WidgetTester tester) async { + testWidgets('ElevatedButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key childKey = Key('test child'); @@ -920,7 +919,7 @@ void main() { expect(childRect, equals(const Rect.fromLTRB(372.0, 293.0, 428.0, 307.0))); }); - testWidgetsWithLeakTracking('ElevatedButton.icon responds to applied padding', (WidgetTester tester) async { + testWidgets('ElevatedButton.icon responds to applied padding', (WidgetTester tester) async { const Key buttonKey = Key('test'); const Key labelKey = Key('label'); await tester.pumpWidget( @@ -1047,7 +1046,7 @@ void main() { if (textDirection == TextDirection.rtl) 'RTL', ].join(', '); - testWidgetsWithLeakTracking(testName, (WidgetTester tester) async { + testWidgets(testName, (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1189,7 +1188,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Override theme fontSize changes padding', (WidgetTester tester) async { + testWidgets('Override theme fontSize changes padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from( @@ -1220,7 +1219,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 12)); }); - testWidgetsWithLeakTracking('Override ElevatedButton default padding', (WidgetTester tester) async { + testWidgets('Override ElevatedButton default padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from(colorScheme: const ColorScheme.light()), @@ -1254,7 +1253,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.all(22)); }); - testWidgetsWithLeakTracking('M3 ElevatedButton has correct padding', (WidgetTester tester) async { + testWidgets('M3 ElevatedButton has correct padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1280,7 +1279,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 24)); }); - testWidgetsWithLeakTracking('M3 ElevatedButton.icon has correct padding', (WidgetTester tester) async { + testWidgets('M3 ElevatedButton.icon has correct padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1307,7 +1306,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 24.0, 0.0)); }); - testWidgetsWithLeakTracking('Elevated buttons animate elevation before color on disable', (WidgetTester tester) async { + testWidgets('Elevated buttons animate elevation before color on disable', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/387 const ColorScheme colorScheme = ColorScheme.light(); @@ -1354,7 +1353,7 @@ void main() { expect(physicalShape().color, disabledBackgroundColor); }); - testWidgetsWithLeakTracking('By default, ElevatedButton shape outline is defined by shape.side', (WidgetTester tester) async { + testWidgets('By default, ElevatedButton shape outline is defined by shape.side', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/69544 const Color borderColor = Color(0xff4caf50); @@ -1385,7 +1384,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Fixed size ElevatedButtons', (WidgetTester tester) async { + testWidgets('Fixed size ElevatedButtons', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1418,7 +1417,7 @@ void main() { expect(tester.getSize(find.widgetWithText(ElevatedButton, 'wx200')).height, 200); }); - testWidgetsWithLeakTracking('ElevatedButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { + testWidgets('ElevatedButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { Widget buildFrame({ InteractiveInkFeatureFactory? splashFactory }) { return MaterialApp( home: Scaffold( @@ -1458,7 +1457,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ElevatedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { + testWidgets('ElevatedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -1485,7 +1484,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('ElevatedButton uses InkRipple when useMaterial3 is false', (WidgetTester tester) async { + testWidgets('ElevatedButton uses InkRipple when useMaterial3 is false', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( @@ -1507,7 +1506,7 @@ void main() { expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('ElevatedButton.icon does not overflow', (WidgetTester tester) async { + testWidgets('ElevatedButton.icon does not overflow', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/77815 await tester.pumpWidget( MaterialApp( @@ -1528,7 +1527,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('ElevatedButton.icon icon,label layout', (WidgetTester tester) async { + testWidgets('ElevatedButton.icon icon,label layout', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); final Key iconKey = UniqueKey(); final Key labelKey = UniqueKey(); @@ -1565,7 +1564,7 @@ void main() { expect(tester.getRect(find.byKey(labelKey)), const Rect.fromLTRB(104.0, 0.0, 154.0, 100.0)); }); - testWidgetsWithLeakTracking('ElevatedButton maximumSize', (WidgetTester tester) async { + testWidgets('ElevatedButton maximumSize', (WidgetTester tester) async { final Key key0 = UniqueKey(); final Key key1 = UniqueKey(); @@ -1607,7 +1606,7 @@ void main() { expect(tester.getSize(find.byKey(key1)), const Size(104.0, 224.0)); }); - testWidgetsWithLeakTracking('Fixed size ElevatedButton, same as minimumSize == maximumSize', (WidgetTester tester) async { + testWidgets('Fixed size ElevatedButton, same as minimumSize == maximumSize', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1637,7 +1636,7 @@ void main() { expect(tester.getSize(find.widgetWithText(ElevatedButton, '200,200')), const Size(200, 200)); }); - testWidgetsWithLeakTracking('ElevatedButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('ElevatedButton changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1715,7 +1714,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('ElevatedButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('ElevatedButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104595. await tester.pumpWidget(MaterialApp( home: SelectionArea( @@ -1738,7 +1737,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('Ink Response shape matches Material shape', (WidgetTester tester) async { + testWidgets('Ink Response shape matches Material shape', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/91844 Widget buildFrame({BorderSide? side}) { @@ -1783,7 +1782,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ElevatedButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { + testWidgets('ElevatedButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1914,15 +1913,15 @@ void main() { await gesture.removePointer(); } - testWidgetsWithLeakTracking('ElevatedButton statesController', (WidgetTester tester) async { + testWidgets('ElevatedButton statesController', (WidgetTester tester) async { testStatesController(null, tester); }); - testWidgetsWithLeakTracking('ElevatedButton.icon statesController', (WidgetTester tester) async { + testWidgets('ElevatedButton.icon statesController', (WidgetTester tester) async { testStatesController(const Icon(Icons.add), tester); }); - testWidgetsWithLeakTracking('Disabled ElevatedButton statesController', (WidgetTester tester) async { + testWidgets('Disabled ElevatedButton statesController', (WidgetTester tester) async { int count = 0; void valueChanged() { count += 1; diff --git a/packages/flutter/test/material/elevated_button_theme_test.dart b/packages/flutter/test/material/elevated_button_theme_test.dart index aa713c23696..1957b746387 100644 --- a/packages/flutter/test/material/elevated_button_theme_test.dart +++ b/packages/flutter/test/material/elevated_button_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('ElevatedButtonThemeData lerp special cases', () { @@ -13,7 +12,7 @@ void main() { expect(identical(ElevatedButtonThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Material3: Passing no ElevatedButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material3: Passing no ElevatedButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -50,7 +49,7 @@ void main() { expect(align.alignment, Alignment.center); }); - testWidgetsWithLeakTracking('Material2: Passing no ElevatedButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material2: Passing no ElevatedButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -190,19 +189,19 @@ void main() { expect(align.alignment, alignment); } - testWidgetsWithLeakTracking('Button style overrides defaults', (WidgetTester tester) async { + testWidgets('Button style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(themeStyle: style)); await tester.pumpAndSettle(); checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallStyle: style)); await tester.pumpAndSettle(); checkButton(tester); @@ -210,26 +209,26 @@ void main() { // Same as the previous tests with empty ButtonStyle's instead of null. - testWidgetsWithLeakTracking('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { + testWidgets('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style, themeStyle: const ButtonStyle(), overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: style, overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); }); - testWidgetsWithLeakTracking('Material 3: Theme shadowColor', (WidgetTester tester) async { + testWidgets('Material 3: Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); @@ -300,7 +299,7 @@ void main() { expect(material.shadowColor, shadowColor); }); - testWidgetsWithLeakTracking('Material 2: Theme shadowColor', (WidgetTester tester) async { + testWidgets('Material 2: Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); diff --git a/packages/flutter/test/material/expand_icon_test.dart b/packages/flutter/test/material/expand_icon_test.dart index b6998cc58f6..4d795da9adb 100644 --- a/packages/flutter/test/material/expand_icon_test.dart +++ b/packages/flutter/test/material/expand_icon_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Widget wrap({ required Widget child, ThemeData? theme }) { return MaterialApp( @@ -16,7 +15,7 @@ Widget wrap({ required Widget child, ThemeData? theme }) { } void main() { - testWidgetsWithLeakTracking('ExpandIcon test', (WidgetTester tester) async { + testWidgets('ExpandIcon test', (WidgetTester tester) async { bool expanded = false; IconTheme iconTheme; @@ -74,7 +73,7 @@ void main() { expect(iconTheme.data.color, equals(Colors.white60)); }); - testWidgetsWithLeakTracking('ExpandIcon disabled', (WidgetTester tester) async { + testWidgets('ExpandIcon disabled', (WidgetTester tester) async { IconTheme iconTheme; // Light mode test await tester.pumpWidget(wrap( @@ -97,7 +96,7 @@ void main() { expect(iconTheme.data.color, equals(Colors.white38)); }); - testWidgetsWithLeakTracking('ExpandIcon test isExpanded does not trigger callback', (WidgetTester tester) async { + testWidgets('ExpandIcon test isExpanded does not trigger callback', (WidgetTester tester) async { bool expanded = false; await tester.pumpWidget(wrap( @@ -120,7 +119,7 @@ void main() { expect(expanded, isFalse); }); - testWidgetsWithLeakTracking('ExpandIcon is rotated initially if isExpanded is true on first build', (WidgetTester tester) async { + testWidgets('ExpandIcon is rotated initially if isExpanded is true on first build', (WidgetTester tester) async { bool expanded = true; await tester.pumpWidget(wrap( @@ -135,7 +134,7 @@ void main() { expect(rotation.turns.value, 0.5); }); - testWidgetsWithLeakTracking('ExpandIcon default size is 24', (WidgetTester tester) async { + testWidgets('ExpandIcon default size is 24', (WidgetTester tester) async { final ExpandIcon expandIcon = ExpandIcon( onPressed: (bool isExpanded) {}, ); @@ -148,7 +147,7 @@ void main() { expect(icon.size, 24); }); - testWidgetsWithLeakTracking('ExpandIcon has the correct given size', (WidgetTester tester) async { + testWidgets('ExpandIcon has the correct given size', (WidgetTester tester) async { ExpandIcon expandIcon = ExpandIcon( size: 36, onPressed: (bool isExpanded) {}, @@ -174,7 +173,7 @@ void main() { expect(icon.size, 48); }); - testWidgetsWithLeakTracking('ExpandIcon has correct semantic hints', (WidgetTester tester) async { + testWidgets('ExpandIcon has correct semantic hints', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); const DefaultMaterialLocalizations localizations = DefaultMaterialLocalizations(); await tester.pumpWidget(wrap( @@ -211,7 +210,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('ExpandIcon uses custom icon color and expanded icon color', (WidgetTester tester) async { + testWidgets('ExpandIcon uses custom icon color and expanded icon color', (WidgetTester tester) async { bool expanded = false; IconTheme iconTheme; @@ -272,7 +271,7 @@ void main() { expect(iconTheme.data.color, equals(Colors.indigo)); }); - testWidgetsWithLeakTracking('ExpandIcon uses custom disabled icon color', (WidgetTester tester) async { + testWidgets('ExpandIcon uses custom disabled icon color', (WidgetTester tester) async { IconTheme iconTheme; await tester.pumpWidget(wrap( diff --git a/packages/flutter/test/material/expansion_panel_test.dart b/packages/flutter/test/material/expansion_panel_test.dart index cfef2a5344f..7c2fc32a49b 100644 --- a/packages/flutter/test/material/expansion_panel_test.dart +++ b/packages/flutter/test/material/expansion_panel_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class SimpleExpansionPanelListTestWidget extends StatefulWidget { const SimpleExpansionPanelListTestWidget({ @@ -113,7 +112,7 @@ class ExpansionPanelListSemanticsTestState extends State<ExpansionPanelListSeman } void main() { - testWidgetsWithLeakTracking('ExpansionPanelList test', (WidgetTester tester) async { + testWidgets('ExpansionPanelList test', (WidgetTester tester) async { late int capturedIndex; late bool capturedIsExpanded; @@ -179,7 +178,7 @@ void main() { expect(box.size.height - oldHeight, greaterThanOrEqualTo(100.0)); // 100 + some margin }); - testWidgetsWithLeakTracking('ExpansionPanelList does not merge header when canTapOnHeader is false', (WidgetTester tester) async { + testWidgets('ExpansionPanelList does not merge header when canTapOnHeader is false', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final Key headerKey = UniqueKey(); await tester.pumpWidget( @@ -227,7 +226,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Multiple Panel List test', (WidgetTester tester) async { + testWidgets('Multiple Panel List test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: ListView( @@ -266,7 +265,7 @@ void main() { expect(find.text('D'), findsOneWidget); }); - testWidgetsWithLeakTracking('Open/close animations', (WidgetTester tester) async { + testWidgets('Open/close animations', (WidgetTester tester) async { const Duration kSizeAnimationDuration = Duration(milliseconds: 1000); // The MaterialGaps animate in using kThemeAnimationDuration (hardcoded), // which should be less than our test size animation length. So we can assume that they @@ -360,7 +359,7 @@ void main() { expect(tester.getRect(find.byType(AnimatedSize).at(2)), const Rect.fromLTWH(0.0, 48.0 + 1.0 + 48.0 + 16.0 + 16.0 + 48.0 + 16.0, 800.0, 100.0)); }); - testWidgetsWithLeakTracking('Radio mode has max of one panel open at a time', (WidgetTester tester) async { + testWidgets('Radio mode has max of one panel open at a time', (WidgetTester tester) async { final List<ExpansionPanel> demoItemsRadio = <ExpansionPanelRadio>[ ExpansionPanelRadio( headerBuilder: (BuildContext context, bool isExpanded) { @@ -499,7 +498,7 @@ void main() { expect(find.text('F'), findsNothing); }); - testWidgetsWithLeakTracking('Radio mode calls expansionCallback once if other panels closed', (WidgetTester tester) async { + testWidgets('Radio mode calls expansionCallback once if other panels closed', (WidgetTester tester) async { final List<ExpansionPanel> demoItemsRadio = <ExpansionPanelRadio>[ ExpansionPanelRadio( headerBuilder: (BuildContext context, bool isExpanded) { @@ -570,7 +569,7 @@ void main() { expect(callbackHistory.last['isExpanded'], equals(false)); }); - testWidgetsWithLeakTracking('Radio mode calls expansionCallback twice if other panel open prior', (WidgetTester tester) async { + testWidgets('Radio mode calls expansionCallback twice if other panel open prior', (WidgetTester tester) async { final List<ExpansionPanel> demoItemsRadio = <ExpansionPanelRadio>[ ExpansionPanelRadio( headerBuilder: (BuildContext context, bool isExpanded) { @@ -650,7 +649,7 @@ void main() { expect(callbackResults['isExpanded'], equals(true)); }); - testWidgetsWithLeakTracking('ExpansionPanelList.radio callback displays true or false based on the visibility of a list item', (WidgetTester tester) async { + testWidgets('ExpansionPanelList.radio callback displays true or false based on the visibility of a list item', (WidgetTester tester) async { late int lastExpanded; bool topElementExpanded = false; bool bottomElementExpanded = false; @@ -745,7 +744,7 @@ void main() { expect(find.text('D'), findsNothing); }); - testWidgetsWithLeakTracking( + testWidgets( 'didUpdateWidget accounts for toggling between ExpansionPanelList ' 'and ExpansionPaneList.radio', (WidgetTester tester) async { @@ -875,7 +874,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('No duplicate global keys at layout/build time', (WidgetTester tester) async { + testWidgets('No duplicate global keys at layout/build time', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/13780 await tester.pumpWidget( StatefulBuilder( @@ -999,7 +998,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Panel header has semantics, canTapOnHeader = false ', (WidgetTester tester) async { + testWidgets('Panel header has semantics, canTapOnHeader = false ', (WidgetTester tester) async { const Key expandedKey = Key('expanded'); const Key collapsedKey = Key('collapsed'); const DefaultMaterialLocalizations localizations = DefaultMaterialLocalizations(); @@ -1084,7 +1083,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Panel header has semantics, canTapOnHeader = true', (WidgetTester tester) async { + testWidgets('Panel header has semantics, canTapOnHeader = true', (WidgetTester tester) async { const Key expandedKey = Key('expanded'); const Key collapsedKey = Key('collapsed'); final SemanticsHandle handle = tester.ensureSemantics(); @@ -1137,7 +1136,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Ensure canTapOnHeader is false by default', (WidgetTester tester) async { + testWidgets('Ensure canTapOnHeader is false by default', (WidgetTester tester) async { final ExpansionPanel expansionPanel = ExpansionPanel( headerBuilder: (BuildContext context, bool isExpanded) => const Text('Demo'), body: const SizedBox(height: 100.0), @@ -1146,7 +1145,7 @@ void main() { expect(expansionPanel.canTapOnHeader, isFalse); }); - testWidgetsWithLeakTracking('Toggle ExpansionPanelRadio when tapping header and canTapOnHeader is true', (WidgetTester tester) async { + testWidgets('Toggle ExpansionPanelRadio when tapping header and canTapOnHeader is true', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); const Key secondPanelKey = Key('secondPanelKey'); @@ -1206,7 +1205,7 @@ void main() { expect(find.text('D'), findsOneWidget); }); - testWidgetsWithLeakTracking('Toggle ExpansionPanel when tapping header and canTapOnHeader is true', (WidgetTester tester) async { + testWidgets('Toggle ExpansionPanel when tapping header and canTapOnHeader is true', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); const Key secondPanelKey = Key('secondPanelKey'); @@ -1265,7 +1264,7 @@ void main() { expect(find.text('D'), findsNothing); }); - testWidgetsWithLeakTracking('Do not toggle ExpansionPanel when tapping header and canTapOnHeader is false', (WidgetTester tester) async { + testWidgets('Do not toggle ExpansionPanel when tapping header and canTapOnHeader is false', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); const Key secondPanelKey = Key('secondPanelKey'); @@ -1305,7 +1304,7 @@ void main() { expect(find.text('D'), findsNothing); }); - testWidgetsWithLeakTracking('Do not toggle ExpansionPanelRadio when tapping header and canTapOnHeader is false', (WidgetTester tester) async { + testWidgets('Do not toggle ExpansionPanelRadio when tapping header and canTapOnHeader is false', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); const Key secondPanelKey = Key('secondPanelKey'); @@ -1363,7 +1362,7 @@ void main() { expect(find.text('D'), findsNothing); }); - testWidgetsWithLeakTracking('Correct default header padding', (WidgetTester tester) async { + testWidgets('Correct default header padding', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); await tester.pumpWidget( @@ -1401,7 +1400,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/5848. - testWidgetsWithLeakTracking('The AnimatedContainer and IconButton have the same height of 48px', (WidgetTester tester) async { + testWidgets('The AnimatedContainer and IconButton have the same height of 48px', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); await tester.pumpWidget( @@ -1426,7 +1425,7 @@ void main() { expect(boxOfContainer.size.height, equals(48.0)); // Header should have 48px height according to Material 2 Design spec. }); - testWidgetsWithLeakTracking("The AnimatedContainer's height is at least kMinInteractiveDimension", (WidgetTester tester) async { + testWidgets("The AnimatedContainer's height is at least kMinInteractiveDimension", (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); await tester.pumpWidget( @@ -1449,7 +1448,7 @@ void main() { expect(box.size.height, greaterThanOrEqualTo(kMinInteractiveDimension)); }); - testWidgetsWithLeakTracking('Correct custom header padding', (WidgetTester tester) async { + testWidgets('Correct custom header padding', (WidgetTester tester) async { const Key firstPanelKey = Key('firstPanelKey'); await tester.pumpWidget( @@ -1487,7 +1486,7 @@ void main() { expect(box.size.width, equals(744.0)); }); - testWidgetsWithLeakTracking('ExpansionPanelList respects dividerColor', (WidgetTester tester) async { + testWidgets('ExpansionPanelList respects dividerColor', (WidgetTester tester) async { const Color dividerColor = Colors.red; await tester.pumpWidget(const MaterialApp( home: SingleChildScrollView( @@ -1504,7 +1503,7 @@ void main() { expect(decoration.border!.top.color, dividerColor); }); - testWidgetsWithLeakTracking('ExpansionPanelList.radio respects DividerColor', (WidgetTester tester) async { + testWidgets('ExpansionPanelList.radio respects DividerColor', (WidgetTester tester) async { const Color dividerColor = Colors.red; await tester.pumpWidget(MaterialApp( home: SingleChildScrollView( @@ -1537,7 +1536,7 @@ void main() { expect(boxDecoration.border!.top.color, dividerColor); }); - testWidgetsWithLeakTracking('ExpansionPanelList respects expandIconColor', (WidgetTester tester) async { + testWidgets('ExpansionPanelList respects expandIconColor', (WidgetTester tester) async { const Color expandIconColor = Colors.blue; await tester.pumpWidget(MaterialApp( home: SingleChildScrollView( @@ -1561,7 +1560,7 @@ void main() { expect(expandIcon.color, expandIconColor); }); - testWidgetsWithLeakTracking('ExpansionPanelList.radio respects expandIconColor', (WidgetTester tester) async { + testWidgets('ExpansionPanelList.radio respects expandIconColor', (WidgetTester tester) async { const Color expandIconColor = Colors.blue; await tester.pumpWidget(MaterialApp( home: SingleChildScrollView( @@ -1586,7 +1585,7 @@ void main() { expect(expandIcon.color, expandIconColor); }); - testWidgetsWithLeakTracking('elevation is propagated properly to MergeableMaterial', (WidgetTester tester) async { + testWidgets('elevation is propagated properly to MergeableMaterial', (WidgetTester tester) async { const double elevation = 8; // Test for ExpansionPanelList. @@ -1628,7 +1627,7 @@ void main() { expect(tester.widget<MergeableMaterial>(find.byType(MergeableMaterial)).elevation, elevation); }); - testWidgetsWithLeakTracking('Using a value non defined value throws assertion error', (WidgetTester tester) async { + testWidgets('Using a value non defined value throws assertion error', (WidgetTester tester) async { // It should throw an AssertionError since, 19 is not defined in kElevationToShadow. await tester.pumpWidget(const MaterialApp( @@ -1647,7 +1646,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('ExpansionPanel.panelColor test', (WidgetTester tester) async { + testWidgets('ExpansionPanel.panelColor test', (WidgetTester tester) async { const Color firstPanelColor = Colors.red; const Color secondPanelColor = Colors.brown; @@ -1683,7 +1682,7 @@ void main() { expect((mergeableMaterial.children.last as MaterialSlice).color, secondPanelColor); }); - testWidgetsWithLeakTracking('ExpansionPanelRadio.backgroundColor test', (WidgetTester tester) async { + testWidgets('ExpansionPanelRadio.backgroundColor test', (WidgetTester tester) async { const Color firstPanelColor = Colors.red; const Color secondPanelColor = Colors.brown; @@ -1718,7 +1717,7 @@ void main() { expect((mergeableMaterial.children.last as MaterialSlice).color, secondPanelColor); }); - testWidgetsWithLeakTracking('ExpansionPanelList.materialGapSize defaults to 16.0', (WidgetTester tester) async { + testWidgets('ExpansionPanelList.materialGapSize defaults to 16.0', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: SingleChildScrollView( child: ExpansionPanelList( @@ -1739,7 +1738,7 @@ void main() { expect(expansionPanelList.materialGapSize, 16); }); - testWidgetsWithLeakTracking('ExpansionPanelList respects materialGapSize', (WidgetTester tester) async { + testWidgets('ExpansionPanelList respects materialGapSize', (WidgetTester tester) async { Widget buildWidgetForTest({double materialGapSize = 16}) { return MaterialApp( home: SingleChildScrollView( diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index ce3758d1878..5e7c860a4fa 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestIcon extends StatefulWidget { const TestIcon({super.key}); @@ -49,7 +48,7 @@ void main() { const Color unselectedWidgetColor = Colors.black54; const Color headerColor = Colors.black45; - testWidgetsWithLeakTracking('ExpansionTile initial state', (WidgetTester tester) async { + testWidgets('ExpansionTile initial state', (WidgetTester tester) async { final Key topKey = UniqueKey(); const Key expandedKey = PageStorageKey<String>('expanded'); const Key collapsedKey = PageStorageKey<String>('collapsed'); @@ -159,7 +158,7 @@ void main() { expect((collapsedContainerDecoration.shape as Border).bottom.color, dividerColor); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('ExpansionTile Theme dependencies', (WidgetTester tester) async { + testWidgets('ExpansionTile Theme dependencies', (WidgetTester tester) async { final Key expandedTitleKey = UniqueKey(); final Key collapsedTitleKey = UniqueKey(); final Key expandedIconKey = UniqueKey(); @@ -218,7 +217,7 @@ void main() { expect(iconColor(collapsedIconKey), foregroundColor); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('ExpansionTile subtitle', (WidgetTester tester) async { + testWidgets('ExpansionTile subtitle', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -234,7 +233,7 @@ void main() { expect(find.text('Subtitle'), findsOneWidget); }); - testWidgetsWithLeakTracking('ExpansionTile maintainState', (WidgetTester tester) async { + testWidgets('ExpansionTile maintainState', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -272,7 +271,7 @@ void main() { expect(find.text('Discarding State'), findsNothing); }); - testWidgetsWithLeakTracking('ExpansionTile padding test', (WidgetTester tester) async { + testWidgets('ExpansionTile padding test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: Center( @@ -299,7 +298,7 @@ void main() { expect(listTileRect.bottom, tallerWidget.bottom + remainingHeight / 2 + 10); }); - testWidgetsWithLeakTracking('ExpansionTile expandedAlignment test', (WidgetTester tester) async { + testWidgets('ExpansionTile expandedAlignment test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: Center( @@ -328,7 +327,7 @@ void main() { expect(columnRect.right, 100.0); }); - testWidgetsWithLeakTracking('ExpansionTile expandedCrossAxisAlignment test', (WidgetTester tester) async { + testWidgets('ExpansionTile expandedCrossAxisAlignment test', (WidgetTester tester) async { const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -372,7 +371,7 @@ void main() { expect(child1Rect.left, 700.0); }); - testWidgetsWithLeakTracking('CrossAxisAlignment.baseline is not allowed', (WidgetTester tester) async { + testWidgets('CrossAxisAlignment.baseline is not allowed', (WidgetTester tester) async { expect( () { MaterialApp( @@ -392,7 +391,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('expandedCrossAxisAlignment and expandedAlignment default values', (WidgetTester tester) async { + testWidgets('expandedCrossAxisAlignment and expandedAlignment default values', (WidgetTester tester) async { const Key child1Key = Key('child1'); await tester.pumpWidget(const MaterialApp( @@ -427,7 +426,7 @@ void main() { }); - testWidgetsWithLeakTracking('childrenPadding default value', (WidgetTester tester) async { + testWidgets('childrenPadding default value', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -457,7 +456,7 @@ void main() { expect(columnRect.bottom, paddingRect.bottom); }); - testWidgetsWithLeakTracking('ExpansionTile childrenPadding test', (WidgetTester tester) async { + testWidgets('ExpansionTile childrenPadding test', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -488,7 +487,7 @@ void main() { expect(columnRect.bottom, paddingRect.bottom - 4); }); - testWidgetsWithLeakTracking('ExpansionTile.collapsedBackgroundColor', (WidgetTester tester) async { + testWidgets('ExpansionTile.collapsedBackgroundColor', (WidgetTester tester) async { const Key expansionTileKey = Key('expansionTileKey'); const Color backgroundColor = Colors.red; const Color collapsedBackgroundColor = Colors.brown; @@ -525,7 +524,7 @@ void main() { expect(shapeDecoration.color, backgroundColor); }); - testWidgetsWithLeakTracking('ExpansionTile default iconColor, textColor', (WidgetTester tester) async { + testWidgets('ExpansionTile default iconColor, textColor', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( @@ -554,7 +553,7 @@ void main() { expect(getTextColor(), theme.colorScheme.onSurface); }); - testWidgetsWithLeakTracking('ExpansionTile iconColor, textColor', (WidgetTester tester) async { + testWidgets('ExpansionTile iconColor, textColor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/78281 const Color iconColor = Color(0xff00ff00); @@ -591,7 +590,7 @@ void main() { expect(getTextColor(), textColor); }); - testWidgetsWithLeakTracking('ExpansionTile Border', (WidgetTester tester) async { + testWidgets('ExpansionTile Border', (WidgetTester tester) async { const Key expansionTileKey = PageStorageKey<String>('expansionTile'); const Border collapsedShape = Border( @@ -639,7 +638,7 @@ void main() { expect(expandedContainerDecoration.shape, shape); }); - testWidgetsWithLeakTracking('ExpansionTile platform controlAffinity test', (WidgetTester tester) async { + testWidgets('ExpansionTile platform controlAffinity test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: ExpansionTile( @@ -653,7 +652,7 @@ void main() { expect(listTile.trailing.runtimeType, RotationTransition); }); - testWidgetsWithLeakTracking('ExpansionTile trailing controlAffinity test', (WidgetTester tester) async { + testWidgets('ExpansionTile trailing controlAffinity test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: ExpansionTile( @@ -668,7 +667,7 @@ void main() { expect(listTile.trailing.runtimeType, RotationTransition); }); - testWidgetsWithLeakTracking('ExpansionTile leading controlAffinity test', (WidgetTester tester) async { + testWidgets('ExpansionTile leading controlAffinity test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: ExpansionTile( @@ -683,7 +682,7 @@ void main() { expect(listTile.trailing, isNull); }); - testWidgetsWithLeakTracking('ExpansionTile override rotating icon test', (WidgetTester tester) async { + testWidgets('ExpansionTile override rotating icon test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: ExpansionTile( @@ -699,7 +698,7 @@ void main() { expect(listTile.trailing, isNull); }); - testWidgetsWithLeakTracking('Nested ListTile Semantics', (WidgetTester tester) async { + testWidgets('Nested ListTile Semantics', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final SemanticsHandle handle = tester.ensureSemantics(); @@ -754,7 +753,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('ExpansionTile Semantics announcement', (WidgetTester tester) async { + testWidgets('ExpansionTile Semantics announcement', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); const DefaultMaterialLocalizations localizations = DefaultMaterialLocalizations(); await tester.pumpWidget( @@ -793,7 +792,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Semantics with the onTapHint is an ancestor of ListTile', (WidgetTester tester) async { + testWidgets('Semantics with the onTapHint is an ancestor of ListTile', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/pull/121624 final SemanticsHandle handle = tester.ensureSemantics(); const DefaultMaterialLocalizations localizations = DefaultMaterialLocalizations(); @@ -845,7 +844,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Semantics hint for iOS and macOS', (WidgetTester tester) async { + testWidgets('Semantics hint for iOS and macOS', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); const DefaultMaterialLocalizations localizations = DefaultMaterialLocalizations(); @@ -893,7 +892,7 @@ void main() { handle.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Collapsed ExpansionTile properties can be updated with setState', (WidgetTester tester) async { + testWidgets('Collapsed ExpansionTile properties can be updated with setState', (WidgetTester tester) async { const Key expansionTileKey = Key('expansionTileKey'); ShapeBorder collapsedShape = const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(4)), @@ -968,7 +967,7 @@ void main() { expect(tester.state<TestTextState>(find.byType(TestText)).textStyle.color, const Color(0xff000000)); }); - testWidgetsWithLeakTracking('Expanded ExpansionTile properties can be updated with setState', (WidgetTester tester) async { + testWidgets('Expanded ExpansionTile properties can be updated with setState', (WidgetTester tester) async { const Key expansionTileKey = Key('expansionTileKey'); ShapeBorder shape = const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(12)), @@ -1049,7 +1048,7 @@ void main() { expect(tester.state<TestTextState>(find.byType(TestText)).textStyle.color, const Color(0xffffffff)); }); - testWidgetsWithLeakTracking('Override ExpansionTile animation using AnimationStyle', (WidgetTester tester) async { + testWidgets('Override ExpansionTile animation using AnimationStyle', (WidgetTester tester) async { const Key expansionTileKey = Key('expansionTileKey'); Widget buildExpansionTile({ AnimationStyle? animationStyle }) { @@ -1155,7 +1154,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('ExpansionTile default iconColor, textColor', (WidgetTester tester) async { + testWidgets('ExpansionTile default iconColor, textColor', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget(MaterialApp( @@ -1185,7 +1184,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ExpansionTileController isExpanded, expand() and collapse()', (WidgetTester tester) async { + testWidgets('ExpansionTileController isExpanded, expand() and collapse()', (WidgetTester tester) async { final ExpansionTileController controller = ExpansionTileController(); await tester.pumpWidget(MaterialApp( @@ -1213,7 +1212,7 @@ void main() { expect(find.text('Child 0'), findsNothing); }); - testWidgetsWithLeakTracking('Calling ExpansionTileController.expand/collapsed has no effect if it is already expanded/collapsed', (WidgetTester tester) async { + testWidgets('Calling ExpansionTileController.expand/collapsed has no effect if it is already expanded/collapsed', (WidgetTester tester) async { final ExpansionTileController controller = ExpansionTileController(); await tester.pumpWidget(MaterialApp( @@ -1249,7 +1248,7 @@ void main() { expect(tester.hasRunningAnimations, isFalse); }); - testWidgetsWithLeakTracking('Call to ExpansionTileController.of()', (WidgetTester tester) async { + testWidgets('Call to ExpansionTileController.of()', (WidgetTester tester) async { final GlobalKey titleKey = GlobalKey(); final GlobalKey childKey = GlobalKey(); await tester.pumpWidget(MaterialApp( @@ -1273,7 +1272,7 @@ void main() { expect(controller1, controller2); }); - testWidgetsWithLeakTracking('Call to ExpansionTile.maybeOf()', (WidgetTester tester) async { + testWidgets('Call to ExpansionTile.maybeOf()', (WidgetTester tester) async { final GlobalKey titleKey = GlobalKey(); final GlobalKey nonDescendantKey = GlobalKey(); await tester.pumpWidget(MaterialApp( @@ -1300,7 +1299,7 @@ void main() { expect(controller2, isNull); }); - testWidgetsWithLeakTracking('Check if dense, enableFeedback, visualDensity parameter is working', (WidgetTester tester) async { + testWidgets('Check if dense, enableFeedback, visualDensity parameter is working', (WidgetTester tester) async { final GlobalKey titleKey = GlobalKey(); final GlobalKey nonDescendantKey = GlobalKey(); @@ -1334,7 +1333,7 @@ void main() { expect(tileWidget.visualDensity, visualDensity); }); - testWidgetsWithLeakTracking('ExpansionTileController should not toggle if disabled', (WidgetTester tester) async { + testWidgets('ExpansionTileController should not toggle if disabled', (WidgetTester tester) async { final ExpansionTileController controller = ExpansionTileController(); await tester.pumpWidget(MaterialApp( diff --git a/packages/flutter/test/material/expansion_tile_theme_test.dart b/packages/flutter/test/material/expansion_tile_theme_test.dart index 076e1876809..57ecaa3563d 100644 --- a/packages/flutter/test/material/expansion_tile_theme_test.dart +++ b/packages/flutter/test/material/expansion_tile_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestIcon extends StatefulWidget { const TestIcon({super.key}); @@ -71,7 +70,7 @@ void main() { expect(theme.expansionAnimationStyle, null); }); - testWidgetsWithLeakTracking('Default ExpansionTileThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ExpansionTileThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TooltipThemeData().debugFillProperties(builder); @@ -83,7 +82,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ExpansionTileThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ExpansionTileThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); ExpansionTileThemeData( backgroundColor: const Color(0xff000000), @@ -123,7 +122,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('ExpansionTileTheme - collapsed', (WidgetTester tester) async { + testWidgets('ExpansionTileTheme - collapsed', (WidgetTester tester) async { final Key tileKey = UniqueKey(); final Key titleKey = UniqueKey(); final Key iconKey = UniqueKey(); @@ -215,7 +214,7 @@ void main() { expect(shapeDecoration.shape, collapsedShape); }); - testWidgetsWithLeakTracking('ExpansionTileTheme - expanded', (WidgetTester tester) async { + testWidgets('ExpansionTileTheme - expanded', (WidgetTester tester) async { final Key tileKey = UniqueKey(); final Key titleKey = UniqueKey(); final Key iconKey = UniqueKey(); @@ -309,7 +308,7 @@ void main() { expect(childRect.bottom, paddingRect.bottom - 20); }); - testWidgetsWithLeakTracking('Override ExpansionTile animation using ExpansionTileThemeData.AnimationStyle', (WidgetTester tester) async { + testWidgets('Override ExpansionTile animation using ExpansionTileThemeData.AnimationStyle', (WidgetTester tester) async { const Key expansionTileKey = Key('expansionTileKey'); Widget buildExpansionTile({ AnimationStyle? animationStyle }) { diff --git a/packages/flutter/test/material/feedback_test.dart b/packages/flutter/test/material/feedback_test.dart index 95cc70b7cb4..a460d799d7f 100644 --- a/packages/flutter/test/material/feedback_test.dart +++ b/packages/flutter/test/material/feedback_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -37,7 +36,7 @@ void main () { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('forTap', (WidgetTester tester) async { + testWidgets('forTap', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(TestWidget( @@ -66,7 +65,7 @@ void main () { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('forTap Wrapper', (WidgetTester tester) async { + testWidgets('forTap Wrapper', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); int callbackCount = 0; @@ -101,7 +100,7 @@ void main () { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('forLongPress', (WidgetTester tester) async { + testWidgets('forLongPress', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(TestWidget( @@ -129,7 +128,7 @@ void main () { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('forLongPress Wrapper', (WidgetTester tester) async { + testWidgets('forLongPress Wrapper', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); int callbackCount = 0; void callback() { @@ -166,7 +165,7 @@ void main () { }); group('Feedback on iOS', () { - testWidgetsWithLeakTracking('forTap', (WidgetTester tester) async { + testWidgets('forTap', (WidgetTester tester) async { await tester.pumpWidget(Theme( data: ThemeData(platform: TargetPlatform.iOS), child: TestWidget( @@ -182,7 +181,7 @@ void main () { expect(feedback.clickSoundCount, 0); }); - testWidgetsWithLeakTracking('forLongPress', (WidgetTester tester) async { + testWidgets('forLongPress', (WidgetTester tester) async { await tester.pumpWidget(Theme( data: ThemeData(platform: TargetPlatform.iOS), child: TestWidget( diff --git a/packages/flutter/test/material/filled_button_test.dart b/packages/flutter/test/material/filled_button_test.dart index 16868cc2dbd..e9e63fe6a11 100644 --- a/packages/flutter/test/material/filled_button_test.dart +++ b/packages/flutter/test/material/filled_button_test.dart @@ -7,11 +7,10 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('FilledButton, FilledButton.icon defaults', (WidgetTester tester) async { + testWidgets('FilledButton, FilledButton.icon defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); final ThemeData theme = ThemeData.from(useMaterial3: false, colorScheme: colorScheme); @@ -128,7 +127,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('FilledButton.tonal, FilledButton.tonalIcon defaults', (WidgetTester tester) async { + testWidgets('FilledButton.tonal, FilledButton.tonalIcon defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: colorScheme); @@ -245,7 +244,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Default FilledButton meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('Default FilledButton meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -285,7 +284,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('FilledButton default overlayColor and elevation resolve pressed state', (WidgetTester tester) async { + testWidgets('FilledButton default overlayColor and elevation resolve pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -351,7 +350,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('FilledButton.tonal default overlayColor and elevation resolve pressed state', (WidgetTester tester) async { + testWidgets('FilledButton.tonal default overlayColor and elevation resolve pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -417,7 +416,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('FilledButton uses stateful color for text color in different states', (WidgetTester tester) async { + testWidgets('FilledButton uses stateful color for text color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); const Color pressedColor = Color(0x00000001); @@ -494,7 +493,7 @@ void main() { }); - testWidgetsWithLeakTracking('FilledButton uses stateful color for icon color in different states', (WidgetTester tester) async { + testWidgets('FilledButton uses stateful color for icon color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final Key buttonKey = UniqueKey(); @@ -570,7 +569,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('FilledButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { + testWidgets('FilledButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { bool wasPressed; Finder filledButton; @@ -613,7 +612,7 @@ void main() { expect(tester.widget<FilledButton>(filledButton).enabled, false); }); - testWidgetsWithLeakTracking('FilledButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { + testWidgets('FilledButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { bool didPressButton = false; bool didLongPressButton = false; @@ -644,7 +643,7 @@ void main() { expect(didLongPressButton, isTrue); }); - testWidgetsWithLeakTracking("FilledButton response doesn't hover when disabled", (WidgetTester tester) async { + testWidgets("FilledButton response doesn't hover when disabled", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'FilledButton Focus'); final GlobalKey childKey = GlobalKey(); @@ -695,7 +694,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('disabled and hovered FilledButton responds to mouse-exit', (WidgetTester tester) async { + testWidgets('disabled and hovered FilledButton responds to mouse-exit', (WidgetTester tester) async { int onHoverCount = 0; late bool hover; @@ -757,7 +756,7 @@ void main() { expect(hover, false); }); - testWidgetsWithLeakTracking('Can set FilledButton focus and Can set unFocus.', (WidgetTester tester) async { + testWidgets('Can set FilledButton focus and Can set unFocus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'FilledButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -787,7 +786,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('When FilledButton disable, Can not set FilledButton focus.', (WidgetTester tester) async { + testWidgets('When FilledButton disable, Can not set FilledButton focus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'FilledButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -811,7 +810,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('Does FilledButton work with hover', (WidgetTester tester) async { + testWidgets('Does FilledButton work with hover', (WidgetTester tester) async { const Color hoverColor = Color(0xff001122); await tester.pumpWidget( @@ -838,7 +837,7 @@ void main() { expect(inkFeatures, paints..rect(color: hoverColor)); }); - testWidgetsWithLeakTracking('Does FilledButton work with focus', (WidgetTester tester) async { + testWidgets('Does FilledButton work with focus', (WidgetTester tester) async { const Color focusColor = Color(0xff001122); final FocusNode focusNode = FocusNode(debugLabel: 'FilledButton Node'); @@ -867,7 +866,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does FilledButton work with autofocus', (WidgetTester tester) async { + testWidgets('Does FilledButton work with autofocus', (WidgetTester tester) async { const Color focusColor = Color(0xff001122); Color? getOverlayColor(Set<MaterialState> states) { @@ -898,7 +897,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does FilledButton contribute semantics', (WidgetTester tester) async { + testWidgets('Does FilledButton contribute semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Theme( @@ -946,7 +945,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('FilledButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('FilledButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { const ButtonStyle style = ButtonStyle( // Specifying minimumSize to mimic the original minimumSize for // RaisedButton so that the corresponding button size matches @@ -980,7 +979,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); }); - testWidgetsWithLeakTracking('FilledButton has no clip by default', (WidgetTester tester) async { + testWidgets('FilledButton has no clip by default', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -997,7 +996,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FilledButton responds to density changes.', (WidgetTester tester) async { + testWidgets('FilledButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key childKey = Key('test child'); @@ -1066,7 +1065,7 @@ void main() { expect(childRect, equals(const Rect.fromLTRB(372.0, 293.0, 428.0, 307.0))); }); - testWidgetsWithLeakTracking('FilledButton.icon responds to applied padding', (WidgetTester tester) async { + testWidgets('FilledButton.icon responds to applied padding', (WidgetTester tester) async { const Key buttonKey = Key('test'); const Key labelKey = Key('label'); await tester.pumpWidget( @@ -1193,7 +1192,7 @@ void main() { if (textDirection == TextDirection.rtl) 'RTL', ].join(', '); - testWidgetsWithLeakTracking(testName, (WidgetTester tester) async { + testWidgets(testName, (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1334,7 +1333,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Override FilledButton default padding', (WidgetTester tester) async { + testWidgets('Override FilledButton default padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from(colorScheme: const ColorScheme.light()), @@ -1368,7 +1367,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.all(22)); }); - testWidgetsWithLeakTracking('Override theme fontSize changes padding', (WidgetTester tester) async { + testWidgets('Override theme fontSize changes padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from( @@ -1399,7 +1398,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 12)); }); - testWidgetsWithLeakTracking('M3 FilledButton has correct padding', (WidgetTester tester) async { + testWidgets('M3 FilledButton has correct padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1425,7 +1424,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 24)); }); - testWidgetsWithLeakTracking('M3 FilledButton.icon has correct padding', (WidgetTester tester) async { + testWidgets('M3 FilledButton.icon has correct padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1452,7 +1451,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 24.0, 0.0)); }); - testWidgetsWithLeakTracking('By default, FilledButton shape outline is defined by shape.side', (WidgetTester tester) async { + testWidgets('By default, FilledButton shape outline is defined by shape.side', (WidgetTester tester) async { const Color borderColor = Color(0xff4caf50); await tester.pumpWidget( MaterialApp( @@ -1481,7 +1480,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Fixed size FilledButtons', (WidgetTester tester) async { + testWidgets('Fixed size FilledButtons', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1514,7 +1513,7 @@ void main() { expect(tester.getSize(find.widgetWithText(FilledButton, 'wx200')).height, 200); }); - testWidgetsWithLeakTracking('FilledButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { + testWidgets('FilledButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { Widget buildFrame({ InteractiveInkFeatureFactory? splashFactory }) { return MaterialApp( home: Scaffold( @@ -1554,7 +1553,7 @@ void main() { } }); - testWidgetsWithLeakTracking('FilledButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { + testWidgets('FilledButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -1581,7 +1580,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('FilledButton.icon does not overflow', (WidgetTester tester) async { + testWidgets('FilledButton.icon does not overflow', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/77815 await tester.pumpWidget( MaterialApp( @@ -1602,7 +1601,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('FilledButton.icon icon,label layout', (WidgetTester tester) async { + testWidgets('FilledButton.icon icon,label layout', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); final Key iconKey = UniqueKey(); final Key labelKey = UniqueKey(); @@ -1639,7 +1638,7 @@ void main() { expect(tester.getRect(find.byKey(labelKey)), const Rect.fromLTRB(104.0, 0.0, 154.0, 100.0)); }); - testWidgetsWithLeakTracking('FilledButton maximumSize', (WidgetTester tester) async { + testWidgets('FilledButton maximumSize', (WidgetTester tester) async { final Key key0 = UniqueKey(); final Key key1 = UniqueKey(); @@ -1681,7 +1680,7 @@ void main() { expect(tester.getSize(find.byKey(key1)), const Size(104.0, 224.0)); }); - testWidgetsWithLeakTracking('Fixed size FilledButton, same as minimumSize == maximumSize', (WidgetTester tester) async { + testWidgets('Fixed size FilledButton, same as minimumSize == maximumSize', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1711,7 +1710,7 @@ void main() { expect(tester.getSize(find.widgetWithText(FilledButton, '200,200')), const Size(200, 200)); }); - testWidgetsWithLeakTracking('FilledButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('FilledButton changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1789,7 +1788,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('FilledButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('FilledButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104595. await tester.pumpWidget(MaterialApp( home: SelectionArea( @@ -1812,7 +1811,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('Ink Response shape matches Material shape', (WidgetTester tester) async { + testWidgets('Ink Response shape matches Material shape', (WidgetTester tester) async { Widget buildFrame({BorderSide? side}) { return MaterialApp( home: Scaffold( @@ -1855,7 +1854,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FilledButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { + testWidgets('FilledButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1986,15 +1985,15 @@ void main() { await gesture.removePointer(); } - testWidgetsWithLeakTracking('FilledButton statesController', (WidgetTester tester) async { + testWidgets('FilledButton statesController', (WidgetTester tester) async { testStatesController(null, tester); }); - testWidgetsWithLeakTracking('FilledButton.icon statesController', (WidgetTester tester) async { + testWidgets('FilledButton.icon statesController', (WidgetTester tester) async { testStatesController(const Icon(Icons.add), tester); }); - testWidgetsWithLeakTracking('Disabled FilledButton statesController', (WidgetTester tester) async { + testWidgets('Disabled FilledButton statesController', (WidgetTester tester) async { int count = 0; void valueChanged() { count += 1; diff --git a/packages/flutter/test/material/filled_button_theme_test.dart b/packages/flutter/test/material/filled_button_theme_test.dart index 2b0ff185dd5..5b0d7c4dbe5 100644 --- a/packages/flutter/test/material/filled_button_theme_test.dart +++ b/packages/flutter/test/material/filled_button_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('FilledButtonThemeData lerp special cases', () { @@ -13,7 +12,7 @@ void main() { expect(identical(FilledButtonThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Passing no FilledButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Passing no FilledButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -154,19 +153,19 @@ void main() { expect(align.alignment, alignment); } - testWidgetsWithLeakTracking('Button style overrides defaults', (WidgetTester tester) async { + testWidgets('Button style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(themeStyle: style)); await tester.pumpAndSettle(); checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallStyle: style)); await tester.pumpAndSettle(); checkButton(tester); @@ -174,26 +173,26 @@ void main() { // Same as the previous tests with empty ButtonStyle's instead of null. - testWidgetsWithLeakTracking('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { + testWidgets('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style, themeStyle: const ButtonStyle(), overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: style, overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); }); - testWidgetsWithLeakTracking('Theme shadowColor', (WidgetTester tester) async { + testWidgets('Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); diff --git a/packages/flutter/test/material/filter_chip_test.dart b/packages/flutter/test/material/filter_chip_test.dart index 76256cfc115..3c940e2b8b7 100644 --- a/packages/flutter/test/material/filter_chip_test.dart +++ b/packages/flutter/test/material/filter_chip_test.dart @@ -10,7 +10,6 @@ library; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'feedback_tester.dart'; @@ -132,7 +131,7 @@ DefaultTextStyle getLabelStyle(WidgetTester tester, String labelText) { } void main() { - testWidgetsWithLeakTracking('FilterChip defaults', (WidgetTester tester) async { + testWidgets('FilterChip defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const String label = 'filter chip'; @@ -267,7 +266,7 @@ void main() { expect(decoration.color, theme.colorScheme.onSurface.withOpacity(0.12)); }); - testWidgetsWithLeakTracking('FilterChip.elevated defaults', (WidgetTester tester) async { + testWidgets('FilterChip.elevated defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const String label = 'filter chip'; @@ -402,7 +401,7 @@ void main() { expect(decoration.color, theme.colorScheme.onSurface.withOpacity(0.12)); }); - testWidgetsWithLeakTracking('FilterChip.color resolves material states', (WidgetTester tester) async { + testWidgets('FilterChip.color resolves material states', (WidgetTester tester) async { const Color disabledSelectedColor = Color(0xffffff00); const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); @@ -502,7 +501,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FilterChip uses provided state color properties', (WidgetTester tester) async { + testWidgets('FilterChip uses provided state color properties', (WidgetTester tester) async { const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); const Color selectedColor = Color(0xffff0000); @@ -577,7 +576,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FilterChip can be tapped', (WidgetTester tester) async { + testWidgets('FilterChip can be tapped', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -593,7 +592,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Filter chip check mark color is determined by platform brightness when light', (WidgetTester tester) async { + testWidgets('Filter chip check mark color is determined by platform brightness when light', (WidgetTester tester) async { await pumpCheckmarkChip( theme: ThemeData(useMaterial3: false), tester, @@ -606,7 +605,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Filter chip check mark color is determined by platform brightness when dark', (WidgetTester tester) async { + testWidgets('Filter chip check mark color is determined by platform brightness when dark', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedFilterChip(), @@ -620,7 +619,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Filter chip check mark color can be set by the chip theme', (WidgetTester tester) async { + testWidgets('Filter chip check mark color can be set by the chip theme', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedFilterChip(), @@ -633,7 +632,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Filter chip check mark color can be set by the chip constructor', (WidgetTester tester) async { + testWidgets('Filter chip check mark color can be set by the chip constructor', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedFilterChip(checkmarkColor: const Color(0xff00ff00)), @@ -645,7 +644,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Filter chip check mark color is set by chip constructor even when a theme color is specified', (WidgetTester tester) async { + testWidgets('Filter chip check mark color is set by chip constructor even when a theme color is specified', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedFilterChip(checkmarkColor: const Color(0xffff0000)), @@ -658,7 +657,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FilterChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { + testWidgets('FilterChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { const Text label = Text('label'); await tester.pumpWidget(wrapForChip(child: FilterChip(label: label, onSelected: (bool b) { }))); checkChipMaterialClipBehavior(tester, Clip.none); @@ -667,7 +666,7 @@ void main() { checkChipMaterialClipBehavior(tester, Clip.antiAlias); }); - testWidgetsWithLeakTracking('M3 width should not change with selection', (WidgetTester tester) async { + testWidgets('M3 width should not change with selection', (WidgetTester tester) async { // Regression tests for: https://github.com/flutter/flutter/issues/110645 // For the text "FilterChip" the chip should default to 175 regardless of selection. @@ -706,7 +705,7 @@ void main() { expect(tester.getSize(find.byType(FilterChip)).width, expectedWidth); }); - testWidgetsWithLeakTracking('FilterChip uses provided iconTheme', (WidgetTester tester) async { + testWidgets('FilterChip uses provided iconTheme', (WidgetTester tester) async { Widget buildChip({ IconThemeData? iconTheme }) { return MaterialApp( home: Material( @@ -731,7 +730,7 @@ void main() { expect(getIconData(tester).color, const Color(0xff00ff00)); }); - testWidgetsWithLeakTracking('Material3 - FilterChip supports delete button', (WidgetTester tester) async { + testWidgets('Material3 - FilterChip supports delete button', (WidgetTester tester) async { final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -783,7 +782,7 @@ void main() { expect(getIconData(tester).color, theme.colorScheme.onSecondaryContainer); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Material2 - FilterChip supports delete button', (WidgetTester tester) async { + testWidgets('Material2 - FilterChip supports delete button', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -832,7 +831,7 @@ void main() { expect(getIconData(tester).color, theme.iconTheme.color?.withAlpha(0xde)); }); - testWidgetsWithLeakTracking('Customize FilterChip delete button', (WidgetTester tester) async { + testWidgets('Customize FilterChip delete button', (WidgetTester tester) async { final ThemeData theme = ThemeData(); Widget buildChip({ Widget? deleteIcon, @@ -888,7 +887,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('FilterChip delete button control test', (WidgetTester tester) async { + testWidgets('FilterChip delete button control test', (WidgetTester tester) async { final FeedbackTester feedback = FeedbackTester(); final List<String> deletedButtonStrings = <String>[]; await tester.pumpWidget( @@ -925,7 +924,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('Delete button is visible FilterChip is disabled', (WidgetTester tester) async { + testWidgets('Delete button is visible FilterChip is disabled', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( child: FilterChip( diff --git a/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart b/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart index c5ce2842a66..ebd7a218963 100644 --- a/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart +++ b/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart @@ -5,14 +5,13 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; final Key blockKey = UniqueKey(); const double expandedAppbarHeight = 250.0; final Key appbarContainerKey = UniqueKey(); void main() { - testWidgetsWithLeakTracking('FlexibleSpaceBar collapse mode none', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar collapse mode none', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: debugDefaultTargetPlatformOverride), @@ -50,7 +49,7 @@ void main() { expect(topAfterScroll.dy, equals(0.0)); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('FlexibleSpaceBar collapse mode pin', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar collapse mode pin', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: debugDefaultTargetPlatformOverride), @@ -88,7 +87,7 @@ void main() { expect(topAfterScroll.dy, equals(-100.0)); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('FlexibleSpaceBar collapse mode parallax', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar collapse mode parallax', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: debugDefaultTargetPlatformOverride), diff --git a/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart b/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart index 1b047096e7a..86efe7056f7 100644 --- a/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart +++ b/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart @@ -9,14 +9,13 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; final Key blockKey = UniqueKey(); const double expandedAppbarHeight = 250.0; final Key finderKey = UniqueKey(); void main() { - testWidgetsWithLeakTracking('FlexibleSpaceBar stretch mode default zoomBackground', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar stretch mode default zoomBackground', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -51,7 +50,7 @@ void main() { expect(sizeBeforeScroll.height, lessThan(sizeAfterScroll.height)); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar stretch mode blurBackground', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar stretch mode blurBackground', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -91,7 +90,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar stretch mode fadeTitle', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar stretch mode fadeTitle', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -135,7 +134,7 @@ void main() { expect(opacityWidget.opacity, equals(0.0)); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar stretch mode ignored for non-overscroll physics', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar stretch mode ignored for non-overscroll physics', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( diff --git a/packages/flutter/test/material/flexible_space_bar_test.dart b/packages/flutter/test/material/flexible_space_bar_test.dart index 50d9e76a000..42a38f576d1 100644 --- a/packages/flutter/test/material/flexible_space_bar_test.dart +++ b/packages/flutter/test/material/flexible_space_bar_test.dart @@ -10,11 +10,10 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('FlexibleSpaceBar centers title on iOS', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar centers title on iOS', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(platform: TargetPlatform.android), @@ -57,7 +56,7 @@ void main() { } }); - testWidgetsWithLeakTracking('FlexibleSpaceBarSettings provides settings to a FlexibleSpaceBar', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBarSettings provides settings to a FlexibleSpaceBar', (WidgetTester tester) async { const double minExtent = 100.0; const double initExtent = 200.0; const double maxExtent = 300.0; @@ -133,7 +132,7 @@ void main() { expect(clipRect.size.height, minExtent); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar.background is visible when using height other than kToolbarHeight', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar.background is visible when using height other than kToolbarHeight', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/80451 await tester.pumpWidget( MaterialApp( @@ -168,7 +167,7 @@ void main() { expect(backgroundOpacity.opacity, 1.0); }); - testWidgetsWithLeakTracking('Collapsed FlexibleSpaceBar has correct semantics', (WidgetTester tester) async { + testWidgets('Collapsed FlexibleSpaceBar has correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const double expandedHeight = 200; await tester.pumpWidget( @@ -434,7 +433,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/14227 - testWidgetsWithLeakTracking('FlexibleSpaceBar sets width constraints for the title', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar sets width constraints for the title', (WidgetTester tester) async { const double titleFontSize = 20.0; const double height = 300.0; late double width; @@ -481,7 +480,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar sets constraints for the title - override expandedTitleScale', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar sets constraints for the title - override expandedTitleScale', (WidgetTester tester) async { const double titleFontSize = 20.0; const double height = 300.0; const double expandedTitleScale = 3.0; @@ -550,7 +549,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar scaled title', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar scaled title', (WidgetTester tester) async { const double titleFontSize = 20.0; const double height = 300.0; await tester.pumpWidget( @@ -610,7 +609,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar scaled title - override expandedTitleScale', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar scaled title - override expandedTitleScale', (WidgetTester tester) async { const double titleFontSize = 20.0; const double height = 300.0; const double expandedTitleScale = 3.0; @@ -673,7 +672,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar test titlePadding defaults', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar test titlePadding defaults', (WidgetTester tester) async { Widget buildFrame(TargetPlatform platform, bool? centerTitle) { return MaterialApp( theme: ThemeData(platform: platform, useMaterial3: false), @@ -723,7 +722,7 @@ void main() { }); - testWidgetsWithLeakTracking('FlexibleSpaceBar test titlePadding override', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar test titlePadding override', (WidgetTester tester) async { Widget buildFrame(TargetPlatform platform, bool? centerTitle) { return MaterialApp( theme: ThemeData(platform: platform, useMaterial3: false), @@ -791,7 +790,7 @@ void main() { expect(getTitleBottomLeft(), const Offset(390.0, 0.0)); }); - testWidgetsWithLeakTracking('FlexibleSpaceBar rebuilds when scrolling.', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBar rebuilds when scrolling.', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: SubCategoryScreenView(), )); @@ -823,7 +822,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/132030. - testWidgetsWithLeakTracking('FlexibleSpaceBarSettings.hasLeading provides a gap between leading and title', (WidgetTester tester) async { + testWidgets('FlexibleSpaceBarSettings.hasLeading provides a gap between leading and title', (WidgetTester tester) async { final FlexibleSpaceBarSettings customSettings = FlexibleSpaceBar.createSettings( currentExtent: 200.0, hasLeading: true, @@ -863,7 +862,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/132030. - testWidgetsWithLeakTracking('Long centered FlexibleSpaceBar.title respects leading widget', (WidgetTester tester) async { + testWidgets('Long centered FlexibleSpaceBar.title respects leading widget', (WidgetTester tester) async { // Test start position of a long title when the leading widget is // shown by default and the long title is centered. await tester.pumpWidget( @@ -911,7 +910,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/135698. - testWidgetsWithLeakTracking('_FlexibleSpaceHeaderOpacity with near zero opacity avoids compositing', (WidgetTester tester) async { + testWidgets('_FlexibleSpaceHeaderOpacity with near zero opacity avoids compositing', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( diff --git a/packages/flutter/test/material/floating_action_button_location_test.dart b/packages/flutter/test/material/floating_action_button_location_test.dart index a94253aa2e9..faefd63c90c 100644 --- a/packages/flutter/test/material/floating_action_button_location_test.dart +++ b/packages/flutter/test/material/floating_action_button_location_test.dart @@ -7,11 +7,10 @@ import 'dart:math'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('Basic floating action button locations', () { - testWidgetsWithLeakTracking('still animates motion when the floating action button is null', (WidgetTester tester) async { + testWidgets('still animates motion when the floating action button is null', (WidgetTester tester) async { await tester.pumpWidget(_buildFrame(fab: null)); expect(find.byType(FloatingActionButton), findsNothing); @@ -28,7 +27,7 @@ void main() { expect(tester.binding.transientCallbackCount, greaterThan(0)); }); - testWidgetsWithLeakTracking('moves fab from center to end and back', (WidgetTester tester) async { + testWidgets('moves fab from center to end and back', (WidgetTester tester) async { await tester.pumpWidget(_buildFrame(location: FloatingActionButtonLocation.endFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(756.0, 356.0)); @@ -53,7 +52,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('moves to and from custom-defined positions', (WidgetTester tester) async { + testWidgets('moves to and from custom-defined positions', (WidgetTester tester) async { await tester.pumpWidget(_buildFrame(location: const _StartTopFloatingActionButtonLocation())); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(44.0, 56.0)); @@ -174,7 +173,7 @@ void main() { previousRotations = null; }); - testWidgetsWithLeakTracking('moving the fab to centerFloat', (WidgetTester tester) async { + testWidgets('moving the fab to centerFloat', (WidgetTester tester) async { // Create a scaffold with the fab at endFloat await tester.pumpWidget(_buildFrame(location: FloatingActionButtonLocation.endFloat, listener: geometryListener)); setupListener(tester); @@ -184,7 +183,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('interrupting motion towards the StartTop location.', (WidgetTester tester) async { + testWidgets('interrupting motion towards the StartTop location.', (WidgetTester tester) async { await tester.pumpWidget(_buildFrame(location: FloatingActionButtonLocation.centerFloat, listener: geometryListener)); setupListener(tester); @@ -197,7 +196,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('interrupting entrance to remove the fab.', (WidgetTester tester) async { + testWidgets('interrupting entrance to remove the fab.', (WidgetTester tester) async { await tester.pumpWidget(_buildFrame(fab: null, location: FloatingActionButtonLocation.centerFloat, listener: geometryListener)); setupListener(tester); @@ -216,7 +215,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('interrupting entrance of a new fab.', (WidgetTester tester) async { + testWidgets('interrupting entrance of a new fab.', (WidgetTester tester) async { await tester.pumpWidget( _buildFrame( fab: null, @@ -242,7 +241,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Docked floating action button locations', (WidgetTester tester) async { + testWidgets('Docked floating action button locations', (WidgetTester tester) async { await tester.pumpWidget( _buildFrame( location: FloatingActionButtonLocation.endDocked, @@ -277,7 +276,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(756.0, 500.0)); }); - testWidgetsWithLeakTracking('Docked floating action button locations: no BAB, small BAB', (WidgetTester tester) async { + testWidgets('Docked floating action button locations: no BAB, small BAB', (WidgetTester tester) async { await tester.pumpWidget( _buildFrame( location: FloatingActionButtonLocation.endDocked, @@ -296,7 +295,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(756.0, 572.0)); }); - testWidgetsWithLeakTracking('Contained floating action button locations', (WidgetTester tester) async { + testWidgets('Contained floating action button locations', (WidgetTester tester) async { await tester.pumpWidget( _buildFrame( location: FloatingActionButtonLocation.endContained, @@ -311,7 +310,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(756.0, 550.0)); }); - testWidgetsWithLeakTracking('Mini-start-top floating action button location', (WidgetTester tester) async { + testWidgets('Mini-start-top floating action button location', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -332,7 +331,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)).dy, kToolbarHeight); }); - testWidgetsWithLeakTracking('Start-top floating action button location LTR', (WidgetTester tester) async { + testWidgets('Start-top floating action button location LTR', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -345,7 +344,7 @@ void main() { expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(16.0, 28.0, 56.0, 56.0))); }); - testWidgetsWithLeakTracking('End-top floating action button location RTL', (WidgetTester tester) async { + testWidgets('End-top floating action button location RTL', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -361,7 +360,7 @@ void main() { expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(16.0, 28.0, 56.0, 56.0))); }); - testWidgetsWithLeakTracking('Start-top floating action button location RTL', (WidgetTester tester) async { + testWidgets('Start-top floating action button location RTL', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -377,7 +376,7 @@ void main() { expect(tester.getRect(find.byType(FloatingActionButton)), rectMoreOrLessEquals(const Rect.fromLTWH(800.0 - 56.0 - 16.0, 28.0, 56.0, 56.0))); }); - testWidgetsWithLeakTracking('End-top floating action button location LTR', (WidgetTester tester) async { + testWidgets('End-top floating action button location LTR', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -391,103 +390,103 @@ void main() { }); group('New Floating Action Button Locations', () { - testWidgetsWithLeakTracking('startTop', (WidgetTester tester) async { + testWidgets('startTop', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.startTop)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('centerTop', (WidgetTester tester) async { + testWidgets('centerTop', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.centerTop)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_centerOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('endTop', (WidgetTester tester) async { + testWidgets('endTop', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.endTop)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('startFloat', (WidgetTester tester) async { + testWidgets('startFloat', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.startFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX, _floatOffsetY)); }); - testWidgetsWithLeakTracking('centerFloat', (WidgetTester tester) async { + testWidgets('centerFloat', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.centerFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_centerOffsetX, _floatOffsetY)); }); - testWidgetsWithLeakTracking('endFloat', (WidgetTester tester) async { + testWidgets('endFloat', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.endFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX, _floatOffsetY)); }); - testWidgetsWithLeakTracking('startDocked', (WidgetTester tester) async { + testWidgets('startDocked', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.startDocked)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX, _dockedOffsetY)); }); - testWidgetsWithLeakTracking('centerDocked', (WidgetTester tester) async { + testWidgets('centerDocked', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.centerDocked)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_centerOffsetX, _dockedOffsetY)); }); - testWidgetsWithLeakTracking('endDocked', (WidgetTester tester) async { + testWidgets('endDocked', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.endDocked)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX, _dockedOffsetY)); }); - testWidgetsWithLeakTracking('endContained', (WidgetTester tester) async { + testWidgets('endContained', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.endContained)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX, _containedOffsetY)); }); - testWidgetsWithLeakTracking('miniStartTop', (WidgetTester tester) async { + testWidgets('miniStartTop', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniStartTop)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniLeftOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('miniEndTop', (WidgetTester tester) async { + testWidgets('miniEndTop', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniEndTop)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniRightOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('miniStartFloat', (WidgetTester tester) async { + testWidgets('miniStartFloat', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniStartFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniLeftOffsetX, _miniFloatOffsetY)); }); - testWidgetsWithLeakTracking('miniCenterFloat', (WidgetTester tester) async { + testWidgets('miniCenterFloat', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniCenterFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_centerOffsetX, _miniFloatOffsetY)); }); - testWidgetsWithLeakTracking('miniEndFloat', (WidgetTester tester) async { + testWidgets('miniEndFloat', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniEndFloat)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniRightOffsetX, _miniFloatOffsetY)); }); - testWidgetsWithLeakTracking('miniStartDocked', (WidgetTester tester) async { + testWidgets('miniStartDocked', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniStartDocked)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniLeftOffsetX, _dockedOffsetY)); }); - testWidgetsWithLeakTracking('miniEndDocked', (WidgetTester tester) async { + testWidgets('miniEndDocked', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniEndDocked)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniRightOffsetX, _dockedOffsetY)); @@ -495,13 +494,13 @@ void main() { // Test a few RTL cases. - testWidgetsWithLeakTracking('endTop, RTL', (WidgetTester tester) async { + testWidgets('endTop, RTL', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.endTop, textDirection: TextDirection.rtl)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('miniStartFloat, RTL', (WidgetTester tester) async { + testWidgets('miniStartFloat, RTL', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.miniStartFloat, textDirection: TextDirection.rtl)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_miniRightOffsetX, _miniFloatOffsetY)); @@ -509,25 +508,25 @@ void main() { }); group('Custom Floating Action Button Locations', () { - testWidgetsWithLeakTracking('Almost end float', (WidgetTester tester) async { + testWidgets('Almost end float', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(_AlmostEndFloatFabLocation())); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX - 50, _floatOffsetY)); }); - testWidgetsWithLeakTracking('Almost end float, RTL', (WidgetTester tester) async { + testWidgets('Almost end float, RTL', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(_AlmostEndFloatFabLocation(), textDirection: TextDirection.rtl)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX + 50, _floatOffsetY)); }); - testWidgetsWithLeakTracking('Quarter end top', (WidgetTester tester) async { + testWidgets('Quarter end top', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(_QuarterEndTopFabLocation())); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX * 0.75 + _leftOffsetX * 0.25, _topOffsetY)); }); - testWidgetsWithLeakTracking('Quarter end top, RTL', (WidgetTester tester) async { + testWidgets('Quarter end top, RTL', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(_QuarterEndTopFabLocation(), textDirection: TextDirection.rtl)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX * 0.75 + _rightOffsetX * 0.25, _topOffsetY)); @@ -535,7 +534,7 @@ void main() { }); group('Moves involving new locations', () { - testWidgetsWithLeakTracking('Moves between new locations and new locations', (WidgetTester tester) async { + testWidgets('Moves between new locations and new locations', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.centerTop)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_centerOffsetX, _topOffsetY)); @@ -557,7 +556,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_leftOffsetX, _dockedOffsetY)); }); - testWidgetsWithLeakTracking('Moves between new locations and old locations', (WidgetTester tester) async { + testWidgets('Moves between new locations and old locations', (WidgetTester tester) async { await tester.pumpWidget(_singleFabScaffold(FloatingActionButtonLocation.endDocked)); expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_rightOffsetX, _dockedOffsetY)); @@ -587,7 +586,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(_centerOffsetX, _topOffsetY)); }); - testWidgetsWithLeakTracking('Moves between new locations and old locations with custom animator', (WidgetTester tester) async { + testWidgets('Moves between new locations and old locations with custom animator', (WidgetTester tester) async { final FloatingActionButtonAnimator animator = _LinearMovementFabAnimator(); const Offset begin = Offset(_centerOffsetX, _topOffsetY); const Offset end = Offset(_rightOffsetX - 50, _floatOffsetY); @@ -629,7 +628,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('Animator can be updated', (WidgetTester tester) async { + testWidgets('Animator can be updated', (WidgetTester tester) async { FloatingActionButtonAnimator fabAnimator = FloatingActionButtonAnimator.scaling; FloatingActionButtonLocation fabLocation = FloatingActionButtonLocation.startFloat; @@ -1000,7 +999,7 @@ void main() { ); } - testWidgetsWithLeakTracking('startFloat', (WidgetTester tester) async { + testWidgets('startFloat', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(16.0, 478.0, 72.0, 534.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(16.0, 422.0, 72.0, 478.0); @@ -1018,7 +1017,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniStartFloat', (WidgetTester tester) async { + testWidgets('miniStartFloat', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(12.0, 490.0, 60.0, 538.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(12.0, 434.0, 60.0, 482.0); @@ -1037,7 +1036,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('centerFloat', (WidgetTester tester) async { + testWidgets('centerFloat', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(372.0, 478.0, 428.0, 534.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(372.0, 422.0, 428.0, 478.0); @@ -1055,7 +1054,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniCenterFloat', (WidgetTester tester) async { + testWidgets('miniCenterFloat', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(376.0, 490.0, 424.0, 538.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(376.0, 434.0, 424.0, 482.0); @@ -1074,7 +1073,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('endFloat', (WidgetTester tester) async { + testWidgets('endFloat', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(728.0, 478.0, 784.0, 534.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(728.0, 422.0, 784.0, 478.0); @@ -1092,7 +1091,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniEndFloat', (WidgetTester tester) async { + testWidgets('miniEndFloat', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(740.0, 490.0, 788.0, 538.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(740.0, 434.0, 788.0, 482.0); @@ -1363,7 +1362,7 @@ void main() { ); } - testWidgetsWithLeakTracking('startDocked', (WidgetTester tester) async { + testWidgets('startDocked', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(16.0, 494.0, 72.0, 550.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(16.0, 466.0, 72.0, 522.0); @@ -1381,7 +1380,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniStartDocked', (WidgetTester tester) async { + testWidgets('miniStartDocked', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(12.0, 502.0, 60.0, 550.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(12.0, 470.0, 60.0, 518.0); @@ -1400,7 +1399,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('centerDocked', (WidgetTester tester) async { + testWidgets('centerDocked', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(372.0, 494.0, 428.0, 550.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(372.0, 466.0, 428.0, 522.0); @@ -1418,7 +1417,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniCenterDocked', (WidgetTester tester) async { + testWidgets('miniCenterDocked', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(376.0, 502.0, 424.0, 550.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(376.0, 470.0, 424.0, 518.0); @@ -1437,7 +1436,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('endDocked', (WidgetTester tester) async { + testWidgets('endDocked', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(728.0, 494.0, 784.0, 550.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(728.0, 466.0, 784.0, 522.0); @@ -1455,7 +1454,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniEndDocked', (WidgetTester tester) async { + testWidgets('miniEndDocked', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(740.0, 502.0, 788.0, 550.0); // Positioned relative to BottomNavigationBar const Rect bottomNavigationBarRect = Rect.fromLTRB(740.0, 470.0, 788.0, 518.0); @@ -1512,7 +1511,7 @@ void main() { ); } - testWidgetsWithLeakTracking('startTop', (WidgetTester tester) async { + testWidgets('startTop', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(16.0, 50.0, 72.0, 106.0); // Positioned relative to AppBar const Rect appBarRect = Rect.fromLTRB(16.0, 28.0, 72.0, 84.0); @@ -1524,7 +1523,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniStartTop', (WidgetTester tester) async { + testWidgets('miniStartTop', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(12.0, 50.0, 60.0, 98.0); // Positioned relative to AppBar const Rect appBarRect = Rect.fromLTRB(12.0, 32.0, 60.0, 80.0); @@ -1537,7 +1536,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('centerTop', (WidgetTester tester) async { + testWidgets('centerTop', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(372.0, 50.0, 428.0, 106.0); // Positioned relative to AppBar const Rect appBarRect = Rect.fromLTRB(372.0, 28.0, 428.0, 84.0); @@ -1549,7 +1548,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniCenterTop', (WidgetTester tester) async { + testWidgets('miniCenterTop', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(376.0, 50.0, 424.0, 98.0); // Positioned relative to AppBar const Rect appBarRect = Rect.fromLTRB(376.0, 32.0, 424.0, 80.0); @@ -1562,7 +1561,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('endTop', (WidgetTester tester) async { + testWidgets('endTop', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(728.0, 50.0, 784.0, 106.0); // Positioned relative to AppBar const Rect appBarRect = Rect.fromLTRB(728.0, 28.0, 784.0, 84.0); @@ -1574,7 +1573,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('miniEndTop', (WidgetTester tester) async { + testWidgets('miniEndTop', (WidgetTester tester) async { const Rect defaultRect = Rect.fromLTRB(740.0, 50.0, 788.0, 98.0); // Positioned relative to AppBar const Rect appBarRect = Rect.fromLTRB(740.0, 32.0, 788.0, 80.0); diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index 7c286f44239..95dfe57b73f 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -13,7 +13,6 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -21,7 +20,7 @@ void main() { final ThemeData material3Theme = ThemeData(useMaterial3: true); final ThemeData material2Theme = ThemeData(useMaterial3: false); - testWidgetsWithLeakTracking('Floating Action Button control test', (WidgetTester tester) async { + testWidgets('Floating Action Button control test', (WidgetTester tester) async { bool didPressButton = false; await tester.pumpWidget( Directionality( @@ -42,7 +41,7 @@ void main() { expect(didPressButton, isTrue); }); - testWidgetsWithLeakTracking('Floating Action Button tooltip', (WidgetTester tester) async { + testWidgets('Floating Action Button tooltip', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -60,7 +59,7 @@ void main() { }); // Regression test for: https://github.com/flutter/flutter/pull/21084 - testWidgetsWithLeakTracking('Floating Action Button tooltip (long press button edge)', (WidgetTester tester) async { + testWidgets('Floating Action Button tooltip (long press button edge)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -81,7 +80,7 @@ void main() { }); // Regression test for: https://github.com/flutter/flutter/pull/21084 - testWidgetsWithLeakTracking('Floating Action Button tooltip (long press button edge - no child)', (WidgetTester tester) async { + testWidgets('Floating Action Button tooltip (long press button edge - no child)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -100,7 +99,7 @@ void main() { expect(find.text('Add'), findsOneWidget); }); - testWidgetsWithLeakTracking('Floating Action Button tooltip (no child)', (WidgetTester tester) async { + testWidgets('Floating Action Button tooltip (no child)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -135,7 +134,7 @@ void main() { expect(find.text('Add'), findsOneWidget); }); - testWidgetsWithLeakTracking('Floating Action Button tooltip reacts when disabled', (WidgetTester tester) async { + testWidgets('Floating Action Button tooltip reacts when disabled', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -171,7 +170,7 @@ void main() { expect(find.text('Add'), findsOneWidget); }); - testWidgetsWithLeakTracking('Floating Action Button elevation when highlighted - effect', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when highlighted - effect', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: material3Theme, @@ -209,7 +208,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 6.0); }); - testWidgetsWithLeakTracking('Floating Action Button elevation when disabled - defaults', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when disabled - defaults', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -224,7 +223,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 6.0); }); - testWidgetsWithLeakTracking('Floating Action Button elevation when disabled - override', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when disabled - override', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -239,7 +238,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 0.0); }); - testWidgetsWithLeakTracking('Floating Action Button elevation when disabled - effect', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when disabled - effect', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -278,7 +277,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 6.0); }); - testWidgetsWithLeakTracking('Floating Action Button elevation when disabled while highlighted - effect', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when disabled while highlighted - effect', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: material3Theme, @@ -325,7 +324,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 6.0); }); - testWidgetsWithLeakTracking('Floating Action Button states elevation', (WidgetTester tester) async { + testWidgets('Floating Action Button states elevation', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -371,7 +370,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('FlatActionButton mini size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('FlatActionButton mini size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { final Key key1 = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -409,7 +408,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(40.0, 40.0)); }); - testWidgetsWithLeakTracking('FloatingActionButton.isExtended', (WidgetTester tester) async { + testWidgets('FloatingActionButton.isExtended', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: material3Theme, @@ -481,7 +480,7 @@ void main() { expect(tester.getSize(fabFinder).width, 168); }); - testWidgetsWithLeakTracking('FloatingActionButton.isExtended (without icon)', (WidgetTester tester) async { + testWidgets('FloatingActionButton.isExtended (without icon)', (WidgetTester tester) async { final Finder fabFinder = find.byType(FloatingActionButton); FloatingActionButton getFabWidget() { @@ -534,7 +533,7 @@ void main() { expect(tester.getSize(fabFinder).width, 140); }); - testWidgetsWithLeakTracking('Floating Action Button heroTag', (WidgetTester tester) async { + testWidgets('Floating Action Button heroTag', (WidgetTester tester) async { late BuildContext theContext; await tester.pumpWidget( MaterialApp( @@ -557,7 +556,7 @@ void main() { await tester.pump(); // this would fail if heroTag was the same on both FloatingActionButtons (see below). }); - testWidgetsWithLeakTracking('Floating Action Button heroTag - with duplicate', (WidgetTester tester) async { + testWidgets('Floating Action Button heroTag - with duplicate', (WidgetTester tester) async { late BuildContext theContext; await tester.pumpWidget( MaterialApp( @@ -581,7 +580,7 @@ void main() { expect(tester.takeException().toString(), contains('FloatingActionButton')); }); - testWidgetsWithLeakTracking('Floating Action Button heroTag - with duplicate', (WidgetTester tester) async { + testWidgets('Floating Action Button heroTag - with duplicate', (WidgetTester tester) async { late BuildContext theContext; await tester.pumpWidget( MaterialApp( @@ -605,7 +604,7 @@ void main() { expect(tester.takeException().toString(), contains('xyzzy')); }); - testWidgetsWithLeakTracking('Floating Action Button semantics (enabled)', (WidgetTester tester) async { + testWidgets('Floating Action Button semantics (enabled)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -640,7 +639,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Floating Action Button semantics (disabled)', (WidgetTester tester) async { + testWidgets('Floating Action Button semantics (disabled)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -670,7 +669,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Tooltip is used as semantics tooltip', (WidgetTester tester) async { + testWidgets('Tooltip is used as semantics tooltip', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -720,7 +719,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('extended FAB hero transitions succeed', (WidgetTester tester) async { + testWidgets('extended FAB hero transitions succeed', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/18782 await tester.pumpWidget( @@ -786,7 +785,7 @@ void main() { }); // This test prevents https://github.com/flutter/flutter/issues/20483 - testWidgetsWithLeakTracking('Floating Action Button clips ink splash and highlight', (WidgetTester tester) async { + testWidgets('Floating Action Button clips ink splash and highlight', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -814,7 +813,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Floating Action Button changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Floating Action Button changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -891,7 +890,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('Floating Action Button has no clip by default', (WidgetTester tester) async { + testWidgets('Floating Action Button has no clip by default', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( Directionality( @@ -914,7 +913,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Can find FloatingActionButton semantics', (WidgetTester tester) async { + testWidgets('Can find FloatingActionButton semantics', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: FloatingActionButton(onPressed: () {}), )); @@ -931,7 +930,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Foreground color applies to icon on fab', (WidgetTester tester) async { + testWidgets('Foreground color applies to icon on fab', (WidgetTester tester) async { const Color foregroundColor = Color(0xcafefeed); await tester.pumpWidget(MaterialApp( @@ -948,7 +947,7 @@ void main() { expect(iconRichText.text.style!.color, foregroundColor); }); - testWidgetsWithLeakTracking('FloatingActionButton uses custom splash color', (WidgetTester tester) async { + testWidgets('FloatingActionButton uses custom splash color', (WidgetTester tester) async { const Color splashColor = Color(0xcafefeed); await tester.pumpWidget(MaterialApp( @@ -969,7 +968,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('extended FAB does not show label when isExtended is false', (WidgetTester tester) async { + testWidgets('extended FAB does not show label when isExtended is false', (WidgetTester tester) async { const Key iconKey = Key('icon'); const Key labelKey = Key('label'); @@ -990,7 +989,7 @@ void main() { expect(find.byKey(labelKey), findsNothing); }); - testWidgetsWithLeakTracking('FloatingActionButton.small configures correct size', (WidgetTester tester) async { + testWidgets('FloatingActionButton.small configures correct size', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1007,7 +1006,7 @@ void main() { expect(tester.getSize(find.byKey(key)), const Size(40.0, 40.0)); }); - testWidgetsWithLeakTracking('FloatingActionButton.large configures correct size', (WidgetTester tester) async { + testWidgets('FloatingActionButton.large configures correct size', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1023,7 +1022,7 @@ void main() { expect(tester.getSize(find.byKey(key)), const Size(96.0, 96.0)); }); - testWidgetsWithLeakTracking('FloatingActionButton.extended can customize spacing', (WidgetTester tester) async { + testWidgets('FloatingActionButton.extended can customize spacing', (WidgetTester tester) async { const Key iconKey = Key('icon'); const Key labelKey = Key('label'); const double spacing = 33.0; @@ -1048,7 +1047,7 @@ void main() { expect(tester.getTopRight(find.byType(FloatingActionButton)).dx - tester.getTopRight(find.byKey(labelKey)).dx, padding.end); }); - testWidgetsWithLeakTracking('FloatingActionButton.extended can customize text style', (WidgetTester tester) async { + testWidgets('FloatingActionButton.extended can customize text style', (WidgetTester tester) async { const Key labelKey = Key('label'); const TextStyle style = TextStyle(letterSpacing: 2.0); @@ -1081,7 +1080,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Floating Action Button elevation when highlighted - effect', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when highlighted - effect', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: material2Theme, @@ -1120,7 +1119,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 6.0); }); - testWidgetsWithLeakTracking('Floating Action Button elevation when disabled while highlighted - effect', (WidgetTester tester) async { + testWidgets('Floating Action Button elevation when disabled while highlighted - effect', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: material2Theme, @@ -1167,7 +1166,7 @@ void main() { expect(tester.widget<PhysicalShape>(find.byType(PhysicalShape)).elevation, 6.0); }); - testWidgetsWithLeakTracking('Floating Action Button states elevation', (WidgetTester tester) async { + testWidgets('Floating Action Button states elevation', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -1213,7 +1212,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('FloatingActionButton.isExtended', (WidgetTester tester) async { + testWidgets('FloatingActionButton.isExtended', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: material2Theme, @@ -1280,7 +1279,7 @@ void main() { expect(tester.getSize(fabFinder).width, 168); }); - testWidgetsWithLeakTracking('FloatingActionButton.isExtended (without icon)', (WidgetTester tester) async { + testWidgets('FloatingActionButton.isExtended (without icon)', (WidgetTester tester) async { final Finder fabFinder = find.byType(FloatingActionButton); FloatingActionButton getFabWidget() { @@ -1332,7 +1331,7 @@ void main() { // This test prevents https://github.com/flutter/flutter/issues/20483 - testWidgetsWithLeakTracking('Floating Action Button clips ink splash and highlight', (WidgetTester tester) async { + testWidgets('Floating Action Button clips ink splash and highlight', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -1372,7 +1371,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('FloatingActionButton with enabled feedback', (WidgetTester tester) async { + testWidgets('FloatingActionButton with enabled feedback', (WidgetTester tester) async { const bool enableFeedback = true; await tester.pumpWidget(MaterialApp( @@ -1389,7 +1388,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('FloatingActionButton with disabled feedback', (WidgetTester tester) async { + testWidgets('FloatingActionButton with disabled feedback', (WidgetTester tester) async { const bool enableFeedback = false; await tester.pumpWidget(MaterialApp( @@ -1406,7 +1405,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('FloatingActionButton with enabled feedback by default', (WidgetTester tester) async { + testWidgets('FloatingActionButton with enabled feedback by default', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: FloatingActionButton( onPressed: () {}, @@ -1420,7 +1419,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('FloatingActionButton with disabled feedback using FloatingActionButtonTheme', (WidgetTester tester) async { + testWidgets('FloatingActionButton with disabled feedback using FloatingActionButtonTheme', (WidgetTester tester) async { const bool enableFeedbackTheme = false; final ThemeData theme = ThemeData( floatingActionButtonTheme: const FloatingActionButtonThemeData( @@ -1444,7 +1443,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('FloatingActionButton.enableFeedback is overridden by FloatingActionButtonThemeData.enableFeedback', (WidgetTester tester) async { + testWidgets('FloatingActionButton.enableFeedback is overridden by FloatingActionButtonThemeData.enableFeedback', (WidgetTester tester) async { const bool enableFeedbackTheme = false; const bool enableFeedback = true; final ThemeData theme = ThemeData( diff --git a/packages/flutter/test/material/floating_action_button_theme_test.dart b/packages/flutter/test/material/floating_action_button_theme_test.dart index 1c282d714fa..f3d54f69957 100644 --- a/packages/flutter/test/material/floating_action_button_theme_test.dart +++ b/packages/flutter/test/material/floating_action_button_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('FloatingActionButtonThemeData copyWith, ==, hashCode basics', () { @@ -20,7 +19,7 @@ void main() { expect(identical(FloatingActionButtonThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Material3: Default values are used when no FloatingActionButton or FloatingActionButtonThemeData properties are specified', (WidgetTester tester) async { + testWidgets('Material3: Default values are used when no FloatingActionButton or FloatingActionButtonThemeData properties are specified', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget(MaterialApp( theme: ThemeData.from(useMaterial3: true, colorScheme: colorScheme), @@ -45,7 +44,7 @@ void main() { expect(_getIconSize(tester).height, 24.0); }); - testWidgetsWithLeakTracking('Material2: Default values are used when no FloatingActionButton or FloatingActionButtonThemeData properties are specified', (WidgetTester tester) async { + testWidgets('Material2: Default values are used when no FloatingActionButton or FloatingActionButtonThemeData properties are specified', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget(MaterialApp( theme: ThemeData.from(useMaterial3: false, colorScheme: colorScheme), @@ -70,7 +69,7 @@ void main() { expect(_getIconSize(tester).height, 24.0); }); - testWidgetsWithLeakTracking('FloatingActionButtonThemeData values are used when no FloatingActionButton properties are specified', (WidgetTester tester) async { + testWidgets('FloatingActionButtonThemeData values are used when no FloatingActionButton properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0xBEEFBEEF); const Color foregroundColor = Color(0xFACEFACE); const Color splashColor = Color(0xCAFEFEED); @@ -111,7 +110,7 @@ void main() { expect(_getRawMaterialButton(tester).constraints, constraints); }); - testWidgetsWithLeakTracking('FloatingActionButton values take priority over FloatingActionButtonThemeData values when both properties are specified', (WidgetTester tester) async { + testWidgets('FloatingActionButton values take priority over FloatingActionButtonThemeData values when both properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0x00000001); const Color foregroundColor = Color(0x00000002); const Color splashColor = Color(0x00000003); @@ -156,7 +155,7 @@ void main() { expect(_getRawMaterialButton(tester).splashColor, splashColor); }); - testWidgetsWithLeakTracking('FloatingActionButton uses a custom shape when specified in the theme', (WidgetTester tester) async { + testWidgets('FloatingActionButton uses a custom shape when specified in the theme', (WidgetTester tester) async { const ShapeBorder customShape = BeveledRectangleBorder(); await tester.pumpWidget(MaterialApp( @@ -171,7 +170,7 @@ void main() { expect(_getRawMaterialButton(tester).shape, customShape); }); - testWidgetsWithLeakTracking('FloatingActionButton.small uses custom constraints when specified in the theme', (WidgetTester tester) async { + testWidgets('FloatingActionButton.small uses custom constraints when specified in the theme', (WidgetTester tester) async { const BoxConstraints constraints = BoxConstraints.tightFor(width: 100.0, height: 100.0); const double iconSize = 24.0; @@ -194,7 +193,7 @@ void main() { expect(_getIconSize(tester).height, iconSize); }); - testWidgetsWithLeakTracking('FloatingActionButton.large uses custom constraints when specified in the theme', (WidgetTester tester) async { + testWidgets('FloatingActionButton.large uses custom constraints when specified in the theme', (WidgetTester tester) async { const BoxConstraints constraints = BoxConstraints.tightFor(width: 100.0, height: 100.0); const double iconSize = 36.0; @@ -217,7 +216,7 @@ void main() { expect(_getIconSize(tester).height, iconSize); }); - testWidgetsWithLeakTracking('Material3: FloatingActionButton.extended uses custom properties when specified in the theme', (WidgetTester tester) async { + testWidgets('Material3: FloatingActionButton.extended uses custom properties when specified in the theme', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Key iconKey = Key('icon'); const Key labelKey = Key('label'); @@ -254,7 +253,7 @@ void main() { expect(_getRawMaterialButton(tester).textStyle, textStyle.copyWith(color: colorScheme.onPrimaryContainer)); }); - testWidgetsWithLeakTracking('Material2: FloatingActionButton.extended uses custom properties when specified in the theme', (WidgetTester tester) async { + testWidgets('Material2: FloatingActionButton.extended uses custom properties when specified in the theme', (WidgetTester tester) async { const Key iconKey = Key('icon'); const Key labelKey = Key('label'); const BoxConstraints constraints = BoxConstraints.tightFor(height: 100.0); @@ -288,7 +287,7 @@ void main() { expect(_getRawMaterialButton(tester).textStyle, textStyle.copyWith(color: const Color(0xffffffff))); }); - testWidgetsWithLeakTracking('Material3: FloatingActionButton.extended custom properties takes priority over FloatingActionButtonThemeData spacing', (WidgetTester tester) async { + testWidgets('Material3: FloatingActionButton.extended custom properties takes priority over FloatingActionButtonThemeData spacing', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Key iconKey = Key('icon'); const Key labelKey = Key('label'); @@ -325,7 +324,7 @@ void main() { expect(_getRawMaterialButton(tester).textStyle, textStyle.copyWith(color: colorScheme.onPrimaryContainer)); }); - testWidgetsWithLeakTracking('Material2: FloatingActionButton.extended custom properties takes priority over FloatingActionButtonThemeData spacing', (WidgetTester tester) async { + testWidgets('Material2: FloatingActionButton.extended custom properties takes priority over FloatingActionButtonThemeData spacing', (WidgetTester tester) async { const Key iconKey = Key('icon'); const Key labelKey = Key('label'); const double iconLabelSpacing = 33.0; @@ -359,7 +358,7 @@ void main() { expect(_getRawMaterialButton(tester).textStyle, textStyle.copyWith(color: const Color(0xffffffff))); }); - testWidgetsWithLeakTracking('default FloatingActionButton debugFillProperties', (WidgetTester tester) async { + testWidgets('default FloatingActionButton debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const FloatingActionButtonThemeData ().debugFillProperties(builder); @@ -371,7 +370,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('Material implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Material implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const FloatingActionButtonThemeData( foregroundColor: Color(0xFEEDFEED), @@ -427,7 +426,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('FloatingActionButton.mouseCursor uses FloatingActionButtonThemeData.mouseCursor when specified.', (WidgetTester tester) async { + testWidgets('FloatingActionButton.mouseCursor uses FloatingActionButtonThemeData.mouseCursor when specified.', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData().copyWith( floatingActionButtonTheme: FloatingActionButtonThemeData( diff --git a/packages/flutter/test/material/flutter_logo_test.dart b/packages/flutter/test/material/flutter_logo_test.dart index 66d9d2484eb..bc81c43333e 100644 --- a/packages/flutter/test/material/flutter_logo_test.dart +++ b/packages/flutter/test/material/flutter_logo_test.dart @@ -9,10 +9,9 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Flutter Logo golden test', (WidgetTester tester) async { + testWidgets('Flutter Logo golden test', (WidgetTester tester) async { final Key logo = UniqueKey(); await tester.pumpWidget(FlutterLogo(key: logo)); diff --git a/packages/flutter/test/material/grid_title_test.dart b/packages/flutter/test/material/grid_title_test.dart index ff5bd5bd5f7..b3f1f1c8569 100644 --- a/packages/flutter/test/material/grid_title_test.dart +++ b/packages/flutter/test/material/grid_title_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('GridTile control test', (WidgetTester tester) async { + testWidgets('GridTile control test', (WidgetTester tester) async { final Key headerKey = UniqueKey(); final Key footerKey = UniqueKey(); diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart index 611a62cdfef..80d91f9e0ed 100644 --- a/packages/flutter/test/material/icon_button_test.dart +++ b/packages/flutter/test/material/icon_button_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -28,7 +27,7 @@ void main() { mockOnPressedFunction = MockOnPressedFunction(); }); - testWidgetsWithLeakTracking('test icon is findable by key', (WidgetTester tester) async { + testWidgets('test icon is findable by key', (WidgetTester tester) async { const ValueKey<String> key = ValueKey<String>('icon-button'); await tester.pumpWidget( wrap( @@ -44,7 +43,7 @@ void main() { expect(find.byKey(key), findsOneWidget); }); - testWidgetsWithLeakTracking('test default icon buttons are sized up to 48', (WidgetTester tester) async { + testWidgets('test default icon buttons are sized up to 48', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( wrap( @@ -63,7 +62,7 @@ void main() { expect(mockOnPressedFunction.called, 1); }); - testWidgetsWithLeakTracking('test small icons are sized up to 48dp', (WidgetTester tester) async { + testWidgets('test small icons are sized up to 48dp', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( wrap( @@ -80,7 +79,7 @@ void main() { expect(iconButton.size, const Size(48.0, 48.0)); }); - testWidgetsWithLeakTracking('test icons can be small when total size is >48dp', (WidgetTester tester) async { + testWidgets('test icons can be small when total size is >48dp', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( wrap( @@ -98,7 +97,7 @@ void main() { expect(iconButton.size, const Size(70.0, 70.0)); }); - testWidgetsWithLeakTracking('when both iconSize and IconTheme.of(context).size are null, size falls back to 24.0', (WidgetTester tester) async { + testWidgets('when both iconSize and IconTheme.of(context).size are null, size falls back to 24.0', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); await tester.pumpWidget( @@ -121,7 +120,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('when null, iconSize is overridden by closest IconTheme', (WidgetTester tester) async { + testWidgets('when null, iconSize is overridden by closest IconTheme', (WidgetTester tester) async { RenderBox icon; final bool material3 = theme.useMaterial3; @@ -205,7 +204,7 @@ void main() { expect(icon.size, const Size(10.0, 10.0)); }); - testWidgetsWithLeakTracking('when non-null, iconSize precedes IconTheme.of(context).size', (WidgetTester tester) async { + testWidgets('when non-null, iconSize precedes IconTheme.of(context).size', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( wrap( @@ -225,7 +224,7 @@ void main() { expect(icon.size, const Size(10.0, 10.0)); }); - testWidgetsWithLeakTracking('Small icons with non-null constraints can be <48dp for M2, but =48dp for M3', (WidgetTester tester) async { + testWidgets('Small icons with non-null constraints can be <48dp for M2, but =48dp for M3', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( wrap( @@ -250,7 +249,7 @@ void main() { expect(icon.size, const Size(10.0, 10.0)); }); - testWidgetsWithLeakTracking('Small icons with non-null constraints and custom padding can be <48dp', (WidgetTester tester) async { + testWidgets('Small icons with non-null constraints and custom padding can be <48dp', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( wrap( @@ -276,7 +275,7 @@ void main() { expect(icon.size, const Size(10.0, 10.0)); }); - testWidgetsWithLeakTracking('Small icons comply with VisualDensity requirements', (WidgetTester tester) async { + testWidgets('Small icons comply with VisualDensity requirements', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; final ThemeData themeDataM2 = ThemeData( useMaterial3: material3, @@ -314,7 +313,7 @@ void main() { expect(iconButton.size, material3 ? const Size(52.0, 44.0) : const Size(36.0, 28.0)); }); - testWidgetsWithLeakTracking('test default icon buttons are constrained', (WidgetTester tester) async { + testWidgets('test default icon buttons are constrained', (WidgetTester tester) async { await tester.pumpWidget( wrap( useMaterial3: theme.useMaterial3, @@ -331,7 +330,7 @@ void main() { expect(box.size, const Size(80.0, 80.0)); }); - testWidgetsWithLeakTracking('test default icon buttons can be stretched if specified', (WidgetTester tester) async { + testWidgets('test default icon buttons can be stretched if specified', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -375,7 +374,7 @@ void main() { expect(boxM3.size, const Size(48.0, 600.0)); }); - testWidgetsWithLeakTracking('test default padding', (WidgetTester tester) async { + testWidgets('test default padding', (WidgetTester tester) async { await tester.pumpWidget( wrap( useMaterial3: theme.useMaterial3, @@ -391,7 +390,7 @@ void main() { expect(box.size, const Size(96.0, 96.0)); }); - testWidgetsWithLeakTracking('test default alignment', (WidgetTester tester) async { + testWidgets('test default alignment', (WidgetTester tester) async { await tester.pumpWidget( wrap( useMaterial3: theme.useMaterial3, @@ -407,7 +406,7 @@ void main() { expect(align.alignment, Alignment.center); }); - testWidgetsWithLeakTracking('test tooltip', (WidgetTester tester) async { + testWidgets('test tooltip', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: theme, @@ -449,7 +448,7 @@ void main() { expect(mockOnPressedFunction.called, 1); }); - testWidgetsWithLeakTracking('IconButton AppBar size', (WidgetTester tester) async { + testWidgets('IconButton AppBar size', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( MaterialApp( @@ -476,7 +475,7 @@ void main() { // This test is very similar to the '...explicit splashColor and highlightColor' test // in buttons_test.dart. If you change this one, you may want to also change that one. - testWidgetsWithLeakTracking('IconButton with explicit splashColor and highlightColor - M2', (WidgetTester tester) async { + testWidgets('IconButton with explicit splashColor and highlightColor - M2', (WidgetTester tester) async { const Color directSplashColor = Color(0xFF00000F); const Color directHighlightColor = Color(0xFF0000F0); @@ -562,7 +561,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('IconButton with explicit splash radius - M2', (WidgetTester tester) async { + testWidgets('IconButton with explicit splash radius - M2', (WidgetTester tester) async { const double splashRadius = 30.0; await tester.pumpWidget( MaterialApp( @@ -593,7 +592,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('IconButton Semantics (enabled) - M2', (WidgetTester tester) async { + testWidgets('IconButton Semantics (enabled) - M2', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -627,7 +626,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('IconButton Semantics (disabled) - M2', (WidgetTester tester) async { + testWidgets('IconButton Semantics (disabled) - M2', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -656,7 +655,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('IconButton Semantics (selected) - M3', (WidgetTester tester) async { + testWidgets('IconButton Semantics (selected) - M3', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -712,7 +711,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('IconButton loses focus when disabled.', (WidgetTester tester) async { + testWidgets('IconButton loses focus when disabled.', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'IconButton'); await tester.pumpWidget( wrap( @@ -746,7 +745,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('IconButton keeps focus when disabled in directional navigation mode.', (WidgetTester tester) async { + testWidgets('IconButton keeps focus when disabled in directional navigation mode.', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'IconButton'); await tester.pumpWidget( wrap( @@ -790,7 +789,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking("Disabled IconButton can't be traversed to when disabled.", (WidgetTester tester) async { + testWidgets("Disabled IconButton can't be traversed to when disabled.", (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'IconButton 1'); final FocusNode focusNode2 = FocusNode(debugLabel: 'IconButton 2'); addTearDown(() { @@ -841,7 +840,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('IconButton with disabled feedback', (WidgetTester tester) async { + testWidgets('IconButton with disabled feedback', (WidgetTester tester) async { final Widget button = Directionality( textDirection: TextDirection.ltr, child: Center( @@ -864,7 +863,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('IconButton with enabled feedback', (WidgetTester tester) async { + testWidgets('IconButton with enabled feedback', (WidgetTester tester) async { final Widget button = Directionality( textDirection: TextDirection.ltr, child: Center( @@ -886,7 +885,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('IconButton with enabled feedback by default', (WidgetTester tester) async { + testWidgets('IconButton with enabled feedback by default', (WidgetTester tester) async { final Widget button = Directionality( textDirection: TextDirection.ltr, child: Center( @@ -909,7 +908,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('IconButton responds to density changes.', (WidgetTester tester) async { + testWidgets('IconButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); final bool material3 = theme.useMaterial3; Future<void> buildTest(VisualDensity visualDensity) async { @@ -953,7 +952,7 @@ void main() { expect(box.size, equals(material3 ? const Size(64, 36) : const Size(60, 40))); }); - testWidgetsWithLeakTracking('IconButton.mouseCursor changes cursor on hover', (WidgetTester tester) async { + testWidgets('IconButton.mouseCursor changes cursor on hover', (WidgetTester tester) async { // Test argument works await tester.pumpWidget( MaterialApp( @@ -1001,7 +1000,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('disabled IconButton has basic mouse cursor', (WidgetTester tester) async { + testWidgets('disabled IconButton has basic mouse cursor', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: theme, @@ -1027,7 +1026,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('IconButton.mouseCursor overrides implicit setting of mouse cursor', (WidgetTester tester) async { + testWidgets('IconButton.mouseCursor overrides implicit setting of mouse cursor', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: theme, @@ -1074,7 +1073,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.none); }); - testWidgetsWithLeakTracking('IconTheme opacity test', (WidgetTester tester) async { + testWidgets('IconTheme opacity test', (WidgetTester tester) async { final ThemeData theme = ThemeData.from(colorScheme: colorScheme, useMaterial3: false); await tester.pumpWidget( @@ -1117,7 +1116,7 @@ void main() { expect(iconColorWithOpacity(), Colors.purple.withOpacity(0.5)); }); - testWidgetsWithLeakTracking('IconButton defaults - M3', (WidgetTester tester) async { + testWidgets('IconButton defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled IconButton @@ -1200,7 +1199,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('IconButton default overlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('IconButton default overlayColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -1255,7 +1254,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('IconButton.fill defaults - M3', (WidgetTester tester) async { + testWidgets('IconButton.fill defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled IconButton @@ -1341,7 +1340,7 @@ void main() { expect(iconColor(), colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('IconButton.fill default overlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('IconButton.fill default overlayColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -1396,7 +1395,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Toggleable IconButton.fill defaults - M3', (WidgetTester tester) async { + testWidgets('Toggleable IconButton.fill defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled selected IconButton @@ -1511,7 +1510,7 @@ void main() { expect(iconColor(), colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('IconButton.filledTonal defaults - M3', (WidgetTester tester) async { + testWidgets('IconButton.filledTonal defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled IconButton.tonal @@ -1597,7 +1596,7 @@ void main() { expect(iconColor(), colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('IconButton.filledTonal default overlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('IconButton.filledTonal default overlayColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -1652,7 +1651,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Toggleable IconButton.filledTonal defaults - M3', (WidgetTester tester) async { + testWidgets('Toggleable IconButton.filledTonal defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled selected IconButton @@ -1767,7 +1766,7 @@ void main() { expect(iconColor(), colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('IconButton.outlined defaults - M3', (WidgetTester tester) async { + testWidgets('IconButton.outlined defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled IconButton.tonal @@ -1853,7 +1852,7 @@ void main() { expect(iconColor(), colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('IconButton.outlined default overlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('IconButton.outlined default overlayColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -1908,7 +1907,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Toggleable IconButton.outlined defaults - M3', (WidgetTester tester) async { + testWidgets('Toggleable IconButton.outlined defaults - M3', (WidgetTester tester) async { final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); // Enabled selected IconButton @@ -2023,7 +2022,7 @@ void main() { expect(iconColor(), colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('Default IconButton meets a11y contrast guidelines - M3', (WidgetTester tester) async { + testWidgets('Default IconButton meets a11y contrast guidelines - M3', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -2072,7 +2071,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('IconButton uses stateful color for icon color in different states - M3', (WidgetTester tester) async { + testWidgets('IconButton uses stateful color for icon color in different states - M3', (WidgetTester tester) async { bool isSelected = false; final FocusNode focusNode = FocusNode(); @@ -2160,7 +2159,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does IconButton contribute semantics - M3', (WidgetTester tester) async { + testWidgets('Does IconButton contribute semantics - M3', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -2207,7 +2206,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('IconButton size is configurable by ThemeData.materialTapTargetSize - M3', (WidgetTester tester) async { + testWidgets('IconButton size is configurable by ThemeData.materialTapTargetSize - M3', (WidgetTester tester) async { Widget buildFrame(MaterialTapTargetSize tapTargetSize) { return Theme( data: ThemeData(materialTapTargetSize: tapTargetSize, useMaterial3: true), @@ -2231,7 +2230,7 @@ void main() { expect(tester.getSize(find.byType(IconButton)), const Size(40.0, 40.0)); }); - testWidgetsWithLeakTracking('Override IconButton default padding - M3', (WidgetTester tester) async { + testWidgets('Override IconButton default padding - M3', (WidgetTester tester) async { // Use [IconButton]'s padding property to override default value. await tester.pumpWidget( MaterialApp( @@ -2307,7 +2306,7 @@ void main() { expect(paddingWidget3.padding, const EdgeInsets.all(22)); }); - testWidgetsWithLeakTracking('Default IconButton is not selectable - M3', (WidgetTester tester) async { + testWidgets('Default IconButton is not selectable - M3', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), @@ -2341,7 +2340,7 @@ void main() { expect(buttonMaterial().color, Colors.transparent); }); - testWidgetsWithLeakTracking('Icon button is selectable when isSelected is not null - M3', (WidgetTester tester) async { + testWidgets('Icon button is selectable when isSelected is not null - M3', (WidgetTester tester) async { bool isSelected = false; await tester.pumpWidget( MaterialApp( @@ -2394,7 +2393,7 @@ void main() { expect(buttonMaterial().color, Colors.transparent); }); - testWidgetsWithLeakTracking('The IconButton is in selected status if isSelected is true by default - M3', (WidgetTester tester) async { + testWidgets('The IconButton is in selected status if isSelected is true by default - M3', (WidgetTester tester) async { bool isSelected = true; await tester.pumpWidget( MaterialApp( @@ -2440,7 +2439,7 @@ void main() { expect(buttonMaterial().color, Colors.transparent); }); - testWidgetsWithLeakTracking("The selectedIcon is used if it's not null and the button is clicked" , (WidgetTester tester) async { + testWidgets("The selectedIcon is used if it's not null and the button is clicked" , (WidgetTester tester) async { bool isSelected = false; await tester.pumpWidget( MaterialApp( @@ -2480,7 +2479,7 @@ void main() { expect(find.byIcon(Icons.account_box), findsNothing); }); - testWidgetsWithLeakTracking('The original icon is used for selected and unselected status when selectedIcon is null' , (WidgetTester tester) async { + testWidgets('The original icon is used for selected and unselected status when selectedIcon is null' , (WidgetTester tester) async { bool isSelected = false; await tester.pumpWidget( MaterialApp( @@ -2516,7 +2515,7 @@ void main() { expect(find.byIcon(Icons.account_box), findsOneWidget); }); - testWidgetsWithLeakTracking('The selectedIcon is used for disabled button if isSelected is true - M3' , (WidgetTester tester) async { + testWidgets('The selectedIcon is used for disabled button if isSelected is true - M3' , (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), @@ -2537,7 +2536,7 @@ void main() { expect(find.byIcon(Icons.ac_unit), findsOneWidget); }); - testWidgetsWithLeakTracking('The visualDensity of M3 IconButton can be configured by IconButtonTheme, ' + testWidgets('The visualDensity of M3 IconButton can be configured by IconButtonTheme, ' 'but cannot be configured by ThemeData - M3' , (WidgetTester tester) async { Future<void> buildTest({VisualDensity? iconButtonThemeVisualDensity, VisualDensity? themeVisualDensity}) async { return tester.pumpWidget( @@ -2588,7 +2587,7 @@ void main() { }); group('IconTheme tests in Material 3', () { - testWidgetsWithLeakTracking('IconTheme overrides default values in M3', (WidgetTester tester) async { + testWidgets('IconTheme overrides default values in M3', (WidgetTester tester) async { // Theme's IconTheme await tester.pumpWidget( MaterialApp( @@ -2631,7 +2630,7 @@ void main() { expect(tester.getSize(find.byIcon(Icons.account_box)), equals(const Size(35, 35)),); }); - testWidgetsWithLeakTracking('Theme IconButtonTheme overrides IconTheme in Material3', (WidgetTester tester) async { + testWidgets('Theme IconButtonTheme overrides IconTheme in Material3', (WidgetTester tester) async { // When IconButtonTheme and IconTheme both exist in ThemeData, the IconButtonTheme can override IconTheme. await tester.pumpWidget( MaterialApp( @@ -2654,7 +2653,7 @@ void main() { expect(tester.getSize(find.byIcon(Icons.account_box)), equals(const Size(27, 27)),); }); - testWidgetsWithLeakTracking('Button IconButtonTheme always overrides IconTheme in Material3', (WidgetTester tester) async { + testWidgets('Button IconButtonTheme always overrides IconTheme in Material3', (WidgetTester tester) async { // When IconButtonTheme is closer to IconButton, IconButtonTheme overrides IconTheme await tester.pumpWidget( MaterialApp( @@ -2704,7 +2703,7 @@ void main() { expect(tester.getSize(find.byIcon(Icons.account_box)), equals(const Size(36, 36)),); }); - testWidgetsWithLeakTracking('White icon color defined by users shows correctly in Material3', (WidgetTester tester) async { + testWidgets('White icon color defined by users shows correctly in Material3', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from( @@ -2724,7 +2723,7 @@ void main() { expect(iconColor1(), Colors.white); }); - testWidgetsWithLeakTracking('In light mode, icon color is M3 default color instead of IconTheme.of(context).color, ' + testWidgets('In light mode, icon color is M3 default color instead of IconTheme.of(context).color, ' 'if only setting color in IconTheme', (WidgetTester tester) async { final ColorScheme darkScheme = const ColorScheme.dark().copyWith(onSurfaceVariant: const Color(0xffe91e60)); // Brightness.dark @@ -2747,7 +2746,7 @@ void main() { expect(iconColor0(), darkScheme.onSurfaceVariant); // onSurfaceVariant }); - testWidgetsWithLeakTracking('In dark mode, icon color is M3 default color instead of IconTheme.of(context).color, ' + testWidgets('In dark mode, icon color is M3 default color instead of IconTheme.of(context).color, ' 'if only setting color in IconTheme', (WidgetTester tester) async { final ColorScheme lightScheme = const ColorScheme.light().copyWith(onSurfaceVariant: const Color(0xffe91e60)); // Brightness.dark @@ -2770,11 +2769,11 @@ void main() { expect(iconColor0(), lightScheme.onSurfaceVariant); // onSurfaceVariant }); - testWidgetsWithLeakTracking('black87 icon color defined by users shows correctly in Material3', (WidgetTester tester) async { + testWidgets('black87 icon color defined by users shows correctly in Material3', (WidgetTester tester) async { }); - testWidgetsWithLeakTracking("IconButton.styleFrom doesn't throw exception on passing only one cursor", (WidgetTester tester) async { + testWidgets("IconButton.styleFrom doesn't throw exception on passing only one cursor", (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/118071. await tester.pumpWidget( Directionality( @@ -2794,7 +2793,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Material3 - IconButton memory leak', (WidgetTester tester) async { + testWidgets('Material3 - IconButton memory leak', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/130708. Widget buildWidget(bool showIconButton) { return showIconButton diff --git a/packages/flutter/test/material/icon_button_theme_test.dart b/packages/flutter/test/material/icon_button_theme_test.dart index f0f3c8cd89f..7cc64cf8744 100644 --- a/packages/flutter/test/material/icon_button_theme_test.dart +++ b/packages/flutter/test/material/icon_button_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('IconButtonThemeData lerp special cases', () { @@ -13,7 +12,7 @@ void main() { expect(identical(IconButtonThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Passing no IconButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Passing no IconButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -147,19 +146,19 @@ void main() { expect(align.alignment, alignment); } - testWidgetsWithLeakTracking('Button style overrides defaults', (WidgetTester tester) async { + testWidgets('Button style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(themeStyle: style)); await tester.pumpAndSettle(); checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallStyle: style)); await tester.pumpAndSettle(); checkButton(tester); @@ -167,26 +166,26 @@ void main() { // Same as the previous tests with empty ButtonStyle's instead of null. - testWidgetsWithLeakTracking('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { + testWidgets('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style, themeStyle: const ButtonStyle(), overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: style, overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); }); - testWidgetsWithLeakTracking('Theme shadowColor', (WidgetTester tester) async { + testWidgets('Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); diff --git a/packages/flutter/test/material/icons_test.dart b/packages/flutter/test/material/icons_test.dart index adc51f4d32f..01106758c97 100644 --- a/packages/flutter/test/material/icons_test.dart +++ b/packages/flutter/test/material/icons_test.dart @@ -12,22 +12,21 @@ import 'package:file/local.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:platform/platform.dart'; void main() { - testWidgetsWithLeakTracking('IconData object test', (WidgetTester tester) async { + testWidgets('IconData object test', (WidgetTester tester) async { expect(Icons.account_balance, isNot(equals(Icons.account_box))); expect(Icons.account_balance.hashCode, isNot(equals(Icons.account_box.hashCode))); expect(Icons.account_balance, hasOneLineDescription); }); - testWidgetsWithLeakTracking('Icons specify the material font', (WidgetTester tester) async { + testWidgets('Icons specify the material font', (WidgetTester tester) async { expect(Icons.clear.fontFamily, 'MaterialIcons'); expect(Icons.search.fontFamily, 'MaterialIcons'); }); - testWidgetsWithLeakTracking('Certain icons (and their variants) match text direction', (WidgetTester tester) async { + testWidgets('Certain icons (and their variants) match text direction', (WidgetTester tester) async { expect(Icons.arrow_back.matchTextDirection, true); expect(Icons.arrow_back_rounded.matchTextDirection, true); expect(Icons.arrow_back_outlined.matchTextDirection, true); @@ -39,7 +38,7 @@ void main() { expect(Icons.access_time_sharp.matchTextDirection, false); }); - testWidgetsWithLeakTracking('Adaptive icons are correct on cupertino platforms', (WidgetTester tester) async { + testWidgets('Adaptive icons are correct on cupertino platforms', (WidgetTester tester) async { expect(Icons.adaptive.arrow_back, Icons.arrow_back_ios); expect(Icons.adaptive.arrow_back_outlined, Icons.arrow_back_ios_outlined); }, @@ -49,7 +48,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Adaptive icons are correct on non-cupertino platforms', (WidgetTester tester) async { + testWidgets('Adaptive icons are correct on non-cupertino platforms', (WidgetTester tester) async { expect(Icons.adaptive.arrow_back, Icons.arrow_back); expect(Icons.adaptive.arrow_back_outlined, Icons.arrow_back_outlined); }, @@ -61,7 +60,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('A sample of icons look as expected', (WidgetTester tester) async { + testWidgets('A sample of icons look as expected', (WidgetTester tester) async { await _loadIconFont(); await tester.pumpWidget(const MaterialApp( @@ -85,7 +84,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/39998 // Regression test for https://github.com/flutter/flutter/issues/95886 - testWidgetsWithLeakTracking('Another sample of icons look as expected', (WidgetTester tester) async { + testWidgets('Another sample of icons look as expected', (WidgetTester tester) async { await _loadIconFont(); await tester.pumpWidget(const MaterialApp( @@ -105,7 +104,7 @@ void main() { await expectLater(find.byType(Wrap), matchesGoldenFile('test.icons.sample2.png')); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/39998 - testWidgetsWithLeakTracking('Another sample of icons look as expected', (WidgetTester tester) async { + testWidgets('Another sample of icons look as expected', (WidgetTester tester) async { await _loadIconFont(); await tester.pumpWidget(const MaterialApp( @@ -126,7 +125,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/39998 // Regression test for https://github.com/flutter/flutter/issues/103202. - testWidgetsWithLeakTracking('Another sample of icons look as expected', (WidgetTester tester) async { + testWidgets('Another sample of icons look as expected', (WidgetTester tester) async { await _loadIconFont(); await tester.pumpWidget(const MaterialApp( diff --git a/packages/flutter/test/material/inherited_theme_test.dart b/packages/flutter/test/material/inherited_theme_test.dart index 40ace7382aa..6f58948a794 100644 --- a/packages/flutter/test/material/inherited_theme_test.dart +++ b/packages/flutter/test/material/inherited_theme_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Theme.wrap()', (WidgetTester tester) async { + testWidgets('Theme.wrap()', (WidgetTester tester) async { const Color primaryColor = Color(0xFF00FF00); final Key primaryContainerKey = UniqueKey(); @@ -92,7 +91,7 @@ void main() { expect(containerColor(), isNot(primaryColor)); }); - testWidgetsWithLeakTracking('PopupMenuTheme.wrap()', (WidgetTester tester) async { + testWidgets('PopupMenuTheme.wrap()', (WidgetTester tester) async { const double menuFontSize = 24; const Color menuTextColor = Color(0xFF0000FF); @@ -146,7 +145,7 @@ void main() { await tester.pumpAndSettle(); // menu route animation }); - testWidgetsWithLeakTracking('BannerTheme.wrap()', (WidgetTester tester) async { + testWidgets('BannerTheme.wrap()', (WidgetTester tester) async { const Color bannerBackgroundColor = Color(0xFF0000FF); const double bannerFontSize = 48; const Color bannerTextColor = Color(0xFF00FF00); @@ -244,7 +243,7 @@ void main() { expect(getTextStyle('hello').color, isNot(bannerTextColor)); }); - testWidgetsWithLeakTracking('DividerTheme.wrap()', (WidgetTester tester) async { + testWidgets('DividerTheme.wrap()', (WidgetTester tester) async { const Color dividerColor = Color(0xFF0000FF); const double dividerSpace = 13; const double dividerThickness = 7; @@ -326,7 +325,7 @@ void main() { expect(dividerBorder().width, isNot(dividerThickness)); }); - testWidgetsWithLeakTracking('ListTileTheme.wrap()', (WidgetTester tester) async { + testWidgets('ListTileTheme.wrap()', (WidgetTester tester) async { const Color tileSelectedColor = Color(0xFF00FF00); const Color tileIconColor = Color(0xFF0000FF); const Color tileTextColor = Color(0xFFFF0000); @@ -437,7 +436,7 @@ void main() { expect(getIconStyle(unselectedIconKey).color, isNot(tileIconColor)); }); - testWidgetsWithLeakTracking('SliderTheme.wrap()', (WidgetTester tester) async { + testWidgets('SliderTheme.wrap()', (WidgetTester tester) async { const Color activeTrackColor = Color(0xFF00FF00); const Color inactiveTrackColor = Color(0xFF0000FF); const Color thumbColor = Color(0xFFFF0000); @@ -520,7 +519,7 @@ void main() { expect(sliderBox, isNot(paints..circle(color: thumbColor))); }); - testWidgetsWithLeakTracking('ToggleButtonsTheme.wrap()', (WidgetTester tester) async { + testWidgets('ToggleButtonsTheme.wrap()', (WidgetTester tester) async { const Color buttonColor = Color(0xFF00FF00); const Color selectedButtonColor = Color(0xFFFF0000); diff --git a/packages/flutter/test/material/ink_paint_test.dart b/packages/flutter/test/material/ink_paint_test.dart index 14b0b500fe9..2cc31710850 100644 --- a/packages/flutter/test/material/ink_paint_test.dart +++ b/packages/flutter/test/material/ink_paint_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('The Ink widget expands when no dimensions are set', (WidgetTester tester) async { + testWidgets('The Ink widget expands when no dimensions are set', (WidgetTester tester) async { await tester.pumpWidget( Material( child: Ink(), @@ -18,7 +17,7 @@ void main() { expect(tester.getSize(find.byType(Ink)), const Size(800.0, 600.0)); }); - testWidgetsWithLeakTracking('The Ink widget fits the specified size', (WidgetTester tester) async { + testWidgets('The Ink widget fits the specified size', (WidgetTester tester) async { const double height = 150.0; const double width = 200.0; await tester.pumpWidget( @@ -36,7 +35,7 @@ void main() { expect(tester.getSize(find.byType(Ink)), const Size(width, height)); }); - testWidgetsWithLeakTracking('The Ink widget expands on a unspecified dimension', (WidgetTester tester) async { + testWidgets('The Ink widget expands on a unspecified dimension', (WidgetTester tester) async { const double height = 150.0; await tester.pumpWidget( Material( @@ -52,7 +51,7 @@ void main() { expect(tester.getSize(find.byType(Ink)), const Size(800, height)); }); - testWidgetsWithLeakTracking('The InkWell widget renders an ink splash', (WidgetTester tester) async { + testWidgets('The InkWell widget renders an ink splash', (WidgetTester tester) async { const Color highlightColor = Color(0xAAFF0000); const Color splashColor = Color(0xAA0000FF); const BorderRadius borderRadius = BorderRadius.all(Radius.circular(6.0)); @@ -101,7 +100,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('The InkWell widget renders an ink ripple', (WidgetTester tester) async { + testWidgets('The InkWell widget renders an ink ripple', (WidgetTester tester) async { const Color highlightColor = Color(0xAAFF0000); const Color splashColor = Color(0xB40000FF); const BorderRadius borderRadius = BorderRadius.all(Radius.circular(6.0)); @@ -187,7 +186,7 @@ void main() { expect(box, ripplePattern(inkWellCenter - tapDownOffset, 105.0, 0)); }); - testWidgetsWithLeakTracking('Does the Ink widget render anything', (WidgetTester tester) async { + testWidgets('Does the Ink widget render anything', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -270,7 +269,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('The InkWell widget renders an SelectAction or ActivateAction-induced ink ripple', (WidgetTester tester) async { + testWidgets('The InkWell widget renders an SelectAction or ActivateAction-induced ink ripple', (WidgetTester tester) async { const Color highlightColor = Color(0xAAFF0000); const Color splashColor = Color(0xB40000FF); const BorderRadius borderRadius = BorderRadius.all(Radius.circular(6.0)); @@ -371,7 +370,7 @@ void main() { expect(box, ripplePattern(105.0, 0)); }); - testWidgetsWithLeakTracking('Cancel an InkRipple that was disposed when its animation ended', (WidgetTester tester) async { + testWidgets('Cancel an InkRipple that was disposed when its animation ended', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/14391 await tester.pumpWidget( Directionality( @@ -404,7 +403,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Cancel an InkRipple that was disposed when its animation ended', (WidgetTester tester) async { + testWidgets('Cancel an InkRipple that was disposed when its animation ended', (WidgetTester tester) async { const Color highlightColor = Color(0xAAFF0000); const Color splashColor = Color(0xB40000FF); @@ -454,7 +453,7 @@ void main() { })); }); - testWidgetsWithLeakTracking('The InkWell widget on OverlayPortal does not throw', (WidgetTester tester) async { + testWidgets('The InkWell widget on OverlayPortal does not throw', (WidgetTester tester) async { final OverlayPortalController controller = OverlayPortalController(); controller.show(); @@ -518,7 +517,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Custom rectCallback renders an ink splash from its center', (WidgetTester tester) async { + testWidgets('Custom rectCallback renders an ink splash from its center', (WidgetTester tester) async { const Color splashColor = Color(0xff00ff00); Widget buildWidget({InteractiveInkFeatureFactory? splashFactory}) { @@ -573,7 +572,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Ink with isVisible=false does not paint', (WidgetTester tester) async { + testWidgets('Ink with isVisible=false does not paint', (WidgetTester tester) async { const Color testColor = Color(0xffff1234); Widget inkWidget({required bool isVisible}) { return Material( diff --git a/packages/flutter/test/material/ink_sparkle_test.dart b/packages/flutter/test/material/ink_sparkle_test.dart index ca7c454d86b..73707841eff 100644 --- a/packages/flutter/test/material/ink_sparkle_test.dart +++ b/packages/flutter/test/material/ink_sparkle_test.dart @@ -10,10 +10,9 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/src/foundation/constants.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('InkSparkle in a Button compiles and does not crash', (WidgetTester tester) async { + testWidgets('InkSparkle in a Button compiles and does not crash', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: Center( @@ -33,7 +32,7 @@ void main() { skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('InkSparkle default splashFactory paints with drawRect when bounded', (WidgetTester tester) async { + testWidgets('InkSparkle default splashFactory paints with drawRect when bounded', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: Center( @@ -64,7 +63,7 @@ void main() { skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('InkSparkle default splashFactory paints with drawPaint when unbounded', (WidgetTester tester) async { + testWidgets('InkSparkle default splashFactory paints with drawPaint when unbounded', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: Center( @@ -91,37 +90,37 @@ void main() { // Goldens // ///////////// - testWidgetsWithLeakTracking('Material2 - InkSparkle renders with sparkles when top left of button is tapped', (WidgetTester tester) async { + testWidgets('Material2 - InkSparkle renders with sparkles when top left of button is tapped', (WidgetTester tester) async { await _runTest(tester, 'top_left', 0.2); }, skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('Material3 - InkSparkle renders with sparkles when top left of button is tapped', (WidgetTester tester) async { + testWidgets('Material3 - InkSparkle renders with sparkles when top left of button is tapped', (WidgetTester tester) async { await _runM3Test(tester, 'top_left', 0.2); }, skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('Material2 - InkSparkle renders with sparkles when center of button is tapped', (WidgetTester tester) async { + testWidgets('Material2 - InkSparkle renders with sparkles when center of button is tapped', (WidgetTester tester) async { await _runTest(tester, 'center', 0.5); }, skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('Material3 - InkSparkle renders with sparkles when center of button is tapped', (WidgetTester tester) async { + testWidgets('Material3 - InkSparkle renders with sparkles when center of button is tapped', (WidgetTester tester) async { await _runM3Test(tester, 'center', 0.5); }, skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('Material2 - InkSparkle renders with sparkles when bottom right of button is tapped', (WidgetTester tester) async { + testWidgets('Material2 - InkSparkle renders with sparkles when bottom right of button is tapped', (WidgetTester tester) async { await _runTest(tester, 'bottom_right', 0.8); }, skip: kIsWeb, // [intended] shaders are not yet supported for web. ); - testWidgetsWithLeakTracking('Material3 - InkSparkle renders with sparkles when bottom right of button is tapped', (WidgetTester tester) async { + testWidgets('Material3 - InkSparkle renders with sparkles when bottom right of button is tapped', (WidgetTester tester) async { await _runM3Test(tester, 'bottom_right', 0.8); }, skip: kIsWeb, // [intended] shaders are not yet supported for web. diff --git a/packages/flutter/test/material/ink_splash_test.dart b/packages/flutter/test/material/ink_splash_test.dart index 77107939928..daafbf76c2b 100644 --- a/packages/flutter/test/material/ink_splash_test.dart +++ b/packages/flutter/test/material/ink_splash_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Page extends StatefulWidget { const Page({ @@ -41,7 +40,7 @@ class _PageState extends State<Page> { void main() { // Regression test for https://github.com/flutter/flutter/issues/21506. - testWidgetsWithLeakTracking('InkSplash receives textDirection', (WidgetTester tester) async { + testWidgets('InkSplash receives textDirection', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( appBar: AppBar(title: const Text('Button Border Test')), @@ -59,7 +58,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('InkWell with NoSplash splashFactory paints nothing', (WidgetTester tester) async { + testWidgets('InkWell with NoSplash splashFactory paints nothing', (WidgetTester tester) async { Widget buildFrame({ InteractiveInkFeatureFactory? splashFactory }) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -101,7 +100,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/136441. - testWidgetsWithLeakTracking('PageView item can dispose when widget with NoSplash.splashFactory is tapped', (WidgetTester tester) async { + testWidgets('PageView item can dispose when widget with NoSplash.splashFactory is tapped', (WidgetTester tester) async { final PageController controller = PageController(); final List<int> disposedPageIndexes = <int>[]; await tester.pumpWidget(MaterialApp( diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart index 032d421ea6b..49096d70ae6 100644 --- a/packages/flutter/test/material/ink_well_test.dart +++ b/packages/flutter/test/material/ink_well_test.dart @@ -7,12 +7,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/src/services/keyboard_key.g.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; void main() { - testWidgetsWithLeakTracking('InkWell gestures control test', (WidgetTester tester) async { + testWidgets('InkWell gestures control test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -79,7 +78,7 @@ void main() { expect(log, equals(<String>['tap-down', 'tap-cancel'])); }); - testWidgetsWithLeakTracking('InkWell only onTapDown enables gestures', (WidgetTester tester) async { + testWidgets('InkWell only onTapDown enables gestures', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/96030 bool downTapped = false; await tester.pumpWidget(Directionality( @@ -99,7 +98,7 @@ void main() { expect(downTapped, true); }); - testWidgetsWithLeakTracking('InkWell invokes activation actions when expected', (WidgetTester tester) async { + testWidgets('InkWell invokes activation actions when expected', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -131,7 +130,7 @@ void main() { expect(log, equals(<String>['tap'])); }); - testWidgetsWithLeakTracking('long-press and tap on disabled should not throw', (WidgetTester tester) async { + testWidgets('long-press and tap on disabled should not throw', (WidgetTester tester) async { await tester.pumpWidget(const Material( child: Directionality( textDirection: TextDirection.ltr, @@ -146,7 +145,7 @@ void main() { await tester.pump(const Duration(seconds: 1)); }); - testWidgetsWithLeakTracking('ink well changes color on hover', (WidgetTester tester) async { + testWidgets('ink well changes color on hover', (WidgetTester tester) async { await tester.pumpWidget(Material( child: Directionality( textDirection: TextDirection.ltr, @@ -175,7 +174,7 @@ void main() { expect(inkFeatures, paints..rect(rect: const Rect.fromLTRB(350.0, 250.0, 450.0, 350.0), color: const Color(0xff00ff00))); }); - testWidgetsWithLeakTracking('ink well changes color on hover with overlayColor', (WidgetTester tester) async { + testWidgets('ink well changes color on hover with overlayColor', (WidgetTester tester) async { // Same test as 'ink well changes color on hover' except that the // hover color is specified with the overlayColor parameter. await tester.pumpWidget(Material( @@ -214,7 +213,7 @@ void main() { expect(inkFeatures, paints..rect(rect: const Rect.fromLTRB(350.0, 250.0, 450.0, 350.0), color: const Color(0xff00ff00))); }); - testWidgetsWithLeakTracking('ink response changes color on focus', (WidgetTester tester) async { + testWidgets('ink response changes color on focus', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); await tester.pumpWidget( @@ -252,7 +251,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ink response changes color on focus with overlayColor', (WidgetTester tester) async { + testWidgets('ink response changes color on focus with overlayColor', (WidgetTester tester) async { // Same test as 'ink well changes color on focus' except that the // hover color is specified with the overlayColor parameter. FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -301,7 +300,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ink well changes color on pressed with overlayColor', (WidgetTester tester) async { + testWidgets('ink well changes color on pressed with overlayColor', (WidgetTester tester) async { const Color pressedColor = Color(0xffdd00ff); await tester.pumpWidget(Material( @@ -335,7 +334,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('ink response splashColor matches splashColor parameter', (WidgetTester tester) async { + testWidgets('ink response splashColor matches splashColor parameter', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); const Color splashColor = Color(0xffff0000); @@ -374,7 +373,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ink response splashColor matches resolved overlayColor for MaterialState.pressed', (WidgetTester tester) async { + testWidgets('ink response splashColor matches resolved overlayColor for MaterialState.pressed', (WidgetTester tester) async { // Same test as 'ink response splashColor matches splashColor // parameter' except that the splash color is specified with the // overlayColor parameter. @@ -424,7 +423,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ink response uses radius for focus highlight', (WidgetTester tester) async { + testWidgets('ink response uses radius for focus highlight', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); await tester.pumpWidget( @@ -455,7 +454,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell uses borderRadius for focus highlight', (WidgetTester tester) async { + testWidgets('InkWell uses borderRadius for focus highlight', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); await tester.pumpWidget( @@ -492,7 +491,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell uses borderRadius for hover highlight', (WidgetTester tester) async { + testWidgets('InkWell uses borderRadius for hover highlight', (WidgetTester tester) async { await tester.pumpWidget( Material( child: Directionality( @@ -529,7 +528,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('InkWell customBorder clips for focus highlight', (WidgetTester tester) async { + testWidgets('InkWell customBorder clips for focus highlight', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); await tester.pumpWidget( @@ -584,7 +583,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell customBorder clips for hover highlight', (WidgetTester tester) async { + testWidgets('InkWell customBorder clips for hover highlight', (WidgetTester tester) async { await tester.pumpWidget( Material( child: Directionality( @@ -637,7 +636,7 @@ void main() { ); }); -testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester tester) async { +testWidgets('InkResponse radius can be updated', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); Widget boilerplate(double radius) { @@ -676,7 +675,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkResponse highlightShape can be updated', (WidgetTester tester) async { + testWidgets('InkResponse highlightShape can be updated', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); Widget boilerplate(BoxShape shape) { @@ -718,7 +717,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell borderRadius can be updated', (WidgetTester tester) async { + testWidgets('InkWell borderRadius can be updated', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); Widget boilerplate(BorderRadius borderRadius) { @@ -764,7 +763,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell customBorder can be updated', (WidgetTester tester) async { + testWidgets('InkWell customBorder can be updated', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); Widget boilerplate(BorderRadius borderRadius) { @@ -832,7 +831,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell splash customBorder can be updated', (WidgetTester tester) async { + testWidgets('InkWell splash customBorder can be updated', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/121626. final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); Widget boilerplate(BorderRadius borderRadius) { @@ -921,7 +920,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking("ink response doesn't change color on focus when on touch device", (WidgetTester tester) async { + testWidgets("ink response doesn't change color on focus when on touch device", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); await tester.pumpWidget(Material( @@ -954,7 +953,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('InkWell.mouseCursor changes cursor on hover', (WidgetTester tester) async { + testWidgets('InkWell.mouseCursor changes cursor on hover', (WidgetTester tester) async { final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse, pointer: 1); await gesture.addPointer(location: const Offset(1, 1)); @@ -1041,7 +1040,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('InkResponse containing selectable text changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('InkResponse containing selectable text changes mouse cursor when hovered', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104595. await tester.pumpWidget(MaterialApp( home: SelectionArea( @@ -1073,7 +1072,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t feedback.dispose(); }); - testWidgetsWithLeakTracking('enabled (default)', (WidgetTester tester) async { + testWidgets('enabled (default)', (WidgetTester tester) async { await tester.pumpWidget(Material( child: Directionality( textDirection: TextDirection.ltr, @@ -1101,7 +1100,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('disabled', (WidgetTester tester) async { + testWidgets('disabled', (WidgetTester tester) async { await tester.pumpWidget(Material( child: Directionality( textDirection: TextDirection.ltr, @@ -1126,7 +1125,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t }); }); - testWidgetsWithLeakTracking('splashing survives scrolling when keep-alive is enabled', (WidgetTester tester) async { + testWidgets('splashing survives scrolling when keep-alive is enabled', (WidgetTester tester) async { Future<void> runTest(bool keepAlive) async { await tester.pumpWidget( MaterialApp( @@ -1167,7 +1166,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await runTest(false); }); - testWidgetsWithLeakTracking('excludeFromSemantics', (WidgetTester tester) async { + testWidgets('excludeFromSemantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Directionality( @@ -1196,7 +1195,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t semantics.dispose(); }); - testWidgetsWithLeakTracking("ink response doesn't focus when disabled", (WidgetTester tester) async { + testWidgets("ink response doesn't focus when disabled", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); final GlobalKey childKey = GlobalKey(); @@ -1233,7 +1232,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('ink response accepts focus when disabled in directional navigation mode', (WidgetTester tester) async { + testWidgets('ink response accepts focus when disabled in directional navigation mode', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); final GlobalKey childKey = GlobalKey(); @@ -1280,7 +1279,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking("ink response doesn't hover when disabled", (WidgetTester tester) async { + testWidgets("ink response doesn't hover when disabled", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'Ink Focus'); final GlobalKey childKey = GlobalKey(); @@ -1334,7 +1333,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t focusNode.dispose(); }); - testWidgetsWithLeakTracking('When ink wells are nested, only the inner one is triggered by tap splash', (WidgetTester tester) async { + testWidgets('When ink wells are nested, only the inner one is triggered by tap splash', (WidgetTester tester) async { final GlobalKey middleKey = GlobalKey(); final GlobalKey innerKey = GlobalKey(); Widget paddedInkWell({Key? key, Widget? child}) { @@ -1403,7 +1402,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await gesture2.up(); }); - testWidgetsWithLeakTracking('Reparenting parent should allow both inkwells to show splash afterwards', (WidgetTester tester) async { + testWidgets('Reparenting parent should allow both inkwells to show splash afterwards', (WidgetTester tester) async { final GlobalKey middleKey = GlobalKey(); final GlobalKey innerKey = GlobalKey(); Widget paddedInkWell({Key? key, Widget? child}) { @@ -1502,7 +1501,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Parent inkwell does not block child inkwells from splashes', (WidgetTester tester) async { + testWidgets('Parent inkwell does not block child inkwells from splashes', (WidgetTester tester) async { final GlobalKey middleKey = GlobalKey(); final GlobalKey innerKey = GlobalKey(); Widget paddedInkWell({Key? key, Widget? child}) { @@ -1555,7 +1554,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Parent inkwell can count the number of pressed children to prevent splash', (WidgetTester tester) async { + testWidgets('Parent inkwell can count the number of pressed children to prevent splash', (WidgetTester tester) async { final GlobalKey parentKey = GlobalKey(); final GlobalKey leftKey = GlobalKey(); final GlobalKey rightKey = GlobalKey(); @@ -1648,7 +1647,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await gesture3.up(); }); - testWidgetsWithLeakTracking('When ink wells are reparented, the old parent can display splash while the new parent can not', (WidgetTester tester) async { + testWidgets('When ink wells are reparented, the old parent can display splash while the new parent can not', (WidgetTester tester) async { final GlobalKey innerKey = GlobalKey(); final GlobalKey leftKey = GlobalKey(); final GlobalKey rightKey = GlobalKey(); @@ -1763,7 +1762,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await gesture2.up(); }); - testWidgetsWithLeakTracking("Ink wells's splash starts before tap is confirmed and disappear after tap is canceled", (WidgetTester tester) async { + testWidgets("Ink wells's splash starts before tap is confirmed and disappear after tap is canceled", (WidgetTester tester) async { final GlobalKey innerKey = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -1820,7 +1819,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(material, paintsExactlyCountTimes(#drawCircle, 1)); }); - testWidgetsWithLeakTracking('disabled and hovered inkwell responds to mouse-exit', (WidgetTester tester) async { + testWidgets('disabled and hovered inkwell responds to mouse-exit', (WidgetTester tester) async { int onHoverCount = 0; late bool hover; @@ -1883,7 +1882,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(hover, false); }); - testWidgetsWithLeakTracking('hovered ink well draws a transparent highlight when disabled', (WidgetTester tester) async { + testWidgets('hovered ink well draws a transparent highlight when disabled', (WidgetTester tester) async { Widget buildFrame({ required bool enabled }) { return Material( child: Directionality( @@ -1933,7 +1932,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t }); - testWidgetsWithLeakTracking('Changing InkWell.enabled should not trigger TextButton setState()', (WidgetTester tester) async { + testWidgets('Changing InkWell.enabled should not trigger TextButton setState()', (WidgetTester tester) async { Widget buildFrame({ required bool enabled }) { return Material( child: Directionality( @@ -1967,7 +1966,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('InkWell does not attach semantics handler for onTap if it was not provided an onTap handler', (WidgetTester tester) async { + testWidgets('InkWell does not attach semantics handler for onTap if it was not provided an onTap handler', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Material( @@ -2010,7 +2009,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t )); }); - testWidgetsWithLeakTracking('InkWell highlight should not survive after [onTapDown, onDoubleTap] sequence', (WidgetTester tester) async { + testWidgets('InkWell highlight should not survive after [onTapDown, onDoubleTap] sequence', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -2051,7 +2050,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(inkFeatures, paintsExactlyCountTimes(#drawRect, 0)); }); - testWidgetsWithLeakTracking('InkWell splash should not survive after [onTapDown, onTapDown, onTapCancel, onDoubleTap] sequence', (WidgetTester tester) async { + testWidgets('InkWell splash should not survive after [onTapDown, onTapDown, onTapCancel, onDoubleTap] sequence', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -2096,7 +2095,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(inkFeatures, paintsExactlyCountTimes(#drawCircle, 0)); }); - testWidgetsWithLeakTracking('InkWell disposes statesController', (WidgetTester tester) async { + testWidgets('InkWell disposes statesController', (WidgetTester tester) async { int tapCount = 0; Widget buildFrame(MaterialStatesController? statesController) { return MaterialApp( @@ -2140,7 +2139,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(pressedCount, 2); }); - testWidgetsWithLeakTracking('ink well overlayColor opacity fades from 0xff when hover ends', (WidgetTester tester) async { + testWidgets('ink well overlayColor opacity fades from 0xff when hover ends', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110266 await tester.pumpWidget(Material( child: Directionality( @@ -2178,7 +2177,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t expect(inkFeatures, paints..rect(rect: const Rect.fromLTRB(350.0, 250.0, 450.0, 350.0), color: const Color(0x8000ff00))); }); - testWidgetsWithLeakTracking('InkWell secondary tap test', (WidgetTester tester) async { + testWidgets('InkWell secondary tap test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -2216,7 +2215,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t }); // Regression test for https://github.com/flutter/flutter/issues/124328. - testWidgetsWithLeakTracking('InkWell secondary tap should not draw a splash when no secondary callbacks are defined', (WidgetTester tester) async { + testWidgets('InkWell secondary tap should not draw a splash when no secondary callbacks are defined', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Material( @@ -2241,7 +2240,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t await gesture.up(); }); - testWidgetsWithLeakTracking('try out hoverDuration property', (WidgetTester tester) async { + testWidgets('try out hoverDuration property', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -2265,7 +2264,7 @@ testWidgetsWithLeakTracking('InkResponse radius can be updated', (WidgetTester t log.clear(); }); - testWidgetsWithLeakTracking('InkWell activation action does not end immediately', (WidgetTester tester) async { + testWidgets('InkWell activation action does not end immediately', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132377. final MaterialStatesController controller = MaterialStatesController(); diff --git a/packages/flutter/test/material/input_chip_test.dart b/packages/flutter/test/material/input_chip_test.dart index aaf1bc9d782..f62fc18d338 100644 --- a/packages/flutter/test/material/input_chip_test.dart +++ b/packages/flutter/test/material/input_chip_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; /// Adds the basic requirements for a Chip. Widget wrapForChip({ @@ -115,7 +114,7 @@ void checkChipMaterialClipBehavior(WidgetTester tester, Clip clipBehavior) { } void main() { - testWidgetsWithLeakTracking('InputChip.color resolves material states', (WidgetTester tester) async { + testWidgets('InputChip.color resolves material states', (WidgetTester tester) async { const Color disabledSelectedColor = Color(0xffffff00); const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); @@ -171,7 +170,7 @@ void main() { expect(getMaterialBox(tester), paints..rrect(color: disabledSelectedColor)); }); - testWidgetsWithLeakTracking('InputChip uses provided state color properties', (WidgetTester tester) async { + testWidgets('InputChip uses provided state color properties', (WidgetTester tester) async { const Color disabledColor = Color(0xff00ff00); const Color backgroundColor = Color(0xff0000ff); const Color selectedColor = Color(0xffff0000); @@ -210,7 +209,7 @@ void main() { expect(getMaterialBox(tester), paints..rrect(color: selectedColor)); }); - testWidgetsWithLeakTracking('InputChip can be tapped', (WidgetTester tester) async { + testWidgets('InputChip can be tapped', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -225,7 +224,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('loses focus when disabled', (WidgetTester tester) async { + testWidgets('loses focus when disabled', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'InputChip'); await tester.pumpWidget( wrapForChip( @@ -259,7 +258,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('cannot be traversed to when disabled', (WidgetTester tester) async { + testWidgets('cannot be traversed to when disabled', (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'InputChip 1'); final FocusNode focusNode2 = FocusNode(debugLabel: 'InputChip 2'); await tester.pumpWidget( @@ -297,7 +296,7 @@ void main() { focusNode2.dispose(); }); - testWidgetsWithLeakTracking('Input chip check mark color is determined by platform brightness when light', (WidgetTester tester) async { + testWidgets('Input chip check mark color is determined by platform brightness when light', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedInputChip(), @@ -309,7 +308,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Input chip check mark color is determined by platform brightness when dark', (WidgetTester tester) async { + testWidgets('Input chip check mark color is determined by platform brightness when dark', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedInputChip(), @@ -322,7 +321,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Input chip check mark color can be set by the chip theme', (WidgetTester tester) async { + testWidgets('Input chip check mark color can be set by the chip theme', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedInputChip(), @@ -335,7 +334,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Input chip check mark color can be set by the chip constructor', (WidgetTester tester) async { + testWidgets('Input chip check mark color can be set by the chip constructor', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedInputChip(checkmarkColor: const Color(0xff00ff00)), @@ -347,7 +346,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Input chip check mark color is set by chip constructor even when a theme color is specified', (WidgetTester tester) async { + testWidgets('Input chip check mark color is set by chip constructor even when a theme color is specified', (WidgetTester tester) async { await pumpCheckmarkChip( tester, chip: selectedInputChip(checkmarkColor: const Color(0xffff0000)), @@ -360,7 +359,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('InputChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { + testWidgets('InputChip clipBehavior properly passes through to the Material', (WidgetTester tester) async { const Text label = Text('label'); await tester.pumpWidget(wrapForChip(child: const InputChip(label: label))); checkChipMaterialClipBehavior(tester, Clip.none); @@ -369,7 +368,7 @@ void main() { checkChipMaterialClipBehavior(tester, Clip.antiAlias); }); - testWidgetsWithLeakTracking('Input chip has correct selected color when enabled - M3 defaults', (WidgetTester tester) async { + testWidgets('Input chip has correct selected color when enabled - M3 defaults', (WidgetTester tester) async { final ChipThemeData material3ChipDefaults = ThemeData(useMaterial3: true).chipTheme; await pumpCheckmarkChip( tester, @@ -381,7 +380,7 @@ void main() { expect(materialBox, paints..rrect(color: material3ChipDefaults.backgroundColor)); }); - testWidgetsWithLeakTracking('Input chip has correct selected color when disabled - M3 defaults', (WidgetTester tester) async { + testWidgets('Input chip has correct selected color when disabled - M3 defaults', (WidgetTester tester) async { final ChipThemeData material3ChipDefaults = ThemeData(useMaterial3: true).chipTheme; await pumpCheckmarkChip( tester, @@ -393,7 +392,7 @@ void main() { expect(materialBox, paints..path(color: material3ChipDefaults.disabledColor)); }); - testWidgetsWithLeakTracking('InputChip uses provided iconTheme', (WidgetTester tester) async { + testWidgets('InputChip uses provided iconTheme', (WidgetTester tester) async { Widget buildChip({ IconThemeData? iconTheme }) { return MaterialApp( home: Material( @@ -417,7 +416,7 @@ void main() { expect(getIconData(tester).color, const Color(0xff00ff00)); }); - testWidgetsWithLeakTracking('Delete button is visible InputChip is disabled', (WidgetTester tester) async { + testWidgets('Delete button is visible InputChip is disabled', (WidgetTester tester) async { await tester.pumpWidget( wrapForChip( child: InputChip( diff --git a/packages/flutter/test/material/input_date_picker_form_field_test.dart b/packages/flutter/test/material/input_date_picker_form_field_test.dart index 2b256cabe2b..0588bdfc03e 100644 --- a/packages/flutter/test/material/input_date_picker_form_field_test.dart +++ b/packages/flutter/test/material/input_date_picker_form_field_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; @@ -100,7 +99,7 @@ void main() { group('InputDatePickerFormField', () { - testWidgetsWithLeakTracking('Initial date is the default', (WidgetTester tester) async { + testWidgets('Initial date is the default', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final DateTime initialDate = DateTime(2016, DateTime.february, 21); DateTime? inputDate; @@ -114,7 +113,7 @@ void main() { expect(inputDate, equals(initialDate)); }); - testWidgetsWithLeakTracking('Changing initial date is reflected in text value', (WidgetTester tester) async { + testWidgets('Changing initial date is reflected in text value', (WidgetTester tester) async { final DateTime initialDate = DateTime(2016, DateTime.february, 21); final DateTime updatedInitialDate = DateTime(2016, DateTime.february, 23); await tester.pumpWidget(inputDatePickerField( @@ -129,7 +128,7 @@ void main() { expect(textFieldController(tester).value.text, equals('02/23/2016')); }); - testWidgetsWithLeakTracking('Valid date entry', (WidgetTester tester) async { + testWidgets('Valid date entry', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); DateTime? inputDate; await tester.pumpWidget(inputDatePickerField( @@ -142,7 +141,7 @@ void main() { expect(inputDate, equals(DateTime(2016, DateTime.february, 21))); }); - testWidgetsWithLeakTracking('Invalid text entry shows errorFormat text', (WidgetTester tester) async { + testWidgets('Invalid text entry shows errorFormat text', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); DateTime? inputDate; await tester.pumpWidget(inputDatePickerField( @@ -169,7 +168,7 @@ void main() { expect(find.text('That is not a date.'), findsOneWidget); }); - testWidgetsWithLeakTracking('Valid text entry, but date outside first or last date shows bounds shows errorInvalid text', (WidgetTester tester) async { + testWidgets('Valid text entry, but date outside first or last date shows bounds shows errorInvalid text', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); DateTime? inputDate; await tester.pumpWidget(inputDatePickerField( @@ -204,7 +203,7 @@ void main() { expect(find.text('Not in given range.'), findsOneWidget); }); - testWidgetsWithLeakTracking('selectableDatePredicate will be used to show errorInvalid if date is not selectable', (WidgetTester tester) async { + testWidgets('selectableDatePredicate will be used to show errorInvalid if date is not selectable', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); DateTime? inputDate; await tester.pumpWidget(inputDatePickerField( @@ -230,7 +229,7 @@ void main() { expect(find.text('Out of range.'), findsNothing); }); - testWidgetsWithLeakTracking('Empty field shows hint text when focused', (WidgetTester tester) async { + testWidgets('Empty field shows hint text when focused', (WidgetTester tester) async { await tester.pumpWidget(inputDatePickerField()); // Focus on it await tester.tap(find.byType(TextField)); @@ -253,7 +252,7 @@ void main() { expect(textOpacity(tester, 'Enter some date'), equals(0.0)); }); - testWidgetsWithLeakTracking('Label text', (WidgetTester tester) async { + testWidgets('Label text', (WidgetTester tester) async { await tester.pumpWidget(inputDatePickerField()); // Default label expect(find.text('Enter Date'), findsOneWidget); @@ -265,7 +264,7 @@ void main() { expect(find.text('Give me a date!'), findsOneWidget); }); - testWidgetsWithLeakTracking('Semantics', (WidgetTester tester) async { + testWidgets('Semantics', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); // Fill the clipboard so that the Paste option is available in the text @@ -294,7 +293,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('InputDecorationTheme is honored', (WidgetTester tester) async { + testWidgets('InputDecorationTheme is honored', (WidgetTester tester) async { const InputBorder border = InputBorder.none; await tester.pumpWidget(inputDatePickerField( theme: ThemeData.from(colorScheme: const ColorScheme.light()).copyWith( @@ -328,7 +327,7 @@ void main() { expect(containerColor, equals(Colors.transparent)); }); - testWidgetsWithLeakTracking('Date text localization', (WidgetTester tester) async { + testWidgets('Date text localization', (WidgetTester tester) async { final Iterable<LocalizationsDelegate<dynamic>> delegates = <LocalizationsDelegate<dynamic>>[ TestMaterialLocalizationsDelegate(), DefaultWidgetsLocalizations.delegate, @@ -351,7 +350,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('when an empty date is entered and acceptEmptyDate is true, then errorFormatText is not shown', (WidgetTester tester) async { + testWidgets('when an empty date is entered and acceptEmptyDate is true, then errorFormatText is not shown', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); const String errorFormatText = 'That is not a date.'; await tester.pumpWidget(inputDatePickerField( @@ -366,7 +365,7 @@ void main() { expect(find.text(errorFormatText), findsNothing); }); - testWidgetsWithLeakTracking('when an empty date is entered and acceptEmptyDate is false, then errorFormatText is shown', (WidgetTester tester) async { + testWidgets('when an empty date is entered and acceptEmptyDate is false, then errorFormatText is shown', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); const String errorFormatText = 'That is not a date.'; await tester.pumpWidget(inputDatePickerField( @@ -381,7 +380,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('FocusNode can request focus', (WidgetTester tester) async { + testWidgets('FocusNode can request focus', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); await tester.pumpWidget(inputDatePickerField( diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index d2ca395b643..25689267baa 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -14,7 +14,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Widget buildInputDecorator({ InputDecoration decoration = const InputDecoration(), @@ -169,7 +168,7 @@ void main() { } void runAllTests({ required bool useMaterial3 }) { - testWidgetsWithLeakTracking('InputDecorator input/label text layout', (WidgetTester tester) async { + testWidgets('InputDecorator input/label text layout', (WidgetTester tester) async { // The label appears above the input text await tester.pumpWidget( buildInputDecorator( @@ -397,7 +396,7 @@ void runAllTests({ required bool useMaterial3 }) { } }); - testWidgetsWithLeakTracking('InputDecorator input/label widget layout', (WidgetTester tester) async { + testWidgets('InputDecorator input/label widget layout', (WidgetTester tester) async { const Key key = Key('l'); // The label appears above the input text. @@ -741,7 +740,7 @@ void runAllTests({ required bool useMaterial3 }) { }); - testWidgetsWithLeakTracking('InputDecorator floating label animation duration and curve', (WidgetTester tester) async { + testWidgets('InputDecorator floating label animation duration and curve', (WidgetTester tester) async { Future<void> pumpInputDecorator({ required bool isFocused, }) async { @@ -792,7 +791,7 @@ void runAllTests({ required bool useMaterial3 }) { group('alignLabelWithHint', () { group('expands false', () { - testWidgetsWithLeakTracking('multiline TextField no-strut', (WidgetTester tester) async { + testWidgets('multiline TextField no-strut', (WidgetTester tester) async { const String text = 'text'; final FocusNode focusNode = FocusNode(); final TextEditingController controller = TextEditingController(); @@ -845,7 +844,7 @@ void runAllTests({ required bool useMaterial3 }) { focusNode.unfocus(); }); - testWidgetsWithLeakTracking('multiline TextField', (WidgetTester tester) async { + testWidgets('multiline TextField', (WidgetTester tester) async { const String text = 'text'; final FocusNode focusNode = FocusNode(); final TextEditingController controller = TextEditingController(); @@ -898,7 +897,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('expands true', () { - testWidgetsWithLeakTracking('multiline TextField', (WidgetTester tester) async { + testWidgets('multiline TextField', (WidgetTester tester) async { const String text = 'text'; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -953,7 +952,7 @@ void runAllTests({ required bool useMaterial3 }) { focusNode.unfocus(); }); - testWidgetsWithLeakTracking('multiline TextField with outline border', (WidgetTester tester) async { + testWidgets('multiline TextField with outline border', (WidgetTester tester) async { const String text = 'text'; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1018,7 +1017,7 @@ void runAllTests({ required bool useMaterial3 }) { // 12 - top padding // 16 - input text (font size 16dps) // 12 - bottom padding - testWidgetsWithLeakTracking('InputDecorator input/hint layout', (WidgetTester tester) async { + testWidgets('InputDecorator input/hint layout', (WidgetTester tester) async { // The hint aligns with the input text await tester.pumpWidget( buildInputDecorator( @@ -1042,7 +1041,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getSize(find.text('hint')).width, tester.getSize(find.text('text')).width); }); - testWidgetsWithLeakTracking('InputDecorator input/label/hint layout', (WidgetTester tester) async { + testWidgets('InputDecorator input/label/hint layout', (WidgetTester tester) async { // Label is visible, hint is not (opacity 0.0). await tester.pumpWidget( buildInputDecorator( @@ -1153,7 +1152,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 2.0); }); - testWidgetsWithLeakTracking('InputDecorator input/label/hint dense layout', (WidgetTester tester) async { + testWidgets('InputDecorator input/label/hint dense layout', (WidgetTester tester) async { // Label is visible, hint is not (opacity 0.0). await tester.pumpWidget( buildInputDecorator( @@ -1217,7 +1216,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 2.0); }); - testWidgetsWithLeakTracking('InputDecorator default hint animation duration', (WidgetTester tester) async { + testWidgets('InputDecorator default hint animation duration', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -1284,7 +1283,7 @@ void runAllTests({ required bool useMaterial3 }) { } }); - testWidgetsWithLeakTracking('InputDecorator custom hint animation duration', (WidgetTester tester) async { + testWidgets('InputDecorator custom hint animation duration', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -1354,7 +1353,7 @@ void runAllTests({ required bool useMaterial3 }) { } }); - testWidgetsWithLeakTracking('InputDecorator custom hint animation duration from theme', (WidgetTester tester) async { + testWidgets('InputDecorator custom hint animation duration from theme', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -1430,7 +1429,7 @@ void runAllTests({ required bool useMaterial3 }) { } }); - testWidgetsWithLeakTracking('InputDecorator with no input border', (WidgetTester tester) async { + testWidgets('InputDecorator with no input border', (WidgetTester tester) async { // Label is visible, hint is not (opacity 0.0). await tester.pumpWidget( buildInputDecorator( @@ -1445,7 +1444,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 0.0); }); - testWidgetsWithLeakTracking('InputDecorator error/helper/counter layout', (WidgetTester tester) async { + testWidgets('InputDecorator error/helper/counter layout', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -1597,7 +1596,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('counter')), const Offset(788.0, 56.0)); }); - testWidgetsWithLeakTracking('InputDecorator counter text, widget, and null', (WidgetTester tester) async { + testWidgets('InputDecorator counter text, widget, and null', (WidgetTester tester) async { Widget buildFrame({ InputCounterWidgetBuilder? buildCounter, String? counterText, @@ -1699,7 +1698,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(find.byKey(buildCounterKey), findsOneWidget); }); - testWidgetsWithLeakTracking('InputDecoration errorMaxLines', (WidgetTester tester) async { + testWidgets('InputDecoration errorMaxLines', (WidgetTester tester) async { const String kError1 = 'e0'; const String kError2 = 'e0\ne1'; const String kError3 = 'e0\ne1\ne2'; @@ -1778,7 +1777,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getBottomLeft(find.text(kError1)), const Offset(12.0, 76.0)); }); - testWidgetsWithLeakTracking('InputDecoration helperMaxLines', (WidgetTester tester) async { + testWidgets('InputDecoration helperMaxLines', (WidgetTester tester) async { const String kHelper1 = 'e0'; const String kHelper2 = 'e0\ne1'; const String kHelper3 = 'e0\ne1\ne2'; @@ -1875,7 +1874,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getBottomLeft(find.text(kHelper1)), const Offset(12.0, 76.0)); }); - testWidgetsWithLeakTracking('InputDecorator shows error text', (WidgetTester tester) async { + testWidgets('InputDecorator shows error text', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -1888,7 +1887,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(find.text('errorText'), findsOneWidget); }); - testWidgetsWithLeakTracking('InputDecoration shows error border for errorText and error widget', (WidgetTester tester) async { + testWidgets('InputDecoration shows error border for errorText and error widget', (WidgetTester tester) async { const InputBorder errorBorder = OutlineInputBorder( borderSide: BorderSide(color: Colors.red, width: 1.5), ); @@ -1987,7 +1986,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorder(tester), errorBorder); }); - testWidgetsWithLeakTracking('InputDecorator shows error widget', (WidgetTester tester) async { + testWidgets('InputDecorator shows error widget', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2000,7 +1999,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(find.text('error'), findsOneWidget); }); - testWidgetsWithLeakTracking('InputDecorator throws when error text and error widget are provided', (WidgetTester tester) async { + testWidgets('InputDecorator throws when error text and error widget are provided', (WidgetTester tester) async { expect( () { buildInputDecorator( @@ -2015,7 +2014,7 @@ void runAllTests({ required bool useMaterial3 }) { ); }); - testWidgetsWithLeakTracking('InputDecorator prefix/suffix texts', (WidgetTester tester) async { + testWidgets('InputDecorator prefix/suffix texts', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2053,7 +2052,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('text')).dx, lessThanOrEqualTo(tester.getTopLeft(find.text('s')).dx)); }); - testWidgetsWithLeakTracking('InputDecorator icon/prefix/suffix', (WidgetTester tester) async { + testWidgets('InputDecorator icon/prefix/suffix', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2093,7 +2092,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('text')).dx, lessThanOrEqualTo(tester.getTopLeft(find.text('s')).dx)); }); - testWidgetsWithLeakTracking('InputDecorator iconColor/prefixIconColor/suffixIconColor', (WidgetTester tester) async { + testWidgets('InputDecorator iconColor/prefixIconColor/suffixIconColor', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -2117,7 +2116,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.widget<IconTheme>(find.widgetWithIcon(IconTheme,Icons.close).first).data.color, Colors.red); }); - testWidgetsWithLeakTracking('InputDecorator suffixIconColor in M3 error state', (WidgetTester tester) async { + testWidgets('InputDecorator suffixIconColor in M3 error state', (WidgetTester tester) async { final ThemeData theme = ThemeData( useMaterial3: true, iconButtonTheme: const IconButtonThemeData( @@ -2144,7 +2143,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getIconStyle(tester, Icons.close)?.color, theme.colorScheme.error); }); - testWidgetsWithLeakTracking('InputDecoration default floatingLabelStyle resolves hovered/focused states', (WidgetTester tester) async { + testWidgets('InputDecoration default floatingLabelStyle resolves hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final ThemeData theme = ThemeData(useMaterial3: true); @@ -2179,7 +2178,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getLabelStyle(tester).color, theme.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('InputDecorator prefix/suffix widgets', (WidgetTester tester) async { + testWidgets('InputDecorator prefix/suffix widgets', (WidgetTester tester) async { const Key pKey = Key('p'); const Key sKey = Key('s'); await tester.pumpWidget( @@ -2231,7 +2230,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('text')).dx, lessThanOrEqualTo(tester.getTopRight(find.byKey(sKey)).dx)); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix', (WidgetTester tester) async { const Key pKey = Key('p'); await tester.pumpWidget( buildInputDecorator( @@ -2276,7 +2275,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.byKey(pKey)).dx, tester.getTopLeft(find.text('text')).dx); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix with border', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix with border', (WidgetTester tester) async { const Key pKey = Key('p'); await tester.pumpWidget( buildInputDecorator( @@ -2327,7 +2326,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.byKey(pKey)).dx, tester.getTopLeft(find.text('text')).dx); }); - testWidgetsWithLeakTracking('InputDecorator prefixIcon/suffixIcon', (WidgetTester tester) async { + testWidgets('InputDecorator prefixIcon/suffixIcon', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2363,7 +2362,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('text')).dx, lessThanOrEqualTo(tester.getTopLeft(find.byIcon(Icons.satellite)).dx)); }); - testWidgetsWithLeakTracking('InputDecorator prefixIconConstraints/suffixIconConstraints', (WidgetTester tester) async { + testWidgets('InputDecorator prefixIconConstraints/suffixIconConstraints', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2401,7 +2400,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.byIcon(Icons.satellite)).dx, 800.0); }); - testWidgetsWithLeakTracking('prefix/suffix icons are centered when smaller than 48 by 48', (WidgetTester tester) async { + testWidgets('prefix/suffix icons are centered when smaller than 48 by 48', (WidgetTester tester) async { const Key prefixKey = Key('prefix'); await tester.pumpWidget( buildInputDecorator( @@ -2427,7 +2426,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.byKey(prefixKey)).dy, 16.0); }); - testWidgetsWithLeakTracking('InputDecorator respects reduced theme visualDensity', (WidgetTester tester) async { + testWidgets('InputDecorator respects reduced theme visualDensity', (WidgetTester tester) async { // Label is visible, hint is not (opacity 0.0). await tester.pumpWidget( buildInputDecorator( @@ -2524,7 +2523,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 2.0); }); - testWidgetsWithLeakTracking('InputDecorator respects increased theme visualDensity', (WidgetTester tester) async { + testWidgets('InputDecorator respects increased theme visualDensity', (WidgetTester tester) async { // Label is visible, hint is not (opacity 0.0). await tester.pumpWidget( buildInputDecorator( @@ -2621,7 +2620,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 2.0); }); - testWidgetsWithLeakTracking('prefix/suffix icons increase height of decoration when larger than 48 by 48', (WidgetTester tester) async { + testWidgets('prefix/suffix icons increase height of decoration when larger than 48 by 48', (WidgetTester tester) async { const Key prefixKey = Key('prefix'); await tester.pumpWidget( buildInputDecorator( @@ -2645,7 +2644,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('constraints', () { - testWidgetsWithLeakTracking('No InputDecorator constraints', (WidgetTester tester) async { + testWidgets('No InputDecorator constraints', (WidgetTester tester) async { await tester.pumpWidget(buildInputDecorator( useMaterial3: useMaterial3, )); @@ -2654,7 +2653,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getSize(find.byType(InputDecorator)), const Size(800, 48)); }); - testWidgetsWithLeakTracking('InputDecoratorThemeData constraints', (WidgetTester tester) async { + testWidgets('InputDecoratorThemeData constraints', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2670,7 +2669,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getSize(find.byType(InputDecorator)), const Size(300, 40)); }); - testWidgetsWithLeakTracking('InputDecorator constraints', (WidgetTester tester) async { + testWidgets('InputDecorator constraints', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -2693,7 +2692,7 @@ void runAllTests({ required bool useMaterial3 }) { group('textAlignVertical position', () { group('simple case', () { - testWidgetsWithLeakTracking('align top (default)', (WidgetTester tester) async { + testWidgets('align top (default)', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2717,7 +2716,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 12.0); }); - testWidgetsWithLeakTracking('align center', (WidgetTester tester) async { + testWidgets('align center', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2741,7 +2740,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 290.0); }); - testWidgetsWithLeakTracking('align bottom', (WidgetTester tester) async { + testWidgets('align bottom', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2765,7 +2764,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 568.0); }); - testWidgetsWithLeakTracking('align as a double', (WidgetTester tester) async { + testWidgets('align as a double', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2789,7 +2788,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 498.5); }); - testWidgetsWithLeakTracking('works with density and content padding', (WidgetTester tester) async { + testWidgets('works with density and content padding', (WidgetTester tester) async { const Key key = Key('child'); const Key containerKey = Key('container'); const double totalHeight = 100.0; @@ -2839,7 +2838,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('outline border', () { - testWidgetsWithLeakTracking('align top', (WidgetTester tester) async { + testWidgets('align top', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2865,7 +2864,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 24.0); }); - testWidgetsWithLeakTracking('align center (default)', (WidgetTester tester) async { + testWidgets('align center (default)', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2890,7 +2889,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 289.0); }); - testWidgetsWithLeakTracking('align bottom', (WidgetTester tester) async { + testWidgets('align bottom', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -2917,7 +2916,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('prefix', () { - testWidgetsWithLeakTracking('InputDecorator tall prefix align top', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix align top', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -2947,7 +2946,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.byKey(pKey)).dy, 12.0); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix align center', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix align center', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -2977,7 +2976,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.byKey(pKey)).dy, 12.0); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix align bottom', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix align bottom', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -3009,7 +3008,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('outline border and prefix', () { - testWidgetsWithLeakTracking('InputDecorator tall prefix align center', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix align center', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -3041,7 +3040,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.byKey(pKey)).dy, 246.5); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix with border align top', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix with border align top', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -3075,7 +3074,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.byKey(pKey)).dy, 24.0); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix with border align bottom', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix with border align bottom', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -3107,7 +3106,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.byKey(pKey)).dy, 479.0); }); - testWidgetsWithLeakTracking('InputDecorator tall prefix with border align double', (WidgetTester tester) async { + testWidgets('InputDecorator tall prefix with border align double', (WidgetTester tester) async { const Key pKey = Key('p'); const String text = 'text'; await tester.pumpWidget( @@ -3141,7 +3140,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('label', () { - testWidgetsWithLeakTracking('align top (default)', (WidgetTester tester) async { + testWidgets('align top (default)', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -3167,7 +3166,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 28.0); }); - testWidgetsWithLeakTracking('align center', (WidgetTester tester) async { + testWidgets('align center', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -3193,7 +3192,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text(text)).dy, 298.0); }); - testWidgetsWithLeakTracking('align bottom', (WidgetTester tester) async { + testWidgets('align bottom', (WidgetTester tester) async { const String text = 'text'; await tester.pumpWidget( buildInputDecorator( @@ -3223,7 +3222,7 @@ void runAllTests({ required bool useMaterial3 }) { group('OutlineInputBorder', () { group('default alignment', () { - testWidgetsWithLeakTracking('Centers when border', (WidgetTester tester) async { + testWidgets('Centers when border', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3240,7 +3239,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('Centers when border and label', (WidgetTester tester) async { + testWidgets('Centers when border and label', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3258,7 +3257,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('Centers when border and contentPadding', (WidgetTester tester) async { + testWidgets('Centers when border and contentPadding', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3279,7 +3278,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('Centers when border and contentPadding and label', (WidgetTester tester) async { + testWidgets('Centers when border and contentPadding and label', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3300,7 +3299,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('Centers when border and lopsided contentPadding and label', (WidgetTester tester) async { + testWidgets('Centers when border and lopsided contentPadding and label', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3322,7 +3321,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('Floating label is aligned with prefixIcon by default in M3', (WidgetTester tester) async { + testWidgets('Floating label is aligned with prefixIcon by default in M3', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3341,7 +3340,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 2.0); }); - testWidgetsWithLeakTracking('Floating label for filled input decoration is aligned with text', (WidgetTester tester) async { + testWidgets('Floating label for filled input decoration is aligned with text', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3362,7 +3361,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('3 point interpolation alignment', () { - testWidgetsWithLeakTracking('top align includes padding', (WidgetTester tester) async { + testWidgets('top align includes padding', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3386,7 +3385,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('center align ignores padding', (WidgetTester tester) async { + testWidgets('center align ignores padding', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3410,7 +3409,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('bottom align includes padding', (WidgetTester tester) async { + testWidgets('bottom align includes padding', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3434,7 +3433,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('padding exceeds middle keeps top at middle', (WidgetTester tester) async { + testWidgets('padding exceeds middle keeps top at middle', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3460,7 +3459,7 @@ void runAllTests({ required bool useMaterial3 }) { }); }); - testWidgetsWithLeakTracking('counter text has correct right margin - LTR, not dense', (WidgetTester tester) async { + testWidgets('counter text has correct right margin - LTR, not dense', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3480,7 +3479,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getRect(find.text('test')).right, dx - 12.0); }); - testWidgetsWithLeakTracking('counter text has correct right margin - RTL, not dense', (WidgetTester tester) async { + testWidgets('counter text has correct right margin - RTL, not dense', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3500,7 +3499,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getRect(find.text('test')).left, 12.0); }); - testWidgetsWithLeakTracking('counter text has correct right margin - LTR, dense', (WidgetTester tester) async { + testWidgets('counter text has correct right margin - LTR, dense', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3521,7 +3520,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getRect(find.text('test')).right, dx - 12.0); }); - testWidgetsWithLeakTracking('counter text has correct right margin - RTL, dense', (WidgetTester tester) async { + testWidgets('counter text has correct right margin - RTL, dense', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3542,7 +3541,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getRect(find.text('test')).left, 12.0); }); - testWidgetsWithLeakTracking('InputDecorator error/helper/counter RTL layout', (WidgetTester tester) async { + testWidgets('InputDecorator error/helper/counter RTL layout', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3599,7 +3598,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(find.text('helper'), findsNothing); }); - testWidgetsWithLeakTracking('InputDecorator prefix/suffix RTL', (WidgetTester tester) async { + testWidgets('InputDecorator prefix/suffix RTL', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3633,7 +3632,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('text')).dx, lessThanOrEqualTo(tester.getTopLeft(find.text('p')).dx)); }); - testWidgetsWithLeakTracking('InputDecorator contentPadding RTL layout', (WidgetTester tester) async { + testWidgets('InputDecorator contentPadding RTL layout', (WidgetTester tester) async { // LTR: content left edge is contentPadding.start: 40.0 await tester.pumpWidget( buildInputDecorator( @@ -3674,13 +3673,13 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('hint')).dx, 760.0); }); - testWidgetsWithLeakTracking('FloatingLabelAlignment.toString()', (WidgetTester tester) async { + testWidgets('FloatingLabelAlignment.toString()', (WidgetTester tester) async { expect(FloatingLabelAlignment.start.toString(), 'FloatingLabelAlignment.start'); expect(FloatingLabelAlignment.center.toString(), 'FloatingLabelAlignment.center'); }); group('inputText width', () { - testWidgetsWithLeakTracking('outline textField', (WidgetTester tester) async { + testWidgets('outline textField', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3693,7 +3692,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text('text')).dx, 12.0); expect(tester.getTopRight(find.text('text')).dx, 788.0); }); - testWidgetsWithLeakTracking('outline textField with prefix and suffix icons', (WidgetTester tester) async { + testWidgets('outline textField with prefix and suffix icons', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3708,7 +3707,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text('text')).dx, 48.0); expect(tester.getTopRight(find.text('text')).dx, 752.0); }); - testWidgetsWithLeakTracking('filled textField', (WidgetTester tester) async { + testWidgets('filled textField', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3721,7 +3720,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text('text')).dx, 12.0); expect(tester.getTopRight(find.text('text')).dx, 788.0); }); - testWidgetsWithLeakTracking('filled textField with prefix and suffix icons', (WidgetTester tester) async { + testWidgets('filled textField with prefix and suffix icons', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -3760,7 +3759,7 @@ void runAllTests({ required bool useMaterial3 }) { ); group('LTR with icon aligned', () { - testWidgetsWithLeakTracking('start', (WidgetTester tester) async { + testWidgets('start', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.ltr, @@ -3784,7 +3783,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text('label')).dx, 80.0); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.ltr, @@ -3810,7 +3809,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('LTR without icon aligned', () { - testWidgetsWithLeakTracking('start', (WidgetTester tester) async { + testWidgets('start', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.ltr, @@ -3834,7 +3833,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text('label')).dx, 40.0); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.ltr, @@ -3860,7 +3859,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('RTL with icon aligned', () { - testWidgetsWithLeakTracking('start', (WidgetTester tester) async { + testWidgets('start', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.rtl, @@ -3884,7 +3883,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('label')).dx, 720.0); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.rtl, @@ -3910,7 +3909,7 @@ void runAllTests({ required bool useMaterial3 }) { }); group('RTL without icon aligned', () { - testWidgetsWithLeakTracking('start', (WidgetTester tester) async { + testWidgets('start', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.rtl, @@ -3934,7 +3933,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('label')).dx, 760.0); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecoratorWithFloatingLabel( textDirection: TextDirection.rtl, @@ -3960,7 +3959,7 @@ void runAllTests({ required bool useMaterial3 }) { }); }); - testWidgetsWithLeakTracking('InputDecorator prefix/suffix dense layout', (WidgetTester tester) async { + testWidgets('InputDecorator prefix/suffix dense layout', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4002,7 +4001,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 2.0); }); - testWidgetsWithLeakTracking('InputDecorator with empty InputDecoration', (WidgetTester tester) async { + testWidgets('InputDecorator with empty InputDecoration', (WidgetTester tester) async { await tester.pumpWidget(buildInputDecorator( useMaterial3: useMaterial3, )); @@ -4019,7 +4018,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('contentPadding smaller than kMinInteractiveDimension', (WidgetTester tester) async { + testWidgets('contentPadding smaller than kMinInteractiveDimension', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/42449 const double verticalPadding = 1.0; await tester.pumpWidget( @@ -4095,7 +4094,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 0.0); }); - testWidgetsWithLeakTracking('InputDecorator.collapsed', (WidgetTester tester) async { + testWidgets('InputDecorator.collapsed', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4138,7 +4137,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 0.0); }); - testWidgetsWithLeakTracking('InputDecorator with baseStyle', (WidgetTester tester) async { + testWidgets('InputDecorator with baseStyle', (WidgetTester tester) async { // Setting the baseStyle of the InputDecoration and the style of the input // text child to a smaller font reduces the InputDecoration's vertical size. const TextStyle style = TextStyle(fontSize: 10.0); @@ -4179,7 +4178,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopLeft(find.text('text')).dy, useMaterial3 ? 28 : 24.75); }); - testWidgetsWithLeakTracking('InputDecorator with empty style overrides', (WidgetTester tester) async { + testWidgets('InputDecorator with empty style overrides', (WidgetTester tester) async { // Same as not specifying any style overrides await tester.pumpWidget( buildInputDecorator( @@ -4222,7 +4221,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getTopRight(find.text('counter')), const Offset(788.0, 64.0)); }); - testWidgetsWithLeakTracking('InputDecoration outline shape with no border and no floating placeholder', (WidgetTester tester) async { + testWidgets('InputDecoration outline shape with no border and no floating placeholder', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4247,7 +4246,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 0.0); }); - testWidgetsWithLeakTracking('InputDecoration outline shape with no border and no floating placeholder not empty', (WidgetTester tester) async { + testWidgets('InputDecoration outline shape with no border and no floating placeholder not empty', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4399,7 +4398,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(merged.constraints, overrideTheme.constraints); }); - testWidgetsWithLeakTracking('InputDecorationTheme outline border', (WidgetTester tester) async { + testWidgets('InputDecorationTheme outline border', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4425,7 +4424,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('InputDecorationTheme outline border, dense layout', (WidgetTester tester) async { + testWidgets('InputDecorationTheme outline border, dense layout', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4453,7 +4452,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderWeight(tester), 1.0); }); - testWidgetsWithLeakTracking('InputDecorationTheme style overrides', (WidgetTester tester) async { + testWidgets('InputDecorationTheme style overrides', (WidgetTester tester) async { const TextStyle defaultStyle = TextStyle(fontSize: 16.0); final TextStyle labelStyle = defaultStyle.merge(const TextStyle(color: Colors.red)); final TextStyle hintStyle = defaultStyle.merge(const TextStyle(color: Colors.green)); @@ -4519,7 +4518,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getLabelStyle(tester).color, labelStyle.color); }); - testWidgetsWithLeakTracking('InputDecorationTheme style overrides (focused)', (WidgetTester tester) async { + testWidgets('InputDecorationTheme style overrides (focused)', (WidgetTester tester) async { const TextStyle defaultStyle = TextStyle(fontSize: 16.0); final TextStyle labelStyle = defaultStyle.merge(const TextStyle(color: Colors.red)); final TextStyle floatingLabelStyle = defaultStyle.merge(const TextStyle(color: Colors.indigo)); @@ -4587,7 +4586,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getLabelStyle(tester).color, floatingLabelStyle.color); }); - testWidgetsWithLeakTracking('InputDecorator.toString()', (WidgetTester tester) async { + testWidgets('InputDecorator.toString()', (WidgetTester tester) async { const Widget child = InputDecorator( key: Key('key'), decoration: InputDecoration(), @@ -4601,7 +4600,7 @@ void runAllTests({ required bool useMaterial3 }) { ); }); - testWidgetsWithLeakTracking('InputDecorator.debugDescribeChildren', (WidgetTester tester) async { + testWidgets('InputDecorator.debugDescribeChildren', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -4643,7 +4642,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(nodeValues.length, 11); }); - testWidgetsWithLeakTracking('InputDecorator with empty border and label', (WidgetTester tester) async { + testWidgets('InputDecorator with empty border and label', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/14165 await tester.pumpWidget( buildInputDecorator( @@ -4663,7 +4662,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(tester.getBottomLeft(find.text('label')).dy, 24.0); }); - testWidgetsWithLeakTracking('InputDecorationTheme.inputDecoration', (WidgetTester tester) async { + testWidgets('InputDecorationTheme.inputDecoration', (WidgetTester tester) async { const TextStyle themeStyle = TextStyle(color: Color(0xFF00FFFF)); const Color themeColor = Color(0xFF00FF00); const InputBorder themeInputBorder = OutlineInputBorder( @@ -4840,7 +4839,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(decoration.constraints, const BoxConstraints(minWidth: 40, maxWidth: 50, minHeight: 60, maxHeight: 70)); }); - testWidgetsWithLeakTracking('InputDecorationTheme.inputDecoration with MaterialState', (WidgetTester tester) async { + testWidgets('InputDecorationTheme.inputDecoration with MaterialState', (WidgetTester tester) async { final MaterialStateTextStyle themeStyle = MaterialStateTextStyle.resolveWith((Set<MaterialState> states) { return const TextStyle(color: Colors.green); }); @@ -4944,7 +4943,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(decoration.constraints, const BoxConstraints(minWidth: 10, maxWidth: 20, minHeight: 30, maxHeight: 40)); }); - testWidgetsWithLeakTracking('InputDecorator OutlineInputBorder fillColor is clipped by border', (WidgetTester tester) async { + testWidgets('InputDecorator OutlineInputBorder fillColor is clipped by border', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/15742 await tester.pumpWidget( @@ -4985,7 +4984,7 @@ void runAllTests({ required bool useMaterial3 }) { )); }); - testWidgetsWithLeakTracking('InputDecorator UnderlineInputBorder fillColor is clipped by border', (WidgetTester tester) async { + testWidgets('InputDecorator UnderlineInputBorder fillColor is clipped by border', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -5019,7 +5018,7 @@ void runAllTests({ required bool useMaterial3 }) { )); }); - testWidgetsWithLeakTracking('InputDecorator constrained to 0x0', (WidgetTester tester) async { + testWidgets('InputDecorator constrained to 0x0', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17710 await tester.pumpWidget( Material( @@ -5039,7 +5038,7 @@ void runAllTests({ required bool useMaterial3 }) { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'InputDecorator OutlineBorder focused label with icon', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/82321 @@ -5087,7 +5086,7 @@ void runAllTests({ required bool useMaterial3 }) { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'InputDecorator OutlineBorder focused label with icon', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/18111 @@ -5133,7 +5132,7 @@ void runAllTests({ required bool useMaterial3 }) { }, ); - testWidgetsWithLeakTracking('InputDecorator draws and animates hoverColor', (WidgetTester tester) async { + testWidgets('InputDecorator draws and animates hoverColor', (WidgetTester tester) async { final Color fillColor = useMaterial3 ? const Color(0xffffffff) : const Color(0x0A000000); const Color hoverColor = Color(0xFF00FF00); final Color disabledColor =useMaterial3 ? const Color(0x0A000000) : const Color(0x05000000); @@ -5214,7 +5213,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderColor(tester), equals(disabledColor)); }); - testWidgetsWithLeakTracking('InputDecorator draws and animates focusColor', (WidgetTester tester) async { + testWidgets('InputDecorator draws and animates focusColor', (WidgetTester tester) async { const Color focusColor = Color(0xFF0000FF); const Color disabledColor = Color(0x05000000); final Color enabledBorderColor = useMaterial3 ? const Color(0xffffffff) : const Color(0x61000000); @@ -5268,7 +5267,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderColor(tester), equals(disabledColor)); }); - testWidgetsWithLeakTracking('InputDecorator withdraws label when not empty or focused', (WidgetTester tester) async { + testWidgets('InputDecorator withdraws label when not empty or focused', (WidgetTester tester) async { Future<void> pumpDecorator({ required bool focused, bool enabled = true, @@ -5336,7 +5335,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getLabelRect(tester).size, equals(labelSize * 0.75)); }); - testWidgetsWithLeakTracking('InputDecorationTheme.toString()', (WidgetTester tester) async { + testWidgets('InputDecorationTheme.toString()', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/19305 expect( const InputDecorationTheme( @@ -5388,7 +5387,7 @@ void runAllTests({ required bool useMaterial3 }) { }); - testWidgetsWithLeakTracking('InputDecoration default border uses colorScheme', (WidgetTester tester) async { + testWidgets('InputDecoration default border uses colorScheme', (WidgetTester tester) async { final ThemeData theme = ThemeData.from(colorScheme: const ColorScheme.light()); final Color enabledColor = useMaterial3 ? theme.colorScheme.onSurfaceVariant : theme.colorScheme.onSurface.withOpacity(0.38); final Color disabledColor = useMaterial3 ? theme.colorScheme.onSurface.withOpacity(0.12) : theme.disabledColor; @@ -5480,7 +5479,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorderColor(tester), useMaterial3 ? theme.colorScheme.onSurface.withOpacity(0.38) : Colors.transparent); }); - testWidgetsWithLeakTracking('InputDecoration borders', (WidgetTester tester) async { + testWidgets('InputDecoration borders', (WidgetTester tester) async { const InputBorder errorBorder = OutlineInputBorder( borderSide: BorderSide(color: Colors.red, width: 1.5), ); @@ -5622,7 +5621,7 @@ void runAllTests({ required bool useMaterial3 }) { expect(getBorder(tester), disabledBorder); }); - testWidgetsWithLeakTracking('OutlineInputBorder borders scale down to fit when large values are passed in', (WidgetTester tester) async { + testWidgets('OutlineInputBorder borders scale down to fit when large values are passed in', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/34327 const double largerBorderRadius = 200.0; const double smallerBorderRadius = 100.0; @@ -5727,7 +5726,7 @@ void runAllTests({ required bool useMaterial3 }) { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/55317 - testWidgetsWithLeakTracking('rounded OutlineInputBorder with zero padding just wraps the label', (WidgetTester tester) async { + testWidgets('rounded OutlineInputBorder with zero padding just wraps the label', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/82321 const double borderRadius = 30.0; const String labelText = 'label text'; @@ -5820,7 +5819,7 @@ void runAllTests({ required bool useMaterial3 }) { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/55317 -testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should draw a rectangular border', (WidgetTester tester) async { +testWidgets('OutlineInputBorder with BorderRadius.zero should draw a rectangular border', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/78855 const String labelText = 'Flutter'; @@ -5884,7 +5883,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/55317 - testWidgetsWithLeakTracking('OutlineInputBorder radius carries over when lerping', (WidgetTester tester) async { + testWidgets('OutlineInputBorder radius carries over when lerping', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/23982 const Key key = Key('textField'); @@ -5922,7 +5921,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(getBorderRadius(tester), BorderRadius.zero); }); - testWidgetsWithLeakTracking('OutlineInputBorder async lerp', (WidgetTester tester) async { + testWidgets('OutlineInputBorder async lerp', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28724 final Completer<void> completer = Completer<void>(); @@ -6054,7 +6053,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr ).hashCode)); }); - testWidgetsWithLeakTracking('InputDecorationTheme implements debugFillDescription', (WidgetTester tester) async { + testWidgets('InputDecorationTheme implements debugFillDescription', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const InputDecorationTheme( labelStyle: TextStyle(), @@ -6105,7 +6104,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr ]); }); - testWidgetsWithLeakTracking('uses alphabetic baseline for CJK layout', (WidgetTester tester) async { + testWidgets('uses alphabetic baseline for CJK layout', (WidgetTester tester) async { await tester.binding.setLocale('zh', 'CN'); final Typography typography = Typography.material2018(); @@ -6151,7 +6150,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.getBottomLeft(find.text('hint')).dy, isBrowser ? 45.75 : 47.75); }); - testWidgetsWithLeakTracking('InputDecorator floating label Y coordinate', (WidgetTester tester) async { + testWidgets('InputDecorator floating label Y coordinate', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/54028 await tester.pumpWidget( buildInputDecorator( @@ -6174,7 +6173,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.getTopLeft(find.text('label')).dy, -4.0); }); - testWidgetsWithLeakTracking('InputDecorator floating label obeys floatingLabelBehavior', (WidgetTester tester) async { + testWidgets('InputDecorator floating label obeys floatingLabelBehavior', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -6191,7 +6190,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.getTopLeft(find.text('label')).dy, 20.0); }); - testWidgetsWithLeakTracking('InputDecorator hint is displayed when floatingLabelBehavior is always', (WidgetTester tester) async { + testWidgets('InputDecorator hint is displayed when floatingLabelBehavior is always', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( useMaterial3: useMaterial3, @@ -6209,7 +6208,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(getOpacity(tester, 'hint'), 1.0); }); - testWidgetsWithLeakTracking('InputDecorator floating label width scales when focused', (WidgetTester tester) async { + testWidgets('InputDecorator floating label width scales when focused', (WidgetTester tester) async { final String longStringA = String.fromCharCodes(List<int>.generate(200, (_) => 65)); final String longStringB = String.fromCharCodes(List<int>.generate(200, (_) => 66)); @@ -6270,7 +6269,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr ); }, skip: isBrowser); // TODO(yjbanov): https://github.com/flutter/flutter/issues/44020 - testWidgetsWithLeakTracking('textAlignVertical can be updated', (WidgetTester tester) async { + testWidgets('textAlignVertical can be updated', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/56933 const String hintText = 'hint'; TextAlignVertical? alignment = TextAlignVertical.top; @@ -6310,7 +6309,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.getTopLeft(find.text(hintText)).dy, topPosition); }); - testWidgetsWithLeakTracking("InputDecorator label width isn't affected by prefix or suffix", (WidgetTester tester) async { + testWidgets("InputDecorator label width isn't affected by prefix or suffix", (WidgetTester tester) async { const String labelText = 'My Label'; const String prefixText = 'The five boxing wizards jump quickly.'; const String suffixText = 'Suffix'; @@ -6371,7 +6370,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr }); // Related issue: https://github.com/flutter/flutter/issues/64427 - testWidgetsWithLeakTracking('OutlineInputBorder and InputDecorator long labels and in Floating, the width should ignore the icon width', (WidgetTester tester) async { + testWidgets('OutlineInputBorder and InputDecorator long labels and in Floating, the width should ignore the icon width', (WidgetTester tester) async { const String labelText = 'Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.'; Widget getLabeledInputDecorator(FloatingLabelBehavior floatingLabelBehavior) => MaterialApp( @@ -6422,7 +6421,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(getLabelRect(tester).width, floatedLabelWidth); }); - testWidgetsWithLeakTracking('given enough space, constrained and unconstrained heights result in the same size widget', (WidgetTester tester) async { + testWidgets('given enough space, constrained and unconstrained heights result in the same size widget', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/65572 final UniqueKey keyUnconstrained = UniqueKey(); final UniqueKey keyConstrained = UniqueKey(); @@ -6473,7 +6472,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(constrainedHeightCompact, equals(unConstrainedHeightCompact)); }); - testWidgetsWithLeakTracking('A vertically constrained TextField still positions its text inside of itself', (WidgetTester tester) async { + testWidgets('A vertically constrained TextField still positions its text inside of itself', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'A'); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -6500,7 +6499,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(textTop, lessThan(textFieldBottom)); }); - testWidgetsWithLeakTracking('visual density is included in the intrinsic height calculation', (WidgetTester tester) async { + testWidgets('visual density is included in the intrinsic height calculation', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); final UniqueKey intrinsicHeightKey = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -6540,7 +6539,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(intrinsicHeight, equals(height)); }); - testWidgetsWithLeakTracking('error message for negative baseline', (WidgetTester tester) async { + testWidgets('error message for negative baseline', (WidgetTester tester) async { FlutterErrorDetails? errorDetails; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails details) { @@ -6578,7 +6577,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(errorDetails?.toString(), contains('RenderStack')); }); - testWidgetsWithLeakTracking('min intrinsic height for TextField with no content padding', (WidgetTester tester) async { + testWidgets('min intrinsic height for TextField with no content padding', (WidgetTester tester) async { // Regression test for: https://github.com/flutter/flutter/issues/75509 await tester.pumpWidget(const MaterialApp( home: Material( @@ -6603,7 +6602,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('min intrinsic height for TextField with prefix icon', (WidgetTester tester) async { + testWidgets('min intrinsic height for TextField with prefix icon', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input'); addTearDown(controller.dispose); @@ -6634,7 +6633,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('min intrinsic height for TextField with suffix icon', (WidgetTester tester) async { + testWidgets('min intrinsic height for TextField with suffix icon', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input'); addTearDown(controller.dispose); @@ -6665,7 +6664,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('min intrinsic height for TextField with prefix', (WidgetTester tester) async { + testWidgets('min intrinsic height for TextField with prefix', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input'); addTearDown(controller.dispose); @@ -6696,7 +6695,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('min intrinsic height for TextField with suffix', (WidgetTester tester) async { + testWidgets('min intrinsic height for TextField with suffix', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input'); addTearDown(controller.dispose); @@ -6727,7 +6726,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('min intrinsic height for TextField with icon', (WidgetTester tester) async { + testWidgets('min intrinsic height for TextField with icon', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input'); addTearDown(controller.dispose); @@ -6758,7 +6757,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('InputDecorationTheme floatingLabelStyle overrides label widget styles when the widget is a text widget (focused)', (WidgetTester tester) async { + testWidgets('InputDecorationTheme floatingLabelStyle overrides label widget styles when the widget is a text widget (focused)', (WidgetTester tester) async { const TextStyle style16 = TextStyle(fontSize: 16.0); final TextStyle floatingLabelStyle = style16.merge(const TextStyle(color: Colors.indigo)); @@ -6800,7 +6799,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(getLabelStyle(tester).color, floatingLabelStyle.color); }); - testWidgetsWithLeakTracking('InputDecorationTheme labelStyle overrides label widget styles when the widget is a text widget', (WidgetTester tester) async { + testWidgets('InputDecorationTheme labelStyle overrides label widget styles when the widget is a text widget', (WidgetTester tester) async { const TextStyle styleDefaultSize = TextStyle(fontSize: 16.0); final TextStyle labelStyle = styleDefaultSize.merge(const TextStyle(color: Colors.purple)); @@ -6841,7 +6840,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(getLabelStyle(tester).color, labelStyle.color); }); - testWidgetsWithLeakTracking('hint style overflow works', (WidgetTester tester) async { + testWidgets('hint style overflow works', (WidgetTester tester) async { final String hintText = 'hint text' * 20; const TextStyle hintStyle = TextStyle( fontSize: 14.0, @@ -6867,7 +6866,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(hintTextWidget.style!.overflow, decoration.hintStyle!.overflow); }); - testWidgetsWithLeakTracking('prefixIcon in RTL with asymmetric padding', (WidgetTester tester) async { + testWidgets('prefixIcon in RTL with asymmetric padding', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/129591 const InputDecoration decoration = InputDecoration( contentPadding: EdgeInsetsDirectional.only(end: 24), @@ -6897,7 +6896,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr expect(decoratorRight, lessThanOrEqualTo(prefixRight)); }); - testWidgetsWithLeakTracking('instrinic width with prefixIcon/suffixIcon', (WidgetTester tester) async { + testWidgets('instrinic width with prefixIcon/suffixIcon', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/137937 for (final TextDirection direction in TextDirection.values) { Future<Size> measureText(InputDecoration decoration) async { @@ -6939,7 +6938,7 @@ testWidgetsWithLeakTracking('OutlineInputBorder with BorderRadius.zero should dr } }); - testWidgetsWithLeakTracking('InputDecorator with counter does not crash when given a 0 size', (WidgetTester tester) async { + testWidgets('InputDecorator with counter does not crash when given a 0 size', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/129611 const InputDecoration decoration = InputDecoration( contentPadding: EdgeInsetsDirectional.all(99), diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index 8e491d7193b..b10cee66659 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -51,7 +50,7 @@ class TestTextState extends State<TestText> { } void main() { - testWidgetsWithLeakTracking('ListTile geometry (LTR)', (WidgetTester tester) async { + testWidgets('ListTile geometry (LTR)', (WidgetTester tester) async { // See https://material.io/go/design-lists final Key leadingKey = GlobalKey(); @@ -175,7 +174,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ListTile geometry (RTL)', (WidgetTester tester) async { + testWidgets('ListTile geometry (RTL)', (WidgetTester tester) async { const double leftPadding = 10.0; const double rightPadding = 20.0; await tester.pumpWidget(MaterialApp( @@ -211,7 +210,7 @@ void main() { testHorizontalGeometry(); }); - testWidgetsWithLeakTracking('ListTile.divideTiles', (WidgetTester tester) async { + testWidgets('ListTile.divideTiles', (WidgetTester tester) async { final List<String> titles = <String>[ 'first', 'second', 'third' ]; await tester.pumpWidget(MaterialApp( @@ -234,17 +233,17 @@ void main() { expect(find.text('third'), findsOneWidget); }); - testWidgetsWithLeakTracking('ListTile.divideTiles with empty list', (WidgetTester tester) async { + testWidgets('ListTile.divideTiles with empty list', (WidgetTester tester) async { final Iterable<Widget> output = ListTile.divideTiles(tiles: <Widget>[], color: Colors.grey); expect(output, isEmpty); }); - testWidgetsWithLeakTracking('ListTile.divideTiles with single item list', (WidgetTester tester) async { + testWidgets('ListTile.divideTiles with single item list', (WidgetTester tester) async { final Iterable<Widget> output = ListTile.divideTiles(tiles: const <Widget>[SizedBox()], color: Colors.grey); expect(output.single, isA<SizedBox>()); }); - testWidgetsWithLeakTracking('ListTile.divideTiles only runs the generator once', (WidgetTester tester) async { + testWidgets('ListTile.divideTiles only runs the generator once', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/78879 int callCount = 0; Iterable<Widget> generator() sync* { @@ -258,7 +257,7 @@ void main() { expect(callCount, 1); }); - testWidgetsWithLeakTracking('ListTile semantics', (WidgetTester tester) async { + testWidgets('ListTile semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -337,7 +336,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ListTile contentPadding', (WidgetTester tester) async { + testWidgets('ListTile contentPadding', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MediaQuery( data: const MediaQueryData(), @@ -379,7 +378,7 @@ void main() { expect(right('L'), 790.0); // 800 - contentPadding.start }); - testWidgetsWithLeakTracking('ListTile wide leading Widget', (WidgetTester tester) async { + testWidgets('ListTile wide leading Widget', (WidgetTester tester) async { const Key leadingKey = ValueKey<String>('L'); Widget buildFrame(double leadingWidth, TextDirection textDirection) { @@ -445,7 +444,7 @@ void main() { expect(right('subtitle'), 800.0 - 72.0); }); - testWidgetsWithLeakTracking('ListTile leading and trailing positions', (WidgetTester tester) async { + testWidgets('ListTile leading and trailing positions', (WidgetTester tester) async { // This test is based on the redlines at // https://material.io/design/components/lists.html#specs @@ -586,7 +585,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder).at(3)), const Rect.fromLTWH(800.0 - 24.0 - 24.0, 328.0 + 16.0, 24.0, 24.0)); }); - testWidgetsWithLeakTracking('ListTile leading icon height does not exceed ListTile height', (WidgetTester tester) async { + testWidgets('ListTile leading icon height does not exceed ListTile height', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/28765 const SizedBox oversizedWidget = SizedBox(height: 80.0, width: 24.0, child: Placeholder()); @@ -669,7 +668,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder).at(1)), const Rect.fromLTWH(16.0, 88.0 + 8.0, 24.0, 56.0)); }); - testWidgetsWithLeakTracking('ListTile trailing icon height does not exceed ListTile height', (WidgetTester tester) async { + testWidgets('ListTile trailing icon height does not exceed ListTile height', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/28765 const SizedBox oversizedWidget = SizedBox(height: 80.0, width: 24.0, child: Placeholder()); @@ -758,7 +757,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder).at(1)), const Rect.fromLTWH(800.0 - 24.0 - 24.0, 88.0 + 8.0, 24.0, 56.0)); }); - testWidgetsWithLeakTracking('ListTile only accepts focus when enabled', (WidgetTester tester) async { + testWidgets('ListTile only accepts focus when enabled', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( @@ -805,7 +804,7 @@ void main() { expect(Focus.of(childKey.currentContext!).hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('ListTile can autofocus unless disabled.', (WidgetTester tester) async { + testWidgets('ListTile can autofocus unless disabled.', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( @@ -850,7 +849,7 @@ void main() { expect(Focus.of(childKey.currentContext!).hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('ListTile is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('ListTile is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'ListTile'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; Widget buildApp({bool enabled = true}) { @@ -909,7 +908,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('ListTile can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('ListTile can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; Widget buildApp({bool enabled = true}) { return MaterialApp( @@ -992,7 +991,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListTile can be splashed and has correct splash color', (WidgetTester tester) async { + testWidgets('ListTile can be splashed and has correct splash color', (WidgetTester tester) async { final Widget buildApp = MaterialApp( theme: ThemeData(useMaterial3: false), home: Material( @@ -1017,7 +1016,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('ListTile can be triggered by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('ListTile can be triggered by keyboard shortcuts', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Key tileKey = Key('ListTile'); bool tapped = false; @@ -1056,7 +1055,7 @@ void main() { expect(tapped, isTrue); }); - testWidgetsWithLeakTracking('ListTile responds to density changes.', (WidgetTester tester) async { + testWidgets('ListTile responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(VisualDensity visualDensity) async { return tester.pumpWidget( @@ -1093,7 +1092,7 @@ void main() { expect(box.size, equals(const Size(800, 44))); }); - testWidgetsWithLeakTracking('ListTile shape is painted correctly', (WidgetTester tester) async { + testWidgets('ListTile shape is painted correctly', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/63877 const ShapeBorder rectShape = RoundedRectangleBorder(); const ShapeBorder stadiumShape = StadiumBorder(); @@ -1133,7 +1132,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListTile changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('ListTile changes mouse cursor when hovered', (WidgetTester tester) async { // Test ListTile() constructor await tester.pumpWidget( MaterialApp( @@ -1211,7 +1210,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('ListTile onFocusChange callback', (WidgetTester tester) async { + testWidgets('ListTile onFocusChange callback', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'ListTile Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -1241,7 +1240,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('ListTile respects tileColor & selectedTileColor', (WidgetTester tester) async { + testWidgets('ListTile respects tileColor & selectedTileColor', (WidgetTester tester) async { bool isSelected = false; final Color tileColor = Colors.green.shade500; final Color selectedTileColor = Colors.red.shade500; @@ -1279,7 +1278,7 @@ void main() { expect(find.byType(Material), paints..rect(color: selectedTileColor)); }); - testWidgetsWithLeakTracking('ListTile shows Material ripple effects on top of tileColor', (WidgetTester tester) async { + testWidgets('ListTile shows Material ripple effects on top of tileColor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/73616 final Color tileColor = Colors.red.shade500; @@ -1314,7 +1313,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListTile default tile color', (WidgetTester tester) async { + testWidgets('ListTile default tile color', (WidgetTester tester) async { bool isSelected = false; final ThemeData theme = ThemeData(useMaterial3: true); const Color defaultColor = Colors.transparent; @@ -1349,7 +1348,7 @@ void main() { expect(find.byType(Material), paints..rect(color: defaultColor)); }); - testWidgetsWithLeakTracking('Default tile color when ListTile is wrapped with an elevated widget', (WidgetTester tester) async { + testWidgets('Default tile color when ListTile is wrapped with an elevated widget', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117700 bool isSelected = false; final ThemeData theme = ThemeData(useMaterial3: true); @@ -1402,7 +1401,7 @@ void main() { expect(find.byType(Material), paints..rect(color: defaultColor)); }); - testWidgetsWithLeakTracking('ListTile layout at zero size', (WidgetTester tester) async { + testWidgets('ListTile layout at zero size', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66636 const Key key = Key('key'); @@ -1433,7 +1432,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('ListTile with disabled feedback', (WidgetTester tester) async { + testWidgets('ListTile with disabled feedback', (WidgetTester tester) async { const bool enableFeedback = false; await tester.pumpWidget( @@ -1454,7 +1453,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('ListTile with enabled feedback', (WidgetTester tester) async { + testWidgets('ListTile with enabled feedback', (WidgetTester tester) async { const bool enableFeedback = true; await tester.pumpWidget( @@ -1475,7 +1474,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('ListTile with enabled feedback by default', (WidgetTester tester) async { + testWidgets('ListTile with enabled feedback by default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( @@ -1494,7 +1493,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('ListTile with disabled feedback using ListTileTheme', (WidgetTester tester) async { + testWidgets('ListTile with disabled feedback using ListTileTheme', (WidgetTester tester) async { const bool enableFeedbackTheme = false; await tester.pumpWidget( @@ -1517,7 +1516,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('ListTile.enableFeedback overrides ListTileTheme.enableFeedback', (WidgetTester tester) async { + testWidgets('ListTile.enableFeedback overrides ListTileTheme.enableFeedback', (WidgetTester tester) async { const bool enableFeedbackTheme = false; const bool enableFeedback = true; @@ -1542,7 +1541,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('ListTile.mouseCursor overrides ListTileTheme.mouseCursor', (WidgetTester tester) async { + testWidgets('ListTile.mouseCursor overrides ListTileTheme.mouseCursor', (WidgetTester tester) async { final Key tileKey = UniqueKey(); await tester.pumpWidget( @@ -1570,7 +1569,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ListTile horizontalTitleGap = 0.0', (WidgetTester tester) async { + testWidgets('ListTile horizontalTitleGap = 0.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeHorizontalTitleGap, double? widgetHorizontalTitleGap }) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1622,7 +1621,7 @@ void main() { expect(right('title'), 760.0); }); - testWidgetsWithLeakTracking('ListTile horizontalTitleGap = (default) && ListTile minLeadingWidth = (default)', (WidgetTester tester) async { + testWidgets('ListTile horizontalTitleGap = (default) && ListTile minLeadingWidth = (default)', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1658,7 +1657,7 @@ void main() { expect(right('title'), 744.0); }); - testWidgetsWithLeakTracking('ListTile horizontalTitleGap with visualDensity', (WidgetTester tester) async { + testWidgets('ListTile horizontalTitleGap with visualDensity', (WidgetTester tester) async { Widget buildFrame({ double? horizontalTitleGap, VisualDensity? visualDensity, @@ -1703,7 +1702,7 @@ void main() { expect(left('title'), 42.0); }); - testWidgetsWithLeakTracking('ListTile minVerticalPadding = 80.0', (WidgetTester tester) async { + testWidgets('ListTile minVerticalPadding = 80.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeMinVerticalPadding, double? widgetMinVerticalPadding }) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1749,7 +1748,7 @@ void main() { expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 184.0)); }); - testWidgetsWithLeakTracking('ListTile minLeadingWidth = 60.0', (WidgetTester tester) async { + testWidgets('ListTile minLeadingWidth = 60.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeMinLeadingWidth, double? widgetMinLeadingWidth }) { return MediaQuery( data: const MediaQueryData(), @@ -1804,7 +1803,7 @@ void main() { expect(right('title'), 708.0); }); - testWidgetsWithLeakTracking('colors are applied to leading and trailing text widgets', (WidgetTester tester) async { + testWidgets('colors are applied to leading and trailing text widgets', (WidgetTester tester) async { final Key leadingKey = UniqueKey(); final Key trailingKey = UniqueKey(); @@ -1856,7 +1855,7 @@ void main() { expect(textColor(trailingKey), theme.disabledColor); }); - testWidgetsWithLeakTracking('selected, enabled ListTile default icon color', (WidgetTester tester) async { + testWidgets('selected, enabled ListTile default icon color', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colorScheme = theme.colorScheme; final Key leadingKey = UniqueKey(); @@ -1896,7 +1895,7 @@ void main() { expect(iconColor(trailingKey), colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('ListTile font size', (WidgetTester tester) async { + testWidgets('ListTile font size', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1929,7 +1928,7 @@ void main() { expect(trailing.text.style!.fontSize, 11.0); }); - testWidgetsWithLeakTracking('ListTile text color', (WidgetTester tester) async { + testWidgets('ListTile text color', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1964,7 +1963,7 @@ void main() { expect(trailing.text.style!.color, theme.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('Default ListTile debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ListTile debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ListTile().debugFillProperties(builder); @@ -1976,7 +1975,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ListTile implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ListTile implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ListTile( leading: Text('leading'), @@ -2049,7 +2048,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListTile.textColor respects MaterialStateColor', (WidgetTester tester) async { + testWidgets('ListTile.textColor respects MaterialStateColor', (WidgetTester tester) async { bool enabled = false; bool selected = false; const Color defaultColor = Colors.blue; @@ -2105,7 +2104,7 @@ void main() { expect(title.text.style!.color, selectedColor); }); - testWidgetsWithLeakTracking('ListTile.iconColor respects MaterialStateColor', (WidgetTester tester) async { + testWidgets('ListTile.iconColor respects MaterialStateColor', (WidgetTester tester) async { bool enabled = false; bool selected = false; const Color defaultColor = Colors.blue; @@ -2160,7 +2159,7 @@ void main() { expect(iconColor(leadingKey), selectedColor); }); - testWidgetsWithLeakTracking('ListTile.iconColor respects iconColor property with icon buttons Material 3 in presence of IconButtonTheme override', (WidgetTester tester) async { + testWidgets('ListTile.iconColor respects iconColor property with icon buttons Material 3 in presence of IconButtonTheme override', (WidgetTester tester) async { const Color iconButtonThemeColor = Colors.blue; const Color listTileIconColor = Colors.green; const Icon leadingIcon = Icon(Icons.favorite); @@ -2204,7 +2203,7 @@ void main() { expect(getIconStyle(tester, trailingIcon.icon!)?.color, listTileIconColor); }); - testWidgetsWithLeakTracking('ListTile.dense does not throw assertion', (WidgetTester tester) async { + testWidgets('ListTile.dense does not throw assertion', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/pull/116908 Widget buildFrame({required bool useMaterial3}) { @@ -2232,7 +2231,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('titleAlignment position with title widget', (WidgetTester tester) async { + testWidgets('titleAlignment position with title widget', (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const double leadingHeight = 24.0; @@ -2331,7 +2330,7 @@ void main() { expect(trailingOffset.dy - tileOffset.dy, bottomPosition); }); - testWidgetsWithLeakTracking('titleAlignment position with title and subtitle widgets', (WidgetTester tester) async { + testWidgets('titleAlignment position with title and subtitle widgets', (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const double leadingHeight = 24.0; @@ -2431,7 +2430,7 @@ void main() { expect(trailingOffset.dy - tileOffset.dy, bottomPosition); }); - testWidgetsWithLeakTracking("ListTile.isThreeLine updates ListTileTitleAlignment.threeLine's alignment", (WidgetTester tester) async { + testWidgets("ListTile.isThreeLine updates ListTileTitleAlignment.threeLine's alignment", (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const double leadingHeight = 24.0; @@ -2491,7 +2490,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('ListTile geometry (LTR)', (WidgetTester tester) async { + testWidgets('ListTile geometry (LTR)', (WidgetTester tester) async { // See https://material.io/go/design-lists final Key leadingKey = GlobalKey(); @@ -2639,7 +2638,7 @@ void main() { testVerticalGeometry(128.0); }); - testWidgetsWithLeakTracking('ListTile geometry (RTL)', (WidgetTester tester) async { + testWidgets('ListTile geometry (RTL)', (WidgetTester tester) async { const double leftPadding = 10.0; const double rightPadding = 20.0; await tester.pumpWidget(MaterialApp( @@ -2675,7 +2674,7 @@ void main() { testHorizontalGeometry(); }); - testWidgetsWithLeakTracking('ListTile leading and trailing positions', (WidgetTester tester) async { + testWidgets('ListTile leading and trailing positions', (WidgetTester tester) async { // This test is based on the redlines at // https://material.io/design/components/lists.html#specs @@ -2910,7 +2909,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder).at(3)), const Rect.fromLTWH(800.0 - 24.0 - 16.0, 216.0 + 16.0, 24.0, 24.0)); }); - testWidgetsWithLeakTracking('ListTile leading icon height does not exceed ListTile height', (WidgetTester tester) async { + testWidgets('ListTile leading icon height does not exceed ListTile height', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/28765 const SizedBox oversizedWidget = SizedBox(height: 80.0, width: 24.0, child: Placeholder()); @@ -3083,7 +3082,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder).at(1)), const Rect.fromLTWH(16.0, 88.0 + 16.0, 24.0, 56.0)); }); - testWidgetsWithLeakTracking('ListTile trailing icon height does not exceed ListTile height', (WidgetTester tester) async { + testWidgets('ListTile trailing icon height does not exceed ListTile height', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/28765 const SizedBox oversizedWidget = SizedBox(height: 80.0, width: 24.0, child: Placeholder()); @@ -3256,7 +3255,7 @@ void main() { expect(tester.getRect(find.byType(Placeholder).at(1)), const Rect.fromLTWH(800.0 - 16.0 - 24.0, 88.0 + 16.0, 24.0, 56.0)); }); - testWidgetsWithLeakTracking('ListTile wide leading Widget', (WidgetTester tester) async { + testWidgets('ListTile wide leading Widget', (WidgetTester tester) async { const Key leadingKey = ValueKey<String>('L'); Widget buildFrame(double leadingWidth, TextDirection textDirection) { @@ -3321,7 +3320,7 @@ void main() { expect(right('subtitle'), 800.0 - 72.0); }); - testWidgetsWithLeakTracking('ListTile horizontalTitleGap = 0.0', (WidgetTester tester) async { + testWidgets('ListTile horizontalTitleGap = 0.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeHorizontalTitleGap, double? widgetHorizontalTitleGap }) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -3373,7 +3372,7 @@ void main() { expect(right('title'), 744.0); }); - testWidgetsWithLeakTracking('ListTile horizontalTitleGap = (default) && ListTile minLeadingWidth = (default)', (WidgetTester tester) async { + testWidgets('ListTile horizontalTitleGap = (default) && ListTile minLeadingWidth = (default)', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -3409,7 +3408,7 @@ void main() { expect(right('title'), 728.0); }); - testWidgetsWithLeakTracking('ListTile horizontalTitleGap with visualDensity', (WidgetTester tester) async { + testWidgets('ListTile horizontalTitleGap with visualDensity', (WidgetTester tester) async { Widget buildFrame({ double? horizontalTitleGap, VisualDensity? visualDensity, @@ -3454,7 +3453,7 @@ void main() { expect(left('title'), 58.0); }); - testWidgetsWithLeakTracking('ListTile minVerticalPadding = 80.0', (WidgetTester tester) async { + testWidgets('ListTile minVerticalPadding = 80.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeMinVerticalPadding, double? widgetMinVerticalPadding }) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -3500,7 +3499,7 @@ void main() { expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 176.0)); }); - testWidgetsWithLeakTracking('ListTile font size', (WidgetTester tester) async { + testWidgets('ListTile font size', (WidgetTester tester) async { Widget buildFrame({ bool dense = false, bool enabled = true, @@ -3578,7 +3577,7 @@ void main() { expect(trailing.text.style!.fontSize, 14.0); }); - testWidgetsWithLeakTracking('ListTile text color', (WidgetTester tester) async { + testWidgets('ListTile text color', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); Widget buildFrame({ bool dense = false, @@ -3633,7 +3632,7 @@ void main() { expect(trailing.text.style!.color, theme.textTheme.bodyMedium!.color); }); - testWidgetsWithLeakTracking('selected, enabled ListTile default icon color, light and dark themes', (WidgetTester tester) async { + testWidgets('selected, enabled ListTile default icon color, light and dark themes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/77004 const ColorScheme lightColorScheme = ColorScheme.light(); @@ -3693,7 +3692,7 @@ void main() { expect(iconColor(trailingKey), Colors.white); }); - testWidgetsWithLeakTracking('ListTile default tile color', (WidgetTester tester) async { + testWidgets('ListTile default tile color', (WidgetTester tester) async { bool isSelected = false; const Color defaultColor = Colors.transparent; @@ -3727,7 +3726,7 @@ void main() { expect(find.byType(Material), paints..rect(color: defaultColor)); }); - testWidgetsWithLeakTracking('titleAlignment position with title widget', (WidgetTester tester) async { + testWidgets('titleAlignment position with title widget', (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const double leadingHeight = 24.0; @@ -3826,7 +3825,7 @@ void main() { expect(trailingOffset.dy - tileOffset.dy, bottomPosition); }); - testWidgetsWithLeakTracking('titleAlignment position with title and subtitle widgets', (WidgetTester tester) async { + testWidgets('titleAlignment position with title and subtitle widgets', (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const double leadingHeight = 24.0; @@ -3926,7 +3925,7 @@ void main() { expect(trailingOffset.dy - tileOffset.dy, bottomPosition); }); - testWidgetsWithLeakTracking("ListTile.isThreeLine updates ListTileTitleAlignment.threeLine's alignment", (WidgetTester tester) async { + testWidgets("ListTile.isThreeLine updates ListTileTitleAlignment.threeLine's alignment", (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const double leadingHeight = 24.0; diff --git a/packages/flutter/test/material/list_tile_theme_test.dart b/packages/flutter/test/material/list_tile_theme_test.dart index 4be26d698df..dac2f3ff620 100644 --- a/packages/flutter/test/material/list_tile_theme_test.dart +++ b/packages/flutter/test/material/list_tile_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestIcon extends StatefulWidget { const TestIcon({ super.key }); @@ -79,7 +78,7 @@ void main() { expect(themeData.titleAlignment, null); }); - testWidgetsWithLeakTracking('Default ListTileThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ListTileThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ListTileThemeData().debugFillProperties(builder); @@ -91,7 +90,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ListTileThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ListTileThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ListTileThemeData( dense: true, @@ -146,7 +145,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListTileTheme backwards compatibility constructor', (WidgetTester tester) async { + testWidgets('ListTileTheme backwards compatibility constructor', (WidgetTester tester) async { late ListTileThemeData theme; await tester.pumpWidget( @@ -196,7 +195,7 @@ void main() { expect(theme.mouseCursor, MaterialStateMouseCursor.clickable); }); - testWidgetsWithLeakTracking('ListTileTheme', (WidgetTester tester) async { + testWidgets('ListTileTheme', (WidgetTester tester) async { final Key listTileKey = UniqueKey(); final Key titleKey = UniqueKey(); final Key subtitleKey = UniqueKey(); @@ -332,7 +331,7 @@ void main() { expect(trailingOffset.dy - titleOffset.dy, 6); }); - testWidgetsWithLeakTracking('ListTileTheme colors are applied to leading and trailing text widgets', (WidgetTester tester) async { + testWidgets('ListTileTheme colors are applied to leading and trailing text widgets', (WidgetTester tester) async { final Key leadingKey = UniqueKey(); final Key trailingKey = UniqueKey(); @@ -392,7 +391,7 @@ void main() { expect(textColor(trailingKey), theme.disabledColor); }); - testWidgetsWithLeakTracking( + testWidgets( "Material3 - ListTile respects ListTileTheme's titleTextStyle, subtitleTextStyle & leadingAndTrailingTextStyle", (WidgetTester tester) async { const TextStyle titleTextStyle = TextStyle( @@ -459,7 +458,7 @@ void main() { expect(trailing.text.style!.fontStyle, leadingAndTrailingTextStyle.fontStyle); }); - testWidgetsWithLeakTracking( + testWidgets( "Material2 - ListTile respects ListTileTheme's titleTextStyle, subtitleTextStyle & leadingAndTrailingTextStyle", (WidgetTester tester) async { const TextStyle titleTextStyle = TextStyle( @@ -526,7 +525,7 @@ void main() { expect(trailing.text.style!.fontStyle, leadingAndTrailingTextStyle.fontStyle); }); - testWidgetsWithLeakTracking( + testWidgets( "Material3 - ListTile's titleTextStyle, subtitleTextStyle & leadingAndTrailingTextStyle are overridden by ListTile properties", (WidgetTester tester) async { final ThemeData theme = ThemeData( @@ -595,7 +594,7 @@ void main() { expect(trailing.text.style!.fontStyle, leadingAndTrailingTextStyle.fontStyle); }); - testWidgetsWithLeakTracking( + testWidgets( "Material2 - ListTile's titleTextStyle, subtitleTextStyle & leadingAndTrailingTextStyle are overridden by ListTile properties", (WidgetTester tester) async { final ThemeData theme = ThemeData( @@ -664,7 +663,7 @@ void main() { expect(trailing.text.style!.fontStyle, leadingAndTrailingTextStyle.fontStyle); }); - testWidgetsWithLeakTracking("ListTile respects ListTileTheme's tileColor & selectedTileColor", (WidgetTester tester) async { + testWidgets("ListTile respects ListTileTheme's tileColor & selectedTileColor", (WidgetTester tester) async { late ListTileThemeData theme; bool isSelected = false; @@ -704,7 +703,7 @@ void main() { expect(find.byType(Material), paints..rect(color: theme.selectedTileColor)); }); - testWidgetsWithLeakTracking("ListTileTheme's tileColor & selectedTileColor are overridden by ListTile properties", (WidgetTester tester) async { + testWidgets("ListTileTheme's tileColor & selectedTileColor are overridden by ListTile properties", (WidgetTester tester) async { bool isSelected = false; final Color tileColor = Colors.green.shade500; final Color selectedTileColor = Colors.red.shade500; @@ -746,7 +745,7 @@ void main() { expect(find.byType(Material), paints..rect(color: selectedTileColor)); }); - testWidgetsWithLeakTracking('ListTile uses ListTileTheme shape in a drawer', (WidgetTester tester) async { + testWidgets('ListTile uses ListTileTheme shape in a drawer', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/106303 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -779,7 +778,7 @@ void main() { expect(inkWellBorder, shapeBorder); }); - testWidgetsWithLeakTracking('ListTile respects MaterialStateColor LisTileTheme.textColor', (WidgetTester tester) async { + testWidgets('ListTile respects MaterialStateColor LisTileTheme.textColor', (WidgetTester tester) async { bool enabled = false; bool selected = false; const Color defaultColor = Colors.blue; @@ -839,7 +838,7 @@ void main() { expect(title.text.style!.color, selectedColor); }); - testWidgetsWithLeakTracking('ListTile respects MaterialStateColor LisTileTheme.iconColor', (WidgetTester tester) async { + testWidgets('ListTile respects MaterialStateColor LisTileTheme.iconColor', (WidgetTester tester) async { bool enabled = false; bool selected = false; const Color defaultColor = Colors.blue; @@ -898,7 +897,7 @@ void main() { expect(iconColor(leadingKey), selectedColor); }); - testWidgetsWithLeakTracking('ListTileThemeData copyWith overrides all properties', (WidgetTester tester) async { + testWidgets('ListTileThemeData copyWith overrides all properties', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/119734 const ListTileThemeData original = ListTileThemeData( @@ -960,7 +959,7 @@ void main() { expect(copy.titleAlignment, ListTileTitleAlignment.top); }); - testWidgetsWithLeakTracking('ListTileTheme.titleAlignment is overridden by ListTile.titleAlignment', (WidgetTester tester) async { + testWidgets('ListTileTheme.titleAlignment is overridden by ListTile.titleAlignment', (WidgetTester tester) async { final Key leadingKey = GlobalKey(); final Key trailingKey = GlobalKey(); const String titleText = '\nHeadline Text\n'; @@ -996,7 +995,7 @@ void main() { expect(trailingOffset.dy - tileOffset.dy, 8.0); }); - testWidgetsWithLeakTracking('ListTileTheme.merge supports all properties', (WidgetTester tester) async { + testWidgets('ListTileTheme.merge supports all properties', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( theme: ThemeData( diff --git a/packages/flutter/test/material/localizations_test.dart b/packages/flutter/test/material/localizations_test.dart index e0fdaccbbba..2f07335921d 100644 --- a/packages/flutter/test/material/localizations_test.dart +++ b/packages/flutter/test/material/localizations_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('English translations exist for all MaterialLocalizations properties', (WidgetTester tester) async { + testWidgets('English translations exist for all MaterialLocalizations properties', (WidgetTester tester) async { const MaterialLocalizations localizations = DefaultMaterialLocalizations(); expect(localizations.openAppDrawerTooltip, isNotNull); @@ -170,7 +169,7 @@ void main() { expect(localizations.licensesPackageDetailText(100).contains(r'$licensesCount'), isFalse); }); - testWidgetsWithLeakTracking('MaterialLocalizations.of throws', (WidgetTester tester) async { + testWidgets('MaterialLocalizations.of throws', (WidgetTester tester) async { final GlobalKey noLocalizationsAvailable = GlobalKey(); final GlobalKey localizationsAvailable = GlobalKey(); @@ -194,7 +193,7 @@ void main() { expect(MaterialLocalizations.of(localizationsAvailable.currentContext!), isA<MaterialLocalizations>()); }); - testWidgetsWithLeakTracking("parseCompactDate doesn't throw an exception on invalid text", (WidgetTester tester) async { + testWidgets("parseCompactDate doesn't throw an exception on invalid text", (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/126397. final GlobalKey localizations = GlobalKey(); diff --git a/packages/flutter/test/material/magnifier_test.dart b/packages/flutter/test/material/magnifier_test.dart index 275550523ff..b1e3555735d 100644 --- a/packages/flutter/test/material/magnifier_test.dart +++ b/packages/flutter/test/material/magnifier_test.dart @@ -8,7 +8,6 @@ library; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { final MagnifierController magnifierController = MagnifierController(); @@ -51,7 +50,7 @@ void main() { }); group('adaptiveMagnifierControllerBuilder', () { - testWidgetsWithLeakTracking('should return a TextEditingMagnifier on Android', + testWidgets('should return a TextEditingMagnifier on Android', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Placeholder(), @@ -71,7 +70,7 @@ void main() { expect(builtWidget, isA<TextMagnifier>()); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('should return a CupertinoMagnifier on iOS', + testWidgets('should return a CupertinoMagnifier on iOS', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Placeholder(), @@ -91,7 +90,7 @@ void main() { expect(builtWidget, isA<CupertinoTextMagnifier>()); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('should return null on all platforms not Android, iOS', + testWidgets('should return null on all platforms not Android, iOS', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Placeholder(), @@ -120,7 +119,7 @@ void main() { group('magnifier', () { group('position', () { - testWidgetsWithLeakTracking( + testWidgets( 'should be at gesture position if does not violate any positioning rules', (WidgetTester tester) async { final Key textField = UniqueKey(); @@ -177,7 +176,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'should never move outside the right bounds of the editing line', (WidgetTester tester) async { const double gestureOutsideLine = 100; @@ -213,7 +212,7 @@ void main() { lessThanOrEqualTo(reasonableTextField.right)); }); - testWidgetsWithLeakTracking( + testWidgets( 'should never move outside the left bounds of the editing line', (WidgetTester tester) async { const double gestureOutsideLine = 100; @@ -248,7 +247,7 @@ void main() { greaterThanOrEqualTo(reasonableTextField.left)); }); - testWidgetsWithLeakTracking('should position vertically at the center of the line', (WidgetTester tester) async { + testWidgets('should position vertically at the center of the line', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Placeholder(), )); @@ -274,7 +273,7 @@ void main() { reasonableTextField.center.dy - basicOffset.dy); }); - testWidgetsWithLeakTracking('should reposition vertically if mashed against the ceiling', + testWidgets('should reposition vertically if mashed against the ceiling', (WidgetTester tester) async { final Rect topOfScreenTextFieldRect = Rect.fromPoints(Offset.zero, const Offset(200, 0)); @@ -312,7 +311,7 @@ void main() { return magnifier.additionalFocalPointOffset; } - testWidgetsWithLeakTracking( + testWidgets( 'should shift focal point so that the lens sees nothing out of bounds', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( @@ -343,7 +342,7 @@ void main() { lessThan(reasonableTextField.left)); }); - testWidgetsWithLeakTracking( + testWidgets( 'focal point should shift if mashed against the top to always point to text', (WidgetTester tester) async { final Rect topOfScreenTextFieldRect = @@ -383,7 +382,7 @@ void main() { return animatedPositioned.duration.compareTo(Duration.zero) != 0; } - testWidgetsWithLeakTracking('should not be animated on the initial state', + testWidgets('should not be animated on the initial state', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Placeholder(), @@ -411,7 +410,7 @@ void main() { expect(getIsAnimated(tester), false); }); - testWidgetsWithLeakTracking('should not be animated on horizontal shifts', + testWidgets('should not be animated on horizontal shifts', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Placeholder(), @@ -445,7 +444,7 @@ void main() { expect(getIsAnimated(tester), false); }); - testWidgetsWithLeakTracking('should be animated on vertical shifts', + testWidgets('should be animated on vertical shifts', (WidgetTester tester) async { const Offset verticalShift = Offset(0, 200); @@ -481,7 +480,7 @@ void main() { expect(getIsAnimated(tester), true); }); - testWidgetsWithLeakTracking('should stop being animated when timer is up', + testWidgets('should stop being animated when timer is up', (WidgetTester tester) async { const Offset verticalShift = Offset(0, 200); diff --git a/packages/flutter/test/material/material_button_test.dart b/packages/flutter/test/material/material_button_test.dart index ee527a1f327..482812fdd89 100644 --- a/packages/flutter/test/material/material_button_test.dart +++ b/packages/flutter/test/material/material_button_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { @@ -14,7 +13,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('MaterialButton defaults', (WidgetTester tester) async { + testWidgets('MaterialButton defaults', (WidgetTester tester) async { final Finder rawButtonMaterial = find.descendant( of: find.byType(MaterialButton), matching: find.byType(Material), @@ -101,7 +100,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Does MaterialButton work with hover', (WidgetTester tester) async { + testWidgets('Does MaterialButton work with hover', (WidgetTester tester) async { const Color hoverColor = Color(0xff001122); await tester.pumpWidget( @@ -124,7 +123,7 @@ void main() { expect(inkFeatures, paints..rect(color: hoverColor)); }); - testWidgetsWithLeakTracking('Does MaterialButton work with focus', (WidgetTester tester) async { + testWidgets('Does MaterialButton work with focus', (WidgetTester tester) async { const Color focusColor = Color(0xff001122); final FocusNode focusNode = FocusNode(debugLabel: 'MaterialButton Node'); @@ -150,7 +149,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('MaterialButton elevation and colors have proper precedence', (WidgetTester tester) async { + testWidgets('MaterialButton elevation and colors have proper precedence', (WidgetTester tester) async { const double elevation = 10.0; const double focusElevation = 11.0; const double hoverElevation = 12.0; @@ -224,7 +223,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking("MaterialButton's disabledColor takes precedence over its default disabled color.", (WidgetTester tester) async { + testWidgets("MaterialButton's disabledColor takes precedence over its default disabled color.", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/30012. final Finder rawButtonMaterial = find.descendant( @@ -247,7 +246,7 @@ void main() { expect(material.color, const Color(0xff00ff00)); }); - testWidgetsWithLeakTracking('Default MaterialButton meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('Default MaterialButton meets a11y contrast guidelines', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -278,7 +277,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('MaterialButton gets focus when autofocus is set.', (WidgetTester tester) async { + testWidgets('MaterialButton gets focus when autofocus is set.', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'MaterialButton'); await tester.pumpWidget( MaterialApp( @@ -314,7 +313,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('MaterialButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { + testWidgets('MaterialButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { bool wasPressed; Finder materialButton; @@ -358,7 +357,7 @@ void main() { expect(tester.widget<MaterialButton>(materialButton).enabled, false); }); - testWidgetsWithLeakTracking('MaterialButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { + testWidgets('MaterialButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { bool didPressButton = false; bool didLongPressButton = false; @@ -389,7 +388,7 @@ void main() { expect(didLongPressButton, isTrue); }); - testWidgetsWithLeakTracking('MaterialButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('MaterialButton changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -443,7 +442,7 @@ void main() { // This test is very similar to the '...explicit splashColor and highlightColor' test // in icon_button_test.dart. If you change this one, you may want to also change that one. - testWidgetsWithLeakTracking('MaterialButton with explicit splashColor and highlightColor', (WidgetTester tester) async { + testWidgets('MaterialButton with explicit splashColor and highlightColor', (WidgetTester tester) async { const Color directSplashColor = Color(0xFF000011); const Color directHighlightColor = Color(0xFF000011); @@ -557,7 +556,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('MaterialButton has no clip by default', (WidgetTester tester) async { + testWidgets('MaterialButton has no clip by default', (WidgetTester tester) async { final GlobalKey buttonKey = GlobalKey(); final Widget buttonWidget = Center( child: MaterialButton( @@ -584,7 +583,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async { + testWidgets('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const Rect expectedButtonSize = Rect.fromLTRB(0.0, 0.0, 116.0, 48.0); @@ -671,7 +670,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('MaterialButton minWidth and height parameters', (WidgetTester tester) async { + testWidgets('MaterialButton minWidth and height parameters', (WidgetTester tester) async { Widget buildFrame({ double? minWidth, double? height, EdgeInsets padding = EdgeInsets.zero, Widget? child }) { return Directionality( textDirection: TextDirection.ltr, @@ -738,7 +737,7 @@ void main() { expect(tester.getSize(find.byType(MaterialButton)), const Size(18.0, 18.0)); }); - testWidgetsWithLeakTracking('MaterialButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('MaterialButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { final Key key1 = UniqueKey(); await tester.pumpWidget( Theme( @@ -778,7 +777,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); }); - testWidgetsWithLeakTracking('MaterialButton shape overrides ButtonTheme shape', (WidgetTester tester) async { + testWidgets('MaterialButton shape overrides ButtonTheme shape', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/29146 await tester.pumpWidget( Directionality( @@ -798,7 +797,7 @@ void main() { expect(tester.widget<Material>(rawButtonMaterial).shape, const StadiumBorder()); }); - testWidgetsWithLeakTracking('MaterialButton responds to density changes.', (WidgetTester tester) async { + testWidgets('MaterialButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key childKey = Key('test child'); @@ -859,7 +858,7 @@ void main() { expect(childRect, equals(const Rect.fromLTRB(372.0, 293.0, 428.0, 307.0))); }); - testWidgetsWithLeakTracking('disabledElevation is passed to RawMaterialButton', (WidgetTester tester) async { + testWidgets('disabledElevation is passed to RawMaterialButton', (WidgetTester tester) async { const double disabledElevation = 16; final Finder rawMaterialButtonFinder = find.descendant( @@ -882,7 +881,7 @@ void main() { expect(rawMaterialButton.disabledElevation, equals(disabledElevation)); }); - testWidgetsWithLeakTracking('MaterialButton.disabledElevation defaults to 0.0 when not provided', (WidgetTester tester) async { + testWidgets('MaterialButton.disabledElevation defaults to 0.0 when not provided', (WidgetTester tester) async { final Finder rawMaterialButtonFinder = find.descendant( of: find.byType(MaterialButton), matching: find.byType(RawMaterialButton), diff --git a/packages/flutter/test/material/material_state_mixin_test.dart b/packages/flutter/test/material/material_state_mixin_test.dart index f45afb6539f..be13d84dcd2 100644 --- a/packages/flutter/test/material/material_state_mixin_test.dart +++ b/packages/flutter/test/material/material_state_mixin_test.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Key key = Key('testContainer'); const Color trueColor = Colors.red; @@ -84,7 +83,7 @@ void main() { expect(tester.widget<ColoredBox>(find.byKey(key)).color, falseColor); } - testWidgetsWithLeakTracking('MaterialState.pressed is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.pressed is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -94,7 +93,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.focused is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.focused is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -104,7 +103,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.hovered is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.hovered is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -114,7 +113,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.disabled is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.disabled is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -124,7 +123,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.selected is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.selected is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -134,7 +133,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.scrolledUnder is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.scrolledUnder is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -144,7 +143,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.dragged is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.dragged is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, @@ -154,7 +153,7 @@ void main() { await verify(tester, widget, controller); }); - testWidgetsWithLeakTracking('MaterialState.error is tracked', (WidgetTester tester) async { + testWidgets('MaterialState.error is tracked', (WidgetTester tester) async { final StreamController<bool> controller = StreamController<bool>(); final _MyWidget widget = _MyWidget( controller: controller, diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 8ab14dda97d..78dc7af1ffd 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -71,7 +71,7 @@ class ElevationColor { void main() { // Regression test for https://github.com/flutter/flutter/issues/81504 - testWidgetsWithLeakTracking('MaterialApp.home nullable and update test', (WidgetTester tester) async { + testWidgets('MaterialApp.home nullable and update test', (WidgetTester tester) async { // _WidgetsAppState._usesNavigator == true await tester.pumpWidget(const MaterialApp(home: SizedBox.shrink())); @@ -84,7 +84,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('default Material debugFillProperties', (WidgetTester tester) async { + testWidgets('default Material debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Material().debugFillProperties(builder); @@ -96,7 +96,7 @@ void main() { expect(description, <String>['type: canvas']); }); - testWidgetsWithLeakTracking('Material implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Material implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Material( color: Color(0xFFFFFFFF), @@ -122,7 +122,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('LayoutChangedNotification test', (WidgetTester tester) async { + testWidgets('LayoutChangedNotification test', (WidgetTester tester) async { await tester.pumpWidget( const Material( child: NotifyMaterial(), @@ -130,7 +130,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListView scroll does not repaint', (WidgetTester tester) async { + testWidgets('ListView scroll does not repaint', (WidgetTester tester) async { final List<Size> log = <Size>[]; await tester.pumpWidget( @@ -189,7 +189,7 @@ void main() { expect(log, isEmpty); }); - testWidgetsWithLeakTracking('Shadow color defaults', (WidgetTester tester) async { + testWidgets('Shadow color defaults', (WidgetTester tester) async { Widget buildWithShadow(Color? shadowColor) { return Center( child: SizedBox( @@ -241,7 +241,7 @@ void main() { expect(getModel(tester).shadowColor, Colors.transparent); }); - testWidgetsWithLeakTracking('Shadows animate smoothly', (WidgetTester tester) async { + testWidgets('Shadows animate smoothly', (WidgetTester tester) async { // This code verifies that the PhysicalModel's elevation animates over // a kThemeChangeDuration time interval. @@ -266,7 +266,7 @@ void main() { expect(modelE.elevation, equals(9.0)); }); - testWidgetsWithLeakTracking('Shadow colors animate smoothly', (WidgetTester tester) async { + testWidgets('Shadow colors animate smoothly', (WidgetTester tester) async { // This code verifies that the PhysicalModel's shadowColor animates over // a kThemeChangeDuration time interval. @@ -291,7 +291,7 @@ void main() { expect(modelE.shadowColor, equals(const Color(0xFFFF0000))); }); - testWidgetsWithLeakTracking('Transparent material widget does not absorb hit test', (WidgetTester tester) async { + testWidgets('Transparent material widget does not absorb hit test', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/58665. bool pressed = false; await tester.pumpWidget( @@ -322,7 +322,7 @@ void main() { }); group('Surface Tint Overlay', () { - testWidgetsWithLeakTracking('applyElevationOverlayColor does not effect anything with useMaterial3 set to true', (WidgetTester tester) async { + testWidgets('applyElevationOverlayColor does not effect anything with useMaterial3 set to true', (WidgetTester tester) async { const Color surfaceColor = Color(0xFF121212); await tester.pumpWidget(Theme( data: ThemeData( @@ -336,7 +336,7 @@ void main() { expect(model.color, equals(surfaceColor)); }); - testWidgetsWithLeakTracking('surfaceTintColor is used to as an overlay to indicate elevation', (WidgetTester tester) async { + testWidgets('surfaceTintColor is used to as an overlay to indicate elevation', (WidgetTester tester) async { const Color baseColor = Color(0xFF121212); const Color surfaceTintColor = Color(0xff44CCFF); @@ -399,7 +399,7 @@ void main() { group('Elevation Overlay M2', () { // These tests only apply to the Material 2 overlay mechanism. This group // can be removed after migration to Material 3 is complete. - testWidgetsWithLeakTracking('applyElevationOverlayColor set to false does not change surface color', (WidgetTester tester) async { + testWidgets('applyElevationOverlayColor set to false does not change surface color', (WidgetTester tester) async { const Color surfaceColor = Color(0xFF121212); await tester.pumpWidget(Theme( data: ThemeData( @@ -413,7 +413,7 @@ void main() { expect(model.color, equals(surfaceColor)); }); - testWidgetsWithLeakTracking('applyElevationOverlayColor set to true applies a semi-transparent onSurface color to the surface color', (WidgetTester tester) async { + testWidgets('applyElevationOverlayColor set to true applies a semi-transparent onSurface color to the surface color', (WidgetTester tester) async { const Color surfaceColor = Color(0xFF121212); const Color onSurfaceColor = Colors.greenAccent; @@ -455,7 +455,7 @@ void main() { } }); - testWidgetsWithLeakTracking('overlay will not apply to materials using a non-surface color', (WidgetTester tester) async { + testWidgets('overlay will not apply to materials using a non-surface color', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData( @@ -474,7 +474,7 @@ void main() { expect(model.color, equals(Colors.cyan)); }); - testWidgetsWithLeakTracking('overlay will not apply to materials using a light theme', (WidgetTester tester) async { + testWidgets('overlay will not apply to materials using a light theme', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData( @@ -493,7 +493,7 @@ void main() { expect(model.color, equals(Colors.cyan)); }); - testWidgetsWithLeakTracking('overlay will apply to materials with a non-opaque surface color', (WidgetTester tester) async { + testWidgets('overlay will apply to materials with a non-opaque surface color', (WidgetTester tester) async { const Color surfaceColor = Color(0xFF121212); const Color surfaceColorWithOverlay = Color(0xC6353535); @@ -516,7 +516,7 @@ void main() { expect(model.color, isNot(equals(surfaceColor))); }); - testWidgetsWithLeakTracking('Expected overlay color can be computed using colorWithOverlay', (WidgetTester tester) async { + testWidgets('Expected overlay color can be computed using colorWithOverlay', (WidgetTester tester) async { const Color surfaceColor = Color(0xFF123456); const Color onSurfaceColor = Color(0xFF654321); const double elevation = 8.0; @@ -549,7 +549,7 @@ void main() { }); // Elevation Overlay M2 group group('Transparency clipping', () { - testWidgetsWithLeakTracking('No clip by default', (WidgetTester tester) async { + testWidgets('No clip by default', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -563,7 +563,7 @@ void main() { expect(renderClip.clipBehavior, equals(Clip.none)); }); - testWidgetsWithLeakTracking('clips to bounding rect by default given Clip.antiAlias', (WidgetTester tester) async { + testWidgets('clips to bounding rect by default given Clip.antiAlias', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -577,7 +577,7 @@ void main() { expect(find.byKey(materialKey), clipsWithBoundingRect); }); - testWidgetsWithLeakTracking('clips to rounded rect when borderRadius provided given Clip.antiAlias', (WidgetTester tester) async { + testWidgets('clips to rounded rect when borderRadius provided given Clip.antiAlias', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -597,7 +597,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('clips to shape when provided given Clip.antiAlias', (WidgetTester tester) async { + testWidgets('clips to shape when provided given Clip.antiAlias', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -617,7 +617,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('supports directional clips', (WidgetTester tester) async { + testWidgets('supports directional clips', (WidgetTester tester) async { final List<String> logs = <String>[]; final ShapeBorder shape = TestBorder((String message) { logs.add(message); }); Widget buildMaterial() { @@ -682,7 +682,7 @@ void main() { }); group('PhysicalModels', () { - testWidgetsWithLeakTracking('canvas', (WidgetTester tester) async { + testWidgets('canvas', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -698,7 +698,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('canvas with borderRadius and elevation', (WidgetTester tester) async { + testWidgets('canvas with borderRadius and elevation', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -716,7 +716,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('canvas with shape and elevation', (WidgetTester tester) async { + testWidgets('canvas with shape and elevation', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -733,7 +733,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('card', (WidgetTester tester) async { + testWidgets('card', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -750,7 +750,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('card with borderRadius and elevation', (WidgetTester tester) async { + testWidgets('card with borderRadius and elevation', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -769,7 +769,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('card with shape and elevation', (WidgetTester tester) async { + testWidgets('card with shape and elevation', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -787,7 +787,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('circle', (WidgetTester tester) async { + testWidgets('circle', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -804,7 +804,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('button', (WidgetTester tester) async { + testWidgets('button', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -822,7 +822,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('button with elevation and borderRadius', (WidgetTester tester) async { + testWidgets('button with elevation and borderRadius', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -842,7 +842,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('button with elevation and shape', (WidgetTester tester) async { + testWidgets('button with elevation and shape', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -863,7 +863,7 @@ void main() { }); group('Border painting', () { - testWidgetsWithLeakTracking('border is painted on physical layers', (WidgetTester tester) async { + testWidgets('border is painted on physical layers', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -884,7 +884,7 @@ void main() { expect(box, paints..circle()); }); - testWidgetsWithLeakTracking('border is painted for transparent material', (WidgetTester tester) async { + testWidgets('border is painted for transparent material', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -904,7 +904,7 @@ void main() { expect(box, paints..circle()); }); - testWidgetsWithLeakTracking('border is not painted for when border side is none', (WidgetTester tester) async { + testWidgets('border is not painted for when border side is none', (WidgetTester tester) async { final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget( Material( @@ -919,7 +919,7 @@ void main() { expect(box, isNot(paints..circle())); }); - testWidgetsWithLeakTracking('Material2 - border is painted above child by default', (WidgetTester tester) async { + testWidgets('Material2 - border is painted above child by default', (WidgetTester tester) async { final Key painterKey = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -958,7 +958,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - border is painted above child by default', (WidgetTester tester) async { + testWidgets('Material3 - border is painted above child by default', (WidgetTester tester) async { final Key painterKey = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -997,7 +997,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - border is painted below child when specified', (WidgetTester tester) async { + testWidgets('Material2 - border is painted below child when specified', (WidgetTester tester) async { final Key painterKey = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -1037,7 +1037,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - border is painted below child when specified', (WidgetTester tester) async { + testWidgets('Material3 - border is painted below child when specified', (WidgetTester tester) async { final Key painterKey = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -1078,7 +1078,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('InkFeature skips painting if intermediate node skips', (WidgetTester tester) async { + testWidgets('InkFeature skips painting if intermediate node skips', (WidgetTester tester) async { final GlobalKey sizedBoxKey = GlobalKey(); final GlobalKey materialKey = GlobalKey(); await tester.pumpWidget(Material( @@ -1124,7 +1124,7 @@ void main() { tracker.dispose(); }); - testWidgetsWithLeakTracking('$InkFeature dispatches memory events', (WidgetTester tester) async { + testWidgets('$InkFeature dispatches memory events', (WidgetTester tester) async { await tester.pumpWidget( const Material( child: SizedBox(width: 20, height: 20), @@ -1148,7 +1148,7 @@ void main() { }); group('LookupBoundary', () { - testWidgetsWithLeakTracking('hides Material from Material.maybeOf', (WidgetTester tester) async { + testWidgets('hides Material from Material.maybeOf', (WidgetTester tester) async { MaterialInkController? material; await tester.pumpWidget( @@ -1167,7 +1167,7 @@ void main() { expect(material, isNull); }); - testWidgetsWithLeakTracking('hides Material from Material.of', (WidgetTester tester) async { + testWidgets('hides Material from Material.of', (WidgetTester tester) async { await tester.pumpWidget( Material( child: LookupBoundary( @@ -1199,7 +1199,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('hides Material from debugCheckHasMaterial', (WidgetTester tester) async { + testWidgets('hides Material from debugCheckHasMaterial', (WidgetTester tester) async { await tester.pumpWidget( Material( child: LookupBoundary( diff --git a/packages/flutter/test/material/menu_anchor_test.dart b/packages/flutter/test/material/menu_anchor_test.dart index e3f2719f198..1b4eea3c871 100644 --- a/packages/flutter/test/material/menu_anchor_test.dart +++ b/packages/flutter/test/material/menu_anchor_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -167,7 +166,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Menu responds to density changes', (WidgetTester tester) async { + testWidgets('Menu responds to density changes', (WidgetTester tester) async { Widget buildMenu({VisualDensity? visualDensity = VisualDensity.standard}) { return MaterialApp( theme: ThemeData(visualDensity: visualDensity, useMaterial3: false), @@ -262,7 +261,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Menu defaults', (WidgetTester tester) async { + testWidgets('Menu defaults', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -352,7 +351,7 @@ void main() { expect(iconRichText.text.style?.color, themeData.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('Menu defaults - disabled', (WidgetTester tester) async { + testWidgets('Menu defaults - disabled', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -435,7 +434,7 @@ void main() { expect(iconRichText.text.style?.color, themeData.colorScheme.onSurface.withOpacity(0.38)); }); - testWidgetsWithLeakTracking('Menu scrollbar inherits ScrollbarTheme', (WidgetTester tester) async { + testWidgets('Menu scrollbar inherits ScrollbarTheme', (WidgetTester tester) async { const ScrollbarThemeData scrollbarTheme = ScrollbarThemeData( thumbColor: MaterialStatePropertyAll<Color?>(Color(0xffff0000)), thumbVisibility: MaterialStatePropertyAll<bool?>(true), @@ -530,7 +529,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('focus is returned to previous focus before invoking onPressed', (WidgetTester tester) async { + testWidgets('focus is returned to previous focus before invoking onPressed', (WidgetTester tester) async { final FocusNode buttonFocus = FocusNode(debugLabel: 'Button Focus'); addTearDown(buttonFocus.dispose); FocusNode? focusInOnPressed; @@ -579,7 +578,7 @@ void main() { }); group('Menu functions', () { - testWidgetsWithLeakTracking('basic menu structure', (WidgetTester tester) async { + testWidgets('basic menu structure', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -632,7 +631,7 @@ void main() { expect(opened.last, equals(TestMenu.subMenu11)); }); - testWidgetsWithLeakTracking('geometry', (WidgetTester tester) async { + testWidgets('geometry', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -697,7 +696,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('geometry with RTL direction', (WidgetTester tester) async { + testWidgets('geometry with RTL direction', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -774,7 +773,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('menu alignment and offset in LTR', (WidgetTester tester) async { + testWidgets('menu alignment and offset in LTR', (WidgetTester tester) async { await tester.pumpWidget(buildTestApp()); final Rect buttonRect = tester.getRect(find.byType(ElevatedButton)); @@ -817,7 +816,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('menu alignment and offset in RTL', (WidgetTester tester) async { + testWidgets('menu alignment and offset in RTL', (WidgetTester tester) async { await tester.pumpWidget(buildTestApp(textDirection: TextDirection.rtl)); final Rect buttonRect = tester.getRect(find.byType(ElevatedButton)); @@ -859,7 +858,7 @@ void main() { expect(tester.getRect(findMenuScope).topLeft - menuRect.topLeft, equals(const Offset(-10, 20))); }); - testWidgetsWithLeakTracking('menu position in LTR', (WidgetTester tester) async { + testWidgets('menu position in LTR', (WidgetTester tester) async { await tester.pumpWidget(buildTestApp(alignmentOffset: const Offset(100, 50))); final Rect buttonRect = tester.getRect(find.byType(ElevatedButton)); @@ -880,7 +879,7 @@ void main() { expect(tester.getRect(findMenuScope), equals(const Rect.fromLTRB(526.0, 214.0, 800.0, 326.0))); }); - testWidgetsWithLeakTracking('menu position in RTL', (WidgetTester tester) async { + testWidgets('menu position in RTL', (WidgetTester tester) async { await tester.pumpWidget(buildTestApp( alignmentOffset: const Offset(100, 50), textDirection: TextDirection.rtl, @@ -905,7 +904,7 @@ void main() { expect(tester.getRect(findMenuScope), equals(const Rect.fromLTRB(526.0, 214.0, 800.0, 326.0))); }); - testWidgetsWithLeakTracking('works with Padding around menu and overlay', (WidgetTester tester) async { + testWidgets('works with Padding around menu and overlay', (WidgetTester tester) async { await tester.pumpWidget( Padding( padding: const EdgeInsets.all(10.0), @@ -958,7 +957,7 @@ void main() { expect(tester.getRect(find.byType(MenuBar)), equals(const Rect.fromLTRB(22.0, 22.0, 778.0, 70.0))); }); - testWidgetsWithLeakTracking('works with Padding around menu and overlay with RTL direction', (WidgetTester tester) async { + testWidgets('works with Padding around menu and overlay with RTL direction', (WidgetTester tester) async { await tester.pumpWidget( Padding( padding: const EdgeInsets.all(10.0), @@ -1014,7 +1013,7 @@ void main() { expect(tester.getRect(find.byType(MenuBar)), equals(const Rect.fromLTRB(22.0, 22.0, 778.0, 70.0))); }); - testWidgetsWithLeakTracking('visual attributes can be set', (WidgetTester tester) async { + testWidgets('visual attributes can be set', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1045,7 +1044,7 @@ void main() { expect(material.color, equals(Colors.red)); }); - testWidgetsWithLeakTracking('MenuAnchor clip behavior', (WidgetTester tester) async { + testWidgets('MenuAnchor clip behavior', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1106,7 +1105,7 @@ void main() { expect(getMenuBarMaterial(tester).clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('open and close works', (WidgetTester tester) async { + testWidgets('open and close works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1155,7 +1154,7 @@ void main() { expect(closed, equals(<TestMenu>[TestMenu.mainMenu1])); }); - testWidgetsWithLeakTracking('Menus close and consume tap when open and tapped outside', (WidgetTester tester) async { + testWidgets('Menus close and consume tap when open and tapped outside', (WidgetTester tester) async { await tester.pumpWidget( buildTestApp(consumesOutsideTap: true, onPressed: onPressed, onOpen: onOpen, onClose: onClose), ); @@ -1191,7 +1190,7 @@ void main() { closed.clear(); }); - testWidgetsWithLeakTracking("Menus close and don't consume tap when open and tapped outside", (WidgetTester tester) async { + testWidgets("Menus close and don't consume tap when open and tapped outside", (WidgetTester tester) async { await tester.pumpWidget( buildTestApp(onPressed: onPressed, onOpen: onOpen, onClose: onClose), ); @@ -1227,7 +1226,7 @@ void main() { closed.clear(); }); - testWidgetsWithLeakTracking('select works', (WidgetTester tester) async { + testWidgets('select works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1262,7 +1261,7 @@ void main() { expect(find.text(TestMenu.subMenu11.label), findsNothing); }); - testWidgetsWithLeakTracking('diagnostics', (WidgetTester tester) async { + testWidgets('diagnostics', (WidgetTester tester) async { const MenuItemButton item = MenuItemButton( shortcut: SingleActivator(LogicalKeyboardKey.keyA), child: Text('label2'), @@ -1301,7 +1300,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('keyboard tab traversal works', (WidgetTester tester) async { + testWidgets('keyboard tab traversal works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1360,7 +1359,7 @@ void main() { expect(closed, <TestMenu>[TestMenu.mainMenu0]); }); - testWidgetsWithLeakTracking('keyboard directional traversal works', (WidgetTester tester) async { + testWidgets('keyboard directional traversal works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1440,7 +1439,7 @@ void main() { expect(focusedMenu, equals('MenuItemButton(Text("Sub Sub Menu 113"))')); }); - testWidgetsWithLeakTracking('keyboard directional traversal works in RTL mode', (WidgetTester tester) async { + testWidgets('keyboard directional traversal works in RTL mode', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -1526,7 +1525,7 @@ void main() { expect(focusedMenu, equals('MenuItemButton(Text("Sub Sub Menu 113"))')); }); - testWidgetsWithLeakTracking('hover traversal works', (WidgetTester tester) async { + testWidgets('hover traversal works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1582,7 +1581,7 @@ void main() { expect(focusedMenu, equals('MenuItemButton(Text("Sub Sub Menu 110"))')); }); - testWidgetsWithLeakTracking('menus close on ancestor scroll', (WidgetTester tester) async { + testWidgets('menus close on ancestor scroll', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1621,7 +1620,7 @@ void main() { expect(closed, isNotEmpty); }); - testWidgetsWithLeakTracking('menus do not close on root menu internal scroll', (WidgetTester tester) async { + testWidgets('menus do not close on root menu internal scroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/122168. final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1698,7 +1697,7 @@ void main() { expect(closed, isNotEmpty); }); - testWidgetsWithLeakTracking('menus close on view size change', (WidgetTester tester) async { + testWidgets('menus close on view size change', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); final MediaQueryData mediaQueryData = MediaQueryData.fromView(tester.view); @@ -1789,7 +1788,7 @@ void main() { } }); - testWidgetsWithLeakTracking('can invoke menu items', (WidgetTester tester) async { + testWidgets('can invoke menu items', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1845,7 +1844,7 @@ void main() { selected.clear(); }, variant: TargetPlatformVariant(nonApple)); - testWidgetsWithLeakTracking('can combine with regular keyboard navigation', (WidgetTester tester) async { + testWidgets('can combine with regular keyboard navigation', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1882,7 +1881,7 @@ void main() { expect(selected, equals(<TestMenu>[TestMenu.subSubMenu110])); }, variant: TargetPlatformVariant(nonApple)); - testWidgetsWithLeakTracking('can combine with mouse', (WidgetTester tester) async { + testWidgets('can combine with mouse', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1917,7 +1916,7 @@ void main() { expect(selected, equals(<TestMenu>[TestMenu.subSubMenu112])); }, variant: TargetPlatformVariant(nonApple)); - testWidgetsWithLeakTracking("disabled items don't respond to accelerators", (WidgetTester tester) async { + testWidgets("disabled items don't respond to accelerators", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1949,7 +1948,7 @@ void main() { expect(find.text(TestMenu.subMenu00.label), findsNothing); }, variant: TargetPlatformVariant(nonApple)); - testWidgetsWithLeakTracking("Apple platforms don't react to accelerators", (WidgetTester tester) async { + testWidgets("Apple platforms don't react to accelerators", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1995,7 +1994,7 @@ void main() { }); group('MenuController', () { - testWidgetsWithLeakTracking('Moving a controller to a new instance works', (WidgetTester tester) async { + testWidgets('Moving a controller to a new instance works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2033,7 +2032,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('closing via controller works', (WidgetTester tester) async { + testWidgets('closing via controller works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2076,7 +2075,7 @@ void main() { }); group('MenuItemButton', () { - testWidgetsWithLeakTracking('Shortcut mnemonics are displayed', (WidgetTester tester) async { + testWidgets('Shortcut mnemonics are displayed', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2196,7 +2195,7 @@ void main() { expect(mnemonic2.data, equals('↵')); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('leadingIcon is used when set', (WidgetTester tester) async { + testWidgets('leadingIcon is used when set', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2224,7 +2223,7 @@ void main() { expect(find.text('leadingIcon'), findsOneWidget); }); - testWidgetsWithLeakTracking('trailingIcon is used when set', (WidgetTester tester) async { + testWidgets('trailingIcon is used when set', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2252,7 +2251,7 @@ void main() { expect(find.text('trailingIcon'), findsOneWidget); }); - testWidgetsWithLeakTracking('SubmenuButton uses supplied controller', (WidgetTester tester) async { + testWidgets('SubmenuButton uses supplied controller', (WidgetTester tester) async { final MenuController submenuController = MenuController(); await tester.pumpWidget( MaterialApp( @@ -2309,7 +2308,7 @@ void main() { expect(find.text(TestMenu.subMenu00.label), findsNothing); }); - testWidgetsWithLeakTracking('diagnostics', (WidgetTester tester) async { + testWidgets('diagnostics', (WidgetTester tester) async { final ButtonStyle style = ButtonStyle( shape: MaterialStateProperty.all<OutlinedBorder?>(const StadiumBorder()), elevation: MaterialStateProperty.all<double?>(10.0), @@ -2369,7 +2368,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('MenuItemButton respects closeOnActivate property', (WidgetTester tester) async { + testWidgets('MenuItemButton respects closeOnActivate property', (WidgetTester tester) async { final MenuController controller = MenuController(); await tester.pumpWidget(MaterialApp( home: Material( @@ -2467,7 +2466,7 @@ void main() { return menuRects; } - testWidgetsWithLeakTracking('unconstrained menus show up in the right place in LTR', (WidgetTester tester) async { + testWidgets('unconstrained menus show up in the right place in LTR', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(800, 600)); await tester.pumpWidget( MaterialApp( @@ -2511,7 +2510,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('unconstrained menus show up in the right place in RTL', (WidgetTester tester) async { + testWidgets('unconstrained menus show up in the right place in RTL', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(800, 600)); await tester.pumpWidget( MaterialApp( @@ -2558,7 +2557,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('constrained menus show up in the right place in LTR', (WidgetTester tester) async { + testWidgets('constrained menus show up in the right place in LTR', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(300, 300)); await tester.pumpWidget( MaterialApp( @@ -2603,7 +2602,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('constrained menus show up in the right place in RTL', (WidgetTester tester) async { + testWidgets('constrained menus show up in the right place in RTL', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(300, 300)); await tester.pumpWidget( MaterialApp( @@ -2648,7 +2647,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('constrained menus show up in the right place with offset in LTR', (WidgetTester tester) async { + testWidgets('constrained menus show up in the right place with offset in LTR', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(800, 600)); await tester.pumpWidget( MaterialApp( @@ -2725,7 +2724,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('constrained menus show up in the right place with offset in RTL', (WidgetTester tester) async { + testWidgets('constrained menus show up in the right place with offset in RTL', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(800, 600)); await tester.pumpWidget( MaterialApp( @@ -2802,7 +2801,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('vertically constrained menus are positioned above the anchor by default', (WidgetTester tester) async { + testWidgets('vertically constrained menus are positioned above the anchor by default', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(800, 600)); await tester.pumpWidget( MaterialApp( @@ -2853,7 +2852,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('vertically constrained menus are positioned above the anchor with the provided offset', + testWidgets('vertically constrained menus are positioned above the anchor with the provided offset', (WidgetTester tester) async { await changeSurfaceSize(tester, const Size(800, 600)); await tester.pumpWidget( @@ -2940,7 +2939,7 @@ void main() { await tester.pump(); } - testWidgetsWithLeakTracking('submenus account for density in LTR', (WidgetTester tester) async { + testWidgets('submenus account for density in LTR', (WidgetTester tester) async { await buildDensityPaddingApp( tester, textDirection: TextDirection.ltr, @@ -2955,7 +2954,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('submenus account for menu density in RTL', (WidgetTester tester) async { + testWidgets('submenus account for menu density in RTL', (WidgetTester tester) async { await buildDensityPaddingApp( tester, textDirection: TextDirection.rtl, @@ -2970,7 +2969,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('submenus account for compact menu density in LTR', (WidgetTester tester) async { + testWidgets('submenus account for compact menu density in LTR', (WidgetTester tester) async { await buildDensityPaddingApp( tester, visualDensity: VisualDensity.compact, @@ -2986,7 +2985,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('submenus account for compact menu density in RTL', (WidgetTester tester) async { + testWidgets('submenus account for compact menu density in RTL', (WidgetTester tester) async { await buildDensityPaddingApp( tester, visualDensity: VisualDensity.compact, @@ -3002,7 +3001,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('submenus account for padding in LTR', (WidgetTester tester) async { + testWidgets('submenus account for padding in LTR', (WidgetTester tester) async { await buildDensityPaddingApp( tester, menuPadding: const EdgeInsetsDirectional.only(start: 10, end: 11, top: 12, bottom: 13), @@ -3018,7 +3017,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('submenus account for padding in RTL', (WidgetTester tester) async { + testWidgets('submenus account for padding in RTL', (WidgetTester tester) async { await buildDensityPaddingApp( tester, menuPadding: const EdgeInsetsDirectional.only(start: 10, end: 11, top: 12, bottom: 13), @@ -3036,7 +3035,7 @@ void main() { }); group('LocalizedShortcutLabeler', () { - testWidgetsWithLeakTracking('getShortcutLabel returns the right labels', (WidgetTester tester) async { + testWidgets('getShortcutLabel returns the right labels', (WidgetTester tester) async { String expectedMeta; String expectedCtrl; String expectedAlt; @@ -3114,7 +3113,7 @@ void main() { }); group('CheckboxMenuButton', () { - testWidgetsWithLeakTracking('tapping toggles checkbox', (WidgetTester tester) async { + testWidgets('tapping toggles checkbox', (WidgetTester tester) async { bool? checkBoxValue; await tester.pumpWidget( MaterialApp( @@ -3168,7 +3167,7 @@ void main() { }); group('RadioMenuButton', () { - testWidgetsWithLeakTracking('tapping toggles radio button', (WidgetTester tester) async { + testWidgets('tapping toggles radio button', (WidgetTester tester) async { int? radioValue; await tester.pumpWidget( MaterialApp( @@ -3237,7 +3236,7 @@ void main() { }); group('Semantics', () { - testWidgetsWithLeakTracking('MenuItemButton is not a semantic button', (WidgetTester tester) async { + testWidgets('MenuItemButton is not a semantic button', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -3281,7 +3280,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SubMenuButton is not a semantic button', (WidgetTester tester) async { + testWidgets('SubMenuButton is not a semantic button', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -3319,7 +3318,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SubmenuButton expanded/collapsed state', (WidgetTester tester) async { + testWidgets('SubmenuButton expanded/collapsed state', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( MaterialApp( @@ -3461,7 +3460,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/issues/131676. - testWidgetsWithLeakTracking('Material3 - Menu uses correct text styles', (WidgetTester tester) async { + testWidgets('Material3 - Menu uses correct text styles', (WidgetTester tester) async { const TextStyle menuTextStyle = TextStyle( fontSize: 18.5, fontStyle: FontStyle.italic, @@ -3520,7 +3519,7 @@ void main() { expect(material.textStyle?.decoration, menuTextStyle.decoration); }); - testWidgetsWithLeakTracking('SubmenuButton.onFocusChange is respected', (WidgetTester tester) async { + testWidgets('SubmenuButton.onFocusChange is respected', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); int onFocusChangeCalled = 0; await tester.pumpWidget( diff --git a/packages/flutter/test/material/menu_bar_theme_test.dart b/packages/flutter/test/material/menu_bar_theme_test.dart index b5dafecaec2..003ff987ed2 100644 --- a/packages/flutter/test/material/menu_bar_theme_test.dart +++ b/packages/flutter/test/material/menu_bar_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { void onPressed(TestMenu item) {} @@ -53,7 +52,7 @@ void main() { expect(identical(MenuBarThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('theme is honored', (WidgetTester tester) async { + testWidgets('theme is honored', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -106,7 +105,7 @@ void main() { expect(subMenuMaterial.color, equals(Colors.green)); }); - testWidgetsWithLeakTracking('Constructor parameters override theme parameters', (WidgetTester tester) async { + testWidgets('Constructor parameters override theme parameters', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), diff --git a/packages/flutter/test/material/menu_style_test.dart b/packages/flutter/test/material/menu_style_test.dart index c3fc058976d..74ce6b8887a 100644 --- a/packages/flutter/test/material/menu_style_test.dart +++ b/packages/flutter/test/material/menu_style_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -44,7 +43,7 @@ void main() { expect(identical(MenuStyle.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('fixedSize affects geometry', (WidgetTester tester) async { + testWidgets('fixedSize affects geometry', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -89,7 +88,7 @@ void main() { } }); - testWidgetsWithLeakTracking('maximumSize affects geometry', (WidgetTester tester) async { + testWidgets('maximumSize affects geometry', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -132,7 +131,7 @@ void main() { expect(tester.getRect(findMenuPanels().at(1)).size, equals(const Size(100.0, 100.0))); }); - testWidgetsWithLeakTracking('minimumSize affects geometry', (WidgetTester tester) async { + testWidgets('minimumSize affects geometry', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -175,7 +174,7 @@ void main() { expect(tester.getRect(findMenuPanels().at(1)).size, equals(const Size(300.0, 300.0))); }); - testWidgetsWithLeakTracking('Material parameters are honored', (WidgetTester tester) async { + testWidgets('Material parameters are honored', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -241,7 +240,7 @@ void main() { expect(panelPadding.padding, equals(const EdgeInsets.all(20))); }); - testWidgetsWithLeakTracking('visual density', (WidgetTester tester) async { + testWidgets('visual density', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), diff --git a/packages/flutter/test/material/menu_theme_test.dart b/packages/flutter/test/material/menu_theme_test.dart index 49089f724ce..26af73bb7bb 100644 --- a/packages/flutter/test/material/menu_theme_test.dart +++ b/packages/flutter/test/material/menu_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -54,7 +53,7 @@ void main() { expect(identical(MenuThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('theme is honored', (WidgetTester tester) async { + testWidgets('theme is honored', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -107,7 +106,7 @@ void main() { expect(subMenuMaterial.color, equals(Colors.red)); }); - testWidgetsWithLeakTracking('Constructor parameters override theme parameters', + testWidgets('Constructor parameters override theme parameters', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/mergeable_material_test.dart b/packages/flutter/test/material/mergeable_material_test.dart index 19539527b4f..b9de0f7f1ec 100644 --- a/packages/flutter/test/material/mergeable_material_test.dart +++ b/packages/flutter/test/material/mergeable_material_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; enum RadiusType { Sharp, @@ -64,7 +63,7 @@ BorderRadius? getBorderRadius(WidgetTester tester, int index) { } void main() { - testWidgetsWithLeakTracking('MergeableMaterial empty', (WidgetTester tester) async { + testWidgets('MergeableMaterial empty', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -79,7 +78,7 @@ void main() { expect(box.size.height, equals(0)); }); - testWidgetsWithLeakTracking('MergeableMaterial update slice', (WidgetTester tester) async { + testWidgets('MergeableMaterial update slice', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -127,7 +126,7 @@ void main() { expect(box.size.height, equals(200.0)); }); - testWidgetsWithLeakTracking('MergeableMaterial swap slices', (WidgetTester tester) async { + testWidgets('MergeableMaterial swap slices', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -198,7 +197,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Sharp, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial paints shadows', (WidgetTester tester) async { + testWidgets('MergeableMaterial paints shadows', (WidgetTester tester) async { debugDisableShadows = false; await tester.pumpWidget( MaterialApp( @@ -233,7 +232,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('MergeableMaterial skips shadow for zero elevation', (WidgetTester tester) async { + testWidgets('MergeableMaterial skips shadow for zero elevation', (WidgetTester tester) async { debugDisableShadows = false; await tester.pumpWidget( const MaterialApp( @@ -263,7 +262,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('MergeableMaterial merge gap', (WidgetTester tester) async { + testWidgets('MergeableMaterial merge gap', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -340,7 +339,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Sharp, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial separate slices', (WidgetTester tester) async { + testWidgets('MergeableMaterial separate slices', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -417,7 +416,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Round, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial separate merge separate', (WidgetTester tester) async { + testWidgets('MergeableMaterial separate merge separate', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -576,7 +575,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Round, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial insert slice', (WidgetTester tester) async { + testWidgets('MergeableMaterial insert slice', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -651,7 +650,7 @@ void main() { matches(getBorderRadius(tester, 2), RadiusType.Sharp, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial remove slice', (WidgetTester tester) async { + testWidgets('MergeableMaterial remove slice', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -727,7 +726,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Sharp, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial insert chunk', (WidgetTester tester) async { + testWidgets('MergeableMaterial insert chunk', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -816,7 +815,7 @@ void main() { matches(getBorderRadius(tester, 2), RadiusType.Round, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial remove chunk', (WidgetTester tester) async { + testWidgets('MergeableMaterial remove chunk', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -904,7 +903,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Sharp, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial replace gap with chunk', (WidgetTester tester) async { + testWidgets('MergeableMaterial replace gap with chunk', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -996,7 +995,7 @@ void main() { matches(getBorderRadius(tester, 2), RadiusType.Round, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial replace chunk with gap', (WidgetTester tester) async { + testWidgets('MergeableMaterial replace chunk with gap', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -1087,7 +1086,7 @@ void main() { matches(getBorderRadius(tester, 1), RadiusType.Round, RadiusType.Round); }); - testWidgetsWithLeakTracking('MergeableMaterial insert and separate slice', (WidgetTester tester) async { + testWidgets('MergeableMaterial insert and separate slice', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -1167,7 +1166,7 @@ void main() { ); } - testWidgetsWithLeakTracking('MergeableMaterial dividers', (WidgetTester tester) async { + testWidgets('MergeableMaterial dividers', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1292,7 +1291,7 @@ void main() { expect(isDivider(boxes[offset + 3], true, false), isTrue); }); - testWidgetsWithLeakTracking('MergeableMaterial respects dividerColor', (WidgetTester tester) async { + testWidgets('MergeableMaterial respects dividerColor', (WidgetTester tester) async { const Color dividerColor = Colors.red; await tester.pumpWidget( const MaterialApp( @@ -1329,7 +1328,7 @@ void main() { expect(decoration.border!.top.color, dividerColor); }); - testWidgetsWithLeakTracking('MergeableMaterial respects MaterialSlice.color', (WidgetTester tester) async { + testWidgets('MergeableMaterial respects MaterialSlice.color', (WidgetTester tester) async { const Color themeCardColor = Colors.red; const Color materialSliceColor = Colors.green; diff --git a/packages/flutter/test/material/navigation_bar_test.dart b/packages/flutter/test/material/navigation_bar_test.dart index 9e01060611f..5e80d13eb4a 100644 --- a/packages/flutter/test/material/navigation_bar_test.dart +++ b/packages/flutter/test/material/navigation_bar_test.dart @@ -14,10 +14,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Navigation bar updates destinations when tapped', (WidgetTester tester) async { + testWidgets('Navigation bar updates destinations when tapped', (WidgetTester tester) async { int mutatedIndex = -1; final Widget widget = _buildWidget( NavigationBar( @@ -49,7 +48,7 @@ void main() { expect(mutatedIndex, 0); }); - testWidgetsWithLeakTracking('NavigationBar can update background color', (WidgetTester tester) async { + testWidgets('NavigationBar can update background color', (WidgetTester tester) async { const Color color = Colors.yellow; await tester.pumpWidget( @@ -74,7 +73,7 @@ void main() { expect(_getMaterial(tester).color, equals(color)); }); - testWidgetsWithLeakTracking('NavigationBar can update elevation', (WidgetTester tester) async { + testWidgets('NavigationBar can update elevation', (WidgetTester tester) async { const double elevation = 42.0; await tester.pumpWidget( @@ -99,7 +98,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(elevation)); }); - testWidgetsWithLeakTracking('NavigationBar adds bottom padding to height', (WidgetTester tester) async { + testWidgets('NavigationBar adds bottom padding to height', (WidgetTester tester) async { const double bottomPadding = 40.0; await tester.pumpWidget( @@ -148,7 +147,7 @@ void main() { expect(tester.getSize(find.byType(NavigationBar)).height, expectedHeight); }); - testWidgetsWithLeakTracking('NavigationBar respects the notch/system navigation bar in landscape mode', (WidgetTester tester) async { + testWidgets('NavigationBar respects the notch/system navigation bar in landscape mode', (WidgetTester tester) async { const double safeAreaPadding = 40.0; Widget navigationBar() { return NavigationBar( @@ -246,7 +245,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - NavigationBar uses proper defaults when no parameters are given', (WidgetTester tester) async { + testWidgets('Material2 - NavigationBar uses proper defaults when no parameters are given', (WidgetTester tester) async { // M2 settings that were hand coded. await tester.pumpWidget( _buildWidget( @@ -275,7 +274,7 @@ void main() { expect(_getIndicatorDecoration(tester)?.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))); }); - testWidgetsWithLeakTracking('Material3 - NavigationBar uses proper defaults when no parameters are given', (WidgetTester tester) async { + testWidgets('Material3 - NavigationBar uses proper defaults when no parameters are given', (WidgetTester tester) async { // M3 settings from the token database. final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -305,7 +304,7 @@ void main() { expect(_getIndicatorDecoration(tester)?.shape, const StadiumBorder()); }); - testWidgetsWithLeakTracking('Material2 - NavigationBar shows tooltips with text scaling', (WidgetTester tester) async { + testWidgets('Material2 - NavigationBar shows tooltips with text scaling', (WidgetTester tester) async { const String label = 'A'; Widget buildApp({ required double textScaleFactor }) { @@ -364,7 +363,7 @@ void main() { expect(tester.getSize(find.text(label).last), Size(defaultTooltipSize.width * 4, defaultTooltipSize.height * 4)); }); - testWidgetsWithLeakTracking('Material3 - NavigationBar shows tooltips with text scaling', (WidgetTester tester) async { + testWidgets('Material3 - NavigationBar shows tooltips with text scaling', (WidgetTester tester) async { const String label = 'A'; Widget buildApp({ required double textScaleFactor }) { @@ -426,7 +425,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Custom tooltips in NavigationBarDestination', (WidgetTester tester) async { + testWidgets('Custom tooltips in NavigationBarDestination', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -466,7 +465,7 @@ void main() { }); - testWidgetsWithLeakTracking('Navigation bar semantics', (WidgetTester tester) async { + testWidgets('Navigation bar semantics', (WidgetTester tester) async { Widget widget({int selectedIndex = 0}) { return _buildWidget( NavigationBar( @@ -530,7 +529,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Navigation bar semantics with some labels hidden', (WidgetTester tester) async { + testWidgets('Navigation bar semantics with some labels hidden', (WidgetTester tester) async { Widget widget({int selectedIndex = 0}) { return _buildWidget( NavigationBar( @@ -595,7 +594,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Navigation bar does not grow with text scale factor', (WidgetTester tester) async { + testWidgets('Navigation bar does not grow with text scale factor', (WidgetTester tester) async { const int animationMilliseconds = 800; Widget widget({double textScaleFactor = 1}) { @@ -628,7 +627,7 @@ void main() { expect(newHeight, equals(initialHeight)); }); - testWidgetsWithLeakTracking('Material3 - Navigation indicator renders ripple', (WidgetTester tester) async { + testWidgets('Material3 - Navigation indicator renders ripple', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/116751. int selectedIndex = 0; @@ -829,7 +828,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Material3 - Navigation indicator ripple golden test', (WidgetTester tester) async { + testWidgets('Material3 - Navigation indicator ripple golden test', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117420. Widget buildWidget({ NavigationDestinationLabelBehavior? labelBehavior }) { @@ -886,7 +885,7 @@ void main() { await expectLater(find.byType(NavigationBar), matchesGoldenFile('indicator_onlyShowSelected_unselected_m3.png')); }); - testWidgetsWithLeakTracking('Navigation indicator scale transform', (WidgetTester tester) async { + testWidgets('Navigation indicator scale transform', (WidgetTester tester) async { int selectedIndex = 0; Widget buildNavigationBar() { @@ -937,7 +936,7 @@ void main() { expect(transform.getColumn(0)[0], 1.0); }); - testWidgetsWithLeakTracking('Material3 - Navigation destination updates indicator color and shape', (WidgetTester tester) async { + testWidgets('Material3 - Navigation destination updates indicator color and shape', (WidgetTester tester) async { final ThemeData theme = ThemeData(); const Color color = Color(0xff0000ff); const ShapeBorder shape = RoundedRectangleBorder(); @@ -991,7 +990,7 @@ void main() { await expectLater(find.byType(NavigationBar), matchesGoldenFile('m3.navigation_bar.custom.indicator.inkwell.shape.png')); }); - testWidgetsWithLeakTracking('Destinations respect their disabled state', (WidgetTester tester) async { + testWidgets('Destinations respect their disabled state', (WidgetTester tester) async { int selectedIndex = 0; await tester.pumpWidget( @@ -1028,7 +1027,7 @@ void main() { expect(selectedIndex, 1); }); - testWidgetsWithLeakTracking('NavigationBar respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('NavigationBar respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoverColor = Color(0xff0000ff); const Color focusColor = Color(0xff00ffff); @@ -1113,7 +1112,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - Navigation destination updates indicator color and shape', (WidgetTester tester) async { + testWidgets('Material2 - Navigation destination updates indicator color and shape', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); const Color color = Color(0xff0000ff); const ShapeBorder shape = RoundedRectangleBorder(); @@ -1157,7 +1156,7 @@ void main() { expect(_getIndicatorDecoration(tester)?.shape, shape); }); - testWidgetsWithLeakTracking('Material2 - Navigation indicator renders ripple', (WidgetTester tester) async { + testWidgets('Material2 - Navigation indicator renders ripple', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/116751. int selectedIndex = 0; @@ -1358,7 +1357,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Navigation indicator ripple golden test', (WidgetTester tester) async { + testWidgets('Material2 - Navigation indicator ripple golden test', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117420. Widget buildWidget({ NavigationDestinationLabelBehavior? labelBehavior }) { @@ -1415,7 +1414,7 @@ void main() { await expectLater(find.byType(NavigationBar), matchesGoldenFile('indicator_onlyShowSelected_unselected_m2.png')); }); - testWidgetsWithLeakTracking('Destination icon does not rebuild when tapped', (WidgetTester tester) async { + testWidgets('Destination icon does not rebuild when tapped', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/122811. Widget buildNavigationBar() { diff --git a/packages/flutter/test/material/navigation_bar_theme_test.dart b/packages/flutter/test/material/navigation_bar_theme_test.dart index 028c0ffbdeb..0362aa0a20d 100644 --- a/packages/flutter/test/material/navigation_bar_theme_test.dart +++ b/packages/flutter/test/material/navigation_bar_theme_test.dart @@ -13,7 +13,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('copyWith, ==, hashCode basics', () { @@ -27,7 +26,7 @@ void main() { expect(identical(NavigationBarThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Default debugFillProperties', (WidgetTester tester) async { + testWidgets('Default debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const NavigationBarThemeData().debugFillProperties(builder); @@ -39,7 +38,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('Custom debugFillProperties', (WidgetTester tester) async { + testWidgets('Custom debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const NavigationBarThemeData( height: 200.0, @@ -71,7 +70,7 @@ void main() { expect(description[8], 'overlayColor: MaterialStatePropertyAll(Color(0x00000096))'); }); - testWidgetsWithLeakTracking('NavigationBarThemeData values are used when no NavigationBar properties are specified', (WidgetTester tester) async { + testWidgets('NavigationBarThemeData values are used when no NavigationBar properties are specified', (WidgetTester tester) async { const double height = 200.0; const Color backgroundColor = Color(0x00000001); const double elevation = 42.0; @@ -143,7 +142,7 @@ void main() { expect(_labelBehavior(tester), labelBehavior); }); - testWidgetsWithLeakTracking('NavigationBar values take priority over NavigationBarThemeData values when both properties are specified', (WidgetTester tester) async { + testWidgets('NavigationBar values take priority over NavigationBarThemeData values when both properties are specified', (WidgetTester tester) async { const double height = 200.0; const Color backgroundColor = Color(0x00000001); const double elevation = 42.0; @@ -177,7 +176,7 @@ void main() { expect(_labelBehavior(tester), labelBehavior); }); - testWidgetsWithLeakTracking('Custom label style renders ink ripple properly', (WidgetTester tester) async { + testWidgets('Custom label style renders ink ripple properly', (WidgetTester tester) async { Widget buildWidget({ NavigationDestinationLabelBehavior? labelBehavior }) { return MaterialApp( theme: ThemeData( @@ -219,7 +218,7 @@ void main() { await expectLater(find.byType(NavigationBar), matchesGoldenFile('indicator_custom_label_style.png')); }); - testWidgetsWithLeakTracking('NavigationBar respects NavigationBarTheme.overlayColor in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('NavigationBar respects NavigationBarTheme.overlayColor in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoverColor = Color(0xff0000ff); const Color focusColor = Color(0xff00ffff); diff --git a/packages/flutter/test/material/navigation_drawer_test.dart b/packages/flutter/test/material/navigation_drawer_test.dart index bf6ab6132b7..1d571afaae2 100644 --- a/packages/flutter/test/material/navigation_drawer_test.dart +++ b/packages/flutter/test/material/navigation_drawer_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Navigation drawer updates destinations when tapped', + testWidgets('Navigation drawer updates destinations when tapped', (WidgetTester tester) async { int mutatedIndex = -1; final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -50,7 +49,7 @@ void main() { expect(mutatedIndex, 0); }); - testWidgetsWithLeakTracking('NavigationDrawer can update background color', + testWidgets('NavigationDrawer can update background color', (WidgetTester tester) async { const Color color = Colors.yellow; final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -83,7 +82,7 @@ void main() { expect(_getMaterial(tester).color, equals(color)); }); - testWidgetsWithLeakTracking('NavigationDrawer can update destination background color', + testWidgets('NavigationDrawer can update destination background color', (WidgetTester tester) async { const Color color = Colors.yellow; final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -121,7 +120,7 @@ void main() { expect(destinationColor.color, equals(color)); }); - testWidgetsWithLeakTracking('NavigationDrawer can update elevation', + testWidgets('NavigationDrawer can update elevation', (WidgetTester tester) async { const double elevation = 42.0; final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -153,7 +152,7 @@ void main() { expect(_getMaterial(tester).elevation, equals(elevation)); }); - testWidgetsWithLeakTracking( + testWidgets( 'NavigationDrawer uses proper defaults when no parameters are given', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -202,7 +201,7 @@ void main() { expect(iconBox.size, const Size(24.0, 24.0)); }); - testWidgetsWithLeakTracking('Navigation drawer is scrollable', (WidgetTester tester) async { + testWidgets('Navigation drawer is scrollable', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); widgetSetup(tester, 500, viewHeight: 300); await tester.pumpWidget( @@ -249,7 +248,7 @@ void main() { expect(find.text('Label10'), findsNothing); }); - testWidgetsWithLeakTracking('Safe Area test', (WidgetTester tester) async { + testWidgets('Safe Area test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const double viewHeight = 300; widgetSetup(tester, 500, viewHeight: viewHeight); @@ -290,7 +289,7 @@ void main() { expect(tester.getBottomRight(find.widgetWithText(NavigationDrawerDestination,'Label4')).dy, viewHeight); }); - testWidgetsWithLeakTracking('Navigation drawer semantics', (WidgetTester tester) async { + testWidgets('Navigation drawer semantics', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final ThemeData theme = ThemeData(); Widget widget({int selectedIndex = 0}) { @@ -360,7 +359,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Navigation destination updates indicator color and shape', (WidgetTester tester) async { + testWidgets('Navigation destination updates indicator color and shape', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final ThemeData theme = ThemeData(useMaterial3: true); const Color color = Color(0xff0000ff); @@ -411,7 +410,7 @@ void main() { expect(_getInkWell(tester)?.customBorder, shape); }); - testWidgetsWithLeakTracking('NavigationDrawer.tilePadding defaults to EdgeInsets.symmetric(horizontal: 12.0)', (WidgetTester tester) async { + testWidgets('NavigationDrawer.tilePadding defaults to EdgeInsets.symmetric(horizontal: 12.0)', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); widgetSetup(tester, 3000, viewHeight: 3000); final Widget widget = _buildWidget( @@ -434,7 +433,7 @@ void main() { expect(drawer.tilePadding, const EdgeInsets.symmetric(horizontal: 12.0)); }); - testWidgetsWithLeakTracking('Destinations respect their disabled state', (WidgetTester tester) async { + testWidgets('Destinations respect their disabled state', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); int selectedIndex = 0; diff --git a/packages/flutter/test/material/navigation_drawer_theme_test.dart b/packages/flutter/test/material/navigation_drawer_theme_test.dart index f055198c020..2df6b7edf2b 100644 --- a/packages/flutter/test/material/navigation_drawer_theme_test.dart +++ b/packages/flutter/test/material/navigation_drawer_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('NavigationDrawerThemeData copyWith, ==, hashCode, basics', () { @@ -19,7 +18,7 @@ void main() { expect(identical(NavigationDrawerThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Default debugFillProperties', (WidgetTester tester) async { + testWidgets('Default debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const NavigationDrawerThemeData().debugFillProperties(builder); @@ -31,7 +30,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('NavigationDrawerThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('NavigationDrawerThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const NavigationDrawerThemeData( tileHeight: 50, @@ -67,7 +66,7 @@ void main() { )); }); - testWidgetsWithLeakTracking( + testWidgets( 'NavigationDrawerThemeData values are used when no NavigationDrawer properties are specified', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -135,7 +134,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'NavigationDrawer values take priority over NavigationDrawerThemeData values when both properties are specified', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -197,7 +196,7 @@ void main() { expect(_getIndicatorDecoration(tester)?.shape, indicatorShape); }); - testWidgetsWithLeakTracking('Local NavigationDrawerTheme takes priority over ThemeData.navigationDrawerTheme', (WidgetTester tester) async { + testWidgets('Local NavigationDrawerTheme takes priority over ThemeData.navigationDrawerTheme', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const Color backgroundColor = Color(0x00000009); const double elevation = 7.0; diff --git a/packages/flutter/test/material/navigation_rail_test.dart b/packages/flutter/test/material/navigation_rail_test.dart index 12ace20d390..916b6594295 100644 --- a/packages/flutter/test/material/navigation_rail_test.dart +++ b/packages/flutter/test/material/navigation_rail_test.dart @@ -7,11 +7,10 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Custom selected and unselected textStyles are honored', (WidgetTester tester) async { + testWidgets('Custom selected and unselected textStyles are honored', (WidgetTester tester) async { const TextStyle selectedTextStyle = TextStyle(fontWeight: FontWeight.w300, fontSize: 17.0); const TextStyle unselectedTextStyle = TextStyle(fontWeight: FontWeight.w800, fontSize: 11.0); @@ -34,7 +33,7 @@ void main() { expect(actualUnselectedTextStyle.fontWeight, equals(actualUnselectedTextStyle.fontWeight)); }); - testWidgetsWithLeakTracking('Custom selected and unselected iconThemes are honored', (WidgetTester tester) async { + testWidgets('Custom selected and unselected iconThemes are honored', (WidgetTester tester) async { const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(0x00000001)); const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(0x00000002)); @@ -57,7 +56,7 @@ void main() { expect(actualUnselectedIconTheme.fontSize, equals(unselectedIconTheme.size)); }); - testWidgetsWithLeakTracking('No selected destination when selectedIndex is null', (WidgetTester tester) async { + testWidgets('No selected destination when selectedIndex is null', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -70,7 +69,7 @@ void main() { expect(semantics.where((Semantics s) => s.properties.selected ?? false), isEmpty); }); - testWidgetsWithLeakTracking('backgroundColor can be changed', (WidgetTester tester) async { + testWidgets('backgroundColor can be changed', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -95,7 +94,7 @@ void main() { expect(_railMaterial(tester).color, equals(Colors.green)); }); - testWidgetsWithLeakTracking('elevation can be changed', (WidgetTester tester) async { + testWidgets('elevation can be changed', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -120,7 +119,7 @@ void main() { expect(_railMaterial(tester).elevation, equals(7)); }); - testWidgetsWithLeakTracking('Renders at the correct default width - [labelType]=none (default)', (WidgetTester tester) async { + testWidgets('Renders at the correct default width - [labelType]=none (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -133,7 +132,7 @@ void main() { expect(renderBox.size.width, 80.0); }); - testWidgetsWithLeakTracking('Renders at the correct default width - [labelType]=selected', (WidgetTester tester) async { + testWidgets('Renders at the correct default width - [labelType]=selected', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -147,7 +146,7 @@ void main() { expect(renderBox.size.width, 80.0); }); - testWidgetsWithLeakTracking('Renders at the correct default width - [labelType]=all', (WidgetTester tester) async { + testWidgets('Renders at the correct default width - [labelType]=all', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -161,7 +160,7 @@ void main() { expect(renderBox.size.width, 80.0); }); - testWidgetsWithLeakTracking('Renders wider for a destination with a long label - [labelType]=all', (WidgetTester tester) async { + testWidgets('Renders wider for a destination with a long label - [labelType]=all', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -187,7 +186,7 @@ void main() { expect(renderBox.size.width, _labelRenderBox(tester, 'Longer Label').size.width + 16.0); }); - testWidgetsWithLeakTracking('Renders only icons - [labelType]=none (default)', (WidgetTester tester) async { + testWidgets('Renders only icons - [labelType]=none (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -208,7 +207,7 @@ void main() { expect(_labelOpacity(tester, 'Jkl'), 0); }); - testWidgetsWithLeakTracking('Renders icons and labels - [labelType]=all', (WidgetTester tester) async { + testWidgets('Renders icons and labels - [labelType]=all', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -235,7 +234,7 @@ void main() { expect(_opacityAboveLabel('Jkl'), findsNothing); }); - testWidgetsWithLeakTracking('Renders icons and selected label - [labelType]=selected', (WidgetTester tester) async { + testWidgets('Renders icons and selected label - [labelType]=selected', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -257,7 +256,7 @@ void main() { expect(_labelOpacity(tester, 'Jkl'), 0); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -331,7 +330,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=3.0', (WidgetTester tester) async { // Since the rail is icon only, its destinations should not be affected by // textScaleFactor. @@ -409,7 +408,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=0.75', (WidgetTester tester) async { // Since the rail is icon only, its destinations should not be affected by // textScaleFactor. @@ -487,7 +486,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -584,7 +583,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=3.0', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -682,7 +681,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=0.75', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -780,7 +779,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=all, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=all, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -877,7 +876,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=all, [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=all, [textScaleFactor]=3.0', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -975,7 +974,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=all, [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=all, [textScaleFactor]=0.75', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1073,7 +1072,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1148,7 +1147,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=3.0', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1226,7 +1225,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=0.75', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1304,7 +1303,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Group alignment works - [groupAlignment]=-1.0 (default)', (WidgetTester tester) async { + testWidgets('Group alignment works - [groupAlignment]=-1.0 (default)', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1378,7 +1377,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Group alignment works - [groupAlignment]=0.0', (WidgetTester tester) async { + testWidgets('Group alignment works - [groupAlignment]=0.0', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1453,7 +1452,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Group alignment works - [groupAlignment]=1.0', (WidgetTester tester) async { + testWidgets('Group alignment works - [groupAlignment]=1.0', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1528,7 +1527,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Leading and trailing appear in the correct places', (WidgetTester tester) async { + testWidgets('Leading and trailing appear in the correct places', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -1545,7 +1544,7 @@ void main() { expect(trailing.localToGlobal(Offset.zero), Offset((80 - trailing.size.width) / 2, 248.0)); }); - testWidgetsWithLeakTracking('Extended rail animates the width and labels appear - [textDirection]=LTR', (WidgetTester tester) async { + testWidgets('Extended rail animates the width and labels appear - [textDirection]=LTR', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1691,7 +1690,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Extended rail animates the width and labels appear - [textDirection]=RTL', (WidgetTester tester) async { + testWidgets('Extended rail animates the width and labels appear - [textDirection]=RTL', (WidgetTester tester) async { // Padding at the top of the rail. const double topPadding = 8.0; // Width of a destination. @@ -1844,7 +1843,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Extended rail gets wider with longer labels are larger text scale', (WidgetTester tester) async { + testWidgets('Extended rail gets wider with longer labels are larger text scale', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -1903,7 +1902,7 @@ void main() { expect(rail.size.width, equals(526.0)); }); - testWidgetsWithLeakTracking('Extended rail final width can be changed', (WidgetTester tester) async { + testWidgets('Extended rail final width can be changed', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -1946,7 +1945,7 @@ void main() { }); /// Regression test for https://github.com/flutter/flutter/issues/65657 - testWidgetsWithLeakTracking('Extended rail transition does not jump from the beginning', (WidgetTester tester) async { + testWidgets('Extended rail transition does not jump from the beginning', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -2005,7 +2004,7 @@ void main() { expect(tester.getSize(rail).width, closeTo(80.0, 1.0)); }); - testWidgetsWithLeakTracking('Extended rail animation can be consumed', (WidgetTester tester) async { + testWidgets('Extended rail animation can be consumed', (WidgetTester tester) async { bool extended = false; late Animation<double> animation; late StateSetter stateSetter; @@ -2050,7 +2049,7 @@ void main() { expect(animation.isCompleted, isTrue); }); - testWidgetsWithLeakTracking('onDestinationSelected is called', (WidgetTester tester) async { + testWidgets('onDestinationSelected is called', (WidgetTester tester) async { late int selectedIndex; await _pumpNavigationRail( @@ -2075,7 +2074,7 @@ void main() { tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('onDestinationSelected is not called if null', (WidgetTester tester) async { + testWidgets('onDestinationSelected is not called if null', (WidgetTester tester) async { const int selectedIndex = 0; await _pumpNavigationRail( tester, @@ -2093,7 +2092,7 @@ void main() { tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Changing destinations animate when [labelType]=selected', (WidgetTester tester) async { + testWidgets('Changing destinations animate when [labelType]=selected', (WidgetTester tester) async { int selectedIndex = 0; await tester.pumpWidget( @@ -2158,7 +2157,7 @@ void main() { expect(_labelOpacity(tester, 'Ghi'), equals(1.0)); }); - testWidgetsWithLeakTracking('Changing destinations animate for selectedIndex=null', (WidgetTester tester) async { + testWidgets('Changing destinations animate for selectedIndex=null', (WidgetTester tester) async { int? selectedIndex = 0; late StateSetter stateSetter; @@ -2213,7 +2212,7 @@ void main() { expect(_labelOpacity(tester, 'Abc'), equals(1.0)); }); - testWidgetsWithLeakTracking('Changing destinations animate when selectedIndex=null during transition', (WidgetTester tester) async { + testWidgets('Changing destinations animate when selectedIndex=null during transition', (WidgetTester tester) async { int? selectedIndex = 0; late StateSetter stateSetter; @@ -2268,7 +2267,7 @@ void main() { expect(_labelOpacity(tester, 'Def'), equals(0.0)); }); - testWidgetsWithLeakTracking('Semantics - labelType=[none]', (WidgetTester tester) async { + testWidgets('Semantics - labelType=[none]', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await _pumpLocalizedTestRail(tester, labelType: NavigationRailLabelType.none); @@ -2278,7 +2277,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics - labelType=[selected]', (WidgetTester tester) async { + testWidgets('Semantics - labelType=[selected]', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await _pumpLocalizedTestRail(tester, labelType: NavigationRailLabelType.selected); @@ -2288,7 +2287,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics - labelType=[all]', (WidgetTester tester) async { + testWidgets('Semantics - labelType=[all]', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await _pumpLocalizedTestRail(tester, labelType: NavigationRailLabelType.all); @@ -2298,7 +2297,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics - extended', (WidgetTester tester) async { + testWidgets('Semantics - extended', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await _pumpLocalizedTestRail(tester, extended: true); @@ -2308,7 +2307,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('NavigationRailDestination padding properly applied - NavigationRailLabelType.all', (WidgetTester tester) async { + testWidgets('NavigationRailDestination padding properly applied - NavigationRailLabelType.all', (WidgetTester tester) async { const EdgeInsets defaultPadding = EdgeInsets.symmetric(horizontal: 8.0); const EdgeInsets secondItemPadding = EdgeInsets.symmetric(vertical: 30.0); const EdgeInsets thirdItemPadding = EdgeInsets.symmetric(horizontal: 10.0); @@ -2365,7 +2364,7 @@ void main() { expect(thirdItem.padding, thirdItemPadding); }); - testWidgetsWithLeakTracking('NavigationRailDestination padding properly applied - NavigationRailLabelType.selected', (WidgetTester tester) async { + testWidgets('NavigationRailDestination padding properly applied - NavigationRailLabelType.selected', (WidgetTester tester) async { const EdgeInsets defaultPadding = EdgeInsets.symmetric(horizontal: 8.0); const EdgeInsets secondItemPadding = EdgeInsets.symmetric(vertical: 30.0); const EdgeInsets thirdItemPadding = EdgeInsets.symmetric(horizontal: 10.0); @@ -2422,7 +2421,7 @@ void main() { expect(thirdItem.padding, thirdItemPadding); }); - testWidgetsWithLeakTracking('NavigationRailDestination padding properly applied - NavigationRailLabelType.none', (WidgetTester tester) async { + testWidgets('NavigationRailDestination padding properly applied - NavigationRailLabelType.none', (WidgetTester tester) async { const EdgeInsets defaultPadding = EdgeInsets.zero; const EdgeInsets secondItemPadding = EdgeInsets.symmetric(vertical: 30.0); const EdgeInsets thirdItemPadding = EdgeInsets.symmetric(horizontal: 10.0); @@ -2479,7 +2478,7 @@ void main() { expect(thirdItem.padding, thirdItemPadding); }); - testWidgetsWithLeakTracking('NavigationRailDestination adds indicator by default when ThemeData.useMaterial3 is true', (WidgetTester tester) async { + testWidgets('NavigationRailDestination adds indicator by default when ThemeData.useMaterial3 is true', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2508,7 +2507,7 @@ void main() { expect(find.byType(NavigationIndicator), findsWidgets); }); - testWidgetsWithLeakTracking('NavigationRailDestination adds indicator when useIndicator is true', (WidgetTester tester) async { + testWidgets('NavigationRailDestination adds indicator when useIndicator is true', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2538,7 +2537,7 @@ void main() { expect(find.byType(NavigationIndicator), findsWidgets); }); - testWidgetsWithLeakTracking('NavigationRailDestination does not add indicator when useIndicator is false', (WidgetTester tester) async { + testWidgets('NavigationRailDestination does not add indicator when useIndicator is false', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2568,7 +2567,7 @@ void main() { expect(find.byType(NavigationIndicator), findsNothing); }); - testWidgetsWithLeakTracking('NavigationRailDestination adds an oval indicator when no labels are present', (WidgetTester tester) async { + testWidgets('NavigationRailDestination adds an oval indicator when no labels are present', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2601,7 +2600,7 @@ void main() { expect(indicator.height, 32); }); - testWidgetsWithLeakTracking('NavigationRailDestination adds an oval indicator when selected labels are present', (WidgetTester tester) async { + testWidgets('NavigationRailDestination adds an oval indicator when selected labels are present', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2634,7 +2633,7 @@ void main() { expect(indicator.height, 32); }); - testWidgetsWithLeakTracking('NavigationRailDestination adds an oval indicator when all labels are present', (WidgetTester tester) async { + testWidgets('NavigationRailDestination adds an oval indicator when all labels are present', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2667,7 +2666,7 @@ void main() { expect(indicator.height, 32); }); - testWidgetsWithLeakTracking('NavigationRailDestination has center aligned indicator - [labelType]=none', (WidgetTester tester) async { + testWidgets('NavigationRailDestination has center aligned indicator - [labelType]=none', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/97753 await _pumpNavigationRail( @@ -2711,7 +2710,7 @@ void main() { expect(lastIndicator.localToGlobal(Offset.zero).dx, 28.0); }); - testWidgetsWithLeakTracking('NavigationRail respects the notch/system navigation bar in landscape mode', (WidgetTester tester) async { + testWidgets('NavigationRail respects the notch/system navigation bar in landscape mode', (WidgetTester tester) async { const double safeAreaPadding = 40.0; NavigationRail navigationRail() { return NavigationRail( @@ -2764,7 +2763,7 @@ void main() { expect(updatedWidthRTL, defaultWidth + safeAreaPadding); }); - testWidgetsWithLeakTracking('NavigationRail indicator renders ripple', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders ripple', (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -2825,7 +2824,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('NavigationRail indicator renders ripple - extended', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders ripple - extended', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117126 await _pumpNavigationRail( tester, @@ -2888,7 +2887,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('NavigationRail indicator renders properly when padding is applied', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders properly when padding is applied', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117126 await _pumpNavigationRail( tester, @@ -2953,7 +2952,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Indicator renders properly when NavigationRai.minWidth < default minWidth', (WidgetTester tester) async { + testWidgets('Indicator renders properly when NavigationRai.minWidth < default minWidth', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117126 await _pumpNavigationRail( tester, @@ -3017,7 +3016,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('NavigationRail indicator renders properly with custom padding and minWidth', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders properly with custom padding and minWidth', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/117126 await _pumpNavigationRail( tester, @@ -3083,7 +3082,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('NavigationRail indicator renders properly with long labels', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders properly with long labels', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/128005. await _pumpNavigationRail( tester, @@ -3173,7 +3172,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('NavigationRail indicator renders properly with large icon', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders properly with large icon', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/133799. const double iconSize = 50; await _pumpNavigationRail( @@ -3276,7 +3275,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('NavigationRail indicator renders properly when text direction is rtl', (WidgetTester tester) async { + testWidgets('NavigationRail indicator renders properly when text direction is rtl', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/134361. await tester.pumpWidget(_buildWidget( NavigationRail( @@ -3375,7 +3374,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('NavigationRail indicator scale transform', (WidgetTester tester) async { + testWidgets('NavigationRail indicator scale transform', (WidgetTester tester) async { int selectedIndex = 0; Future<void> buildWidget() async { await _pumpNavigationRail( @@ -3419,7 +3418,7 @@ void main() { expect(transform.getColumn(0)[0], 1.0); }); - testWidgetsWithLeakTracking('Navigation destination updates indicator color and shape', (WidgetTester tester) async { + testWidgets('Navigation destination updates indicator color and shape', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const Color color = Color(0xff0000ff); const ShapeBorder shape = RoundedRectangleBorder(); @@ -3463,7 +3462,7 @@ void main() { expect(_getIndicatorDecoration(tester)?.shape, shape); }); - testWidgetsWithLeakTracking("Destination's respect their disabled state", (WidgetTester tester) async { + testWidgets("Destination's respect their disabled state", (WidgetTester tester) async { late int selectedIndex; await _pumpNavigationRail( tester, @@ -3507,7 +3506,7 @@ void main() { tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking("Destination's label with the right opacity while disabled", (WidgetTester tester) async { + testWidgets("Destination's label with the right opacity while disabled", (WidgetTester tester) async { await _pumpNavigationRail( tester, navigationRail: NavigationRail( @@ -3548,7 +3547,7 @@ void main() { expect(bcdLabelOpacity, closeTo(0.38, 0.01)); }); - testWidgetsWithLeakTracking('NavigationRail indicator inkwell can be transparent', (WidgetTester tester) async { + testWidgets('NavigationRail indicator inkwell can be transparent', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/135866. final ThemeData theme = ThemeData( colorScheme: const ColorScheme.light().copyWith(primary: Colors.transparent), @@ -3610,7 +3609,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Renders at the correct default width - [labelType]=none (default)', (WidgetTester tester) async { + testWidgets('Renders at the correct default width - [labelType]=none (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -3624,7 +3623,7 @@ void main() { expect(renderBox.size.width, 72.0); }); - testWidgetsWithLeakTracking('Renders at the correct default width - [labelType]=selected', (WidgetTester tester) async { + testWidgets('Renders at the correct default width - [labelType]=selected', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -3639,7 +3638,7 @@ void main() { expect(renderBox.size.width, 72.0); }); - testWidgetsWithLeakTracking('Renders at the correct default width - [labelType]=all', (WidgetTester tester) async { + testWidgets('Renders at the correct default width - [labelType]=all', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -3654,7 +3653,7 @@ void main() { expect(renderBox.size.width, 72.0); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -3721,7 +3720,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=3.0', (WidgetTester tester) async { // Since the rail is icon only, its destinations should not be affected by // textScaleFactor. await _pumpNavigationRail( @@ -3791,7 +3790,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=none (default), [textScaleFactor]=0.75', (WidgetTester tester) async { // Since the rail is icon only, its destinations should not be affected by // textScaleFactor. await _pumpNavigationRail( @@ -3861,7 +3860,7 @@ void main() { ); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -3939,7 +3938,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=3.0', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4018,7 +4017,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=selected, [textScaleFactor]=0.75', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4097,7 +4096,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=all, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=all, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4205,7 +4204,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=all, [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=all, [textScaleFactor]=3.0', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4312,7 +4311,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct - [labelType]=all, [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct - [labelType]=all, [textScaleFactor]=0.75', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4422,7 +4421,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { + testWidgets('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=1.0 (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4490,7 +4489,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=3.0', (WidgetTester tester) async { + testWidgets('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=3.0', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4561,7 +4560,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=0.75', (WidgetTester tester) async { + testWidgets('Destination spacing is correct for a compact rail - [preferredWidth]=56, [textScaleFactor]=0.75', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4632,7 +4631,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Group alignment works - [groupAlignment]=-1.0 (default)', (WidgetTester tester) async { + testWidgets('Group alignment works - [groupAlignment]=-1.0 (default)', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4696,7 +4695,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Group alignment works - [groupAlignment]=0.0', (WidgetTester tester) async { + testWidgets('Group alignment works - [groupAlignment]=0.0', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4759,7 +4758,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Group alignment works - [groupAlignment]=1.0', (WidgetTester tester) async { + testWidgets('Group alignment works - [groupAlignment]=1.0', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4822,7 +4821,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Leading and trailing appear in the correct places', (WidgetTester tester) async { + testWidgets('Leading and trailing appear in the correct places', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -4840,7 +4839,7 @@ void main() { expect(trailing.localToGlobal(Offset.zero), Offset((72 - trailing.size.width) / 2.0, 360.0)); }); - testWidgetsWithLeakTracking('Extended rail animates the width and labels appear - [textDirection]=LTR', (WidgetTester tester) async { + testWidgets('Extended rail animates the width and labels appear - [textDirection]=LTR', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -4978,7 +4977,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Extended rail animates the width and labels appear - [textDirection]=RTL', (WidgetTester tester) async { + testWidgets('Extended rail animates the width and labels appear - [textDirection]=RTL', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -5123,7 +5122,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Extended rail gets wider with longer labels are larger text scale', (WidgetTester tester) async { + testWidgets('Extended rail gets wider with longer labels are larger text scale', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -5182,7 +5181,7 @@ void main() { expect(rail.size.width, equals(584.0)); }); - testWidgetsWithLeakTracking('Extended rail final width can be changed', (WidgetTester tester) async { + testWidgets('Extended rail final width can be changed', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -5225,7 +5224,7 @@ void main() { }); /// Regression test for https://github.com/flutter/flutter/issues/65657 - testWidgetsWithLeakTracking('Extended rail transition does not jump from the beginning', (WidgetTester tester) async { + testWidgets('Extended rail transition does not jump from the beginning', (WidgetTester tester) async { bool extended = false; late StateSetter stateSetter; @@ -5284,7 +5283,7 @@ void main() { expect(tester.getSize(rail).width, closeTo(72.0, 1.0)); }); - testWidgetsWithLeakTracking('NavigationRailDestination adds circular indicator when no labels are present', (WidgetTester tester) async { + testWidgets('NavigationRailDestination adds circular indicator when no labels are present', (WidgetTester tester) async { await _pumpNavigationRail( tester, useMaterial3: false, @@ -5318,7 +5317,7 @@ void main() { expect(indicator.height, 56); }); - testWidgetsWithLeakTracking('NavigationRailDestination has center aligned indicator - [labelType]=none', (WidgetTester tester) async { + testWidgets('NavigationRailDestination has center aligned indicator - [labelType]=none', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/97753 await _pumpNavigationRail( @@ -5363,7 +5362,7 @@ void main() { expect(lastIndicator.localToGlobal(Offset.zero).dx, 24.0); }); - testWidgetsWithLeakTracking('NavigationRail respects the notch/system navigation bar in landscape mode', (WidgetTester tester) async { + testWidgets('NavigationRail respects the notch/system navigation bar in landscape mode', (WidgetTester tester) async { const double safeAreaPadding = 40.0; NavigationRail navigationRail() { return NavigationRail( diff --git a/packages/flutter/test/material/navigation_rail_theme_test.dart b/packages/flutter/test/material/navigation_rail_theme_test.dart index c3c29ce5135..7a56586ca26 100644 --- a/packages/flutter/test/material/navigation_rail_theme_test.dart +++ b/packages/flutter/test/material/navigation_rail_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('copyWith, ==, hashCode basics', () { @@ -13,7 +12,7 @@ void main() { expect(const NavigationRailThemeData().hashCode, const NavigationRailThemeData().copyWith().hashCode); }); - testWidgetsWithLeakTracking('Material3 - Default values are used when no NavigationRail or NavigationRailThemeData properties are specified', (WidgetTester tester) async { + testWidgets('Material3 - Default values are used when no NavigationRail or NavigationRailThemeData properties are specified', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: true); // Material 3 defaults await tester.pumpWidget( @@ -48,7 +47,7 @@ void main() { expect(inkResponse.customBorder, const StadiumBorder()); }); - testWidgetsWithLeakTracking('Material2 - Default values are used when no NavigationRail or NavigationRailThemeData properties are specified', (WidgetTester tester) async { + testWidgets('Material2 - Default values are used when no NavigationRail or NavigationRailThemeData properties are specified', (WidgetTester tester) async { // This test can be removed when `useMaterial3` is deprecated. await tester.pumpWidget( MaterialApp( @@ -78,7 +77,7 @@ void main() { expect(find.byType(NavigationIndicator), findsNothing); }); - testWidgetsWithLeakTracking('NavigationRailThemeData values are used when no NavigationRail properties are specified', (WidgetTester tester) async { + testWidgets('NavigationRailThemeData values are used when no NavigationRail properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0x00000001); const double elevation = 7.0; const double selectedIconSize = 25.0; @@ -146,7 +145,7 @@ void main() { expect(_indicatorDecoration(tester)?.shape, indicatorShape); }); - testWidgetsWithLeakTracking('NavigationRail values take priority over NavigationRailThemeData values when both properties are specified', (WidgetTester tester) async { + testWidgets('NavigationRail values take priority over NavigationRailThemeData values when both properties are specified', (WidgetTester tester) async { const Color backgroundColor = Color(0x00000001); const double elevation = 7.0; const double selectedIconSize = 25.0; @@ -230,14 +229,14 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/118618. - testWidgetsWithLeakTracking('NavigationRailThemeData lerps correctly with null iconThemes', (WidgetTester tester) async { + testWidgets('NavigationRailThemeData lerps correctly with null iconThemes', (WidgetTester tester) async { final NavigationRailThemeData lerp = NavigationRailThemeData.lerp(const NavigationRailThemeData(), const NavigationRailThemeData(), 0.5)!; expect(lerp.selectedIconTheme, isNull); expect(lerp.unselectedIconTheme, isNull); }); - testWidgetsWithLeakTracking('Default debugFillProperties', (WidgetTester tester) async { + testWidgets('Default debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const NavigationRailThemeData().debugFillProperties(builder); @@ -249,7 +248,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('Custom debugFillProperties', (WidgetTester tester) async { + testWidgets('Custom debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const NavigationRailThemeData( backgroundColor: Color(0x00000099), diff --git a/packages/flutter/test/material/outlined_button_test.dart b/packages/flutter/test/material/outlined_button_test.dart index b01203e07f8..a2f640e6cb7 100644 --- a/packages/flutter/test/material/outlined_button_test.dart +++ b/packages/flutter/test/material/outlined_button_test.dart @@ -7,11 +7,10 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('OutlinedButton, OutlinedButton.icon defaults', (WidgetTester tester) async { + testWidgets('OutlinedButton, OutlinedButton.icon defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: colorScheme); final bool material3 = theme.useMaterial3; @@ -175,7 +174,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('OutlinedButton default overlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('OutlinedButton default overlayColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -230,7 +229,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does OutlinedButton work with hover', (WidgetTester tester) async { + testWidgets('Does OutlinedButton work with hover', (WidgetTester tester) async { const Color hoverColor = Color(0xff001122); Color? getOverlayColor(Set<MaterialState> states) { @@ -258,7 +257,7 @@ void main() { expect(inkFeatures, paints..rect(color: hoverColor)); }); - testWidgetsWithLeakTracking('Does OutlinedButton work with focus', (WidgetTester tester) async { + testWidgets('Does OutlinedButton work with focus', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; const Color focusColor = Color(0xff001122); @@ -301,7 +300,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does OutlinedButton work with autofocus', (WidgetTester tester) async { + testWidgets('Does OutlinedButton work with autofocus', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; const Color focusColor = Color(0xff001122); @@ -344,7 +343,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Default OutlinedButton meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('Default OutlinedButton meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -393,7 +392,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('OutlinedButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('OutlinedButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); Color getTextColor(Set<MaterialState> states) { @@ -464,7 +463,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('OutlinedButton uses stateful color for text color in different states', (WidgetTester tester) async { + testWidgets('OutlinedButton uses stateful color for text color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); const Color pressedColor = Color(0x00000001); @@ -533,7 +532,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('OutlinedButton uses stateful color for icon color in different states', (WidgetTester tester) async { + testWidgets('OutlinedButton uses stateful color for icon color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final Key buttonKey = UniqueKey(); @@ -602,7 +601,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('OutlinedButton uses stateful color for border color in different states', (WidgetTester tester) async { + testWidgets('OutlinedButton uses stateful color for border color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); const Color pressedColor = Color(0x00000001); @@ -672,7 +671,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('OutlinedButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { + testWidgets('OutlinedButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { bool wasPressed; Finder outlinedButton; @@ -716,7 +715,7 @@ void main() { expect(tester.widget<OutlinedButton>(outlinedButton).enabled, false); }); - testWidgetsWithLeakTracking("OutlinedButton response doesn't hover when disabled", (WidgetTester tester) async { + testWidgets("OutlinedButton response doesn't hover when disabled", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'OutlinedButton Focus'); final GlobalKey childKey = GlobalKey(); @@ -768,7 +767,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('disabled and hovered OutlinedButton responds to mouse-exit', (WidgetTester tester) async { + testWidgets('disabled and hovered OutlinedButton responds to mouse-exit', (WidgetTester tester) async { int onHoverCount = 0; late bool hover; @@ -830,7 +829,7 @@ void main() { expect(hover, false); }); - testWidgetsWithLeakTracking('Can set OutlinedButton focus and Can set unFocus.', (WidgetTester tester) async { + testWidgets('Can set OutlinedButton focus and Can set unFocus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'OutlinedButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -861,7 +860,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('When OutlinedButton disable, Can not set OutlinedButton focus.', (WidgetTester tester) async { + testWidgets('When OutlinedButton disable, Can not set OutlinedButton focus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'OutlinedButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -886,7 +885,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking("Outline button doesn't crash if disabled during a gesture", (WidgetTester tester) async { + testWidgets("Outline button doesn't crash if disabled during a gesture", (WidgetTester tester) async { Widget buildFrame(VoidCallback? onPressed) { return Directionality( textDirection: TextDirection.ltr, @@ -906,7 +905,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('OutlinedButton shape and border component overrides', (WidgetTester tester) async { + testWidgets('OutlinedButton shape and border component overrides', (WidgetTester tester) async { const Color fillColor = Color(0xFF00FF00); const BorderSide disabledBorderSide = BorderSide(color: Color(0xFFFF0000), width: 3); const BorderSide enabledBorderSide = BorderSide(color: Color(0xFFFF00FF), width: 4); @@ -984,7 +983,7 @@ void main() { expect(getBorderSide(), enabledBorderSide); }); - testWidgetsWithLeakTracking('OutlinedButton has no clip by default', (WidgetTester tester) async { + testWidgets('OutlinedButton has no clip by default', (WidgetTester tester) async { final GlobalKey buttonKey = GlobalKey(); await tester.pumpWidget( Directionality( @@ -1006,7 +1005,7 @@ void main() { }); - testWidgetsWithLeakTracking('OutlinedButton contributes semantics', (WidgetTester tester) async { + testWidgets('OutlinedButton contributes semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Theme( @@ -1054,7 +1053,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('OutlinedButton scales textScaleFactor', (WidgetTester tester) async { + testWidgets('OutlinedButton scales textScaleFactor', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -1134,7 +1133,7 @@ void main() { expect(tester.getSize(find.byType(Text)), const Size(126.0, 42.0)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/122066 - testWidgetsWithLeakTracking('OutlinedButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { + testWidgets('OutlinedButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { bool didPressButton = false; bool didLongPressButton = false; @@ -1165,7 +1164,7 @@ void main() { expect(didLongPressButton, isTrue); }); - testWidgetsWithLeakTracking('OutlinedButton responds to density changes.', (WidgetTester tester) async { + testWidgets('OutlinedButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key childKey = Key('test child'); @@ -1298,7 +1297,7 @@ void main() { if (textDirection == TextDirection.rtl) 'RTL', ].join(', '); - testWidgetsWithLeakTracking(testName, (WidgetTester tester) async { + testWidgets(testName, (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1442,7 +1441,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Override OutlinedButton default padding', (WidgetTester tester) async { + testWidgets('Override OutlinedButton default padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1476,7 +1475,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.all(22)); }); - testWidgetsWithLeakTracking('Override theme fontSize changes padding', (WidgetTester tester) async { + testWidgets('Override theme fontSize changes padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from( @@ -1507,7 +1506,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 12)); }); - testWidgetsWithLeakTracking('M3 OutlinedButton has correct padding', (WidgetTester tester) async { + testWidgets('M3 OutlinedButton has correct padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1533,7 +1532,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 24)); }); - testWidgetsWithLeakTracking('M3 OutlinedButton.icon has correct padding', (WidgetTester tester) async { + testWidgets('M3 OutlinedButton.icon has correct padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1560,7 +1559,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 24.0, 0.0)); }); - testWidgetsWithLeakTracking('Fixed size OutlinedButtons', (WidgetTester tester) async { + testWidgets('Fixed size OutlinedButtons', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1593,7 +1592,7 @@ void main() { expect(tester.getSize(find.widgetWithText(OutlinedButton, 'wx200')).height, 200); }); - testWidgetsWithLeakTracking('OutlinedButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { + testWidgets('OutlinedButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { Widget buildFrame({ InteractiveInkFeatureFactory? splashFactory }) { return MaterialApp( home: Scaffold( @@ -1633,7 +1632,7 @@ void main() { } }); - testWidgetsWithLeakTracking('OutlinedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { + testWidgets('OutlinedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -1660,7 +1659,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('OutlinedButton uses InkRipple when useMaterial3 is false', (WidgetTester tester) async { + testWidgets('OutlinedButton uses InkRipple when useMaterial3 is false', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( @@ -1682,7 +1681,7 @@ void main() { expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('OutlinedButton.icon does not overflow', (WidgetTester tester) async { + testWidgets('OutlinedButton.icon does not overflow', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/77815 await tester.pumpWidget( MaterialApp( @@ -1703,7 +1702,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('OutlinedButton.icon icon,label layout', (WidgetTester tester) async { + testWidgets('OutlinedButton.icon icon,label layout', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); final Key iconKey = UniqueKey(); final Key labelKey = UniqueKey(); @@ -1740,7 +1739,7 @@ void main() { expect(tester.getRect(find.byKey(labelKey)), const Rect.fromLTRB(104.0, 0.0, 154.0, 100.0)); }); - testWidgetsWithLeakTracking('OutlinedButton maximumSize', (WidgetTester tester) async { + testWidgets('OutlinedButton maximumSize', (WidgetTester tester) async { final Key key0 = UniqueKey(); final Key key1 = UniqueKey(); @@ -1782,7 +1781,7 @@ void main() { expect(tester.getSize(find.byKey(key1)), const Size(104.0, 224.0)); }); - testWidgetsWithLeakTracking('Fixed size OutlinedButton, same as minimumSize == maximumSize', (WidgetTester tester) async { + testWidgets('Fixed size OutlinedButton, same as minimumSize == maximumSize', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1812,7 +1811,7 @@ void main() { expect(tester.getSize(find.widgetWithText(OutlinedButton, '200,200')), const Size(200, 200)); }); - testWidgetsWithLeakTracking('OutlinedButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('OutlinedButton changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1890,7 +1889,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('OutlinedButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('OutlinedButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104595. await tester.pumpWidget(MaterialApp( home: SelectionArea( @@ -1913,7 +1912,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('OutlinedButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { + testWidgets('OutlinedButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -2044,15 +2043,15 @@ void main() { await gesture.removePointer(); } - testWidgetsWithLeakTracking('OutlinedButton statesController', (WidgetTester tester) async { + testWidgets('OutlinedButton statesController', (WidgetTester tester) async { testStatesController(null, tester); }); - testWidgetsWithLeakTracking('OutlinedButton.icon statesController', (WidgetTester tester) async { + testWidgets('OutlinedButton.icon statesController', (WidgetTester tester) async { testStatesController(const Icon(Icons.add), tester); }); - testWidgetsWithLeakTracking('Disabled OutlinedButton statesController', (WidgetTester tester) async { + testWidgets('Disabled OutlinedButton statesController', (WidgetTester tester) async { int count = 0; void valueChanged() { count += 1; @@ -2076,7 +2075,7 @@ void main() { expect(count, 1); }); - testWidgetsWithLeakTracking("OutlinedButton.styleFrom doesn't throw exception on passing only one cursor", (WidgetTester tester) async { + testWidgets("OutlinedButton.styleFrom doesn't throw exception on passing only one cursor", (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/118071. await tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/material/outlined_button_theme_test.dart b/packages/flutter/test/material/outlined_button_theme_test.dart index d29697eaa89..93e10033f75 100644 --- a/packages/flutter/test/material/outlined_button_theme_test.dart +++ b/packages/flutter/test/material/outlined_button_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('OutlinedButtonThemeData lerp special cases', () { @@ -13,7 +12,7 @@ void main() { expect(identical(OutlinedButtonThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Material3: Passing no OutlinedButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material3: Passing no OutlinedButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -54,7 +53,7 @@ void main() { expect(align.alignment, Alignment.center); }); - testWidgetsWithLeakTracking('Material2: Passing no OutlinedButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material2: Passing no OutlinedButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -197,19 +196,19 @@ void main() { expect(align.alignment, alignment); } - testWidgetsWithLeakTracking('Button style overrides defaults', (WidgetTester tester) async { + testWidgets('Button style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(themeStyle: style)); await tester.pumpAndSettle(); checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallStyle: style)); await tester.pumpAndSettle(); checkButton(tester); @@ -217,26 +216,26 @@ void main() { // Same as the previous tests with empty ButtonStyle's instead of null. - testWidgetsWithLeakTracking('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { + testWidgets('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style, themeStyle: const ButtonStyle(), overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: style, overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); }); - testWidgetsWithLeakTracking('Material3: Theme shadowColor', (WidgetTester tester) async { + testWidgets('Material3: Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); @@ -307,7 +306,7 @@ void main() { expect(material.shadowColor, shadowColor); }); - testWidgetsWithLeakTracking('Material2: Theme shadowColor', (WidgetTester tester) async { + testWidgets('Material2: Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); diff --git a/packages/flutter/test/material/page_selector_test.dart b/packages/flutter/test/material/page_selector_test.dart index 27da67f0940..8e988eda443 100644 --- a/packages/flutter/test/material/page_selector_test.dart +++ b/packages/flutter/test/material/page_selector_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Color kSelectedColor = Color(0xFF00FF00); const Color kUnselectedColor = Colors.transparent; @@ -65,7 +64,7 @@ List<Color> indicatorColors(WidgetTester tester) { } void main() { - testWidgetsWithLeakTracking('PageSelector responds correctly to setting the TabController index', (WidgetTester tester) async { + testWidgets('PageSelector responds correctly to setting the TabController index', (WidgetTester tester) async { final TabController tabController = TabController( vsync: const TestVSync(), length: 3, @@ -87,7 +86,7 @@ void main() { expect(indicatorColors(tester), const <Color>[kUnselectedColor, kUnselectedColor, kSelectedColor]); }); - testWidgetsWithLeakTracking('PageSelector responds correctly to TabController.animateTo()', (WidgetTester tester) async { + testWidgets('PageSelector responds correctly to TabController.animateTo()', (WidgetTester tester) async { final TabController tabController = TabController( vsync: const TestVSync(), length: 3, @@ -131,7 +130,7 @@ void main() { expect(indicatorColors(tester), const <Color>[kUnselectedColor, kUnselectedColor, kSelectedColor]); }); - testWidgetsWithLeakTracking('PageSelector responds correctly to TabBarView drags', (WidgetTester tester) async { + testWidgets('PageSelector responds correctly to TabBarView drags', (WidgetTester tester) async { final TabController tabController = TabController( vsync: const TestVSync(), initialIndex: 1, @@ -190,7 +189,7 @@ void main() { expect(indicatorColors(tester), const <Color>[kUnselectedColor, kSelectedColor, kUnselectedColor]); }); - testWidgetsWithLeakTracking('PageSelector indicatorColors', (WidgetTester tester) async { + testWidgets('PageSelector indicatorColors', (WidgetTester tester) async { const Color kRed = Color(0xFFFF0000); const Color kBlue = Color(0xFF0000FF); @@ -210,7 +209,7 @@ void main() { expect(indicatorColors(tester), const <Color>[kBlue, kRed, kRed]); }); - testWidgetsWithLeakTracking('PageSelector indicatorSize', (WidgetTester tester) async { + testWidgets('PageSelector indicatorSize', (WidgetTester tester) async { final TabController tabController = TabController( vsync: const TestVSync(), initialIndex: 1, @@ -232,7 +231,7 @@ void main() { expect(tester.getSize(find.byType(TabPageSelector)).height, 24.0); }); - testWidgetsWithLeakTracking('PageSelector circle border', (WidgetTester tester) async { + testWidgets('PageSelector circle border', (WidgetTester tester) async { final TabController tabController = TabController( vsync: const TestVSync(), initialIndex: 1, diff --git a/packages/flutter/test/material/page_test.dart b/packages/flutter/test/material/page_test.dart index 8b130928a9a..bd6293b101a 100644 --- a/packages/flutter/test/material/page_test.dart +++ b/packages/flutter/test/material/page_test.dart @@ -13,10 +13,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('test page transition (_FadeUpwardsPageTransition)', (WidgetTester tester) async { + testWidgets('test page transition (_FadeUpwardsPageTransition)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: const Material(child: Text('Page 1')), @@ -80,7 +79,7 @@ void main() { expect(find.text('Page 2'), findsNothing); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('test page transition (CupertinoPageTransition)', (WidgetTester tester) async { + testWidgets('test page transition (CupertinoPageTransition)', (WidgetTester tester) async { final Key page2Key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -161,7 +160,7 @@ void main() { expect(widget1InitialTopLeft == widget1TransientTopLeft, true); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('test page transition (_ZoomPageTransition) without rasterization', (WidgetTester tester) async { + testWidgets('test page transition (_ZoomPageTransition) without rasterization', (WidgetTester tester) async { Iterable<Layer> findLayers(Finder of) { return tester.layerListOf( find.ancestor(of: of, matching: find.byType(SnapshotWidget)).first, @@ -240,7 +239,7 @@ void main() { expect(find.text('Page 2'), findsNothing); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Material2 - test page transition (_ZoomPageTransition) with rasterization re-rasterizes when view insets change', (WidgetTester tester) async { + testWidgets('Material2 - test page transition (_ZoomPageTransition) with rasterization re-rasterizes when view insets change', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(1000, 1000); tester.view.viewInsets = FakeViewPadding.zero; @@ -281,7 +280,7 @@ void main() { await expectLater(find.byKey(key), matchesGoldenFile('m2_zoom_page_transition.big.png')); }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] rasterization is not used on the web. - testWidgetsWithLeakTracking('Material3 - test page transition (_ZoomPageTransition) with rasterization re-rasterizes when view insets change', (WidgetTester tester) async { + testWidgets('Material3 - test page transition (_ZoomPageTransition) with rasterization re-rasterizes when view insets change', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(1000, 1000); tester.view.viewInsets = FakeViewPadding.zero; @@ -322,7 +321,7 @@ void main() { await expectLater(find.byKey(key), matchesGoldenFile('m3_zoom_page_transition.big.png')); }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] rasterization is not used on the web. - testWidgetsWithLeakTracking( + testWidgets( 'test page transition (_ZoomPageTransition) with rasterization disables snapshotting for enter route', (WidgetTester tester) async { Iterable<Layer> findLayers(Finder of) { @@ -404,7 +403,7 @@ void main() { expect(isSnapshotted(page1Finder), isFalse); }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] rasterization is not used on the web. - testWidgetsWithLeakTracking('test fullscreen dialog transition', (WidgetTester tester) async { + testWidgets('test fullscreen dialog transition', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material(child: Text('Page 1')), @@ -464,7 +463,7 @@ void main() { expect(widget1InitialTopLeft == widget1TransientTopLeft, true); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('test no back gesture on Android', (WidgetTester tester) async { + testWidgets('test no back gesture on Android', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: const Scaffold(body: Text('Page 1')), @@ -494,7 +493,7 @@ void main() { expect(tester.getTopLeft(find.text('Page 2')), Offset.zero); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('test back gesture', (WidgetTester tester) async { + testWidgets('test back gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: const Scaffold(body: Text('Page 1')), @@ -535,7 +534,7 @@ void main() { expect(tester.getTopLeft(find.text('Page 2')), const Offset(100.0, 0.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('back gesture while OS changes', (WidgetTester tester) async { + testWidgets('back gesture while OS changes', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => Material( child: TextButton( @@ -626,7 +625,7 @@ void main() { expect(Theme.of(tester.element(find.text('HELLO'))).platform, TargetPlatform.macOS); }); - testWidgetsWithLeakTracking('test no back gesture on fullscreen dialogs', (WidgetTester tester) async { + testWidgets('test no back gesture on fullscreen dialogs', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold(body: Text('Page 1')), @@ -656,7 +655,7 @@ void main() { expect(tester.getTopLeft(find.text('Page 2')), Offset.zero); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('test adaptable transitions switch during execution', (WidgetTester tester) async { + testWidgets('test adaptable transitions switch during execution', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -737,7 +736,7 @@ void main() { expect(widget1InitialTopLeft == widget1TransientTopLeft, true); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('test edge swipe then drop back at starting point works', (WidgetTester tester) async { + testWidgets('test edge swipe then drop back at starting point works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( onGenerateRoute: (RouteSettings settings) { @@ -772,7 +771,7 @@ void main() { expect(find.text('Page 2'), isOnstage); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('test edge swipe then drop back at ending point works', (WidgetTester tester) async { + testWidgets('test edge swipe then drop back at ending point works', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( onGenerateRoute: (RouteSettings settings) { @@ -805,7 +804,7 @@ void main() { expect(find.text('Page 2'), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Back swipe dismiss interrupted by route push', (WidgetTester tester) async { + testWidgets('Back swipe dismiss interrupted by route push', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28728 final GlobalKey scaffoldKey = GlobalKey(); @@ -900,7 +899,7 @@ void main() { expect(find.text('push'), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('During back swipe the route ignores input', (WidgetTester tester) async { + testWidgets('During back swipe the route ignores input', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/39989 final GlobalKey homeScaffoldKey = GlobalKey(); @@ -970,7 +969,7 @@ void main() { expect(tester.getTopLeft(find.byKey(homeScaffoldKey)).dx, lessThan(0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('After a pop caused by a back-swipe, input reaches the exposed route', (WidgetTester tester) async { + 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 final GlobalKey homeScaffoldKey = GlobalKey(); @@ -1041,7 +1040,7 @@ void main() { expect(pageTapCount, 1); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('A MaterialPageRoute should slide out with CupertinoPageTransition when a compatible PageRoute is pushed on top of it', (WidgetTester tester) async { + 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. await tester.pumpWidget( @@ -1070,7 +1069,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('MaterialPage works', (WidgetTester tester) async { + testWidgets('MaterialPage works', (WidgetTester tester) async { final LocalKey pageKey = UniqueKey(); final TransitionDetector detector = TransitionDetector(); List<Page<void>> myPages = <Page<void>>[ @@ -1113,7 +1112,7 @@ void main() { expect(find.text('second'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialPage can toggle MaintainState', (WidgetTester tester) async { + testWidgets('MaterialPage can toggle MaintainState', (WidgetTester tester) async { final LocalKey pageKeyOne = UniqueKey(); final LocalKey pageKeyTwo = UniqueKey(); final TransitionDetector detector = TransitionDetector(); @@ -1162,7 +1161,7 @@ void main() { expect(find.text('second'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialPage does not lose its state when transitioning out', (WidgetTester tester) async { + testWidgets('MaterialPage does not lose its state when transitioning out', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget(KeepsStateTestWidget(navigatorKey: navigator)); expect(find.text('subpage'), findsOneWidget); @@ -1175,7 +1174,7 @@ void main() { expect(find.text('home'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialPage restores its state', (WidgetTester tester) async { + testWidgets('MaterialPage restores its state', (WidgetTester tester) async { await tester.pumpWidget( RootRestorationScope( restorationId: 'root', @@ -1233,7 +1232,7 @@ void main() { expect(find.text('count: 1'), findsOneWidget); }); - testWidgetsWithLeakTracking('MaterialPageRoute can be dismissed with escape keyboard shortcut', (WidgetTester tester) async { + testWidgets('MaterialPageRoute can be dismissed with escape keyboard shortcut', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132138. final GlobalKey scaffoldKey = GlobalKey(); diff --git a/packages/flutter/test/material/page_transitions_theme_test.dart b/packages/flutter/test/material/page_transitions_theme_test.dart index 2f79094a67c..323d4ed0c03 100644 --- a/packages/flutter/test/material/page_transitions_theme_test.dart +++ b/packages/flutter/test/material/page_transitions_theme_test.dart @@ -7,10 +7,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Default PageTransitionsTheme platform', (WidgetTester tester) async { + testWidgets('Default PageTransitionsTheme platform', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: Text('home'))); final PageTransitionsTheme theme = Theme.of(tester.element(find.text('home'))).pageTransitionsTheme; expect(theme.builders, isNotNull); @@ -36,7 +35,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Default PageTransitionsTheme builds a CupertinoPageTransition', (WidgetTester tester) async { + testWidgets('Default PageTransitionsTheme builds a CupertinoPageTransition', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => Material( child: TextButton( @@ -62,7 +61,7 @@ void main() { expect(find.byType(CupertinoPageTransition), findsOneWidget); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Default PageTransitionsTheme builds a _ZoomPageTransition for android', (WidgetTester tester) async { + testWidgets('Default PageTransitionsTheme builds a _ZoomPageTransition for android', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => Material( child: TextButton( @@ -95,7 +94,7 @@ void main() { expect(findZoomPageTransition(), findsOneWidget); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('PageTransitionsTheme override builds a _OpenUpwardsPageTransition', (WidgetTester tester) async { + testWidgets('PageTransitionsTheme override builds a _OpenUpwardsPageTransition', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => Material( child: TextButton( @@ -135,7 +134,7 @@ void main() { expect(findOpenUpwardsPageTransition(), findsOneWidget); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('PageTransitionsTheme override builds a _FadeUpwardsTransition', (WidgetTester tester) async { + testWidgets('PageTransitionsTheme override builds a _FadeUpwardsTransition', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => Material( child: TextButton( @@ -215,7 +214,7 @@ void main() { return !(hasOneOpacityLayer && hasOneTransformLayer); } - testWidgetsWithLeakTracking('ZoomPageTransitionsBuilder default route snapshotting behavior', (WidgetTester tester) async { + testWidgets('ZoomPageTransitionsBuilder default route snapshotting behavior', (WidgetTester tester) async { await tester.pumpWidget( boilerplate(themeAllowSnapshotting: true), ); @@ -248,7 +247,7 @@ void main() { expect(isTransitioningWithSnapshotting(tester, page1), isTrue); }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] rasterization is not used on the web. - testWidgetsWithLeakTracking('ZoomPageTransitionsBuilder.allowSnapshotting can disable route snapshotting', (WidgetTester tester) async { + testWidgets('ZoomPageTransitionsBuilder.allowSnapshotting can disable route snapshotting', (WidgetTester tester) async { await tester.pumpWidget( boilerplate(themeAllowSnapshotting: false), ); @@ -281,7 +280,7 @@ void main() { expect(isTransitioningWithSnapshotting(tester, page1), isFalse); }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] rasterization is not used on the web. - testWidgetsWithLeakTracking('Setting PageRoute.allowSnapshotting to false overrides ZoomPageTransitionsBuilder.allowSnapshotting = true', (WidgetTester tester) async { + testWidgets('Setting PageRoute.allowSnapshotting to false overrides ZoomPageTransitionsBuilder.allowSnapshotting = true', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( themeAllowSnapshotting: true, @@ -306,7 +305,7 @@ void main() { await tester.pumpAndSettle(); }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] rasterization is not used on the web. - testWidgetsWithLeakTracking('_ZoomPageTransition only causes child widget built once', (WidgetTester tester) async { + testWidgets('_ZoomPageTransition only causes child widget built once', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/58345 int builtCount = 0; diff --git a/packages/flutter/test/material/paginated_data_table_test.dart b/packages/flutter/test/material/paginated_data_table_test.dart index 3cf4452053f..725ef14ae59 100644 --- a/packages/flutter/test/material/paginated_data_table_test.dart +++ b/packages/flutter/test/material/paginated_data_table_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'data_table_test_utils.dart'; @@ -71,7 +70,7 @@ void main() { setUp(() => source = TestDataSource()); tearDown(() => source.dispose()); - testWidgetsWithLeakTracking('PaginatedDataTable paging', (WidgetTester tester) async { + testWidgets('PaginatedDataTable paging', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(MaterialApp( @@ -173,7 +172,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('PaginatedDataTable footer page number', (WidgetTester tester) async { + testWidgets('PaginatedDataTable footer page number', (WidgetTester tester) async { int rowsPerPage = 2; Widget buildTable(TestDataSource source, int rowsPerPage) { @@ -303,7 +302,7 @@ void main() { expect(find.text('497–500 of 500'), findsOneWidget); }); - testWidgetsWithLeakTracking('PaginatedDataTable Last Page Empty Space', (WidgetTester tester) async { + testWidgets('PaginatedDataTable Last Page Empty Space', (WidgetTester tester) async { final TestDataSource source = TestDataSource(); int rowsPerPage = 3; final int rowCount = source.rowCount; @@ -380,7 +379,7 @@ void main() { expect(find.byWidgetPredicate((Widget widget) => widget is SizedBox && widget.height == (rowsPerPage - (rowCount % rowsPerPage)) * 46.0), findsOneWidget); }); - testWidgetsWithLeakTracking('PaginatedDataTable control test', (WidgetTester tester) async { + testWidgets('PaginatedDataTable control test', (WidgetTester tester) async { TestDataSource source = TestDataSource() ..generation = 42; addTearDown(source.dispose); @@ -475,7 +474,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('PaginatedDataTable text alignment', (WidgetTester tester) async { + testWidgets('PaginatedDataTable text alignment', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: PaginatedDataTable( header: const Text('HEADER'), @@ -497,7 +496,7 @@ void main() { expect(tester.getTopRight(find.text('8')).dx, tester.getTopRight(find.text('Rows per page:')).dx + 40.0); // per spec }); - testWidgetsWithLeakTracking('PaginatedDataTable with and without header and actions', (WidgetTester tester) async { + testWidgets('PaginatedDataTable with and without header and actions', (WidgetTester tester) async { await binding.setSurfaceSize(const Size(800, 800)); const String headerText = 'HEADER'; final List<Widget> actions = <Widget>[ @@ -536,7 +535,7 @@ void main() { await binding.setSurfaceSize(null); }); - testWidgetsWithLeakTracking('PaginatedDataTable with large text', (WidgetTester tester) async { + testWidgets('PaginatedDataTable with large text', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: MediaQuery( data: const MediaQueryData( @@ -572,7 +571,7 @@ void main() { expect(tester.getTopRight(find.text('501')).dx, greaterThanOrEqualTo(tester.getTopRight(find.text('Rows per page:')).dx + 40.0)); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/43433 - testWidgetsWithLeakTracking('PaginatedDataTable footer scrolls', (WidgetTester tester) async { + testWidgets('PaginatedDataTable footer scrolls', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Align( @@ -607,7 +606,7 @@ void main() { expect(tester.getTopLeft(find.text('Rows per page:')).dx, 18.0); // 14 padding in the footer row, 4 padding from the card }); - testWidgetsWithLeakTracking('PaginatedDataTable custom row height', (WidgetTester tester) async { + testWidgets('PaginatedDataTable custom row height', (WidgetTester tester) async { Widget buildCustomHeightPaginatedTable({ double? dataRowHeight, double? dataRowMinHeight, @@ -697,7 +696,7 @@ void main() { ).size.height, 51.0); }); - testWidgetsWithLeakTracking('PaginatedDataTable custom horizontal padding - checkbox', (WidgetTester tester) async { + testWidgets('PaginatedDataTable custom horizontal padding - checkbox', (WidgetTester tester) async { const double defaultHorizontalMargin = 24.0; const double defaultColumnSpacing = 56.0; const double customHorizontalMargin = 10.0; @@ -861,7 +860,7 @@ void main() { await binding.setSurfaceSize(originalSize); }); - testWidgetsWithLeakTracking('PaginatedDataTable custom horizontal padding - no checkbox', (WidgetTester tester) async { + testWidgets('PaginatedDataTable custom horizontal padding - no checkbox', (WidgetTester tester) async { const double defaultHorizontalMargin = 24.0; const double defaultColumnSpacing = 56.0; const double customHorizontalMargin = 10.0; @@ -983,7 +982,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PaginatedDataTable table fills Card width', (WidgetTester tester) async { + testWidgets('PaginatedDataTable table fills Card width', (WidgetTester tester) async { // 800 is wide enough to ensure that all of the columns fit in the // Card. The test makes sure that the DataTable is exactly as wide // as the Card, minus the Card's margin. @@ -1045,7 +1044,7 @@ void main() { await binding.setSurfaceSize(originalSize); }); - testWidgetsWithLeakTracking('PaginatedDataTable with optional column checkbox', (WidgetTester tester) async { + testWidgets('PaginatedDataTable with optional column checkbox', (WidgetTester tester) async { await binding.setSurfaceSize(const Size(800, 800)); addTearDown(() => binding.setSurfaceSize(null)); final TestDataSource source = TestDataSource(allowSelection: true); @@ -1071,7 +1070,7 @@ void main() { expect(find.byType(Checkbox), findsNothing); }); - testWidgetsWithLeakTracking('Table should not use decoration from DataTableTheme', (WidgetTester tester) async { + testWidgets('Table should not use decoration from DataTableTheme', (WidgetTester tester) async { final Size originalSize = binding.renderView.size; await binding.setSurfaceSize(const Size(800, 800)); @@ -1105,7 +1104,7 @@ void main() { await binding.setSurfaceSize(originalSize); }); - testWidgetsWithLeakTracking('dataRowMinHeight & dataRowMaxHeight if not set will use DataTableTheme', (WidgetTester tester) async { + testWidgets('dataRowMinHeight & dataRowMaxHeight if not set will use DataTableTheme', (WidgetTester tester) async { addTearDown(() => binding.setSurfaceSize(null)); await binding.setSurfaceSize(const Size(800, 800)); @@ -1140,7 +1139,7 @@ void main() { expect(rowContainer.constraints?.maxHeight, minMaxDataRowHeight); }); - testWidgetsWithLeakTracking('PaginatedDataTable custom checkboxHorizontalMargin properly applied', (WidgetTester tester) async { + testWidgets('PaginatedDataTable custom checkboxHorizontalMargin properly applied', (WidgetTester tester) async { const double customCheckboxHorizontalMargin = 15.0; const double customHorizontalMargin = 10.0; @@ -1208,7 +1207,7 @@ void main() { await binding.setSurfaceSize(originalSize); }); - testWidgetsWithLeakTracking('Items selected text uses secondary color', (WidgetTester tester) async { + testWidgets('Items selected text uses secondary color', (WidgetTester tester) async { const Color selectedTextColor = Color(0xff00ddff); final ColorScheme colors = const ColorScheme.light().copyWith(secondary: selectedTextColor); final ThemeData theme = ThemeData.from(colorScheme: colors); @@ -1250,7 +1249,7 @@ void main() { await binding.setSurfaceSize(null); }); - testWidgetsWithLeakTracking('PaginatedDataTable arrowHeadColor set properly', (WidgetTester tester) async { + testWidgets('PaginatedDataTable arrowHeadColor set properly', (WidgetTester tester) async { await binding.setSurfaceSize(const Size(800, 800)); addTearDown(() => binding.setSurfaceSize(null)); const Color arrowHeadColor = Color(0xFFE53935); @@ -1279,7 +1278,7 @@ void main() { expect(icons.elementAt(3).color, arrowHeadColor); }); - testWidgetsWithLeakTracking('OverflowBar header left alignment', (WidgetTester tester) async { + testWidgets('OverflowBar header left alignment', (WidgetTester tester) async { // Test an old special case that tried to align the first child of a ButtonBar // and the left edge of a Text header widget. Still possible with OverflowBar // albeit without any special case in the implementation's build method. @@ -1307,7 +1306,7 @@ void main() { expect(headerX, tester.getTopLeft(find.byType(ElevatedButton)).dx); }); - testWidgetsWithLeakTracking('PaginatedDataTable can be scrolled using ScrollController', (WidgetTester tester) async { + testWidgets('PaginatedDataTable can be scrolled using ScrollController', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1356,7 +1355,7 @@ void main() { expect(scrollController.offset, 50.0); }); - testWidgetsWithLeakTracking('PaginatedDataTable uses PrimaryScrollController when primary ', (WidgetTester tester) async { + testWidgets('PaginatedDataTable uses PrimaryScrollController when primary ', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); @@ -1388,7 +1387,7 @@ void main() { expect(footerScrollView.controller, null); }); - testWidgetsWithLeakTracking('PaginatedDataTable custom heading row color', (WidgetTester tester) async { + testWidgets('PaginatedDataTable custom heading row color', (WidgetTester tester) async { const MaterialStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(Color(0xffFF0000)); await tester.pumpWidget( diff --git a/packages/flutter/test/material/persistent_bottom_sheet_test.dart b/packages/flutter/test/material/persistent_bottom_sheet_test.dart index aaa96364971..cba10e53340 100644 --- a/packages/flutter/test/material/persistent_bottom_sheet_test.dart +++ b/packages/flutter/test/material/persistent_bottom_sheet_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Pumps and ensures that the BottomSheet animates non-linearly. @@ -23,7 +22,7 @@ void main() { expect(dyDelta1, isNot(moreOrLessEquals(dyDelta2, epsilon: 0.1))); } - testWidgetsWithLeakTracking('Persistent draggableScrollableSheet localHistoryEntries test', (WidgetTester tester) async { + testWidgets('Persistent draggableScrollableSheet localHistoryEntries test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110123 Widget buildFrame(Widget? bottomSheet) { return MaterialApp( @@ -79,7 +78,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/83668 - testWidgetsWithLeakTracking('Scaffold.bottomSheet update test', (WidgetTester tester) async { + testWidgets('Scaffold.bottomSheet update test', (WidgetTester tester) async { Widget buildFrame(Widget? bottomSheet) { return MaterialApp( home: Scaffold( @@ -96,7 +95,7 @@ void main() { await tester.pumpWidget(buildFrame(const Text('I love Flutter!'))); }); - testWidgetsWithLeakTracking('Verify that a BottomSheet can be rebuilt with ScaffoldFeatureController.setState()', (WidgetTester tester) async { + testWidgets('Verify that a BottomSheet can be rebuilt with ScaffoldFeatureController.setState()', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); int buildCount = 0; @@ -123,7 +122,7 @@ void main() { expect(buildCount, equals(2)); }); - testWidgetsWithLeakTracking('Verify that a persistent BottomSheet cannot be dismissed', (WidgetTester tester) async { + testWidgets('Verify that a persistent BottomSheet cannot be dismissed', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: const Center(child: Text('body')), @@ -154,7 +153,7 @@ void main() { expect(find.text('Two'), findsOneWidget); }); - testWidgetsWithLeakTracking('Verify that a scrollable BottomSheet can be dismissed', (WidgetTester tester) async { + testWidgets('Verify that a scrollable BottomSheet can be dismissed', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( @@ -186,7 +185,7 @@ void main() { expect(find.text('Two'), findsNothing); }); - testWidgetsWithLeakTracking('Verify DraggableScrollableSheet.shouldCloseOnMinExtent == false prevents dismissal', (WidgetTester tester) async { + testWidgets('Verify DraggableScrollableSheet.shouldCloseOnMinExtent == false prevents dismissal', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( @@ -224,7 +223,7 @@ void main() { expect(find.text('Two'), findsOneWidget); }); - testWidgetsWithLeakTracking('Verify that a BottomSheet animates non-linearly', (WidgetTester tester) async { + testWidgets('Verify that a BottomSheet animates non-linearly', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( @@ -259,7 +258,7 @@ void main() { expect(find.text('Two'), findsNothing); }); - testWidgetsWithLeakTracking('Verify that a scrollControlled BottomSheet can be dismissed', (WidgetTester tester) async { + testWidgets('Verify that a scrollControlled BottomSheet can be dismissed', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( @@ -298,7 +297,7 @@ void main() { expect(find.text('Two'), findsNothing); }); - testWidgetsWithLeakTracking('Verify that a persistent BottomSheet can fling up and hide the fab', (WidgetTester tester) async { + testWidgets('Verify that a persistent BottomSheet can fling up and hide the fab', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -348,7 +347,7 @@ void main() { expect(find.byType(FloatingActionButton).hitTestable(), findsNothing); }); - testWidgetsWithLeakTracking('Verify that a back button resets a persistent BottomSheet', (WidgetTester tester) async { + testWidgets('Verify that a back button resets a persistent BottomSheet', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -409,7 +408,7 @@ void main() { expect(find.text('Item 22'), findsNothing); }); - testWidgetsWithLeakTracking('Verify that a scrollable BottomSheet hides the fab when scrolled up', (WidgetTester tester) async { + testWidgets('Verify that a scrollable BottomSheet hides the fab when scrolled up', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( @@ -463,7 +462,7 @@ void main() { expect(find.byType(FloatingActionButton).hitTestable(), findsNothing); }); - testWidgetsWithLeakTracking('showBottomSheet()', (WidgetTester tester) async { + testWidgets('showBottomSheet()', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -487,7 +486,7 @@ void main() { expect(buildCount, equals(1)); }); - testWidgetsWithLeakTracking('Scaffold removes top MediaQuery padding', (WidgetTester tester) async { + testWidgets('Scaffold removes top MediaQuery padding', (WidgetTester tester) async { late BuildContext scaffoldContext; late BuildContext bottomSheetContext; @@ -530,7 +529,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scaffold.bottomSheet', (WidgetTester tester) async { + testWidgets('Scaffold.bottomSheet', (WidgetTester tester) async { final Key bottomSheetKey = UniqueKey(); await tester.pumpWidget( @@ -589,7 +588,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/71435 - testWidgetsWithLeakTracking( + testWidgets( 'Scaffold.bottomSheet should be updated without creating a new RO' ' when the new widget has the same key and type.', (WidgetTester tester) async { @@ -613,7 +612,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Verify that visual properties are passed through', (WidgetTester tester) async { + testWidgets('Verify that visual properties are passed through', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); const Color color = Colors.pink; const double elevation = 9.0; @@ -648,7 +647,7 @@ void main() { expect(bottomSheet.clipBehavior, clipBehavior); }); - testWidgetsWithLeakTracking('PersistentBottomSheetController.close dismisses the bottom sheet', (WidgetTester tester) async { + testWidgets('PersistentBottomSheetController.close dismisses the bottom sheet', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey(); await tester.pumpWidget(MaterialApp( home: Scaffold( diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index 16bc3d894cf..e462834c917 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -9,13 +9,12 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; void main() { - testWidgetsWithLeakTracking('Navigator.push works within a PopupMenuButton', (WidgetTester tester) async { + testWidgets('Navigator.push works within a PopupMenuButton', (WidgetTester tester) async { final Key targetKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -65,7 +64,7 @@ void main() { expect(find.text('Next'), findsOneWidget); }); - testWidgetsWithLeakTracking('PopupMenuButton calls onOpened callback when the menu is opened', (WidgetTester tester) async { + testWidgets('PopupMenuButton calls onOpened callback when the menu is opened', (WidgetTester tester) async { int opens = 0; late BuildContext popupContext; final Key noItemsKey = UniqueKey(); @@ -134,7 +133,7 @@ void main() { expect(opens, equals(1)); }); - testWidgetsWithLeakTracking('PopupMenuButton calls onCanceled callback when an item is not selected', (WidgetTester tester) async { + testWidgets('PopupMenuButton calls onCanceled callback when an item is not selected', (WidgetTester tester) async { int cancels = 0; late BuildContext popupContext; final Key noCallbackKey = UniqueKey(); @@ -200,7 +199,7 @@ void main() { expect(cancels, equals(2)); }); - testWidgetsWithLeakTracking('Disabled PopupMenuButton will not call itemBuilder, onOpened, onSelected or onCanceled', (WidgetTester tester) async { + testWidgets('Disabled PopupMenuButton will not call itemBuilder, onOpened, onSelected or onCanceled', (WidgetTester tester) async { final GlobalKey popupButtonKey = GlobalKey(); bool itemBuilderCalled = false; bool onOpenedCalled = false; @@ -285,7 +284,7 @@ void main() { expect(onCanceledCalled, isFalse); }); - testWidgetsWithLeakTracking('disabled PopupMenuButton is not focusable', (WidgetTester tester) async { + testWidgets('disabled PopupMenuButton is not focusable', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); final GlobalKey childKey = GlobalKey(); bool itemBuilderCalled = false; @@ -327,7 +326,7 @@ void main() { expect(onSelectedCalled, isFalse); }); - testWidgetsWithLeakTracking('Disabled PopupMenuButton is focusable with directional navigation', (WidgetTester tester) async { + testWidgets('Disabled PopupMenuButton is focusable with directional navigation', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); final GlobalKey childKey = GlobalKey(); @@ -368,7 +367,7 @@ void main() { expect(Focus.of(childKey.currentContext!).hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('PopupMenuItem onTap callback is called when defined', (WidgetTester tester) async { + testWidgets('PopupMenuItem onTap callback is called when defined', (WidgetTester tester) async { final List<int> menuItemTapCounters = <int>[0, 0]; await tester.pumpWidget( @@ -430,7 +429,7 @@ void main() { expect(menuItemTapCounters, <int>[2, 1]); }); - testWidgetsWithLeakTracking('PopupMenuItem can have both onTap and value', (WidgetTester tester) async { + testWidgets('PopupMenuItem can have both onTap and value', (WidgetTester tester) async { final List<int> menuItemTapCounters = <int>[0, 0]; String? selected; @@ -501,7 +500,7 @@ void main() { expect(selected, 'third'); }); - testWidgetsWithLeakTracking('PopupMenuItem is only focusable when enabled', (WidgetTester tester) async { + testWidgets('PopupMenuItem is only focusable when enabled', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); final GlobalKey childKey = GlobalKey(); bool itemBuilderCalled = false; @@ -578,7 +577,7 @@ void main() { expect(Focus.of(childKey.currentContext!).hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('PopupMenuButton is horizontal on iOS', (WidgetTester tester) async { + testWidgets('PopupMenuButton is horizontal on iOS', (WidgetTester tester) async { Widget build(TargetPlatform platform) { debugDefaultTargetPlatformOverride = platform; return MaterialApp( @@ -632,7 +631,7 @@ void main() { ]; } - testWidgetsWithLeakTracking('PopupMenuButton fails when given both child and icon', (WidgetTester tester) async { + testWidgets('PopupMenuButton fails when given both child and icon', (WidgetTester tester) async { expect(() { PopupMenuButton<int>( icon: const Icon(Icons.view_carousel), @@ -642,7 +641,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking('PopupMenuButton creates IconButton when given an icon', (WidgetTester tester) async { + testWidgets('PopupMenuButton creates IconButton when given an icon', (WidgetTester tester) async { final PopupMenuButton<int> button = PopupMenuButton<int>( icon: const Icon(Icons.view_carousel), itemBuilder: simplePopupMenuItemBuilder, @@ -662,7 +661,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('PopupMenu positioning', (WidgetTester tester) async { + testWidgets('PopupMenu positioning', (WidgetTester tester) async { final Widget testButton = PopupMenuButton<int>( itemBuilder: (BuildContext context) { return <PopupMenuItem<int>>[ @@ -842,7 +841,7 @@ void main() { await testPositioningDownThenUp(tester, TextDirection.rtl, Alignment.bottomCenter, TextDirection.rtl, const Rect.fromLTWH(450.0, 500.0, 0.0, 0.0)); }); - testWidgetsWithLeakTracking('PopupMenu positioning inside nested Overlay', (WidgetTester tester) async { + testWidgets('PopupMenu positioning inside nested Overlay', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -883,7 +882,7 @@ void main() { expect(tester.getTopLeft(popupFinder), buttonTopLeft); }); - testWidgetsWithLeakTracking('PopupMenu positioning inside nested Navigator', (WidgetTester tester) async { + testWidgets('PopupMenu positioning inside nested Navigator', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); await tester.pumpWidget( @@ -927,7 +926,7 @@ void main() { expect(tester.getTopLeft(popupFinder), buttonTopLeft); }); - testWidgetsWithLeakTracking('PopupMenu positioning around display features', (WidgetTester tester) async { + testWidgets('PopupMenu positioning around display features', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); await tester.pumpWidget( @@ -987,7 +986,7 @@ void main() { expect(tester.getTopRight(popupFinder), const Offset(390 - 8, 8)); }); - testWidgetsWithLeakTracking('PopupMenu removes MediaQuery padding', (WidgetTester tester) async { + testWidgets('PopupMenu removes MediaQuery padding', (WidgetTester tester) async { late BuildContext popupContext; await tester.pumpWidget(MaterialApp( @@ -1028,7 +1027,7 @@ void main() { expect(MediaQuery.of(popupContext).padding, EdgeInsets.zero); }); - testWidgetsWithLeakTracking('Popup Menu Offset Test', (WidgetTester tester) async { + testWidgets('Popup Menu Offset Test', (WidgetTester tester) async { PopupMenuButton<int> buildMenuButton({Offset offset = Offset.zero}) { return PopupMenuButton<int>( offset: offset, @@ -1087,7 +1086,7 @@ void main() { expect(tester.getTopLeft(find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_PopupMenu<int?>')), const Offset(50.0, 50.0)); }); - testWidgetsWithLeakTracking('Opened PopupMenu has correct semantics', (WidgetTester tester) async { + testWidgets('Opened PopupMenu has correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( MaterialApp( @@ -1211,7 +1210,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('PopupMenuItem merges the semantics of its descendants', (WidgetTester tester) async { + testWidgets('PopupMenuItem merges the semantics of its descendants', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( MaterialApp( @@ -1299,7 +1298,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Disabled PopupMenuItem has correct semantics', (WidgetTester tester) async { + testWidgets('Disabled PopupMenuItem has correct semantics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/45044. final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1422,7 +1421,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('PopupMenuButton PopupMenuDivider', (WidgetTester tester) async { + testWidgets('PopupMenuButton PopupMenuDivider', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/27072 late String selectedValue; @@ -1474,7 +1473,7 @@ void main() { expect(selectedValue, '2'); }); - testWidgetsWithLeakTracking('PopupMenuItem child height is a minimum, child is vertically centered', (WidgetTester tester) async { + testWidgets('PopupMenuItem child height is a minimum, child is vertically centered', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final Type menuItemType = const PopupMenuItem<String>(child: Text('item')).runtimeType; @@ -1556,7 +1555,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - PopupMenuItem default padding', (WidgetTester tester) async { + testWidgets('Material3 - PopupMenuItem default padding', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1594,7 +1593,7 @@ void main() { expect(tester.widget<Container>(find.widgetWithText(Container, 'Item 1')).padding, const EdgeInsets.symmetric(horizontal: 12.0)); }); - testWidgetsWithLeakTracking('Material2 - PopupMenuItem default padding', (WidgetTester tester) async { + testWidgets('Material2 - PopupMenuItem default padding', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1632,7 +1631,7 @@ void main() { expect(tester.widget<Container>(find.widgetWithText(Container, 'Item 1')).padding, const EdgeInsets.symmetric(horizontal: 16.0)); }); - testWidgetsWithLeakTracking('PopupMenuItem custom padding', (WidgetTester tester) async { + testWidgets('PopupMenuItem custom padding', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final Type menuItemType = const PopupMenuItem<String>(child: Text('item')).runtimeType; @@ -1694,7 +1693,7 @@ void main() { expect(tester.widget<Container>(find.widgetWithText(Container, 'Item 3')).padding, const EdgeInsets.all(20)); }); - testWidgetsWithLeakTracking('CheckedPopupMenuItem child height is a minimum, child is vertically centered', (WidgetTester tester) async { + testWidgets('CheckedPopupMenuItem child height is a minimum, child is vertically centered', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final Type menuItemType = const CheckedPopupMenuItem<String>(child: Text('item')).runtimeType; @@ -1783,7 +1782,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CheckedPopupMenuItem custom padding', (WidgetTester tester) async { + testWidgets('CheckedPopupMenuItem custom padding', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final Type menuItemType = const CheckedPopupMenuItem<String>(child: Text('item')).runtimeType; @@ -1844,7 +1843,7 @@ void main() { expect(tester.widget<Container>(find.widgetWithText(Container, 'Item 3')).padding, const EdgeInsets.all(20)); }); - testWidgetsWithLeakTracking('Update PopupMenuItem layout while the menu is visible', (WidgetTester tester) async { + testWidgets('Update PopupMenuItem layout while the menu is visible', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final Type menuItemType = const PopupMenuItem<String>(child: Text('item')).runtimeType; @@ -1928,7 +1927,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking('PopupMenuButton default tooltip', (WidgetTester tester) async { + testWidgets('PopupMenuButton default tooltip', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1984,7 +1983,7 @@ void main() { expect(find.byTooltip(const DefaultMaterialLocalizations().showMenuTooltip), findsNWidgets(3)); }); - testWidgetsWithLeakTracking('PopupMenuButton custom tooltip', (WidgetTester tester) async { + testWidgets('PopupMenuButton custom tooltip', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2041,7 +2040,7 @@ void main() { expect(find.byTooltip('Test tooltip'), findsNWidgets(3)); }); - testWidgetsWithLeakTracking('Allow Widget for PopupMenuButton.icon', (WidgetTester tester) async { + testWidgets('Allow Widget for PopupMenuButton.icon', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2064,7 +2063,7 @@ void main() { expect(find.text('PopupMenuButton icon'), findsOneWidget); }); - testWidgetsWithLeakTracking('showMenu uses nested navigator by default', (WidgetTester tester) async { + testWidgets('showMenu uses nested navigator by default', (WidgetTester tester) async { final MenuObserver rootObserver = MenuObserver(); final MenuObserver nestedObserver = MenuObserver(); @@ -2102,7 +2101,7 @@ void main() { expect(nestedObserver.menuCount, 1); }); - testWidgetsWithLeakTracking('showMenu uses root navigator if useRootNavigator is true', (WidgetTester tester) async { + testWidgets('showMenu uses root navigator if useRootNavigator is true', (WidgetTester tester) async { final MenuObserver rootObserver = MenuObserver(); final MenuObserver nestedObserver = MenuObserver(); @@ -2141,7 +2140,7 @@ void main() { expect(nestedObserver.menuCount, 0); }); - testWidgetsWithLeakTracking('PopupMenuButton calling showButtonMenu manually', (WidgetTester tester) async { + testWidgets('PopupMenuButton calling showButtonMenu manually', (WidgetTester tester) async { final GlobalKey<PopupMenuButtonState<int>> globalKey = GlobalKey(); await tester.pumpWidget( @@ -2176,7 +2175,7 @@ void main() { expect(find.text('Tap me please!'), findsOneWidget); }); - testWidgetsWithLeakTracking('PopupMenuItem changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('PopupMenuItem changes mouse cursor when hovered', (WidgetTester tester) async { const Key key = ValueKey<int>(1); // Test PopupMenuItem() constructor await tester.pumpWidget( @@ -2255,7 +2254,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('CheckedPopupMenuItem changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('CheckedPopupMenuItem changes mouse cursor when hovered', (WidgetTester tester) async { const Key key = ValueKey<int>(1); // Test CheckedPopupMenuItem() constructor await tester.pumpWidget( @@ -2335,7 +2334,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('PopupMenu in AppBar does not overlap with the status bar', (WidgetTester tester) async { + testWidgets('PopupMenu in AppBar does not overlap with the status bar', (WidgetTester tester) async { const List<PopupMenuItem<int>> choices = <PopupMenuItem<int>>[ PopupMenuItem<int>(value: 1, child: Text('Item 1')), PopupMenuItem<int>(value: 2, child: Text('Item 2')), @@ -2394,7 +2393,7 @@ void main() { expect(tester.getTopLeft(find.byWidget(firstItem)).dy, greaterThan(statusBarHeight)); }); - testWidgetsWithLeakTracking('Vertically long PopupMenu does not overlap with the status bar and bottom notch', (WidgetTester tester) async { + testWidgets('Vertically long PopupMenu does not overlap with the status bar and bottom notch', (WidgetTester tester) async { const double windowPaddingTop = 44; const double windowPaddingBottom = 34; @@ -2438,7 +2437,7 @@ void main() { expect(bottomRightOfMenu.dy, 600.0 - windowPaddingBottom - 8.0); // Screen height is 600. }); - testWidgetsWithLeakTracking('PopupMenu position test when have unsafe area', (WidgetTester tester) async { + testWidgets('PopupMenu position test when have unsafe area', (WidgetTester tester) async { final GlobalKey buttonKey = GlobalKey(); Widget buildFrame(double width, double height) { @@ -2496,7 +2495,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/82874 - testWidgetsWithLeakTracking('PopupMenu position test when have unsafe area - left/right padding', (WidgetTester tester) async { + testWidgets('PopupMenu position test when have unsafe area - left/right padding', (WidgetTester tester) async { final GlobalKey buttonKey = GlobalKey(); const EdgeInsets padding = EdgeInsets.only(left: 300.0, top: 32.0, right: 310.0, bottom: 64.0); EdgeInsets? mediaQueryPadding; @@ -2606,7 +2605,7 @@ void main() { ); } - testWidgetsWithLeakTracking('PopupMenuButton enableFeedback works properly', (WidgetTester tester) async { + testWidgets('PopupMenuButton enableFeedback works properly', (WidgetTester tester) async { expect(feedback.clickSoundCount, 0); expect(feedback.hapticCount, 0); @@ -2655,7 +2654,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can customize PopupMenuButton icon', (WidgetTester tester) async { + testWidgets('Can customize PopupMenuButton icon', (WidgetTester tester) async { const Color iconColor = Color(0xffffff00); const double iconSize = 29.5; await tester.pumpWidget( @@ -2681,7 +2680,7 @@ void main() { expect(tester.getSize(find.byIcon(Icons.adaptive.more)), const Size(iconSize, iconSize)); }); - testWidgetsWithLeakTracking('does not crash in small overlay', (WidgetTester tester) async { + testWidgets('does not crash in small overlay', (WidgetTester tester) async { final GlobalKey navigator = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -2722,7 +2721,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/80869 - testWidgetsWithLeakTracking('The menu position test in the scrollable widget', (WidgetTester tester) async { + testWidgets('The menu position test in the scrollable widget', (WidgetTester tester) async { final GlobalKey buttonKey = GlobalKey(); await tester.pumpWidget( @@ -2786,7 +2785,7 @@ void main() { expect(popupMenu, const Offset(8.0, 50.0)); }); - testWidgetsWithLeakTracking('PopupMenuButton custom splash radius', (WidgetTester tester) async { + testWidgets('PopupMenuButton custom splash radius', (WidgetTester tester) async { Future<void> buildFrameWithoutChild({double? splashRadius}) { return tester.pumpWidget( MaterialApp( @@ -2844,7 +2843,7 @@ void main() { testSplashRadius); }); - testWidgetsWithLeakTracking('Can override menu size constraints', (WidgetTester tester) async { + testWidgets('Can override menu size constraints', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final Type menuItemType = const PopupMenuItem<String>(child: Text('item')).runtimeType; @@ -2877,7 +2876,7 @@ void main() { expect(tester.getSize(find.widgetWithText(menuItemType, 'Item 0')).width, 500); }); - testWidgetsWithLeakTracking('Can change menu position and offset', (WidgetTester tester) async { + testWidgets('Can change menu position and offset', (WidgetTester tester) async { PopupMenuButton<int> buildMenuButton({required PopupMenuPosition position}) { return PopupMenuButton<int>( position: position, @@ -3006,7 +3005,7 @@ void main() { expect(tester.getTopLeft(find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_PopupMenu<int?>')), const Offset(8.0, 90.0)); }); - testWidgetsWithLeakTracking("PopupMenuButton icon inherits IconTheme's size", (WidgetTester tester) async { + testWidgets("PopupMenuButton icon inherits IconTheme's size", (WidgetTester tester) async { Widget buildPopupMenu({double? themeIconSize, double? iconSize}) { return MaterialApp( theme: ThemeData( @@ -3048,7 +3047,7 @@ void main() { expect(tester.getSize(find.byIcon(Icons.more_vert)), const Size(50.0, 50.0)); }); - testWidgetsWithLeakTracking('Popup menu clip behavior', (WidgetTester tester) async { + testWidgets('Popup menu clip behavior', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/107215 final Key popupButtonKey = UniqueKey(); const double radius = 20.0; @@ -3100,7 +3099,7 @@ void main() { expect(material.clipBehavior, Clip.hardEdge); }); - testWidgetsWithLeakTracking('Uses closed loop focus traversal', (WidgetTester tester) async { + testWidgets('Uses closed loop focus traversal', (WidgetTester tester) async { FocusNode nodeA() => Focus.of(find.text('A').evaluate().single); FocusNode nodeB() => Focus.of(find.text('B').evaluate().single); @@ -3174,7 +3173,7 @@ void main() { expect(nodeB().hasFocus, false); }); - testWidgetsWithLeakTracking('Popup menu scrollbar inherits ScrollbarTheme', (WidgetTester tester) async { + testWidgets('Popup menu scrollbar inherits ScrollbarTheme', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); const ScrollbarThemeData scrollbarTheme = ScrollbarThemeData( thumbColor: MaterialStatePropertyAll<Color?>(Color(0xffff0000)), @@ -3262,7 +3261,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Popup menu with RouteSettings', (WidgetTester tester) async { + testWidgets('Popup menu with RouteSettings', (WidgetTester tester) async { late RouteSettings currentRouteSetting; await tester.pumpWidget( @@ -3304,7 +3303,7 @@ void main() { expect(currentRouteSetting.name, '/'); }); - testWidgetsWithLeakTracking('Popup menu is positioned under the child', (WidgetTester tester) async { + testWidgets('Popup menu is positioned under the child', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); final Key childKey = UniqueKey(); await tester.pumpWidget( @@ -3342,7 +3341,7 @@ void main() { expect(childBottomLeft, menuTopLeft); }); - testWidgetsWithLeakTracking('PopupMenuItem onTap should be calling after Navigator.pop', (WidgetTester tester) async { + testWidgets('PopupMenuItem onTap should be calling after Navigator.pop', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -3384,7 +3383,7 @@ void main() { expect(modalBottomSheet, findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - CheckedPopupMenuItem.labelTextStyle uses correct text style', (WidgetTester tester) async { + testWidgets('Material3 - CheckedPopupMenuItem.labelTextStyle uses correct text style', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); ThemeData theme = ThemeData(useMaterial3: true); @@ -3447,7 +3446,7 @@ void main() { expect(_labelStyle(tester, 'Item 1')!.fontStyle, customTextStyle.fontStyle); }); - testWidgetsWithLeakTracking('CheckedPopupMenuItem.labelTextStyle resolve material states', (WidgetTester tester) async { + testWidgets('CheckedPopupMenuItem.labelTextStyle resolve material states', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); final MaterialStateProperty<TextStyle?> labelTextStyle = MaterialStateProperty.resolveWith( (Set<MaterialState> states) { @@ -3497,7 +3496,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CheckedPopupMenuItem overrides redundant ListTile.contentPadding', (WidgetTester tester) async { + testWidgets('CheckedPopupMenuItem overrides redundant ListTile.contentPadding', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -3542,7 +3541,7 @@ void main() { expect(getItemSafeArea('Item 1').minimum, EdgeInsets.zero); }); - testWidgetsWithLeakTracking('PopupMenuItem overrides redundant ListTile.contentPadding', (WidgetTester tester) async { + testWidgets('PopupMenuItem overrides redundant ListTile.contentPadding', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -3587,7 +3586,7 @@ void main() { expect(getItemSafeArea('Item 1').minimum, EdgeInsets.zero); }); - testWidgetsWithLeakTracking('Material3 - PopupMenuItem overrides ListTile.titleTextStyle', (WidgetTester tester) async { + testWidgets('Material3 - PopupMenuItem overrides ListTile.titleTextStyle', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); ThemeData theme = ThemeData(useMaterial3: true); @@ -3664,7 +3663,7 @@ void main() { expect(_labelStyle(tester, 'Item 1')!.fontStyle, customTextStyle.fontStyle); }); - testWidgetsWithLeakTracking('Material2 - PopupMenuItem overrides ListTile.titleTextStyle', (WidgetTester tester) async { + testWidgets('Material2 - PopupMenuItem overrides ListTile.titleTextStyle', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); ThemeData theme = ThemeData(useMaterial3: false); @@ -3741,7 +3740,7 @@ void main() { expect(_labelStyle(tester, 'Item 1')!.fontStyle, customTextStyle.fontStyle); }); - testWidgetsWithLeakTracking('CheckedPopupMenuItem.onTap callback is called when defined', (WidgetTester tester) async { + testWidgets('CheckedPopupMenuItem.onTap callback is called when defined', (WidgetTester tester) async { int count = 0; await tester.pumpWidget( TestApp( @@ -3786,7 +3785,7 @@ void main() { expect(count, 1); }); - testWidgetsWithLeakTracking('PopupMenuButton uses root navigator if useRootNavigator is true', (WidgetTester tester) async { + testWidgets('PopupMenuButton uses root navigator if useRootNavigator is true', (WidgetTester tester) async { final MenuObserver rootObserver = MenuObserver(); final MenuObserver nestedObserver = MenuObserver(); @@ -3830,7 +3829,7 @@ void main() { expect(nestedObserver.menuCount, 0); }); - testWidgetsWithLeakTracking('PopupMenuButton does not use root navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('PopupMenuButton does not use root navigator if useRootNavigator is false', (WidgetTester tester) async { final MenuObserver rootObserver = MenuObserver(); final MenuObserver nestedObserver = MenuObserver(); @@ -3873,7 +3872,7 @@ void main() { expect(nestedObserver.menuCount, 1); }); - testWidgetsWithLeakTracking('Override Popup Menu animation using AnimationStyle', (WidgetTester tester) async { + testWidgets('Override Popup Menu animation using AnimationStyle', (WidgetTester tester) async { final Key targetKey = UniqueKey(); Widget buildPopupMenu({ AnimationStyle? animationStyle }) { diff --git a/packages/flutter/test/material/popup_menu_theme_test.dart b/packages/flutter/test/material/popup_menu_theme_test.dart index f17caec6901..ccdf0cbf890 100644 --- a/packages/flutter/test/material/popup_menu_theme_test.dart +++ b/packages/flutter/test/material/popup_menu_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; PopupMenuThemeData _popupMenuThemeM2() { return PopupMenuThemeData( @@ -72,7 +71,7 @@ void main() { expect(popupMenuTheme.mouseCursor, null); }); - testWidgetsWithLeakTracking('Default PopupMenuThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default PopupMenuThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const PopupMenuThemeData().debugFillProperties(builder); @@ -84,7 +83,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('PopupMenuThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('PopupMenuThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); PopupMenuThemeData( color: const Color(0xfffffff1), @@ -127,7 +126,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Passing no PopupMenuThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Passing no PopupMenuThemeData returns defaults', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); final Key popupButtonApp = UniqueKey(); final Key enabledPopupItemKey = UniqueKey(); @@ -247,7 +246,7 @@ void main() { expect(listTile.titleTextStyle?.color, theme.colorScheme.onSurface); }); - testWidgetsWithLeakTracking('Popup menu uses values from PopupMenuThemeData', (WidgetTester tester) async { + testWidgets('Popup menu uses values from PopupMenuThemeData', (WidgetTester tester) async { final PopupMenuThemeData popupMenuTheme = _popupMenuThemeM3(); final Key popupButtonKey = UniqueKey(); final Key popupButtonApp = UniqueKey(); @@ -363,7 +362,7 @@ void main() { expect(listTile.titleTextStyle, popupMenuTheme.labelTextStyle?.resolve(enabled)); }); - testWidgetsWithLeakTracking('Popup menu widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('Popup menu widget properties take priority over theme', (WidgetTester tester) async { final PopupMenuThemeData popupMenuTheme = _popupMenuThemeM3(); final Key popupButtonKey = UniqueKey(); final Key popupButtonApp = UniqueKey(); @@ -468,7 +467,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Passing no PopupMenuThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Passing no PopupMenuThemeData returns defaults', (WidgetTester tester) async { final Key popupButtonKey = UniqueKey(); final Key popupButtonApp = UniqueKey(); final Key enabledPopupItemKey = UniqueKey(); @@ -567,7 +566,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Popup menu uses values from PopupMenuThemeData', (WidgetTester tester) async { + testWidgets('Popup menu uses values from PopupMenuThemeData', (WidgetTester tester) async { final PopupMenuThemeData popupMenuTheme = _popupMenuThemeM2(); final Key popupButtonKey = UniqueKey(); final Key popupButtonApp = UniqueKey(); @@ -653,7 +652,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Popup menu widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('Popup menu widget properties take priority over theme', (WidgetTester tester) async { final PopupMenuThemeData popupMenuTheme = _popupMenuThemeM2(); final Key popupButtonKey = UniqueKey(); final Key popupButtonApp = UniqueKey(); diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index 6f8b098634e..c084e290d9e 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -17,7 +17,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { final ThemeData theme = ThemeData(); @@ -25,7 +24,7 @@ void main() { // The "can be constructed" tests that follow are primarily to ensure that any // animations started by the progress indicators are stopped at dispose() time. - testWidgetsWithLeakTracking('LinearProgressIndicator(value: 0.0) can be constructed and has empty semantics by default', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator(value: 0.0) can be constructed and has empty semantics by default', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Theme( @@ -46,7 +45,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('LinearProgressIndicator(value: null) can be constructed and has empty semantics by default', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator(value: null) can be constructed and has empty semantics by default', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Theme( @@ -67,7 +66,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('LinearProgressIndicator custom minHeight', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator custom minHeight', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -116,7 +115,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('LinearProgressIndicator paint (LTR)', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator paint (LTR)', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -142,7 +141,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('LinearProgressIndicator paint (RTL)', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator paint (RTL)', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -168,7 +167,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('LinearProgressIndicator indeterminate (LTR)', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator indeterminate (LTR)', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -198,7 +197,7 @@ void main() { expect(tester.binding.transientCallbackCount, 1); }); - testWidgetsWithLeakTracking('LinearProgressIndicator paint (RTL)', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator paint (RTL)', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -228,7 +227,7 @@ void main() { expect(tester.binding.transientCallbackCount, 1); }); - testWidgetsWithLeakTracking('LinearProgressIndicator with colors', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator with colors', (WidgetTester tester) async { // With valueColor & color provided await tester.pumpWidget( Theme( @@ -348,7 +347,7 @@ void main() { }); - testWidgetsWithLeakTracking('LinearProgressIndicator with animation with null colors', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator with animation with null colors', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -376,7 +375,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CircularProgressIndicator(value: 0.0) can be constructed and has value semantics by default', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator(value: 0.0) can be constructed and has value semantics by default', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Theme( @@ -397,7 +396,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('CircularProgressIndicator(value: null) can be constructed and has empty semantics by default', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator(value: null) can be constructed and has empty semantics by default', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Theme( @@ -412,7 +411,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('LinearProgressIndicator causes a repaint when it changes', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator causes a repaint when it changes', (WidgetTester tester) async { await tester.pumpWidget(Theme( data: theme, child: Directionality( @@ -432,7 +431,7 @@ void main() { expect(layers1, isNot(equals(layers2))); }); - testWidgetsWithLeakTracking('CircularProgressIndicator stroke width', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator stroke width', (WidgetTester tester) async { await tester.pumpWidget(Theme(data: theme, child: const CircularProgressIndicator())); expect(find.byType(CircularProgressIndicator), paints..arc(strokeWidth: 4.0)); @@ -442,7 +441,7 @@ void main() { expect(find.byType(CircularProgressIndicator), paints..arc(strokeWidth: 16.0)); }); - testWidgetsWithLeakTracking('CircularProgressIndicator strokeAlign', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator strokeAlign', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -483,7 +482,7 @@ void main() { expect(find.byType(CircularProgressIndicator), paints..arc(rect: const Offset(-4.0, -4.0) & const Size(808.0, 608.0))); }); - testWidgetsWithLeakTracking('CircularProgressIndicator with strokeCap', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator with strokeCap', (WidgetTester tester) async { await tester.pumpWidget(const CircularProgressIndicator()); expect(find.byType(CircularProgressIndicator), paints..arc(strokeCap: StrokeCap.square), @@ -505,7 +504,7 @@ void main() { expect(find.byType(CircularProgressIndicator), paints..arc(strokeCap: StrokeCap.round)); }); - testWidgetsWithLeakTracking('LinearProgressIndicator with indicatorBorderRadius', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator with indicatorBorderRadius', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -540,7 +539,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('CircularProgressIndicator paint colors', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator paint colors', (WidgetTester tester) async { const Color green = Color(0xFF00FF00); const Color blue = Color(0xFF0000FF); const Color red = Color(0xFFFF0000); @@ -597,7 +596,7 @@ void main() { expect(find.byType(CircularProgressIndicator), paints..arc(color: blue)..arc(color: green)); }); - testWidgetsWithLeakTracking('RefreshProgressIndicator paint colors', (WidgetTester tester) async { + testWidgets('RefreshProgressIndicator paint colors', (WidgetTester tester) async { const Color green = Color(0xFF00FF00); const Color blue = Color(0xFF0000FF); const Color red = Color(0xFFFF0000); @@ -666,7 +665,7 @@ void main() { expect(themeBackgroundMaterial.color, blue); }); - testWidgetsWithLeakTracking('RefreshProgressIndicator with a round indicator', (WidgetTester tester) async { + testWidgets('RefreshProgressIndicator with a round indicator', (WidgetTester tester) async { await tester.pumpWidget(const RefreshProgressIndicator()); expect(find.byType(RefreshProgressIndicator), paints..arc(strokeCap: StrokeCap.square), @@ -689,7 +688,7 @@ void main() { expect(find.byType(RefreshProgressIndicator), paints..arc(strokeCap: StrokeCap.round)); }); - testWidgetsWithLeakTracking('Indeterminate RefreshProgressIndicator keeps spinning until end of time (approximate)', (WidgetTester tester) async { + testWidgets('Indeterminate RefreshProgressIndicator keeps spinning until end of time (approximate)', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/13782 await tester.pumpWidget( @@ -718,7 +717,7 @@ void main() { expect(tester.hasRunningAnimations, isTrue); }); - testWidgetsWithLeakTracking('Material2 - RefreshProgressIndicator uses expected animation', (WidgetTester tester) async { + testWidgets('Material2 - RefreshProgressIndicator uses expected animation', (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(50, 50)); addTearDown(animationSheet.dispose); @@ -735,7 +734,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/56001 - testWidgetsWithLeakTracking('Material3 - RefreshProgressIndicator uses expected animation', (WidgetTester tester) async { + testWidgets('Material3 - RefreshProgressIndicator uses expected animation', (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(50, 50)); addTearDown(animationSheet.dispose); @@ -752,7 +751,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/56001 - testWidgetsWithLeakTracking('Determinate CircularProgressIndicator stops the animator', (WidgetTester tester) async { + testWidgets('Determinate CircularProgressIndicator stops the animator', (WidgetTester tester) async { double? progressValue; late StateSetter setState; await tester.pumpWidget( @@ -782,7 +781,7 @@ void main() { expect(tester.hasRunningAnimations, isTrue); }); - testWidgetsWithLeakTracking('LinearProgressIndicator with height 12.0', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator with height 12.0', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -807,7 +806,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('LinearProgressIndicator with a height less than the minimum', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator with a height less than the minimum', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -832,7 +831,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('LinearProgressIndicator with default height', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator with default height', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: theme, @@ -857,7 +856,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('LinearProgressIndicator can be made accessible', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator can be made accessible', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey key = GlobalKey(); const String label = 'Label'; @@ -886,7 +885,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('LinearProgressIndicator that is determinate gets default a11y value', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator that is determinate gets default a11y value', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey key = GlobalKey(); const String label = 'Label'; @@ -913,7 +912,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('LinearProgressIndicator that is determinate does not default a11y value when label is null', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator that is determinate does not default a11y value when label is null', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey key = GlobalKey(); await tester.pumpWidget( @@ -934,7 +933,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('LinearProgressIndicator that is indeterminate does not default a11y value', (WidgetTester tester) async { + testWidgets('LinearProgressIndicator that is indeterminate does not default a11y value', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey key = GlobalKey(); const String label = 'Progress'; @@ -960,7 +959,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('CircularProgressIndicator can be made accessible', (WidgetTester tester) async { + testWidgets('CircularProgressIndicator can be made accessible', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey key = GlobalKey(); const String label = 'Label'; @@ -989,7 +988,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('RefreshProgressIndicator can be made accessible', (WidgetTester tester) async { + testWidgets('RefreshProgressIndicator can be made accessible', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey key = GlobalKey(); const String label = 'Label'; @@ -1017,7 +1016,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Indeterminate CircularProgressIndicator uses expected animation', (WidgetTester tester) async { + testWidgets('Material2 - Indeterminate CircularProgressIndicator uses expected animation', (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(40, 40)); addTearDown(animationSheet.dispose); @@ -1040,7 +1039,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/56001 - testWidgetsWithLeakTracking('Material3 - Indeterminate CircularProgressIndicator uses expected animation', (WidgetTester tester) async { + testWidgets('Material3 - Indeterminate CircularProgressIndicator uses expected animation', (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(40, 40)); addTearDown(animationSheet.dispose); @@ -1063,7 +1062,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/56001 - testWidgetsWithLeakTracking( + testWidgets( 'Adaptive CircularProgressIndicator displays CupertinoActivityIndicator in iOS', (WidgetTester tester) async { await tester.pumpWidget( @@ -1085,7 +1084,7 @@ void main() { }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Adaptive CircularProgressIndicator can use backgroundColor to change tick color for iOS', (WidgetTester tester) async { await tester.pumpWidget( @@ -1114,7 +1113,7 @@ void main() { }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Adaptive CircularProgressIndicator does not display CupertinoActivityIndicator in non-iOS', (WidgetTester tester) async { await tester.pumpWidget( @@ -1138,7 +1137,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('ProgressIndicatorTheme.wrap() always creates a new ProgressIndicatorTheme', (WidgetTester tester) async { + testWidgets('ProgressIndicatorTheme.wrap() always creates a new ProgressIndicatorTheme', (WidgetTester tester) async { late BuildContext builderContext; @@ -1169,7 +1168,7 @@ void main() { expect((wrappedTheme as ProgressIndicatorTheme).data, themeData); }); - testWidgetsWithLeakTracking('default size of CircularProgressIndicator is 36x36 - M3', (WidgetTester tester) async { + testWidgets('default size of CircularProgressIndicator is 36x36 - M3', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: theme.copyWith(useMaterial3: true), @@ -1184,7 +1183,7 @@ void main() { expect(tester.getSize(find.byType(CircularProgressIndicator)), const Size(36, 36)); }); - testWidgetsWithLeakTracking('RefreshProgressIndicator using fields correctly', (WidgetTester tester) async { + testWidgets('RefreshProgressIndicator using fields correctly', (WidgetTester tester) async { Future<void> pumpIndicator(RefreshProgressIndicator indicator) { return tester.pumpWidget(Theme(data: theme, child: indicator)); } diff --git a/packages/flutter/test/material/radio_list_tile_test.dart b/packages/flutter/test/material/radio_list_tile_test.dart index 6793eb6ed8e..ac5c51d5b39 100644 --- a/packages/flutter/test/material/radio_list_tile_test.dart +++ b/packages/flutter/test/material/radio_list_tile_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -24,7 +23,7 @@ Widget wrap({Widget? child}) { } void main() { - testWidgetsWithLeakTracking('RadioListTile should initialize according to groupValue', (WidgetTester tester) async { + testWidgets('RadioListTile should initialize according to groupValue', (WidgetTester tester) async { final List<int> values = <int>[0, 1, 2]; int? selectedValue; // Constructor parameters are required for [RadioListTile], but they are @@ -84,7 +83,7 @@ void main() { expect(generatedRadioListTiles[2].checked, equals(false)); }); - testWidgetsWithLeakTracking('RadioListTile simple control test', (WidgetTester tester) async { + testWidgets('RadioListTile simple control test', (WidgetTester tester) async { final Key key = UniqueKey(); final Key titleKey = UniqueKey(); final List<int?> log = <int?>[]; @@ -156,7 +155,7 @@ void main() { expect(log, equals(<int>[1])); }); - testWidgetsWithLeakTracking('RadioListTile control tests', (WidgetTester tester) async { + testWidgets('RadioListTile control tests', (WidgetTester tester) async { final List<int> values = <int>[0, 1, 2]; int? selectedValue; // Constructor parameters are required for [Radio], but they are irrelevant @@ -223,7 +222,7 @@ void main() { expect(log, equals(<dynamic>[1, '-', 2])); }); - testWidgetsWithLeakTracking('Selected RadioListTile should not trigger onChanged', (WidgetTester tester) async { + testWidgets('Selected RadioListTile should not trigger onChanged', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/30311 final List<int> values = <int>[0, 1, 2]; int? selectedValue; @@ -275,7 +274,7 @@ void main() { expect(log, equals(<int>[0])); }); - testWidgetsWithLeakTracking('Selected RadioListTile should trigger onChanged when toggleable', (WidgetTester tester) async { + testWidgets('Selected RadioListTile should trigger onChanged when toggleable', (WidgetTester tester) async { final List<int> values = <int>[0, 1, 2]; int? selectedValue; // Constructor parameters are required for [Radio], but they are irrelevant @@ -329,7 +328,7 @@ void main() { expect(log, equals(<int?>[0, null, 0])); }); - testWidgetsWithLeakTracking('RadioListTile can be toggled when toggleable is set', (WidgetTester tester) async { + testWidgets('RadioListTile can be toggled when toggleable is set', (WidgetTester tester) async { final Key key = UniqueKey(); final List<int?> log = <int?>[]; @@ -384,7 +383,7 @@ void main() { expect(log, equals(<int>[1])); }); - testWidgetsWithLeakTracking('RadioListTile semantics', (WidgetTester tester) async { + testWidgets('RadioListTile semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -533,7 +532,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('RadioListTile has semantic events', (WidgetTester tester) async { + testWidgets('RadioListTile has semantic events', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); dynamic semanticEvent; @@ -572,7 +571,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('RadioListTile can autofocus unless disabled.', (WidgetTester tester) async { + testWidgets('RadioListTile can autofocus unless disabled.', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( @@ -606,7 +605,7 @@ void main() { expect(Focus.of(childKey.currentContext!).hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('RadioListTile contentPadding test', (WidgetTester tester) async { + testWidgets('RadioListTile contentPadding test', (WidgetTester tester) async { final Type radioType = const Radio<bool>( groupValue: true, value: true, @@ -646,7 +645,7 @@ void main() { expect(paddingRect.right, titleRect.right + 15); //right padding }); - testWidgetsWithLeakTracking('RadioListTile respects shape', (WidgetTester tester) async { + testWidgets('RadioListTile respects shape', (WidgetTester tester) async { const ShapeBorder shapeBorder = RoundedRectangleBorder( borderRadius: BorderRadius.horizontal(right: Radius.circular(100)), ); @@ -666,7 +665,7 @@ void main() { expect(tester.widget<InkWell>(find.byType(InkWell)).customBorder, shapeBorder); }); - testWidgetsWithLeakTracking('RadioListTile respects tileColor', (WidgetTester tester) async { + testWidgets('RadioListTile respects tileColor', (WidgetTester tester) async { final Color tileColor = Colors.red.shade500; await tester.pumpWidget( @@ -686,7 +685,7 @@ void main() { expect(find.byType(Material), paints..rect(color: tileColor)); }); - testWidgetsWithLeakTracking('RadioListTile respects selectedTileColor', (WidgetTester tester) async { + testWidgets('RadioListTile respects selectedTileColor', (WidgetTester tester) async { final Color selectedTileColor = Colors.green.shade500; await tester.pumpWidget( @@ -707,7 +706,7 @@ void main() { expect(find.byType(Material), paints..rect(color: selectedTileColor)); }); - testWidgetsWithLeakTracking('RadioListTile selected item text Color', (WidgetTester tester) async { + testWidgets('RadioListTile selected item text Color', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/76906 const Color activeColor = Color(0xff00ff00); @@ -747,7 +746,7 @@ void main() { expect(textColor('title'), activeColor); }); - testWidgetsWithLeakTracking('RadioListTile respects visualDensity', (WidgetTester tester) async { + testWidgets('RadioListTile respects visualDensity', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(VisualDensity visualDensity) async { return tester.pumpWidget( @@ -772,7 +771,7 @@ void main() { expect(box.size, equals(const Size(800, 56))); }); - testWidgetsWithLeakTracking('RadioListTile respects focusNode', (WidgetTester tester) async { + testWidgets('RadioListTile respects focusNode', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( wrap( @@ -795,7 +794,7 @@ void main() { expect(tileNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('RadioListTile onFocusChange callback', (WidgetTester tester) async { + testWidgets('RadioListTile onFocusChange callback', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'RadioListTile onFocusChange'); addTearDown(node.dispose); @@ -827,7 +826,7 @@ void main() { expect(node.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Radio changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Radio changes mouse cursor when hovered', (WidgetTester tester) async { // Test Radio() constructor await tester.pumpWidget( wrap(child: MouseRegion( @@ -878,7 +877,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('RadioListTile respects fillColor in enabled/disabled states', (WidgetTester tester) async { + testWidgets('RadioListTile respects fillColor in enabled/disabled states', (WidgetTester tester) async { const Color activeEnabledFillColor = Color(0xFF000001); const Color activeDisabledFillColor = Color(0xFF000002); const Color inactiveEnabledFillColor = Color(0xFF000003); @@ -965,7 +964,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RadioListTile respects fillColor in hovered state', (WidgetTester tester) async { + testWidgets('RadioListTile respects fillColor in hovered state', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredFillColor = Color(0xFF000001); @@ -1014,7 +1013,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - RadioListTile respects hoverColor', (WidgetTester tester) async { + testWidgets('Material3 - RadioListTile respects hoverColor', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; final Color? hoverColor = Colors.orange[500]; @@ -1080,7 +1079,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - RadioListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('Material3 - RadioListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color fillColor = Color(0xFF000000); @@ -1205,7 +1204,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RadioListTile respects splashRadius', (WidgetTester tester) async { + testWidgets('RadioListTile respects splashRadius', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double splashRadius = 30; Widget buildApp() { @@ -1237,7 +1236,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Radio respects materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Radio respects materialTapTargetSize', (WidgetTester tester) async { await tester.pumpWidget( wrap(child: RadioListTile<bool>( groupValue: true, @@ -1261,7 +1260,7 @@ void main() { expect(tester.getSize(find.byType(Radio<bool>)), const Size(48.0, 48.0)); }); - testWidgetsWithLeakTracking('RadioListTile.adaptive shows the correct radio platform widget', (WidgetTester tester) async { + testWidgets('RadioListTile.adaptive shows the correct radio platform widget', (WidgetTester tester) async { Widget buildApp(TargetPlatform platform) { return MaterialApp( theme: ThemeData(platform: platform), @@ -1303,7 +1302,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('RadioListTile respects enableFeedback', (WidgetTester tester) async { + testWidgets('RadioListTile respects enableFeedback', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(bool enableFeedback) async { return tester.pumpWidget( @@ -1341,7 +1340,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Material2 - RadioListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('Material2 - RadioListTile respects overlayColor in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color fillColor = Color(0xFF000000); @@ -1445,7 +1444,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - RadioListTile respects hoverColor', (WidgetTester tester) async { + testWidgets('Material2 - RadioListTile respects hoverColor', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; final Color? hoverColor = Colors.orange[500]; diff --git a/packages/flutter/test/material/radio_test.dart b/packages/flutter/test/material/radio_test.dart index 27729790243..33f12724d06 100644 --- a/packages/flutter/test/material/radio_test.dart +++ b/packages/flutter/test/material/radio_test.dart @@ -16,13 +16,12 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/src/gestures/constants.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { final ThemeData theme = ThemeData(); - testWidgetsWithLeakTracking('Radio control test', (WidgetTester tester) async { + testWidgets('Radio control test', (WidgetTester tester) async { final Key key = UniqueKey(); final List<int?> log = <int?>[]; @@ -83,7 +82,7 @@ void main() { expect(log, isEmpty); }); - testWidgetsWithLeakTracking('Radio can be toggled when toggleable is set', (WidgetTester tester) async { + testWidgets('Radio can be toggled when toggleable is set', (WidgetTester tester) async { final Key key = UniqueKey(); final List<int?> log = <int?>[]; @@ -147,7 +146,7 @@ void main() { expect(log, equals(<int>[1])); }); - testWidgetsWithLeakTracking('Radio size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Radio size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { final Key key1 = UniqueKey(); await tester.pumpWidget( Theme( @@ -193,7 +192,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(40.0, 40.0)); }); - testWidgetsWithLeakTracking('Radio selected semantics - platform adaptive', (WidgetTester tester) async { + testWidgets('Radio selected semantics - platform adaptive', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Theme( @@ -228,7 +227,7 @@ void main() { semantics.dispose(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Radio semantics', (WidgetTester tester) async { + testWidgets('Radio semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Theme( @@ -359,7 +358,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('has semantic events', (WidgetTester tester) async { + testWidgets('has semantic events', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); dynamic semanticEvent; @@ -397,7 +396,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('Material2 - Radio ink ripple is displayed correctly', (WidgetTester tester) async { + testWidgets('Material2 - Radio ink ripple is displayed correctly', (WidgetTester tester) async { final Key painterKey = UniqueKey(); const Key radioKey = Key('radio'); @@ -431,7 +430,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Radio ink ripple is displayed correctly', (WidgetTester tester) async { + testWidgets('Material3 - Radio ink ripple is displayed correctly', (WidgetTester tester) async { final Key painterKey = UniqueKey(); const Key radioKey = Key('radio'); @@ -465,7 +464,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Radio with splash radius set', (WidgetTester tester) async { + testWidgets('Radio with splash radius set', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double splashRadius = 30; Widget buildApp() { @@ -502,7 +501,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Radio is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material2 - Radio is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; @@ -586,7 +585,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Radio is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material3 - Radio is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; @@ -665,7 +664,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Radio can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Material2 - Radio can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; const Key radioKey = Key('radio'); @@ -748,7 +747,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Radio can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Material3 - Radio can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; const Key radioKey = Key('radio'); @@ -832,7 +831,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Radio can be controlled by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('Radio can be controlled by keyboard shortcuts', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 1; const Key radioKey0 = Key('radio0'); @@ -913,7 +912,7 @@ void main() { focusNode2.dispose(); }); - testWidgetsWithLeakTracking('Radio responds to density changes.', (WidgetTester tester) async { + testWidgets('Radio responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(VisualDensity visualDensity) async { return tester.pumpWidget( @@ -952,7 +951,7 @@ void main() { expect(box.size, equals(const Size(60, 36))); }); - testWidgetsWithLeakTracking('Radio changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Radio changes mouse cursor when hovered', (WidgetTester tester) async { const Key key = ValueKey<int>(1); // Test Radio() constructor await tester.pumpWidget( @@ -1035,7 +1034,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('Radio button fill color resolves in enabled/disabled states', (WidgetTester tester) async { + testWidgets('Radio button fill color resolves in enabled/disabled states', (WidgetTester tester) async { const Color activeEnabledFillColor = Color(0xFF000001); const Color activeDisabledFillColor = Color(0xFF000002); const Color inactiveEnabledFillColor = Color(0xFF000003); @@ -1146,7 +1145,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Radio fill color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Material2 - Radio fill color resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredFillColor = Color(0xFF000001); @@ -1231,7 +1230,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Radio fill color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Material3 - Radio fill color resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredFillColor = Color(0xFF000001); @@ -1311,7 +1310,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Radio overlay color resolves in active/pressed/focused/hovered states', (WidgetTester tester) async { + testWidgets('Radio overlay color resolves in active/pressed/focused/hovered states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1458,7 +1457,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { + testWidgets('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { final Key key = UniqueKey(); Widget buildRadio(bool show) { @@ -1484,7 +1483,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('disabled radio shows tooltip', (WidgetTester tester) async { + testWidgets('disabled radio shows tooltip', (WidgetTester tester) async { const String longPressTooltip = 'long press tooltip'; const String tapTooltip = 'tap tooltip'; await tester.pumpWidget( @@ -1540,7 +1539,7 @@ void main() { expect(find.text(tapTooltip), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - Radio button default colors', (WidgetTester tester) async { + testWidgets('Material2 - Radio button default colors', (WidgetTester tester) async { Widget buildRadio({bool enabled = true, bool selected = true}) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1586,7 +1585,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Radio button default colors', (WidgetTester tester) async { + testWidgets('Material3 - Radio button default colors', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); Widget buildRadio({bool enabled = true, bool selected = true}) { return MaterialApp( @@ -1634,7 +1633,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Radio button default overlay colors in hover/focus/press states', (WidgetTester tester) async { + testWidgets('Material2 - Radio button default overlay colors in hover/focus/press states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1728,7 +1727,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Material3 - Radio button default overlay colors in hover/focus/press states', (WidgetTester tester) async { + testWidgets('Material3 - Radio button default overlay colors in hover/focus/press states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1821,7 +1820,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Radio.adaptive shows the correct platform widget', (WidgetTester tester) async { + testWidgets('Radio.adaptive shows the correct platform widget', (WidgetTester tester) async { Widget buildApp(TargetPlatform platform) { return MaterialApp( theme: ThemeData(platform: platform), @@ -1852,7 +1851,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material2 - Radio default overlayColor and fillColor resolves pressed state', (WidgetTester tester) async { + testWidgets('Material2 - Radio default overlayColor and fillColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final ThemeData theme = ThemeData(useMaterial3: false); @@ -1918,7 +1917,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Radio default overlayColor and fillColor resolves pressed state', (WidgetTester tester) async { + testWidgets('Material3 - Radio default overlayColor and fillColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final ThemeData theme = ThemeData(useMaterial3: true); diff --git a/packages/flutter/test/material/radio_theme_test.dart b/packages/flutter/test/material/radio_theme_test.dart index 5c8c1861216..ebafbed6c62 100644 --- a/packages/flutter/test/material/radio_theme_test.dart +++ b/packages/flutter/test/material/radio_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('RadioThemeData copyWith, ==, hashCode basics', () { @@ -38,7 +37,7 @@ void main() { expect(theme.data.visualDensity, null); }); - testWidgetsWithLeakTracking('Default RadioThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default RadioThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const RadioThemeData().debugFillProperties(builder); @@ -50,7 +49,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('RadioThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('RadioThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const RadioThemeData( mouseCursor: MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.click), @@ -79,7 +78,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Radio is themeable', (WidgetTester tester) async { + testWidgets('Radio is themeable', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const MouseCursor mouseCursor = SystemMouseCursors.text; @@ -152,7 +151,7 @@ void main() { expect(_getRadioMaterial(tester), paints..circle(color: focusOverlayColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Radio properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('Radio properties are taken over the theme values', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const MouseCursor themeMouseCursor = SystemMouseCursors.click; @@ -246,7 +245,7 @@ void main() { expect(_getRadioMaterial(tester), paints..circle(color: focusColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Radio activeColor property is taken over the theme', (WidgetTester tester) async { + testWidgets('Radio activeColor property is taken over the theme', (WidgetTester tester) async { const Color themeDefaultFillColor = Color(0xfffffff0); const Color themeSelectedFillColor = Color(0xfffffff1); @@ -287,7 +286,7 @@ void main() { expect(_getRadioMaterial(tester), paints..circle(color: selectedFillColor)); }); - testWidgetsWithLeakTracking('Radio theme overlay color resolves in active/pressed states', (WidgetTester tester) async { + testWidgets('Radio theme overlay color resolves in active/pressed states', (WidgetTester tester) async { const Color activePressedOverlayColor = Color(0xFF000001); const Color inactivePressedOverlayColor = Color(0xFF000002); @@ -349,7 +348,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Local RadioTheme can override global RadioTheme', (WidgetTester tester) async { + testWidgets('Local RadioTheme can override global RadioTheme', (WidgetTester tester) async { const Color globalThemeFillColor = Color(0xfffffff1); const Color localThemeFillColor = Color(0xffff0000); diff --git a/packages/flutter/test/material/range_slider_test.dart b/packages/flutter/test/material/range_slider_test.dart index bd1c5280652..d00fe4275f2 100644 --- a/packages/flutter/test/material/range_slider_test.dart +++ b/packages/flutter/test/material/range_slider_test.dart @@ -8,11 +8,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/src/physics/utils.dart' show nearEqual; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/105833 - testWidgetsWithLeakTracking('Drag gesture uses provided gesture settings', (WidgetTester tester) async { + testWidgets('Drag gesture uses provided gesture settings', (WidgetTester tester) async { RangeValues values = const RangeValues(0.1, 0.5); bool dragStarted = false; final Key sliderKey = UniqueKey(); @@ -118,7 +117,7 @@ void main() { expect(dragStarted, false); }); - testWidgetsWithLeakTracking('Range Slider can move when tapped (continuous LTR)', (WidgetTester tester) async { + testWidgets('Range Slider can move when tapped (continuous LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -172,7 +171,7 @@ void main() { expect(values.end, moreOrLessEquals(0.9, epsilon: 0.01)); }); - testWidgetsWithLeakTracking('Range Slider can move when tapped (continuous RTL)', (WidgetTester tester) async { + testWidgets('Range Slider can move when tapped (continuous RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -226,7 +225,7 @@ void main() { expect(values.end, moreOrLessEquals(0.9, epsilon: 0.01)); }); - testWidgetsWithLeakTracking('Range Slider can move when tapped (discrete LTR)', (WidgetTester tester) async { + testWidgets('Range Slider can move when tapped (discrete LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -284,7 +283,7 @@ void main() { expect(values.end.round(), equals(90)); }); - testWidgetsWithLeakTracking('Range Slider can move when tapped (discrete RTL)', (WidgetTester tester) async { + testWidgets('Range Slider can move when tapped (discrete RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -342,7 +341,7 @@ void main() { expect(values.end.round(), equals(90)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged to the min and max (continuous LTR)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged to the min and max (continuous LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -386,7 +385,7 @@ void main() { expect(values.end, equals(1)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged to the min and max (continuous RTL)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged to the min and max (continuous RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -430,7 +429,7 @@ void main() { expect(values.start, equals(0)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged to the min and max (discrete LTR)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged to the min and max (discrete LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -476,7 +475,7 @@ void main() { expect(values.end, equals(100)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged to the min and max (discrete RTL)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged to the min and max (discrete RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -522,7 +521,7 @@ void main() { expect(values.start, equals(0)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (continuous LTR)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (continuous LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -572,7 +571,7 @@ void main() { expect(values.start, moreOrLessEquals(0.2, epsilon: 0.05)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (continuous RTL)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (continuous RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -622,7 +621,7 @@ void main() { expect(values.start, moreOrLessEquals(0.2, epsilon: 0.05)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (discrete LTR)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (discrete LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -674,7 +673,7 @@ void main() { expect(values.start, moreOrLessEquals(20, epsilon: 0.01)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (discrete RTL)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the start thumb can be dragged apart (discrete RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -726,7 +725,7 @@ void main() { expect(values.start, moreOrLessEquals(20, epsilon: 0.01)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (continuous LTR)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (continuous LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -776,7 +775,7 @@ void main() { expect(values.end, moreOrLessEquals(0.8, epsilon: 0.05)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (continuous RTL)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (continuous RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); await tester.pumpWidget( @@ -826,7 +825,7 @@ void main() { expect(values.end, moreOrLessEquals(0.8, epsilon: 0.05)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (discrete LTR)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (discrete LTR)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -878,7 +877,7 @@ void main() { expect(values.end, moreOrLessEquals(80, epsilon: 0.01)); }); - testWidgetsWithLeakTracking('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (discrete RTL)', (WidgetTester tester) async { + testWidgets('Range Slider thumbs can be dragged together and the end thumb can be dragged apart (discrete RTL)', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); await tester.pumpWidget( @@ -930,7 +929,7 @@ void main() { expect(values.end, moreOrLessEquals(80, epsilon: 0.01)); }); - testWidgetsWithLeakTracking('Range Slider onChangeEnd and onChangeStart are called on an interaction initiated by tap', (WidgetTester tester) async { + testWidgets('Range Slider onChangeEnd and onChangeStart are called on an interaction initiated by tap', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); RangeValues? startValues; RangeValues? endValues; @@ -984,7 +983,7 @@ void main() { expect(endValues!.end, moreOrLessEquals(70, epsilon: 1)); }); - testWidgetsWithLeakTracking('Range Slider onChangeEnd and onChangeStart are called on an interaction initiated by drag', (WidgetTester tester) async { + testWidgets('Range Slider onChangeEnd and onChangeStart are called on an interaction initiated by drag', (WidgetTester tester) async { RangeValues values = const RangeValues(30, 70); late RangeValues startValues; late RangeValues endValues; @@ -1099,7 +1098,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes for a default enabled slider', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes for a default enabled slider', (WidgetTester tester) async { final ThemeData theme = buildTheme(); final SliderThemeData sliderTheme = theme.sliderTheme; @@ -1128,7 +1127,7 @@ void main() { expect(sliderBox, isNot(paints..circle(color: sliderTheme.inactiveTickMarkColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes when setting the active color', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes when setting the active color', (WidgetTester tester) async { const Color activeColor = Color(0xcafefeed); final ThemeData theme = buildTheme(); final SliderThemeData sliderTheme = theme.sliderTheme; @@ -1156,7 +1155,7 @@ void main() { expect(sliderBox, isNot(paints..rect(color: sliderTheme.disabledInactiveTrackColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes when setting the inactive color', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes when setting the inactive color', (WidgetTester tester) async { const Color inactiveColor = Color(0xdeadbeef); final ThemeData theme = buildTheme(); final SliderThemeData sliderTheme = theme.sliderTheme; @@ -1183,7 +1182,7 @@ void main() { expect(sliderBox, isNot(paints..rect(color: sliderTheme.disabledInactiveTrackColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes with active and inactive colors', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes with active and inactive colors', (WidgetTester tester) async { const Color activeColor = Color(0xcafefeed); const Color inactiveColor = Color(0xdeadbeef); final ThemeData theme = buildTheme(); @@ -1216,7 +1215,7 @@ void main() { expect(sliderBox, isNot(paints..rect(color: sliderTheme.disabledInactiveTrackColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes for a discrete slider', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes for a discrete slider', (WidgetTester tester) async { final ThemeData theme = buildTheme(); final SliderThemeData sliderTheme = theme.sliderTheme; @@ -1246,7 +1245,7 @@ void main() { expect(sliderBox, isNot(paints..rect(color: sliderTheme.disabledInactiveTrackColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes for a discrete slider with active and inactive colors', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes for a discrete slider with active and inactive colors', (WidgetTester tester) async { const Color activeColor = Color(0xcafefeed); const Color inactiveColor = Color(0xdeadbeef); final ThemeData theme = buildTheme(); @@ -1287,7 +1286,7 @@ void main() { expect(sliderBox, isNot(paints..circle(color: sliderTheme.inactiveTickMarkColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes for a default disabled slider', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes for a default disabled slider', (WidgetTester tester) async { final ThemeData theme = buildTheme(); final SliderThemeData sliderTheme = theme.sliderTheme; @@ -1307,7 +1306,7 @@ void main() { expect(sliderBox, isNot(paints..rect(color: sliderTheme.inactiveTrackColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes for a disabled slider with active and inactive colors', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes for a disabled slider with active and inactive colors', (WidgetTester tester) async { const Color activeColor = Color(0xcafefeed); const Color inactiveColor = Color(0xdeadbeef); final ThemeData theme = buildTheme(); @@ -1334,7 +1333,7 @@ void main() { expect(sliderBox, isNot(paints..rect(color: sliderTheme.inactiveTrackColor))); }); - testWidgetsWithLeakTracking('Range Slider uses the right theme colors for the right shapes when the value indicators are showing', (WidgetTester tester) async { + testWidgets('Range Slider uses the right theme colors for the right shapes when the value indicators are showing', (WidgetTester tester) async { final ThemeData theme = buildTheme(); final SliderThemeData sliderTheme = theme.sliderTheme; RangeValues values = const RangeValues(0.5, 0.75); @@ -1392,7 +1391,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Range Slider removes value indicator from overlay if Slider gets disposed without value indicator animation completing.', (WidgetTester tester) async { + testWidgets('Range Slider removes value indicator from overlay if Slider gets disposed without value indicator animation completing.', (WidgetTester tester) async { RangeValues values = const RangeValues(0.5, 0.75); const Color fillColor = Color(0xf55f5f5f); @@ -1496,7 +1495,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Range Slider top thumb gets stroked when overlapping', (WidgetTester tester) async { + testWidgets('Range Slider top thumb gets stroked when overlapping', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); final ThemeData theme = ThemeData( @@ -1563,7 +1562,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Range Slider top value indicator gets stroked when overlapping', (WidgetTester tester) async { + testWidgets('Range Slider top value indicator gets stroked when overlapping', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); final ThemeData theme = ThemeData( @@ -1637,7 +1636,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Range Slider top value indicator gets stroked when overlapping with large text scale', (WidgetTester tester) async { + testWidgets('Range Slider top value indicator gets stroked when overlapping with large text scale', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); final ThemeData theme = ThemeData( @@ -1714,7 +1713,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Range Slider thumb gets stroked when overlapping', (WidgetTester tester) async { + testWidgets('Range Slider thumb gets stroked when overlapping', (WidgetTester tester) async { RangeValues values = const RangeValues(0.3, 0.7); final ThemeData theme = ThemeData( @@ -1795,7 +1794,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/101868 - testWidgetsWithLeakTracking('RangeSlider.label info should not write to semantic node', (WidgetTester tester) async { + testWidgets('RangeSlider.label info should not write to semantic node', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Theme( @@ -1853,7 +1852,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Range Slider Semantics - ltr', (WidgetTester tester) async { + testWidgets('Range Slider Semantics - ltr', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Theme( @@ -1937,7 +1936,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Range Slider Semantics - rtl', (WidgetTester tester) async { + testWidgets('Range Slider Semantics - rtl', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Theme( @@ -2019,7 +2018,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Range Slider implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Range Slider implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); RangeSlider( @@ -2050,7 +2049,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Range Slider can be painted in a narrower constraint when track shape is RoundedRectRange', (WidgetTester tester) async { + testWidgets('Range Slider can be painted in a narrower constraint when track shape is RoundedRectRange', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -2089,7 +2088,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Range Slider can be painted in a narrower constraint when track shape is Rectangular', (WidgetTester tester) async { + testWidgets('Range Slider can be painted in a narrower constraint when track shape is Rectangular', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -2134,7 +2133,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Update the divisions and values at the same time for RangeSlider', (WidgetTester tester) async { + testWidgets('Update the divisions and values at the same time for RangeSlider', (WidgetTester tester) async { // Regress test for https://github.com/flutter/flutter/issues/65943 Widget buildFrame(double maxValue) { return MaterialApp( @@ -2178,7 +2177,7 @@ void main() { expect(nearEqual(activeTrackRect.right, (800.0 - 24.0 - 24.0) * (8 / 15) + 24.0, 0.01), true); }); - testWidgetsWithLeakTracking('RangeSlider changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('RangeSlider changes mouse cursor when hovered', (WidgetTester tester) async { const RangeValues values = RangeValues(50, 70); // Test default cursor. @@ -2233,7 +2232,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('RangeSlider MaterialStateMouseCursor resolves correctly', (WidgetTester tester) async { + testWidgets('RangeSlider MaterialStateMouseCursor resolves correctly', (WidgetTester tester) async { RangeValues values = const RangeValues(50, 70); const MouseCursor disabledCursor = SystemMouseCursors.basic; const MouseCursor hoveredCursor = SystemMouseCursors.grab; @@ -2307,7 +2306,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), draggedCursor); }); - testWidgetsWithLeakTracking('RangeSlider can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('RangeSlider can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; RangeValues values = const RangeValues(50, 70); final ThemeData theme = ThemeData(); @@ -2370,7 +2369,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RangeSlider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('RangeSlider is draggable and has correct dragged color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; RangeValues values = const RangeValues(50, 70); final ThemeData theme = ThemeData(); @@ -2426,7 +2425,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RangeSlider overlayColor supports hovered and dragged states', (WidgetTester tester) async { + testWidgets('RangeSlider overlayColor supports hovered and dragged states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; RangeValues values = const RangeValues(50, 70); const Color hoverColor = Color(0xffff0000); @@ -2541,7 +2540,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RangeSlider onChangeStart and onChangeEnd fire once', (WidgetTester tester) async { + testWidgets('RangeSlider onChangeStart and onChangeEnd fire once', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/128433 int startFired = 0; @@ -2582,7 +2581,7 @@ void main() { expect(endFired, equals(1)); }); - testWidgetsWithLeakTracking('RangeSlider in a ListView does not throw an exception', (WidgetTester tester) async { + testWidgets('RangeSlider in a ListView does not throw an exception', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126648 await tester.pumpWidget( diff --git a/packages/flutter/test/material/raw_material_button_test.dart b/packages/flutter/test/material/raw_material_button_test.dart index 3736ab1a31c..d58db5f7851 100644 --- a/packages/flutter/test/material/raw_material_button_test.dart +++ b/packages/flutter/test/material/raw_material_button_test.dart @@ -8,11 +8,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/src/services/keyboard_key.g.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('RawMaterialButton responds when tapped', (WidgetTester tester) async { + testWidgets('RawMaterialButton responds when tapped', (WidgetTester tester) async { bool pressed = false; const Color splashColor = Color(0xff00ff00); await tester.pumpWidget( @@ -42,7 +41,7 @@ void main() { expect(pressed, isTrue); }); - testWidgetsWithLeakTracking('RawMaterialButton responds to shortcut when activated', (WidgetTester tester) async { + testWidgets('RawMaterialButton responds to shortcut when activated', (WidgetTester tester) async { bool pressed = false; final FocusNode focusNode = FocusNode(debugLabel: 'Test Button'); const Color splashColor = Color(0xff00ff00); @@ -110,7 +109,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('materialTapTargetSize.padded expands hit test area', (WidgetTester tester) async { + testWidgets('materialTapTargetSize.padded expands hit test area', (WidgetTester tester) async { int pressed = 0; await tester.pumpWidget( @@ -132,7 +131,7 @@ void main() { expect(pressed, 1); }); - testWidgetsWithLeakTracking('materialTapTargetSize.padded expands semantics area', (WidgetTester tester) async { + testWidgets('materialTapTargetSize.padded expands semantics area', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -175,7 +174,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Ink splash from center tap originates in correct location', (WidgetTester tester) async { + testWidgets('Ink splash from center tap originates in correct location', (WidgetTester tester) async { const Color highlightColor = Color(0xAAFF0000); const Color splashColor = Color(0xAA0000FF); const Color fillColor = Color(0xFFEF5350); @@ -210,7 +209,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Ink splash from tap above material originates in correct location', (WidgetTester tester) async { + testWidgets('Ink splash from tap above material originates in correct location', (WidgetTester tester) async { const Color highlightColor = Color(0xAAFF0000); const Color splashColor = Color(0xAA0000FF); const Color fillColor = Color(0xFFEF5350); @@ -244,7 +243,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('off-center child is hit testable', (WidgetTester tester) async { + testWidgets('off-center child is hit testable', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Column( @@ -274,7 +273,7 @@ void main() { expect(find.text('Material').hitTestable(), findsOneWidget); }); - testWidgetsWithLeakTracking('smaller child is hit testable', (WidgetTester tester) async { + testWidgets('smaller child is hit testable', (WidgetTester tester) async { const Key key = Key('test'); await tester.pumpWidget( MaterialApp( @@ -299,7 +298,7 @@ void main() { expect(find.byKey(key).hitTestable(), findsOneWidget); }); - testWidgetsWithLeakTracking('RawMaterialButton can be expanded by parent constraints', (WidgetTester tester) async { + testWidgets('RawMaterialButton can be expanded by parent constraints', (WidgetTester tester) async { const Key key = Key('test'); await tester.pumpWidget( MaterialApp( @@ -319,7 +318,7 @@ void main() { expect(tester.getSize(find.byKey(key)), const Size(800.0, 48.0)); }); - testWidgetsWithLeakTracking('RawMaterialButton handles focus', (WidgetTester tester) async { + testWidgets('RawMaterialButton handles focus', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Button Focus'); const Key key = Key('test'); const Color focusColor = Color(0xff00ff00); @@ -348,7 +347,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('RawMaterialButton loses focus when disabled.', (WidgetTester tester) async { + testWidgets('RawMaterialButton loses focus when disabled.', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'RawMaterialButton'); await tester.pumpWidget( MaterialApp( @@ -383,7 +382,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking("Disabled RawMaterialButton can't be traversed to.", (WidgetTester tester) async { + testWidgets("Disabled RawMaterialButton can't be traversed to.", (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: '$RawMaterialButton 1'); final FocusNode focusNode2 = FocusNode(debugLabel: '$RawMaterialButton 2'); @@ -426,7 +425,7 @@ void main() { focusNode2.dispose(); }); - testWidgetsWithLeakTracking('RawMaterialButton handles hover', (WidgetTester tester) async { + testWidgets('RawMaterialButton handles hover', (WidgetTester tester) async { const Key key = Key('test'); const Color hoverColor = Color(0xff00ff00); @@ -455,7 +454,7 @@ void main() { expect(box, paints..rect(color: hoverColor)); }); - testWidgetsWithLeakTracking('RawMaterialButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { + testWidgets('RawMaterialButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { bool wasPressed; Finder rawMaterialButton; @@ -499,7 +498,7 @@ void main() { expect(tester.widget<RawMaterialButton>(rawMaterialButton).enabled, false); }); - testWidgetsWithLeakTracking('RawMaterialButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { + testWidgets('RawMaterialButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { bool didPressButton = false; bool didLongPressButton = false; @@ -530,7 +529,7 @@ void main() { expect(didLongPressButton, isTrue); }); - testWidgetsWithLeakTracking('RawMaterialButton responds to density changes.', (WidgetTester tester) async { + testWidgets('RawMaterialButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key childKey = Key('test child'); @@ -591,7 +590,7 @@ void main() { expect(childRect, equals(const Rect.fromLTRB(372.0, 293.0, 428.0, 307.0))); }); - testWidgetsWithLeakTracking('RawMaterialButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('RawMaterialButton changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/material/refresh_indicator_test.dart b/packages/flutter/test/material/refresh_indicator_test.dart index 25cd1bc1078..68e687a2ce4 100644 --- a/packages/flutter/test/material/refresh_indicator_test.dart +++ b/packages/flutter/test/material/refresh_indicator_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; bool refreshCalled = false; @@ -23,7 +22,7 @@ Future<void> holdRefresh() { } void main() { - testWidgetsWithLeakTracking('RefreshIndicator', (WidgetTester tester) async { + testWidgets('RefreshIndicator', (WidgetTester tester) async { refreshCalled = false; final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( @@ -57,7 +56,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Refresh Indicator - nested', (WidgetTester tester) async { + testWidgets('Refresh Indicator - nested', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -98,7 +97,7 @@ void main() { expect(refreshCalled, true); }); - testWidgetsWithLeakTracking('RefreshIndicator - reverse', (WidgetTester tester) async { + testWidgets('RefreshIndicator - reverse', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -126,7 +125,7 @@ void main() { expect(refreshCalled, true); }); - testWidgetsWithLeakTracking('RefreshIndicator - top - position', (WidgetTester tester) async { + testWidgets('RefreshIndicator - top - position', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -152,7 +151,7 @@ void main() { expect(tester.getCenter(find.byType(RefreshProgressIndicator)).dy, lessThan(300.0)); }); - testWidgetsWithLeakTracking('RefreshIndicator - reverse - position', (WidgetTester tester) async { + testWidgets('RefreshIndicator - reverse - position', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -179,7 +178,7 @@ void main() { expect(tester.getCenter(find.byType(RefreshProgressIndicator)).dy, lessThan(300.0)); }); - testWidgetsWithLeakTracking('RefreshIndicator - no movement', (WidgetTester tester) async { + testWidgets('RefreshIndicator - no movement', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -207,7 +206,7 @@ void main() { expect(refreshCalled, false); }); - testWidgetsWithLeakTracking('RefreshIndicator - not enough', (WidgetTester tester) async { + testWidgets('RefreshIndicator - not enough', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -234,7 +233,7 @@ void main() { expect(refreshCalled, false); }); - testWidgetsWithLeakTracking('RefreshIndicator - just enough', (WidgetTester tester) async { + testWidgets('RefreshIndicator - just enough', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -261,7 +260,7 @@ void main() { expect(refreshCalled, true); }); - testWidgetsWithLeakTracking('RefreshIndicator - show - slow', (WidgetTester tester) async { + testWidgets('RefreshIndicator - show - slow', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -304,7 +303,7 @@ void main() { expect(refreshCalled, false); }); - testWidgetsWithLeakTracking('RefreshIndicator - show - fast', (WidgetTester tester) async { + testWidgets('RefreshIndicator - show - fast', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -348,7 +347,7 @@ void main() { expect(completed, true); }); - testWidgetsWithLeakTracking('RefreshIndicator - show - fast - twice', (WidgetTester tester) async { + testWidgets('RefreshIndicator - show - fast - twice', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -386,7 +385,7 @@ void main() { expect(completed2, true); }); - testWidgetsWithLeakTracking('Refresh starts while scroll view moves back to 0.0 after overscroll', (WidgetTester tester) async { + testWidgets('Refresh starts while scroll view moves back to 0.0 after overscroll', (WidgetTester tester) async { refreshCalled = false; double lastScrollOffset; final ScrollController controller = ScrollController(); @@ -427,7 +426,7 @@ void main() { controller.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('RefreshIndicator does not force child to relayout', (WidgetTester tester) async { + testWidgets('RefreshIndicator does not force child to relayout', (WidgetTester tester) async { int layoutCount = 0; Widget layoutCallback(BuildContext context, BoxConstraints constraints) { @@ -462,7 +461,7 @@ void main() { expect(layoutCount, 1); }); - testWidgetsWithLeakTracking('RefreshIndicator responds to strokeWidth', (WidgetTester tester) async { + testWidgets('RefreshIndicator responds to strokeWidth', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: RefreshIndicator( @@ -510,7 +509,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RefreshIndicator responds to edgeOffset', (WidgetTester tester) async { + testWidgets('RefreshIndicator responds to edgeOffset', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: RefreshIndicator( @@ -558,7 +557,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RefreshIndicator appears at edgeOffset', (WidgetTester tester) async { + testWidgets('RefreshIndicator appears at edgeOffset', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: RefreshIndicator( edgeOffset: kToolbarHeight, @@ -587,7 +586,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Top RefreshIndicator(anywhere mode) should be shown when dragging from non-zero scroll position', (WidgetTester tester) async { + testWidgets('Top RefreshIndicator(anywhere mode) should be shown when dragging from non-zero scroll position', (WidgetTester tester) async { refreshCalled = false; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -624,7 +623,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Reverse RefreshIndicator(anywhere mode) should be shown when dragging from non-zero scroll position', (WidgetTester tester) async { + testWidgets('Reverse RefreshIndicator(anywhere mode) should be shown when dragging from non-zero scroll position', (WidgetTester tester) async { refreshCalled = false; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -663,7 +662,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/71936 - testWidgetsWithLeakTracking('RefreshIndicator(anywhere mode) should not be shown when overscroll occurs due to inertia', (WidgetTester tester) async { + testWidgets('RefreshIndicator(anywhere mode) should not be shown when overscroll occurs due to inertia', (WidgetTester tester) async { refreshCalled = false; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -701,7 +700,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Top RefreshIndicator(onEdge mode) should not be shown when dragging from non-zero scroll position', (WidgetTester tester) async { + testWidgets('Top RefreshIndicator(onEdge mode) should not be shown when dragging from non-zero scroll position', (WidgetTester tester) async { refreshCalled = false; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -737,7 +736,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Reverse RefreshIndicator(onEdge mode) should be shown when dragging from non-zero scroll position', (WidgetTester tester) async { + testWidgets('Reverse RefreshIndicator(onEdge mode) should be shown when dragging from non-zero scroll position', (WidgetTester tester) async { refreshCalled = false; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -774,7 +773,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('ScrollController.jumpTo should not trigger the refresh indicator', (WidgetTester tester) async { + testWidgets('ScrollController.jumpTo should not trigger the refresh indicator', (WidgetTester tester) async { refreshCalled = false; final ScrollController scrollController = ScrollController(initialScrollOffset: 500.0); await tester.pumpWidget( @@ -808,7 +807,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('RefreshIndicator.adaptive', (WidgetTester tester) async { + testWidgets('RefreshIndicator.adaptive', (WidgetTester tester) async { Widget buildFrame(TargetPlatform platform) { return MaterialApp( theme: ThemeData(platform: platform), @@ -850,7 +849,7 @@ void main() { } }); - testWidgetsWithLeakTracking('RefreshIndicator color defaults to ColorScheme.primary', (WidgetTester tester) async { + testWidgets('RefreshIndicator color defaults to ColorScheme.primary', (WidgetTester tester) async { const Color primaryColor = Color(0xff4caf50); final ThemeData theme = ThemeData.from(colorScheme: const ColorScheme.light().copyWith(primary: primaryColor)); await tester.pumpWidget( @@ -886,7 +885,7 @@ void main() { expect(tester.widget<RefreshProgressIndicator>(find.byType(RefreshProgressIndicator)).valueColor!.value, primaryColor); }); - testWidgetsWithLeakTracking('RefreshIndicator.color can be updated at runtime', (WidgetTester tester) async { + testWidgets('RefreshIndicator.color can be updated at runtime', (WidgetTester tester) async { refreshCalled = false; Color refreshIndicatorColor = Colors.green; const Color red = Colors.red; @@ -933,7 +932,7 @@ void main() { expect(tester.widget<RefreshProgressIndicator>(find.byType(RefreshProgressIndicator)).valueColor!.value, red.withOpacity(1.0)); }); - testWidgetsWithLeakTracking('RefreshIndicator - reverse - BouncingScrollPhysics', (WidgetTester tester) async { + testWidgets('RefreshIndicator - reverse - BouncingScrollPhysics', (WidgetTester tester) async { refreshCalled = false; await tester.pumpWidget( MaterialApp( @@ -967,7 +966,7 @@ void main() { expect(refreshCalled, true); }); - testWidgetsWithLeakTracking('RefreshIndicator disallows indicator - glow', (WidgetTester tester) async { + testWidgets('RefreshIndicator disallows indicator - glow', (WidgetTester tester) async { refreshCalled = false; bool glowAccepted = true; ScrollNotification? lastNotification; @@ -1019,7 +1018,7 @@ void main() { expect(glowAccepted, false); }); - testWidgetsWithLeakTracking('RefreshIndicator disallows indicator - stretch', (WidgetTester tester) async { + testWidgets('RefreshIndicator disallows indicator - stretch', (WidgetTester tester) async { refreshCalled = false; bool stretchAccepted = true; ScrollNotification? lastNotification; @@ -1071,7 +1070,7 @@ void main() { expect(stretchAccepted, false); }); - testWidgetsWithLeakTracking('RefreshIndicator manipulates value color opacity correctly', (WidgetTester tester) async { + testWidgets('RefreshIndicator manipulates value color opacity correctly', (WidgetTester tester) async { final List<Color> colors = <Color>[ Colors.black, Colors.black54, diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index 7b5f2b9b9a9..5595fe6448f 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('$ReorderableListView', () { @@ -72,7 +71,7 @@ void main() { }); group('in vertical mode', () { - testWidgetsWithLeakTracking('reorder is not triggered when children length is less or equals to 1', (WidgetTester tester) async { + testWidgets('reorder is not triggered when children length is less or equals to 1', (WidgetTester tester) async { bool onReorderWasCalled = false; final List<String> currentListItems = listItems.take(1).toList(); final ReorderableListView reorderableListView = ReorderableListView( @@ -98,7 +97,7 @@ void main() { expect(currentListItems, orderedEquals(<String>['Item 1'])); }); - testWidgetsWithLeakTracking('reorders its contents only when a drag finishes', (WidgetTester tester) async { + testWidgets('reorders its contents only when a drag finishes', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(listItems, orderedEquals(originalListItems)); final TestGesture drag = await tester.startGesture(tester.getCenter(find.text('Item 1'))); @@ -111,7 +110,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 3', 'Item 1', 'Item 4'])); }); - testWidgetsWithLeakTracking('allows reordering from the very top to the very bottom', (WidgetTester tester) async { + testWidgets('allows reordering from the very top to the very bottom', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(listItems, orderedEquals(originalListItems)); await longPressDrag( @@ -123,7 +122,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 3', 'Item 4', 'Item 1'])); }); - testWidgetsWithLeakTracking('allows reordering from the very bottom to the very top', (WidgetTester tester) async { + testWidgets('allows reordering from the very bottom to the very top', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(listItems, orderedEquals(originalListItems)); await longPressDrag( @@ -135,7 +134,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 4', 'Item 1', 'Item 2', 'Item 3'])); }); - testWidgetsWithLeakTracking('allows reordering inside the middle of the widget', (WidgetTester tester) async { + testWidgets('allows reordering inside the middle of the widget', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(listItems, orderedEquals(originalListItems)); await longPressDrag( @@ -147,7 +146,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 1', 'Item 3', 'Item 2', 'Item 4'])); }); - testWidgetsWithLeakTracking('properly reorders with a header', (WidgetTester tester) async { + testWidgets('properly reorders with a header', (WidgetTester tester) async { await tester.pumpWidget(build(header: const Text('Header Text'))); expect(find.text('Header Text'), findsOneWidget); expect(listItems, orderedEquals(originalListItems)); @@ -161,7 +160,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 3', 'Item 4', 'Item 1'])); }); - testWidgetsWithLeakTracking('properly reorders with a footer', (WidgetTester tester) async { + testWidgets('properly reorders with a footer', (WidgetTester tester) async { await tester.pumpWidget(build(footer: const Text('Footer Text'))); expect(find.text('Footer Text'), findsOneWidget); expect(listItems, orderedEquals(originalListItems)); @@ -175,7 +174,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 3', 'Item 4', 'Item 1'])); }); - testWidgetsWithLeakTracking('properly determines the vertical drop area extents', (WidgetTester tester) async { + testWidgets('properly determines the vertical drop area extents', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( onReorder: (int oldIndex, int newIndex) { }, children: const <Widget>[ @@ -242,7 +241,7 @@ void main() { expect(getListHeight(), kDraggingListHeight); }); - testWidgetsWithLeakTracking('Vertical drag in progress golden image', (WidgetTester tester) async { + testWidgets('Vertical drag in progress golden image', (WidgetTester tester) async { debugDisableShadows = false; final Widget reorderableListView = ReorderableListView( children: <Widget>[ @@ -310,7 +309,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('Preserves children states when the list parent changes the order', (WidgetTester tester) async { + testWidgets('Preserves children states when the list parent changes the order', (WidgetTester tester) async { _StatefulState findState(Key key) { return find.byElementPredicate((Element element) => element.findAncestorWidgetOfExactType<_Stateful>()?.key == key) .evaluate() @@ -350,7 +349,7 @@ void main() { expect(findState(const Key('A')).checked, true); }); - testWidgetsWithLeakTracking('Preserves children states when rebuilt', (WidgetTester tester) async { + testWidgets('Preserves children states when rebuilt', (WidgetTester tester) async { const Key firstBox = Key('key'); Widget build() { return MaterialApp( @@ -378,7 +377,7 @@ void main() { expect(e0, equals(e1)); }); - testWidgetsWithLeakTracking('Uses the PrimaryScrollController when available', (WidgetTester tester) async { + testWidgets('Uses the PrimaryScrollController when available', (WidgetTester tester) async { final ScrollController primary = ScrollController(); addTearDown(primary.dispose); final Widget reorderableList = ReorderableListView( @@ -420,7 +419,7 @@ void main() { expect(scrollView.controller, primary2); }); - testWidgetsWithLeakTracking('Test custom ScrollController behavior when set', (WidgetTester tester) async { + testWidgets('Test custom ScrollController behavior when set', (WidgetTester tester) async { const Key firstBox = Key('C'); const Key secondBox = Key('B'); const Key thirdBox = Key('A'); @@ -484,7 +483,7 @@ void main() { expect(customController.offset, 120.0); }); - testWidgetsWithLeakTracking('ReorderableList auto scrolling is fast enough', (WidgetTester tester) async { + testWidgets('ReorderableList auto scrolling is fast enough', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/121603. final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -525,7 +524,7 @@ void main() { expect(controller.offset, greaterThan(kMinimumAllowedAutoScrollDistancePer5ms * 4)); }); - testWidgetsWithLeakTracking('Still builds when no PrimaryScrollController is available', (WidgetTester tester) async { + testWidgets('Still builds when no PrimaryScrollController is available', (WidgetTester tester) async { final Widget reorderableList = ReorderableListView( children: const <Widget>[ SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')), @@ -578,7 +577,7 @@ void main() { const CustomSemanticsAction moveUp = CustomSemanticsAction(label: 'Move up'); const CustomSemanticsAction moveDown = CustomSemanticsAction(label: 'Move down'); - testWidgetsWithLeakTracking('Provides the correct accessibility actions in LTR and RTL modes', (WidgetTester tester) async { + testWidgets('Provides the correct accessibility actions in LTR and RTL modes', (WidgetTester tester) async { // The a11y actions for a vertical list are the same in LTR and RTL modes. final SemanticsHandle handle = tester.ensureSemantics(); for (final TextDirection direction in TextDirection.values) { @@ -613,7 +612,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('First item accessibility (a11y) actions work', (WidgetTester tester) async { + testWidgets('First item accessibility (a11y) actions work', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); expect(listItems, orderedEquals(originalListItems)); @@ -634,7 +633,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Middle item accessibility (a11y) actions work', (WidgetTester tester) async { + testWidgets('Middle item accessibility (a11y) actions work', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); expect(listItems, orderedEquals(originalListItems)); @@ -669,7 +668,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Last item accessibility (a11y) actions work', (WidgetTester tester) async { + testWidgets('Last item accessibility (a11y) actions work', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); expect(listItems, orderedEquals(originalListItems)); @@ -690,7 +689,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking("Doesn't hide accessibility when a child declares its own semantics", (WidgetTester tester) async { + testWidgets("Doesn't hide accessibility when a child declares its own semantics", (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final Widget reorderableListView = ReorderableListView( onReorder: (int oldIndex, int newIndex) { }, @@ -759,7 +758,7 @@ void main() { }); group('in horizontal mode', () { - testWidgetsWithLeakTracking('reorder is not triggered when children length is less or equals to 1', (WidgetTester tester) async { + testWidgets('reorder is not triggered when children length is less or equals to 1', (WidgetTester tester) async { bool onReorderWasCalled = false; final List<String> currentListItems = listItems.take(1).toList(); final ReorderableListView reorderableListView = ReorderableListView( @@ -786,7 +785,7 @@ void main() { expect(currentListItems, orderedEquals(<String>['Item 1'])); }); - testWidgetsWithLeakTracking('allows reordering from the very top to the very bottom', (WidgetTester tester) async { + testWidgets('allows reordering from the very top to the very bottom', (WidgetTester tester) async { await tester.pumpWidget(build(scrollDirection: Axis.horizontal)); expect(listItems, orderedEquals(originalListItems)); await longPressDrag( @@ -798,7 +797,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 3', 'Item 4', 'Item 1'])); }); - testWidgetsWithLeakTracking('allows reordering from the very bottom to the very top', (WidgetTester tester) async { + testWidgets('allows reordering from the very bottom to the very top', (WidgetTester tester) async { await tester.pumpWidget(build(scrollDirection: Axis.horizontal)); expect(listItems, orderedEquals(originalListItems)); await longPressDrag( @@ -810,7 +809,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 4', 'Item 1', 'Item 2', 'Item 3'])); }); - testWidgetsWithLeakTracking('allows reordering inside the middle of the widget', (WidgetTester tester) async { + testWidgets('allows reordering inside the middle of the widget', (WidgetTester tester) async { await tester.pumpWidget(build(scrollDirection: Axis.horizontal)); expect(listItems, orderedEquals(originalListItems)); await longPressDrag( @@ -822,7 +821,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 1', 'Item 3', 'Item 2', 'Item 4'])); }); - testWidgetsWithLeakTracking('properly reorders with a header', (WidgetTester tester) async { + testWidgets('properly reorders with a header', (WidgetTester tester) async { await tester.pumpWidget(build(header: const Text('Header Text'), scrollDirection: Axis.horizontal)); expect(find.text('Header Text'), findsOneWidget); expect(listItems, orderedEquals(originalListItems)); @@ -845,7 +844,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 4', 'Item 3', 'Item 1'])); }); - testWidgetsWithLeakTracking('properly reorders with a footer', (WidgetTester tester) async { + testWidgets('properly reorders with a footer', (WidgetTester tester) async { await tester.pumpWidget(build(footer: const Text('Footer Text'), scrollDirection: Axis.horizontal)); expect(find.text('Footer Text'), findsOneWidget); expect(listItems, orderedEquals(originalListItems)); @@ -868,7 +867,7 @@ void main() { expect(listItems, orderedEquals(<String>['Item 2', 'Item 4', 'Item 3', 'Item 1'])); }); - testWidgetsWithLeakTracking('properly determines the horizontal drop area extents', (WidgetTester tester) async { + testWidgets('properly determines the horizontal drop area extents', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( scrollDirection: Axis.horizontal, onReorder: (int oldIndex, int newIndex) { }, @@ -936,7 +935,7 @@ void main() { expect(getListWidth(), kDraggingListWidth); }); - testWidgetsWithLeakTracking('Horizontal drag in progress golden image', (WidgetTester tester) async { + testWidgets('Horizontal drag in progress golden image', (WidgetTester tester) async { debugDisableShadows = false; final Widget reorderableListView = ReorderableListView( scrollDirection: Axis.horizontal, @@ -1005,7 +1004,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('Preserves children states when the list parent changes the order', (WidgetTester tester) async { + testWidgets('Preserves children states when the list parent changes the order', (WidgetTester tester) async { _StatefulState findState(Key key) { return find.byElementPredicate((Element element) => element.findAncestorWidgetOfExactType<_Stateful>()?.key == key) .evaluate() @@ -1047,7 +1046,7 @@ void main() { expect(findState(const Key('A')).checked, true); }); - testWidgetsWithLeakTracking('Preserves children states when rebuilt', (WidgetTester tester) async { + testWidgets('Preserves children states when rebuilt', (WidgetTester tester) async { const Key firstBox = Key('key'); Widget build() { return MaterialApp( @@ -1090,7 +1089,7 @@ void main() { const CustomSemanticsAction moveLeft = CustomSemanticsAction(label: 'Move left'); const CustomSemanticsAction moveRight = CustomSemanticsAction(label: 'Move right'); - testWidgetsWithLeakTracking('Provides the correct accessibility actions in LTR mode', (WidgetTester tester) async { + testWidgets('Provides the correct accessibility actions in LTR mode', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(build(scrollDirection: Axis.horizontal)); @@ -1123,7 +1122,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Provides the correct accessibility actions in Right-To-Left directionality', (WidgetTester tester) async { + testWidgets('Provides the correct accessibility actions in Right-To-Left directionality', (WidgetTester tester) async { // In RTL mode, the right is the start and the left is the end. // The array representation is unchanged (LTR), but the direction of the motion actions is reversed. final SemanticsHandle handle = tester.ensureSemantics(); @@ -1158,7 +1157,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('First item accessibility (a11y) actions work in LTR mode', (WidgetTester tester) async { + testWidgets('First item accessibility (a11y) actions work in LTR mode', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); expect(listItems, orderedEquals(originalListItems)); @@ -1179,7 +1178,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('First item accessibility (a11y) actions work in Right-To-Left directionality', (WidgetTester tester) async { + testWidgets('First item accessibility (a11y) actions work in Right-To-Left directionality', (WidgetTester tester) async { // In RTL mode, the right is the start and the left is the end. // The array representation is unchanged (LTR), but the direction of the motion actions is reversed. final SemanticsHandle handle = tester.ensureSemantics(); @@ -1202,7 +1201,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Middle item accessibility (a11y) actions work in LTR mode', (WidgetTester tester) async { + testWidgets('Middle item accessibility (a11y) actions work in LTR mode', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); expect(listItems, orderedEquals(originalListItems)); @@ -1237,7 +1236,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Middle item accessibility (a11y) actions work in Right-To-Left directionality', (WidgetTester tester) async { + testWidgets('Middle item accessibility (a11y) actions work in Right-To-Left directionality', (WidgetTester tester) async { // In RTL mode, the right is the start and the left is the end. // The array representation is unchanged (LTR), but the direction of the motion actions is reversed. final SemanticsHandle handle = tester.ensureSemantics(); @@ -1274,7 +1273,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Last item accessibility (a11y) actions work in LTR mode', (WidgetTester tester) async { + testWidgets('Last item accessibility (a11y) actions work in LTR mode', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); expect(listItems, orderedEquals(originalListItems)); @@ -1295,7 +1294,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Last item accessibility (a11y) actions work in Right-To-Left directionality', (WidgetTester tester) async { + testWidgets('Last item accessibility (a11y) actions work in Right-To-Left directionality', (WidgetTester tester) async { // In RTL mode, the right is the start and the left is the end. // The array representation is unchanged (LTR), but the direction of the motion actions is reversed. final SemanticsHandle handle = tester.ensureSemantics(); @@ -1322,7 +1321,7 @@ void main() { }); - testWidgetsWithLeakTracking('ReorderableListView.builder asserts on negative childCount', (WidgetTester tester) async { + testWidgets('ReorderableListView.builder asserts on negative childCount', (WidgetTester tester) async { expect(() => ReorderableListView.builder( itemBuilder: (BuildContext context, int index) { return const SizedBox(); @@ -1332,7 +1331,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ReorderableListView.builder only creates the children it needs', (WidgetTester tester) async { + testWidgets('ReorderableListView.builder only creates the children it needs', (WidgetTester tester) async { final Set<int> itemsCreated = <int>{}; await tester.pumpWidget(MaterialApp( home: ReorderableListView.builder( @@ -1350,7 +1349,7 @@ void main() { }); group('Padding', () { - testWidgetsWithLeakTracking('Padding with no header & footer', (WidgetTester tester) async { + testWidgets('Padding with no header & footer', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.fromLTRB(10, 20, 30, 40); // Vertical @@ -1364,7 +1363,7 @@ void main() { expect(tester.getRect(find.byKey(const Key('Item 4'))), const Rect.fromLTRB(154, 20, 202, 560)); }); - testWidgetsWithLeakTracking('Padding with header or footer', (WidgetTester tester) async { + testWidgets('Padding with header or footer', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.fromLTRB(10, 20, 30, 40); const Key headerKey = Key('Header'); const Key footerKey = Key('Footer'); @@ -1423,7 +1422,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ReorderableListView can be reversed', (WidgetTester tester) async { + testWidgets('ReorderableListView can be reversed', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( reverse: true, onReorder: (int oldIndex, int newIndex) { }, @@ -1448,7 +1447,7 @@ void main() { expect(tester.getCenter(find.text('A')).dy, greaterThan(tester.getCenter(find.text('B')).dy)); }); - testWidgetsWithLeakTracking('Animation test when placing an item in place', (WidgetTester tester) async { + testWidgets('Animation test when placing an item in place', (WidgetTester tester) async { const Key testItemKey = Key('Test item'); final Widget reorderableListView = ReorderableListView( onReorder: (int oldIndex, int newIndex) { }, @@ -1500,21 +1499,21 @@ void main() { }); // TODO(djshuckerow): figure out how to write a test for scrolling the list. - testWidgetsWithLeakTracking('ReorderableListView on desktop platforms should have drag handles', (WidgetTester tester) async { + testWidgets('ReorderableListView on desktop platforms should have drag handles', (WidgetTester tester) async { await tester.pumpWidget(build()); // All four items should have drag handles and not delayed listeners. expect(find.byIcon(Icons.drag_handle), findsNWidgets(4)); expect(find.byType(ReorderableDelayedDragStartListener), findsNothing); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('ReorderableListView on mobile platforms should not have drag handles', (WidgetTester tester) async { + testWidgets('ReorderableListView on mobile platforms should not have drag handles', (WidgetTester tester) async { await tester.pumpWidget(build()); // All four items should have delayed listeners and not drag handles. expect(find.byType(ReorderableDelayedDragStartListener), findsNWidgets(4)); expect(find.byIcon(Icons.drag_handle), findsNothing); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('Vertical list renders drag handle in correct position', (WidgetTester tester) async { + testWidgets('Vertical list renders drag handle in correct position', (WidgetTester tester) async { await tester.pumpWidget(build(platform: TargetPlatform.macOS)); final Finder listView = find.byType(ReorderableListView); final Finder item1 = find.byKey(const Key('Item 1')); @@ -1525,7 +1524,7 @@ void main() { expect(tester.getTopRight(dragHandle).dx, tester.getSize(listView).width - 8); }); - testWidgetsWithLeakTracking('Horizontal list renders drag handle in correct position', (WidgetTester tester) async { + testWidgets('Horizontal list renders drag handle in correct position', (WidgetTester tester) async { await tester.pumpWidget(build(scrollDirection: Axis.horizontal, platform: TargetPlatform.macOS)); final Finder listView = find.byType(ReorderableListView); final Finder item1 = find.byKey(const Key('Item 1')); @@ -1537,7 +1536,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ReorderableListView, can deal with the dragged item getting unmounted and rebuilt during drag', (WidgetTester tester) async { + testWidgets('ReorderableListView, can deal with the dragged item getting unmounted and rebuilt during drag', (WidgetTester tester) async { // See https://github.com/flutter/flutter/issues/74840 for more details. final List<int> items = List<int>.generate(100, (int index) => index); @@ -1606,7 +1605,7 @@ void main() { expect(items.take(8), orderedEquals(<int>[0, 1, 2, 3, 4, 5, 6, 7])); }); - testWidgetsWithLeakTracking('ReorderableListView calls onReorderStart and onReorderEnd correctly', (WidgetTester tester) async { + testWidgets('ReorderableListView calls onReorderStart and onReorderEnd correctly', (WidgetTester tester) async { final List<int> items = List<int>.generate(8, (int index) => index); int? startIndex, endIndex; final Finder item0 = find.textContaining('item 0'); @@ -1683,7 +1682,7 @@ void main() { expect(endIndex, equals(0)); }); - testWidgetsWithLeakTracking('ReorderableListView throws an error when key is not passed to its children', (WidgetTester tester) async { + testWidgets('ReorderableListView throws an error when key is not passed to its children', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView.builder( itemBuilder: (BuildContext context, int index) { return SizedBox(child: Text('Item $index')); @@ -1699,7 +1698,7 @@ void main() { expect(exception.toString(), contains('Every item of ReorderableListView must have a key.')); }); - testWidgetsWithLeakTracking('Throws an error if no overlay present', (WidgetTester tester) async { + testWidgets('Throws an error if no overlay present', (WidgetTester tester) async { final Widget reorderableList = ReorderableListView( children: const <Widget>[ SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')), @@ -1731,7 +1730,7 @@ void main() { expect(exception.toString(), contains('ReorderableListView widgets require an Overlay widget ancestor')); }); - testWidgetsWithLeakTracking('ReorderableListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('ReorderableListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { expect(() => ReorderableListView( itemExtent: 30, prototypeItem: const SizedBox(), @@ -1740,7 +1739,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ReorderableListView.builder asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('ReorderableListView.builder asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; expect(() => ReorderableListView.builder( itemBuilder: (BuildContext context, int index) { @@ -1760,7 +1759,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('if itemExtent is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { + testWidgets('if itemExtent is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; await tester.pumpWidget( @@ -1799,7 +1798,7 @@ void main() { expect(item2Height, 30.0); }); - testWidgetsWithLeakTracking('if prototypeItem is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { + testWidgets('if prototypeItem is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; await tester.pumpWidget( @@ -1841,7 +1840,7 @@ void main() { expect(item2Height, 30.0); }); - testWidgetsWithLeakTracking('ReorderableListView auto scrolls speed is configurable', (WidgetTester tester) async { + testWidgets('ReorderableListView auto scrolls speed is configurable', (WidgetTester tester) async { Future<void> pumpFor({ required Duration duration, Duration interval = const Duration(milliseconds: 50), diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 949021da4cb..760dedcf516 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -19,7 +18,7 @@ const Duration _bottomSheetExitDuration = Duration(milliseconds: 200); void main() { // Regression test for https://github.com/flutter/flutter/issues/103741 - testWidgetsWithLeakTracking('extendBodyBehindAppBar change should not cause the body widget lose state', (WidgetTester tester) async { + testWidgets('extendBodyBehindAppBar change should not cause the body widget lose state', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -53,7 +52,7 @@ void main() { expect(controller.position.pixels, 100.0); }); - testWidgetsWithLeakTracking('Scaffold drawer callback test', (WidgetTester tester) async { + testWidgets('Scaffold drawer callback test', (WidgetTester tester) async { bool isDrawerOpen = false; bool isEndDrawerOpen = false; @@ -92,7 +91,7 @@ void main() { expect(isEndDrawerOpen, false); }); - testWidgetsWithLeakTracking('Scaffold drawer callback test - only call when changed', (WidgetTester tester) async { + testWidgets('Scaffold drawer callback test - only call when changed', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/87914 bool onDrawerChangedCalled = false; bool onEndDrawerChangedCalled = false; @@ -126,7 +125,7 @@ void main() { expect(onEndDrawerChangedCalled, false); }); - testWidgetsWithLeakTracking('Scaffold control test', (WidgetTester tester) async { + testWidgets('Scaffold control test', (WidgetTester tester) async { final Key bodyKey = UniqueKey(); Widget boilerplate(Widget child) { return Localizations( @@ -176,7 +175,7 @@ void main() { expect(bodyBox.size, equals(const Size(800.0, 544.0))); }); - testWidgetsWithLeakTracking('Scaffold large bottom padding test', (WidgetTester tester) async { + testWidgets('Scaffold large bottom padding test', (WidgetTester tester) async { final Key bodyKey = UniqueKey(); Widget boilerplate(Widget child) { @@ -233,7 +232,7 @@ void main() { expect(bodyBox.size, equals(const Size(800.0, 0.0))); }); - testWidgetsWithLeakTracking('Floating action entrance/exit animation', (WidgetTester tester) async { + testWidgets('Floating action entrance/exit animation', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: Scaffold( floatingActionButton: FloatingActionButton( key: Key('one'), @@ -271,7 +270,7 @@ void main() { expect(tester.binding.transientCallbackCount, greaterThan(0)); }); - testWidgetsWithLeakTracking('Floating action button shrinks when bottom sheet becomes dominant', (WidgetTester tester) async { + testWidgets('Floating action button shrinks when bottom sheet becomes dominant', (WidgetTester tester) async { final DraggableScrollableController draggableController = DraggableScrollableController(); addTearDown(draggableController.dispose); const double kBottomSheetDominatesPercentage = 0.3; @@ -311,7 +310,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Scaffold shows scrim when bottom sheet becomes dominant', (WidgetTester tester) async { + testWidgets('Scaffold shows scrim when bottom sheet becomes dominant', (WidgetTester tester) async { final DraggableScrollableController draggableController = DraggableScrollableController(); addTearDown(draggableController.dispose); const double kBottomSheetDominatesPercentage = 0.3; @@ -351,7 +350,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Floating action button directionality', (WidgetTester tester) async { + testWidgets('Floating action button directionality', (WidgetTester tester) async { Widget build(TextDirection textDirection) { return Directionality( textDirection: textDirection, @@ -379,7 +378,7 @@ void main() { expect(tester.getCenter(find.byType(FloatingActionButton)), const Offset(44.0, 356.0)); }); - testWidgetsWithLeakTracking('Floating Action Button bottom padding not consumed by viewInsets', (WidgetTester tester) async { + testWidgets('Floating Action Button bottom padding not consumed by viewInsets', (WidgetTester tester) async { final Widget child = Directionality( textDirection: TextDirection.ltr, child: Scaffold( @@ -417,7 +416,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('viewPadding change should trigger _ScaffoldLayout re-layout', (WidgetTester tester) async { + testWidgets('viewPadding change should trigger _ScaffoldLayout re-layout', (WidgetTester tester) async { Widget buildFrame(EdgeInsets viewPadding) { return MediaQuery( data: MediaQueryData( @@ -448,7 +447,7 @@ void main() { expect(renderBox.debugNeedsLayout, true); }); - testWidgetsWithLeakTracking('Drawer scrolling', (WidgetTester tester) async { + testWidgets('Drawer scrolling', (WidgetTester tester) async { final Key drawerKey = UniqueKey(); const double appBarHeight = 256.0; @@ -532,7 +531,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Tapping the status bar scrolls to top', (WidgetTester tester) async { + testWidgets('Tapping the status bar scrolls to top', (WidgetTester tester) async { await tester.pumpWidget(buildStatusBarTestApp(debugDefaultTargetPlatformOverride)); final ScrollableState scrollable = tester.state(find.byType(Scrollable)); scrollable.position.jumpTo(500.0); @@ -542,7 +541,7 @@ void main() { expect(scrollable.position.pixels, equals(0.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Tapping the status bar scrolls to top with ease out curve animation', (WidgetTester tester) async { + testWidgets('Tapping the status bar scrolls to top with ease out curve animation', (WidgetTester tester) async { const int duration = 1000; final List<double> stops = <double>[0.842, 0.959, 0.993, 1.0]; const double scrollOffset = 1000; @@ -571,7 +570,7 @@ void main() { expect(scrollable.position.pixels, equals(0.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Tapping the status bar does not scroll to top', (WidgetTester tester) async { + testWidgets('Tapping the status bar does not scroll to top', (WidgetTester tester) async { await tester.pumpWidget(buildStatusBarTestApp(TargetPlatform.android)); final ScrollableState scrollable = tester.state(find.byType(Scrollable)); scrollable.position.jumpTo(500.0); @@ -582,7 +581,7 @@ void main() { expect(scrollable.position.pixels, equals(500.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); - testWidgetsWithLeakTracking('Bottom sheet cannot overlap app bar', (WidgetTester tester) async { + testWidgets('Bottom sheet cannot overlap app bar', (WidgetTester tester) async { final Key sheetKey = UniqueKey(); await tester.pumpWidget( @@ -623,7 +622,7 @@ void main() { expect(appBarBottomRight, equals(sheetTopRight)); }); - testWidgetsWithLeakTracking('BottomSheet bottom padding is not consumed by viewInsets', (WidgetTester tester) async { + testWidgets('BottomSheet bottom padding is not consumed by viewInsets', (WidgetTester tester) async { final Widget child = Directionality( textDirection: TextDirection.ltr, child: Scaffold( @@ -656,7 +655,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('Persistent bottom buttons are persistent', (WidgetTester tester) async { + testWidgets('Persistent bottom buttons are persistent', (WidgetTester tester) async { bool didPressButton = false; await tester.pumpWidget( MaterialApp( @@ -686,7 +685,7 @@ void main() { expect(didPressButton, isTrue); }); - testWidgetsWithLeakTracking('Persistent bottom buttons alignment', (WidgetTester tester) async { + testWidgets('Persistent bottom buttons alignment', (WidgetTester tester) async { Widget buildApp(AlignmentDirectional persistentAlignment) { return MaterialApp( home: Scaffold( @@ -721,7 +720,7 @@ void main() { expect(tester.getTopLeft(footerButton).dx, 8.0); }); - testWidgetsWithLeakTracking('Persistent bottom buttons apply media padding', (WidgetTester tester) async { + testWidgets('Persistent bottom buttons apply media padding', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -748,7 +747,7 @@ void main() { expect(tester.getBottomRight(buttonsBar), const Offset(770.0, 560.0)); }); - testWidgetsWithLeakTracking('persistentFooterButtons with bottomNavigationBar apply SafeArea properly', (WidgetTester tester) async { + testWidgets('persistentFooterButtons with bottomNavigationBar apply SafeArea properly', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/92039 await tester.pumpWidget( MaterialApp( @@ -798,7 +797,7 @@ void main() { expect(tester.getTopLeft(buttonsBar), const Offset(0.0, 488.0)); }); - testWidgetsWithLeakTracking('Persistent bottom buttons bottom padding is not consumed by viewInsets', (WidgetTester tester) async { + testWidgets('Persistent bottom buttons bottom padding is not consumed by viewInsets', (WidgetTester tester) async { final Widget child = Directionality( textDirection: TextDirection.ltr, child: Scaffold( @@ -851,11 +850,11 @@ void main() { expect(icon.icon, expectedIcon); } - testWidgetsWithLeakTracking('Back arrow uses correct default', (WidgetTester tester) async { + testWidgets('Back arrow uses correct default', (WidgetTester tester) async { await expectBackIcon(tester, Icons.arrow_back); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('Back arrow uses correct default', (WidgetTester tester) async { + testWidgets('Back arrow uses correct default', (WidgetTester tester) async { await expectBackIcon(tester, kIsWeb ? Icons.arrow_back : Icons.arrow_back_ios_new_rounded); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); }); @@ -906,21 +905,21 @@ void main() { ); } - testWidgetsWithLeakTracking('Close button shows correctly', (WidgetTester tester) async { + testWidgets('Close button shows correctly', (WidgetTester tester) async { await expectCloseIcon(tester, materialRouteBuilder, 'materialRouteBuilder'); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Close button shows correctly with PageRouteBuilder', (WidgetTester tester) async { + testWidgets('Close button shows correctly with PageRouteBuilder', (WidgetTester tester) async { await expectCloseIcon(tester, pageRouteBuilder, 'pageRouteBuilder'); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Close button shows correctly with custom page route', (WidgetTester tester) async { + testWidgets('Close button shows correctly with custom page route', (WidgetTester tester) async { await expectCloseIcon(tester, customPageRouteBuilder, 'customPageRouteBuilder'); }, variant: TargetPlatformVariant.all()); }); group('body size', () { - testWidgetsWithLeakTracking('body size with container', (WidgetTester tester) async { + testWidgets('body size with container', (WidgetTester tester) async { final Key testKey = UniqueKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -937,7 +936,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(testKey)).localToGlobal(Offset.zero), Offset.zero); }); - testWidgetsWithLeakTracking('body size with sized container', (WidgetTester tester) async { + testWidgets('body size with sized container', (WidgetTester tester) async { final Key testKey = UniqueKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -955,7 +954,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(testKey)).localToGlobal(Offset.zero), Offset.zero); }); - testWidgetsWithLeakTracking('body size with centered container', (WidgetTester tester) async { + testWidgets('body size with centered container', (WidgetTester tester) async { final Key testKey = UniqueKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -974,7 +973,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(testKey)).localToGlobal(Offset.zero), Offset.zero); }); - testWidgetsWithLeakTracking('body size with button', (WidgetTester tester) async { + testWidgets('body size with button', (WidgetTester tester) async { final Key testKey = UniqueKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -993,7 +992,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byKey(testKey)).localToGlobal(Offset.zero), Offset.zero); }); - testWidgetsWithLeakTracking('body size with extendBody', (WidgetTester tester) async { + testWidgets('body size with extendBody', (WidgetTester tester) async { final Key bodyKey = UniqueKey(); late double mediaQueryBottom; @@ -1050,7 +1049,7 @@ void main() { expect(mediaQueryBottom, 0.0); }); - testWidgetsWithLeakTracking('body size with extendBodyBehindAppBar', (WidgetTester tester) async { + testWidgets('body size with extendBodyBehindAppBar', (WidgetTester tester) async { final Key appBarKey = UniqueKey(); final Key bodyKey = UniqueKey(); @@ -1147,7 +1146,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Open drawer hides underlying semantics tree', (WidgetTester tester) async { + testWidgets('Open drawer hides underlying semantics tree', (WidgetTester tester) async { const String bodyLabel = 'I am the body'; const String persistentFooterButtonLabel = 'a button on the bottom'; const String bottomNavigationBarLabel = 'a bar in an app'; @@ -1183,7 +1182,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Scaffold and extreme window padding', (WidgetTester tester) async { + testWidgets('Scaffold and extreme window padding', (WidgetTester tester) async { final Key appBar = UniqueKey(); final Key body = UniqueKey(); final Key floatingActionButton = UniqueKey(); @@ -1288,7 +1287,7 @@ void main() { expect(tester.getRect(find.byKey(insideBottomNavigationBar)), const Rect.fromLTRB(20.0, 515.0, 750.0, 540.0)); }); - testWidgetsWithLeakTracking('Scaffold and extreme window padding - persistent footer buttons only', (WidgetTester tester) async { + testWidgets('Scaffold and extreme window padding - persistent footer buttons only', (WidgetTester tester) async { final Key appBar = UniqueKey(); final Key body = UniqueKey(); final Key floatingActionButton = UniqueKey(); @@ -1383,7 +1382,7 @@ void main() { group('ScaffoldGeometry', () { - testWidgetsWithLeakTracking('bottomNavigationBar', (WidgetTester tester) async { + testWidgets('bottomNavigationBar', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(MaterialApp(home: Scaffold( body: Container(), @@ -1405,7 +1404,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('no bottomNavigationBar', (WidgetTester tester) async { + testWidgets('no bottomNavigationBar', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(home: Scaffold( body: ConstrainedBox( constraints: const BoxConstraints.expand(height: 80.0), @@ -1422,7 +1421,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scaffold BottomNavigationBar bottom padding is not consumed by viewInsets.', (WidgetTester tester) async { + testWidgets('Scaffold BottomNavigationBar bottom padding is not consumed by viewInsets.', (WidgetTester tester) async { Widget boilerplate(Widget child) { return Localizations( locale: const Locale('en', 'us'), @@ -1485,7 +1484,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('floatingActionButton', (WidgetTester tester) async { + testWidgets('floatingActionButton', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(MaterialApp(home: Scaffold( body: Container(), @@ -1508,7 +1507,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('no floatingActionButton', (WidgetTester tester) async { + testWidgets('no floatingActionButton', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(home: Scaffold( body: ConstrainedBox( constraints: const BoxConstraints.expand(height: 80.0), @@ -1525,7 +1524,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('floatingActionButton entrance/exit animation', (WidgetTester tester) async { + testWidgets('floatingActionButton entrance/exit animation', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(MaterialApp(home: Scaffold( body: ConstrainedBox( @@ -1587,7 +1586,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('change notifications', (WidgetTester tester) async { + testWidgets('change notifications', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); int numNotificationsAtLastFrame = 0; await tester.pumpWidget(MaterialApp(home: Scaffold( @@ -1625,7 +1624,7 @@ void main() { numNotificationsAtLastFrame = listenerState.numNotifications; }); - testWidgetsWithLeakTracking('Simultaneous drawers on either side', (WidgetTester tester) async { + testWidgets('Simultaneous drawers on either side', (WidgetTester tester) async { const String bodyLabel = 'I am the body'; const String drawerLabel = 'I am the label on start side'; const String endDrawerLabel = 'I am the label on end side'; @@ -1659,7 +1658,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Drawer state query correctly', (WidgetTester tester) async { + testWidgets('Drawer state query correctly', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: SafeArea( @@ -1715,7 +1714,7 @@ void main() { expect(scaffoldState.isDrawerOpen, true); }); - testWidgetsWithLeakTracking('Dual Drawer Opening', (WidgetTester tester) async { + testWidgets('Dual Drawer Opening', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: SafeArea( @@ -1767,7 +1766,7 @@ void main() { expect(find.text('drawer'), findsOneWidget); }); - testWidgetsWithLeakTracking('Drawer opens correctly with padding from MediaQuery (LTR)', (WidgetTester tester) async { + testWidgets('Drawer opens correctly with padding from MediaQuery (LTR)', (WidgetTester tester) async { const double simulatedNotchSize = 40.0; await tester.pumpWidget( MaterialApp( @@ -1821,7 +1820,7 @@ void main() { expect(scaffoldState.isDrawerOpen, true); }); - testWidgetsWithLeakTracking('Drawer opens correctly with padding from MediaQuery (RTL)', (WidgetTester tester) async { + testWidgets('Drawer opens correctly with padding from MediaQuery (RTL)', (WidgetTester tester) async { const double simulatedNotchSize = 40.0; await tester.pumpWidget( MaterialApp( @@ -1885,7 +1884,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Drawer opens correctly with custom edgeDragWidth', (WidgetTester tester) async { + testWidgets('Drawer opens correctly with custom edgeDragWidth', (WidgetTester tester) async { // The default edge drag width is 20.0. await tester.pumpWidget( MaterialApp( @@ -1931,7 +1930,7 @@ void main() { expect(scaffoldState.isDrawerOpen, true); }); - testWidgetsWithLeakTracking('Drawer does not open with a drag gesture when it is disabled on mobile', (WidgetTester tester) async { + testWidgets('Drawer does not open with a drag gesture when it is disabled on mobile', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1995,7 +1994,7 @@ void main() { expect(scaffoldState.isDrawerOpen, false); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('Drawer does not open with a drag gesture on desktop', (WidgetTester tester) async { + testWidgets('Drawer does not open with a drag gesture on desktop', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -2035,7 +2034,7 @@ void main() { expect(scaffoldState.isDrawerOpen, false); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('End drawer does not open with a drag gesture when it is disabled', (WidgetTester tester) async { + testWidgets('End drawer does not open with a drag gesture when it is disabled', (WidgetTester tester) async { late double screenWidth; await tester.pumpWidget( MaterialApp( @@ -2105,7 +2104,7 @@ void main() { expect(scaffoldState.isEndDrawerOpen, false); }); - testWidgetsWithLeakTracking('Nested scaffold body insets', (WidgetTester tester) async { + testWidgets('Nested scaffold body insets', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/20295 final Key bodyKey = UniqueKey(); @@ -2157,7 +2156,7 @@ void main() { }); group('FlutterError control test', () { - testWidgetsWithLeakTracking('showBottomSheet() while Scaffold has bottom sheet', + testWidgets('showBottomSheet() while Scaffold has bottom sheet', (WidgetTester tester) async { final GlobalKey<ScaffoldState> key = GlobalKey<ScaffoldState>(); await tester.pumpWidget( @@ -2206,7 +2205,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'didUpdate bottomSheet while a previous bottom sheet is still displayed', (WidgetTester tester) async { final GlobalKey<ScaffoldState> key = GlobalKey<ScaffoldState>(); @@ -2261,7 +2260,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Call to Scaffold.of() without context', (WidgetTester tester) async { + testWidgets('Call to Scaffold.of() without context', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Builder( @@ -2334,7 +2333,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Call to Scaffold.geometryOf() without context', (WidgetTester tester) async { + testWidgets('Call to Scaffold.geometryOf() without context', (WidgetTester tester) async { ValueListenable<ScaffoldGeometry>? geometry; await tester.pumpWidget( MaterialApp( @@ -2400,7 +2399,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('FloatingActionButton always keeps the same position regardless of extendBodyBehindAppBar', (WidgetTester tester) async { + testWidgets('FloatingActionButton always keeps the same position regardless of extendBodyBehindAppBar', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( appBar: AppBar(), @@ -2430,7 +2429,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ScaffoldMessenger.maybeOf can return null if not found', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger.maybeOf can return null if not found', (WidgetTester tester) async { ScaffoldMessengerState? scaffoldMessenger; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(Directionality( @@ -2461,7 +2460,7 @@ void main() { expect(scaffoldMessenger, isNull); }); - testWidgetsWithLeakTracking('ScaffoldMessenger.of will assert if not found', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger.of will assert if not found', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); final List<dynamic> exceptions = <dynamic>[]; @@ -2524,7 +2523,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('ScaffoldMessenger checks for nesting when a new Scaffold is registered', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger checks for nesting when a new Scaffold is registered', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/77251 const String snackBarContent = 'SnackBar Content'; await tester.pumpWidget(MaterialApp( @@ -2595,7 +2594,7 @@ void main() { expect(find.text(snackBarContent), findsNothing); }); - testWidgetsWithLeakTracking('Drawer can be dismissed with escape keyboard shortcut', (WidgetTester tester) async { + testWidgets('Drawer can be dismissed with escape keyboard shortcut', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/106131 bool isDrawerOpen = false; bool isEndDrawerOpen = false; @@ -2643,7 +2642,7 @@ void main() { expect(isEndDrawerOpen, false); }); - testWidgetsWithLeakTracking('ScaffoldMessenger showSnackBar throws an intuitive error message if called during build', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger showSnackBar throws an intuitive error message if called during build', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold( body: Builder( @@ -2660,7 +2659,7 @@ void main() { expect(summary.toString(), 'The showSnackBar() method cannot be called during build.'); }); - testWidgetsWithLeakTracking('Persistent BottomSheet is not dismissible via a11y means', (WidgetTester tester) async { + testWidgets('Persistent BottomSheet is not dismissible via a11y means', (WidgetTester tester) async { final Key bottomSheetKey = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -2683,7 +2682,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/117004 - testWidgetsWithLeakTracking('can rebuild and remove bottomSheet at the same time', (WidgetTester tester) async { + testWidgets('can rebuild and remove bottomSheet at the same time', (WidgetTester tester) async { bool themeIsLight = true; bool? defaultBottomSheet = true; final GlobalKey bottomSheetKey1 = GlobalKey(); @@ -2762,7 +2761,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('showBottomSheet removes scrim when draggable sheet is dismissed', (WidgetTester tester) async { + testWidgets('showBottomSheet removes scrim when draggable sheet is dismissed', (WidgetTester tester) async { final DraggableScrollableController draggableController = DraggableScrollableController(); addTearDown(draggableController.dispose); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey(); @@ -2809,7 +2808,7 @@ void main() { expect(findModalBarrier(), findsNothing); }); - testWidgetsWithLeakTracking("Closing bottom sheet & removing FAB at the same time doesn't throw assertion", (WidgetTester tester) async { + testWidgets("Closing bottom sheet & removing FAB at the same time doesn't throw assertion", (WidgetTester tester) async { final Key bottomSheetKey = UniqueKey(); PersistentBottomSheetController? controller; bool show = true; diff --git a/packages/flutter/test/material/scrollbar_paint_test.dart b/packages/flutter/test/material/scrollbar_paint_test.dart index 09be56932fa..85bf5491012 100644 --- a/packages/flutter/test/material/scrollbar_paint_test.dart +++ b/packages/flutter/test/material/scrollbar_paint_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Color _kAndroidThumbIdleColor = Color(0xffbcbcbc); @@ -25,7 +24,7 @@ Widget _buildSingleChildScrollViewWithScrollbar({ } void main() { - testWidgetsWithLeakTracking('Viewport basic test (LTR)', (WidgetTester tester) async { + testWidgets('Viewport basic test (LTR)', (WidgetTester tester) async { await tester.pumpWidget(_buildSingleChildScrollViewWithScrollbar( child: const SizedBox(width: 4000.0, height: 4000.0), )); @@ -51,7 +50,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Viewport basic test (RTL)', (WidgetTester tester) async { + testWidgets('Viewport basic test (RTL)', (WidgetTester tester) async { await tester.pumpWidget(_buildSingleChildScrollViewWithScrollbar( textDirection: TextDirection.rtl, child: const SizedBox(width: 4000.0, height: 4000.0), @@ -78,7 +77,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('works with MaterialApp and Scaffold', (WidgetTester tester) async { + testWidgets('works with MaterialApp and Scaffold', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: MediaQuery( data: const MediaQueryData( @@ -122,7 +121,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("should not paint when there isn't enough space", (WidgetTester tester) async { + testWidgets("should not paint when there isn't enough space", (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: MediaQuery( data: const MediaQueryData( diff --git a/packages/flutter/test/material/scrollbar_test.dart b/packages/flutter/test/material/scrollbar_test.dart index 25e2fdf4e00..a3c1884c69a 100644 --- a/packages/flutter/test/material/scrollbar_test.dart +++ b/packages/flutter/test/material/scrollbar_test.dart @@ -16,7 +16,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Duration _kScrollbarFadeDuration = Duration(milliseconds: 300); const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600); @@ -71,7 +70,7 @@ class NoScrollbarBehavior extends MaterialScrollBehavior { } void main() { - testWidgetsWithLeakTracking("Scrollbar doesn't show when tapping list", (WidgetTester tester) async { + testWidgets("Scrollbar doesn't show when tapping list", (WidgetTester tester) async { await tester.pumpWidget( _buildBoilerplate( child: Center( @@ -115,7 +114,7 @@ void main() { await tester.pump(const Duration(milliseconds: 200)); }); - testWidgetsWithLeakTracking('ScrollbarPainter does not divide by zero', (WidgetTester tester) async { + testWidgets('ScrollbarPainter does not divide by zero', (WidgetTester tester) async { await tester.pumpWidget( _buildBoilerplate(child: SizedBox( height: 200.0, @@ -157,7 +156,7 @@ void main() { expect(canvas.invocations.isEmpty, isTrue); }); - testWidgetsWithLeakTracking('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { + testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { Widget viewWithScroll() { return _buildBoilerplate( child: Theme( @@ -180,7 +179,7 @@ void main() { expect(exception, isAssertionError); }); - testWidgetsWithLeakTracking('When thumbVisibility is true, must pass a controller that is attached to a scroll view or find PrimaryScrollController', (WidgetTester tester) async { + testWidgets('When thumbVisibility is true, must pass a controller that is attached to a scroll view or find PrimaryScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll() { return _buildBoilerplate( @@ -207,7 +206,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll() { return _buildBoilerplate( @@ -235,7 +234,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll() { return _buildBoilerplate( @@ -269,7 +268,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { Widget viewWithScroll() { @@ -295,7 +294,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'When thumbVisibility is true, must pass a controller that is attached to a scroll view or find PrimaryScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController(); @@ -325,7 +324,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll() { return _buildBoilerplate( @@ -353,7 +352,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll() { return _buildBoilerplate( @@ -387,7 +386,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('On first render with thumbVisibility: false, the thumb is hidden', (WidgetTester tester) async { + testWidgets('On first render with thumbVisibility: false, the thumb is hidden', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll() { return _buildBoilerplate( @@ -415,7 +414,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'With thumbVisibility: true, fling a scroll. While it is still scrolling, set thumbVisibility: false. The thumb should not fade out until the scrolling stops.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); @@ -471,7 +470,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'With thumbVisibility: false, set thumbVisibility: true. The thumb should be always shown directly', (WidgetTester tester) async { final ScrollController controller = ScrollController(); @@ -522,7 +521,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'With thumbVisibility: false, fling a scroll. While it is still scrolling, set thumbVisibility: true. The thumb should not fade even after the scrolling stops', (WidgetTester tester) async { final ScrollController controller = ScrollController(); @@ -584,7 +583,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Toggling thumbVisibility while not scrolling fades the thumb in/out. This works even when you have never scrolled at all yet', (WidgetTester tester) async { final ScrollController controller = ScrollController(); @@ -635,7 +634,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Scrollbar respects thickness and radius', (WidgetTester tester) async { + testWidgets('Scrollbar respects thickness and radius', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll({Radius? radius}) { return _buildBoilerplate( @@ -699,7 +698,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('Tapping the track area pages the Scroll View', (WidgetTester tester) async { + testWidgets('Tapping the track area pages the Scroll View', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); await tester.pumpWidget( Directionality( @@ -791,7 +790,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Scrollbar never goes away until finger lift', (WidgetTester tester) async { + testWidgets('Scrollbar never goes away until finger lift', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scrollbar( @@ -872,7 +871,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); await tester.pumpWidget( MaterialApp( @@ -966,7 +965,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Scrollbar thumb color completes a hover animation', (WidgetTester tester) async { + testWidgets('Scrollbar thumb color completes a hover animation', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1014,7 +1013,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Hover animation is not triggered by tap gestures', (WidgetTester tester) async { + testWidgets('Hover animation is not triggered by tap gestures', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1089,7 +1088,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking('ScrollbarThemeData.thickness replaces hoverThickness', (WidgetTester tester) async { + testWidgets('ScrollbarThemeData.thickness replaces hoverThickness', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1161,7 +1160,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('ScrollbarThemeData.trackVisibility replaces showTrackOnHover', (WidgetTester tester) async { + testWidgets('ScrollbarThemeData.trackVisibility replaces showTrackOnHover', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1229,7 +1228,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Scrollbar showTrackOnHover', (WidgetTester tester) async { + testWidgets('Scrollbar showTrackOnHover', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1292,7 +1291,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Adaptive scrollbar', (WidgetTester tester) async { + testWidgets('Adaptive scrollbar', (WidgetTester tester) async { Widget viewWithScroll(TargetPlatform platform) { return _buildBoilerplate( child: Theme( @@ -1329,7 +1328,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Scrollbar passes controller to CupertinoScrollbar', (WidgetTester tester) async { + testWidgets('Scrollbar passes controller to CupertinoScrollbar', (WidgetTester tester) async { final ScrollController controller = ScrollController(); Widget viewWithScroll(TargetPlatform? platform) { return _buildBoilerplate( @@ -1363,7 +1362,7 @@ void main() { controller.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking("Scrollbar doesn't show when scroll the inner scrollable widget", (WidgetTester tester) async { + testWidgets("Scrollbar doesn't show when scroll the inner scrollable widget", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); final GlobalKey outerKey = GlobalKey(); @@ -1426,7 +1425,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Scrollbar dragging can be disabled', (WidgetTester tester) async { + testWidgets('Scrollbar dragging can be disabled', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); await tester.pumpWidget( MaterialApp( @@ -1497,7 +1496,7 @@ void main() { scrollController.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('Scrollbar dragging is disabled by default on Android', (WidgetTester tester) async { + testWidgets('Scrollbar dragging is disabled by default on Android', (WidgetTester tester) async { int tapCount = 0; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -1593,7 +1592,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Simultaneous dragging and pointer scrolling does not cause a crash', (WidgetTester tester) async { + testWidgets('Simultaneous dragging and pointer scrolling does not cause a crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/70105 final ScrollController scrollController = ScrollController(); await tester.pumpWidget( @@ -1767,7 +1766,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Scrollbar.thumbVisibility triggers assertion when multiple ScrollPositions are attached.', (WidgetTester tester) async { + testWidgets('Scrollbar.thumbVisibility triggers assertion when multiple ScrollPositions are attached.', (WidgetTester tester) async { Widget getTabContent({ ScrollController? scrollController }) { return Scrollbar( thumbVisibility: true, @@ -1836,7 +1835,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('Scrollbar scrollOrientation works correctly', (WidgetTester tester) async { + testWidgets('Scrollbar scrollOrientation works correctly', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); Widget buildScrollWithOrientation(ScrollbarOrientation orientation) { diff --git a/packages/flutter/test/material/scrollbar_theme_test.dart b/packages/flutter/test/material/scrollbar_theme_test.dart index c1e616629c1..635fa6fb2f5 100644 --- a/packages/flutter/test/material/scrollbar_theme_test.dart +++ b/packages/flutter/test/material/scrollbar_theme_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // The const represents the starting position of the scrollbar thumb for // the below tests. The thumb is 90 pixels long, and 8 pixels wide, with a 2 @@ -30,7 +29,7 @@ void main() { expect(identical(ScrollbarThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Passing no ScrollbarTheme returns defaults', (WidgetTester tester) async { + testWidgets('Passing no ScrollbarTheme returns defaults', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); await tester.pumpWidget( MaterialApp( @@ -123,7 +122,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Scrollbar uses values from ScrollbarTheme', (WidgetTester tester) async { + testWidgets('Scrollbar uses values from ScrollbarTheme', (WidgetTester tester) async { final ScrollbarThemeData scrollbarTheme = _scrollbarTheme(); final ScrollController scrollController = ScrollController(); await tester.pumpWidget(MaterialApp( @@ -216,7 +215,7 @@ void main() { }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Scrollbar uses values from ScrollbarTheme if exists instead of values from Theme', (WidgetTester tester) async { final ScrollbarThemeData scrollbarTheme = _scrollbarTheme(); @@ -262,7 +261,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('ScrollbarTheme can disable gestures', (WidgetTester tester) async { + testWidgets('ScrollbarTheme can disable gestures', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false, scrollbarTheme: const ScrollbarThemeData(interactive: false)), @@ -311,7 +310,7 @@ void main() { scrollController.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('Scrollbar.interactive takes priority over ScrollbarTheme', (WidgetTester tester) async { + testWidgets('Scrollbar.interactive takes priority over ScrollbarTheme', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false, scrollbarTheme: const ScrollbarThemeData(interactive: false)), @@ -361,7 +360,7 @@ void main() { scrollController.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('Scrollbar widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('Scrollbar widget properties take priority over theme', (WidgetTester tester) async { const double thickness = 4.0; const bool showTrackOnHover = true; const Radius radius = Radius.circular(3.0); @@ -462,7 +461,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('ThemeData colorScheme is used when no ScrollbarTheme is set', (WidgetTester tester) async { + testWidgets('ThemeData colorScheme is used when no ScrollbarTheme is set', (WidgetTester tester) async { (ScrollController, Widget) buildFrame(ThemeData appTheme) { final ScrollController scrollController = ScrollController(); return ( @@ -638,7 +637,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('ScrollbarThemeData.trackVisibility test', (WidgetTester tester) async { + testWidgets('ScrollbarThemeData.trackVisibility test', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); bool? getTrackVisibility(Set<MaterialState> states) { return true; @@ -686,7 +685,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Default ScrollbarTheme debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ScrollbarTheme debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ScrollbarThemeData().debugFillProperties(builder); @@ -698,7 +697,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ScrollbarTheme implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ScrollbarTheme implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); ScrollbarThemeData( thickness: MaterialStateProperty.resolveWith(_getThickness), diff --git a/packages/flutter/test/material/search_anchor_test.dart b/packages/flutter/test/material/search_anchor_test.dart index cc9c55f4582..c9ab1164835 100644 --- a/packages/flutter/test/material/search_anchor_test.dart +++ b/packages/flutter/test/material/search_anchor_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Returns the RenderEditable at the given index, or the first if not given. @@ -51,7 +50,7 @@ void main() { return endpoints[0].point + const Offset(kIsWeb? 1.0 : 0.0, -2.0); } - testWidgetsWithLeakTracking('SearchBar defaults', (WidgetTester tester) async { + testWidgets('SearchBar defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colorScheme = theme.colorScheme; @@ -75,7 +74,7 @@ void main() { checkSearchBarDefaults(tester, colorScheme, material); }); - testWidgetsWithLeakTracking('SearchBar respects controller property', (WidgetTester tester) async { + testWidgets('SearchBar respects controller property', (WidgetTester tester) async { const String defaultText = 'default text'; final TextEditingController controller = TextEditingController(text: defaultText); addTearDown(controller.dispose); @@ -100,7 +99,7 @@ void main() { expect(find.text(updatedText), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchBar respects focusNode property', (WidgetTester tester) async { + testWidgets('SearchBar respects focusNode property', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); @@ -125,7 +124,7 @@ void main() { expect(node.hasFocus, false); }); - testWidgetsWithLeakTracking('SearchBar focusNode is hot swappable', (WidgetTester tester) async { + testWidgets('SearchBar focusNode is hot swappable', (WidgetTester tester) async { final FocusNode node1 = FocusNode(); addTearDown(node1.dispose); @@ -192,7 +191,7 @@ void main() { expect(node2.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('SearchBar has correct default layout and padding LTR', (WidgetTester tester) async { + testWidgets('SearchBar has correct default layout and padding LTR', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -229,7 +228,7 @@ void main() { expect(trailingIcon.right, equals(barRect.right - 8.0)); }); - testWidgetsWithLeakTracking('SearchBar has correct default layout and padding - RTL', (WidgetTester tester) async { + testWidgets('SearchBar has correct default layout and padding - RTL', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -269,7 +268,7 @@ void main() { expect(trailingIcon.left, equals(barRect.left + 8.0)); }); - testWidgetsWithLeakTracking('SearchBar respects hintText property', (WidgetTester tester) async { + testWidgets('SearchBar respects hintText property', (WidgetTester tester) async { const String hintText = 'hint text'; await tester.pumpWidget( const MaterialApp( @@ -284,7 +283,7 @@ void main() { expect(find.text(hintText), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchBar respects leading property', (WidgetTester tester) async { + testWidgets('SearchBar respects leading property', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colorScheme = theme.colorScheme; await tester.pumpWidget( @@ -305,7 +304,7 @@ void main() { expect(iconColor, colorScheme.onSurface); // Default icon color. }); - testWidgetsWithLeakTracking('SearchBar respects trailing property', (WidgetTester tester) async { + testWidgets('SearchBar respects trailing property', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final ColorScheme colorScheme = theme.colorScheme; await tester.pumpWidget( @@ -328,7 +327,7 @@ void main() { expect(iconColor, colorScheme.onSurfaceVariant); // Default icon color. }); - testWidgetsWithLeakTracking('SearchBar respects onTap property', (WidgetTester tester) async { + testWidgets('SearchBar respects onTap property', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( MaterialApp( @@ -354,7 +353,7 @@ void main() { expect(tapCount, 2); }); - testWidgetsWithLeakTracking('SearchBar respects onChanged property', (WidgetTester tester) async { + testWidgets('SearchBar respects onChanged property', (WidgetTester tester) async { int changeCount = 0; await tester.pumpWidget( MaterialApp( @@ -381,7 +380,7 @@ void main() { expect(changeCount, 2); }); - testWidgetsWithLeakTracking('SearchBar respects onSubmitted property', (WidgetTester tester) async { + testWidgets('SearchBar respects onSubmitted property', (WidgetTester tester) async { String submittedQuery = ''; await tester.pumpWidget( MaterialApp( @@ -401,7 +400,7 @@ void main() { expect(submittedQuery, equals('query')); }); - testWidgetsWithLeakTracking('SearchBar respects constraints property', (WidgetTester tester) async { + testWidgets('SearchBar respects constraints property', (WidgetTester tester) async { const BoxConstraints constraints = BoxConstraints(maxWidth: 350.0, minHeight: 80); await tester.pumpWidget( const MaterialApp( @@ -419,7 +418,7 @@ void main() { expect(barRect.size, const Size(350.0, 80.0)); }); - testWidgetsWithLeakTracking('SearchBar respects elevation property', (WidgetTester tester) async { + testWidgets('SearchBar respects elevation property', (WidgetTester tester) async { const double pressedElevation = 0.0; const double hoveredElevation = 1.0; const double focusedElevation = 2.0; @@ -477,7 +476,7 @@ void main() { expect(material.elevation, focusedElevation); }); - testWidgetsWithLeakTracking('SearchBar respects backgroundColor property', (WidgetTester tester) async { + testWidgets('SearchBar respects backgroundColor property', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -519,7 +518,7 @@ void main() { expect(material.color, focusedColor); }); - testWidgetsWithLeakTracking('SearchBar respects shadowColor property', (WidgetTester tester) async { + testWidgets('SearchBar respects shadowColor property', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -561,7 +560,7 @@ void main() { expect(material.shadowColor, focusedColor); }); - testWidgetsWithLeakTracking('SearchBar respects surfaceTintColor property', (WidgetTester tester) async { + testWidgets('SearchBar respects surfaceTintColor property', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -603,7 +602,7 @@ void main() { expect(material.surfaceTintColor, focusedColor); }); - testWidgetsWithLeakTracking('SearchBar respects overlayColor property', (WidgetTester tester) async { + testWidgets('SearchBar respects overlayColor property', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -645,7 +644,7 @@ void main() { expect(inkFeatures, paints..rect()..rect(color: focusedColor.withOpacity(1.0))); }); - testWidgetsWithLeakTracking('SearchBar respects side and shape properties', (WidgetTester tester) async { + testWidgets('SearchBar respects side and shape properties', (WidgetTester tester) async { const BorderSide pressedSide = BorderSide(width: 2.0); const BorderSide hoveredSide = BorderSide(width: 3.0); const BorderSide focusedSide = BorderSide(width: 4.0); @@ -721,7 +720,7 @@ void main() { expect(material.shape, focusedShape.copyWith(side: focusedSide)); }); - testWidgetsWithLeakTracking('SearchBar respects padding property', (WidgetTester tester) async { + testWidgets('SearchBar respects padding property', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( @@ -749,7 +748,7 @@ void main() { expect(trailingRect.right, barRect.right - 16.0); }); - testWidgetsWithLeakTracking('SearchBar respects hintStyle property', (WidgetTester tester) async { + testWidgets('SearchBar respects hintStyle property', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -785,7 +784,7 @@ void main() { expect(helperText.style?.color, focusedColor); }); - testWidgetsWithLeakTracking('SearchBar respects textStyle property', (WidgetTester tester) async { + testWidgets('SearchBar respects textStyle property', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'input text'); addTearDown(controller.dispose); @@ -824,7 +823,7 @@ void main() { expect(inputText.style.color, focusedColor); }); - testWidgetsWithLeakTracking('SearchBar respects textCapitalization property', (WidgetTester tester) async { + testWidgets('SearchBar respects textCapitalization property', (WidgetTester tester) async { Widget buildSearchBar(TextCapitalization textCapitalization) { return MaterialApp( home: Center( @@ -857,7 +856,7 @@ void main() { expect(textField.textCapitalization, TextCapitalization.none); }); - testWidgetsWithLeakTracking('SearchAnchor respects textCapitalization property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects textCapitalization property', (WidgetTester tester) async { Widget buildSearchAnchor(TextCapitalization textCapitalization) { return MaterialApp( home: Center( @@ -897,7 +896,7 @@ void main() { expect(textField.textCapitalization, TextCapitalization.none); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewOnChanged and viewOnSubmitted properties', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewOnChanged and viewOnSubmitted properties', (WidgetTester tester) async { final SearchController controller = SearchController(); addTearDown(controller.dispose); int onChangedCalled = 0; @@ -956,7 +955,7 @@ void main() { expect(controller.isOpen, false); }); - testWidgetsWithLeakTracking('SearchAnchor.bar respects textCapitalization property', (WidgetTester tester) async { + testWidgets('SearchAnchor.bar respects textCapitalization property', (WidgetTester tester) async { Widget buildSearchAnchor(TextCapitalization textCapitalization) { return MaterialApp( home: Center( @@ -985,7 +984,7 @@ void main() { expect(textField.textCapitalization, TextCapitalization.characters); }); - testWidgetsWithLeakTracking('SearchAnchor.bar respects onChanged and onSubmitted properties', (WidgetTester tester) async { + testWidgets('SearchAnchor.bar respects onChanged and onSubmitted properties', (WidgetTester tester) async { final SearchController controller = SearchController(); addTearDown(controller.dispose); int onChangedCalled = 0; @@ -1038,7 +1037,7 @@ void main() { expect(onSubmittedCalled, 2); }); - testWidgetsWithLeakTracking('hintStyle can override textStyle for hintText', (WidgetTester tester) async { + testWidgets('hintStyle can override textStyle for hintText', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -1076,7 +1075,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/127092. - testWidgetsWithLeakTracking('The text is still centered when SearchBar text field is smaller than 48', (WidgetTester tester) async { + testWidgets('The text is still centered when SearchBar text field is smaller than 48', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1098,7 +1097,7 @@ void main() { expect(textCenterY, searchBarCenterY); }); - testWidgetsWithLeakTracking('The search view defaults', (WidgetTester tester) async { + testWidgets('The search view defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colorScheme = theme.colorScheme; await tester.pumpWidget( @@ -1158,7 +1157,7 @@ void main() { expect(inputText.style.fontWeight, FontWeight.w400); }); - testWidgetsWithLeakTracking('The search view default size on different platforms', (WidgetTester tester) async { + testWidgets('The search view default size on different platforms', (WidgetTester tester) async { // The search view should be is full-screen on mobile platforms, // and have a size of (360, 2/3 screen height) on other platforms Widget buildSearchAnchor(TargetPlatform platform) { @@ -1205,7 +1204,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SearchAnchor respects isFullScreen property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects isFullScreen property', (WidgetTester tester) async { Widget buildSearchAnchor(TargetPlatform platform) { return MaterialApp( theme: ThemeData(platform: platform), @@ -1241,7 +1240,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SearchAnchor respects controller property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects controller property', (WidgetTester tester) async { const String defaultText = 'initial text'; final SearchController controller = SearchController(); addTearDown(controller.dispose); @@ -1277,7 +1276,7 @@ void main() { expect(find.text(updatedText), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchAnchor attaches and detaches controllers property', (WidgetTester tester) async { + testWidgets('SearchAnchor attaches and detaches controllers property', (WidgetTester tester) async { Widget builder(BuildContext context, SearchController controller) { return const Icon(Icons.search); } @@ -1352,7 +1351,7 @@ void main() { expect(controller2.isAttached, isFalse); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewBuilder property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewBuilder property', (WidgetTester tester) async { Widget buildAnchor({ViewBuilder? viewBuilder}) { return MaterialApp( home: Material( @@ -1387,7 +1386,7 @@ void main() { expect(find.byType(GridView), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewLeading property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewLeading property', (WidgetTester tester) async { Widget buildAnchor({Widget? viewLeading}) { return MaterialApp( home: Material( @@ -1420,7 +1419,7 @@ void main() { expect(find.byIcon(Icons.history), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewTrailing property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewTrailing property', (WidgetTester tester) async { Widget buildAnchor({Iterable<Widget>? viewTrailing}) { return MaterialApp( home: Material( @@ -1453,7 +1452,7 @@ void main() { expect(find.byIcon(Icons.history), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewHintText property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewHintText property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1474,7 +1473,7 @@ void main() { expect(find.text('hint text'), findsOneWidget); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewBackgroundColor property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewBackgroundColor property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1496,7 +1495,7 @@ void main() { expect(getSearchViewMaterial(tester).color, Colors.purple); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewElevation property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewElevation property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1518,7 +1517,7 @@ void main() { expect(getSearchViewMaterial(tester).elevation, 3.0); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewSurfaceTint property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewSurfaceTint property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1540,7 +1539,7 @@ void main() { expect(getSearchViewMaterial(tester).surfaceTintColor, Colors.purple); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewSide property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewSide property', (WidgetTester tester) async { const BorderSide side = BorderSide(color: Colors.purple, width: 5.0); await tester.pumpWidget(MaterialApp( home: Material( @@ -1564,7 +1563,7 @@ void main() { expect(getSearchViewMaterial(tester).shape, RoundedRectangleBorder(side: side, borderRadius: BorderRadius.circular(28.0))); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewShape property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewShape property', (WidgetTester tester) async { const BorderSide side = BorderSide(color: Colors.purple, width: 5.0); const OutlinedBorder shape = StadiumBorder(side: side); @@ -1590,7 +1589,7 @@ void main() { expect(getSearchViewMaterial(tester).shape, shape); }); - testWidgetsWithLeakTracking('SearchAnchor respects headerTextStyle property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects headerTextStyle property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1616,7 +1615,7 @@ void main() { expect(inputText.style.color, Colors.red); }); - testWidgetsWithLeakTracking('SearchAnchor respects headerHintStyle property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects headerHintStyle property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1641,7 +1640,7 @@ void main() { expect(inputText.style?.color, Colors.orange); }); - testWidgetsWithLeakTracking('SearchAnchor respects dividerColor property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects dividerColor property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: SearchAnchor( @@ -1667,7 +1666,7 @@ void main() { expect(decoration.border!.bottom.color, Colors.red); }); - testWidgetsWithLeakTracking('SearchAnchor respects viewConstraints property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects viewConstraints property', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Center( @@ -1695,7 +1694,7 @@ void main() { expect(sizedBox.height, 390.0); }); - testWidgetsWithLeakTracking('SearchAnchor respects builder property - LTR', (WidgetTester tester) async { + testWidgets('SearchAnchor respects builder property - LTR', (WidgetTester tester) async { Widget buildAnchor({required SearchAnchorChildBuilder builder}) { return MaterialApp( home: Material( @@ -1731,7 +1730,7 @@ void main() { expect(searchViewRect.topLeft, anchorRect.topLeft); }); - testWidgetsWithLeakTracking('SearchAnchor respects builder property - RTL', (WidgetTester tester) async { + testWidgets('SearchAnchor respects builder property - RTL', (WidgetTester tester) async { Widget buildAnchor({required SearchAnchorChildBuilder builder}) { return MaterialApp( home: Directionality( @@ -1768,7 +1767,7 @@ void main() { expect(searchViewRect.topRight, anchorRect.topRight); }); - testWidgetsWithLeakTracking('SearchAnchor respects suggestionsBuilder property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects suggestionsBuilder property', (WidgetTester tester) async { final SearchController controller = SearchController(); addTearDown(controller.dispose); const String suggestion = 'suggestion text'; @@ -1813,7 +1812,7 @@ void main() { expect(controller.value.text, suggestion); }); - testWidgetsWithLeakTracking('SearchAnchor should update suggestions on changes to search controller', (WidgetTester tester) async { + testWidgets('SearchAnchor should update suggestions on changes to search controller', (WidgetTester tester) async { final SearchController controller = SearchController(); const List<String> suggestions = <String>['foo','far','bim']; addTearDown(controller.dispose); @@ -1902,7 +1901,7 @@ void main() { expect(listTile3, findsNothing); }); - testWidgetsWithLeakTracking('SearchAnchor suggestionsBuilder property could be async', (WidgetTester tester) async { + testWidgets('SearchAnchor suggestionsBuilder property could be async', (WidgetTester tester) async { final SearchController controller = SearchController(); addTearDown(controller.dispose); const String suggestion = 'suggestion text'; @@ -1948,7 +1947,7 @@ void main() { expect(controller.value.text, suggestion); }); - testWidgetsWithLeakTracking('SearchAnchor.bar has a default search bar as the anchor', (WidgetTester tester) async { + testWidgets('SearchAnchor.bar has a default search bar as the anchor', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Align( @@ -1978,7 +1977,7 @@ void main() { expect(searchViewRect.width, anchorRect.width); }); - testWidgetsWithLeakTracking('SearchController can open/close view', (WidgetTester tester) async { + testWidgets('SearchController can open/close view', (WidgetTester tester) async { final SearchController controller = SearchController(); addTearDown(controller.dispose); @@ -2015,7 +2014,7 @@ void main() { expect(controller.isOpen, true); }); - testWidgetsWithLeakTracking('Search view does not go off the screen - LTR', (WidgetTester tester) async { + testWidgets('Search view does not go off the screen - LTR', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2054,7 +2053,7 @@ void main() { expect(searchViewRect, equals(const Rect.fromLTRB(440.0, 200.0, 800.0, 600.0))); }); - testWidgetsWithLeakTracking('Search view does not go off the screen - RTL', (WidgetTester tester) async { + testWidgets('Search view does not go off the screen - RTL', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( @@ -2095,7 +2094,7 @@ void main() { expect(searchViewRect, equals(const Rect.fromLTRB(0.0, 200.0, 360.0, 600.0))); }); - testWidgetsWithLeakTracking('Search view becomes smaller if the window size is smaller than the view size', (WidgetTester tester) async { + testWidgets('Search view becomes smaller if the window size is smaller than the view size', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(200.0, 200.0); tester.view.devicePixelRatio = 1.0; @@ -2157,7 +2156,7 @@ void main() { expect(searchViewRectRTL, equals(const Rect.fromLTRB(0.0, 0.0, 200.0, 200.0))); }); - testWidgetsWithLeakTracking('Docked search view route is popped if the window size changes', (WidgetTester tester) async { + testWidgets('Docked search view route is popped if the window size changes', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(500.0, 600.0); tester.view.devicePixelRatio = 1.0; @@ -2198,7 +2197,7 @@ void main() { expect(find.byIcon(Icons.arrow_back), findsNothing); }); - testWidgetsWithLeakTracking('Full-screen search view route should stay if the window size changes', (WidgetTester tester) async { + testWidgets('Full-screen search view route should stay if the window size changes', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(500.0, 600.0); tester.view.devicePixelRatio = 1.0; @@ -2239,7 +2238,7 @@ void main() { expect(find.byIcon(Icons.arrow_back), findsOneWidget); }); - testWidgetsWithLeakTracking('Search view route does not throw exception during pop animation', (WidgetTester tester) async { + testWidgets('Search view route does not throw exception during pop animation', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126590. await tester.pumpWidget( MaterialApp( @@ -2281,7 +2280,7 @@ void main() { // No exception. }); - testWidgetsWithLeakTracking('Docked search should position itself correctly based on closest navigator', (WidgetTester tester) async { + testWidgets('Docked search should position itself correctly based on closest navigator', (WidgetTester tester) async { const double rootSpacing = 100.0; await tester.pumpWidget( @@ -2320,7 +2319,7 @@ void main() { expect(searchViewRect.topLeft, equals(const Offset(rootSpacing, rootSpacing))); }); - testWidgetsWithLeakTracking('Docked search view with nested navigator does not go off the screen', (WidgetTester tester) async { + testWidgets('Docked search view with nested navigator does not go off the screen', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view.physicalSize = const Size(400.0, 400.0); tester.view.devicePixelRatio = 1.0; @@ -2368,7 +2367,7 @@ void main() { // Regression tests for https://github.com/flutter/flutter/issues/128332 group('SearchAnchor text selection', () { - testWidgetsWithLeakTracking('can right-click to select word', (WidgetTester tester) async { + testWidgets('can right-click to select word', (WidgetTester tester) async { const String defaultText = 'initial text'; final SearchController controller = SearchController(); addTearDown(controller.dispose); @@ -2402,7 +2401,7 @@ void main() { await gesture.removePointer(); }, variant: TargetPlatformVariant.only(TargetPlatform.macOS)); - testWidgetsWithLeakTracking('can click to set position', (WidgetTester tester) async { + testWidgets('can click to set position', (WidgetTester tester) async { const String defaultText = 'initial text'; final SearchController controller = SearchController(); addTearDown(controller.dispose); @@ -2439,7 +2438,7 @@ void main() { await gesture.removePointer(); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('can double-click to select word', (WidgetTester tester) async { + testWidgets('can double-click to select word', (WidgetTester tester) async { const String defaultText = 'initial text'; final SearchController controller = SearchController(); addTearDown(controller.dispose); @@ -2482,7 +2481,7 @@ void main() { await gesture.removePointer(); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('can triple-click to select field', (WidgetTester tester) async { + testWidgets('can triple-click to select field', (WidgetTester tester) async { const String defaultText = 'initial text'; final SearchController controller = SearchController(); addTearDown(controller.dispose); @@ -2577,7 +2576,7 @@ void main() { expect(decoration?.hintStyle?.color, theme.colorScheme.onSurfaceVariant); } - testWidgetsWithLeakTracking('Overall InputDecorationTheme does not override text field style' + testWidgets('Overall InputDecorationTheme does not override text field style' ' in SearchBar', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( @@ -2603,7 +2602,7 @@ void main() { checkSearchBarDefaults(tester, theme.colorScheme, material); }); - testWidgetsWithLeakTracking('Overall InputDecorationTheme does not override text field style' + testWidgets('Overall InputDecorationTheme does not override text field style' ' in the search view route', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( @@ -2652,7 +2651,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('SearchAnchor view respects theme brightness', (WidgetTester tester) async { + testWidgets('SearchAnchor view respects theme brightness', (WidgetTester tester) async { Widget buildSearchAnchor(ThemeData theme) { return MaterialApp( theme: theme, @@ -2697,7 +2696,7 @@ void main() { expect(material.color, theme.colorScheme.surface); }); - testWidgetsWithLeakTracking('Search view widgets can inherit local themes', (WidgetTester tester) async { + testWidgets('Search view widgets can inherit local themes', (WidgetTester tester) async { final ThemeData globalTheme = ThemeData(colorSchemeSeed: Colors.red); final ThemeData localTheme = ThemeData( colorSchemeSeed: Colors.green, @@ -2763,7 +2762,7 @@ void main() { expect(suggestionMaterial.color, localTheme.cardTheme.color); }); - testWidgetsWithLeakTracking('SearchBar respects keyboardType property', (WidgetTester tester) async { + testWidgets('SearchBar respects keyboardType property', (WidgetTester tester) async { Widget buildSearchBar(TextInputType keyboardType) { return MaterialApp( home: Center( @@ -2786,7 +2785,7 @@ void main() { expect(textField.keyboardType, TextInputType.phone); }); - testWidgetsWithLeakTracking('SearchAnchor respects keyboardType property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects keyboardType property', (WidgetTester tester) async { Widget buildSearchAnchor(TextInputType keyboardType) { return MaterialApp( home: Center( @@ -2826,7 +2825,7 @@ void main() { expect(textField.keyboardType, TextInputType.phone); }); - testWidgetsWithLeakTracking('SearchAnchor.bar respects keyboardType property', (WidgetTester tester) async { + testWidgets('SearchAnchor.bar respects keyboardType property', (WidgetTester tester) async { Widget buildSearchAnchor(TextInputType keyboardType) { return MaterialApp( home: Center( @@ -2855,7 +2854,7 @@ void main() { expect(textField.keyboardType, TextInputType.number); }); - testWidgetsWithLeakTracking('SearchBar respects textInputAction property', (WidgetTester tester) async { + testWidgets('SearchBar respects textInputAction property', (WidgetTester tester) async { Widget buildSearchBar(TextInputAction textInputAction) { return MaterialApp( home: Center( @@ -2878,7 +2877,7 @@ void main() { expect(textField.textInputAction, TextInputAction.send); }); - testWidgetsWithLeakTracking('SearchAnchor respects textInputAction property', (WidgetTester tester) async { + testWidgets('SearchAnchor respects textInputAction property', (WidgetTester tester) async { Widget buildSearchAnchor(TextInputAction textInputAction) { return MaterialApp( home: Center( @@ -2918,7 +2917,7 @@ void main() { expect(textField.textInputAction, TextInputAction.send); }); - testWidgetsWithLeakTracking('SearchAnchor.bar respects textInputAction property', (WidgetTester tester) async { + testWidgets('SearchAnchor.bar respects textInputAction property', (WidgetTester tester) async { Widget buildSearchAnchor(TextInputAction textInputAction) { return MaterialApp( home: Center( diff --git a/packages/flutter/test/material/search_bar_theme_test.dart b/packages/flutter/test/material/search_bar_theme_test.dart index 358c7ddb79e..017baf4f750 100644 --- a/packages/flutter/test/material/search_bar_theme_test.dart +++ b/packages/flutter/test/material/search_bar_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('SearchBarThemeData copyWith, ==, hashCode basics', () { @@ -51,7 +50,7 @@ void main() { expect(theme.data.textCapitalization, null); }); - testWidgetsWithLeakTracking('Default SearchBarThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default SearchBarThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SearchBarThemeData().debugFillProperties(builder); @@ -63,7 +62,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('SearchBarThemeData implements debugFillProperties', ( + testWidgets('SearchBarThemeData implements debugFillProperties', ( WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SearchBarThemeData( @@ -242,19 +241,19 @@ void main() { expect(trailingRect.right, barRect.right - 16.0); } - testWidgetsWithLeakTracking('SearchBar properties overrides defaults', (WidgetTester tester) async { + testWidgets('SearchBar properties overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(useSearchBarProperties: true)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchBar(tester); }); - testWidgetsWithLeakTracking('SearchBar theme data overrides defaults', (WidgetTester tester) async { + testWidgets('SearchBar theme data overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(searchBarThemeData: searchBarTheme)); await tester.pumpAndSettle(); checkSearchBar(tester); }); - testWidgetsWithLeakTracking('Overall Theme SearchBar theme overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme SearchBar theme overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallTheme: searchBarTheme)); await tester.pumpAndSettle(); checkSearchBar(tester); @@ -262,7 +261,7 @@ void main() { // Same as the previous tests with empty SearchBarThemeData's instead of null. - testWidgetsWithLeakTracking('SearchBar properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async { + testWidgets('SearchBar properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(useSearchBarProperties: true, searchBarThemeData: const SearchBarThemeData(), overallTheme: const SearchBarThemeData())); @@ -270,14 +269,14 @@ void main() { checkSearchBar(tester); }); - testWidgetsWithLeakTracking('SearchBar theme overrides defaults and overall theme', (WidgetTester tester) async { + testWidgets('SearchBar theme overrides defaults and overall theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(searchBarThemeData: searchBarTheme, overallTheme: const SearchBarThemeData())); await tester.pumpAndSettle(); // allow the animations to finish checkSearchBar(tester); }); - testWidgetsWithLeakTracking('Overall Theme SearchBar theme overrides defaults and null theme', (WidgetTester tester) async { + testWidgets('Overall Theme SearchBar theme overrides defaults and null theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallTheme: searchBarTheme)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchBar(tester); diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index ab36668fd90..4b4359b7696 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/semantics_tester.dart'; @@ -26,7 +25,7 @@ void main() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, null); }); - testWidgetsWithLeakTracking('Changing query moves cursor to the end of query', (WidgetTester tester) async { + testWidgets('Changing query moves cursor to the end of query', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -48,7 +47,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can open and close search', (WidgetTester tester) async { + testWidgets('Can open and close search', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); final List<String> selectedResults = <String>[]; @@ -85,7 +84,7 @@ void main() { expect(selectedResults, <String>['Result']); }); - testWidgetsWithLeakTracking('Can close search with system back button to return null', (WidgetTester tester) async { + testWidgets('Can close search with system back button to return null', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/18145 final _TestSearchDelegate delegate = _TestSearchDelegate(); @@ -132,7 +131,7 @@ void main() { expect(find.text('Suggestions'), findsOneWidget); }); - testWidgetsWithLeakTracking('Hint text color overridden', (WidgetTester tester) async { + testWidgets('Hint text color overridden', (WidgetTester tester) async { const String searchHintText = 'Enter search terms'; final _TestSearchDelegate delegate = _TestSearchDelegate(searchHint: searchHintText); addTearDown(() => delegate.dispose()); @@ -147,7 +146,7 @@ void main() { expect(hintText.style!.color, _TestSearchDelegate.hintTextColor); }); - testWidgetsWithLeakTracking('Requests suggestions', (WidgetTester tester) async { + testWidgets('Requests suggestions', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -177,7 +176,7 @@ void main() { expect(delegate.queriesForResults, hasLength(0)); }); - testWidgetsWithLeakTracking('Shows Results and closes search', (WidgetTester tester) async { + testWidgets('Shows Results and closes search', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); final List<String> selectedResults = <String>[]; @@ -214,7 +213,7 @@ void main() { expect(selectedResults, <String>['Result']); }); - testWidgetsWithLeakTracking('Can switch between results and suggestions', (WidgetTester tester) async { + testWidgets('Can switch between results and suggestions', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -285,7 +284,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Fresh search always starts with empty query', (WidgetTester tester) async { + testWidgets('Fresh search always starts with empty query', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -306,7 +305,7 @@ void main() { expect(delegate.query, ''); }); - testWidgetsWithLeakTracking('Initial queries are honored', (WidgetTester tester) async { + testWidgets('Initial queries are honored', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -323,7 +322,7 @@ void main() { expect(delegate.query, 'Foo'); }); - testWidgetsWithLeakTracking('Initial query null re-used previous query', (WidgetTester tester) async { + testWidgets('Initial query null re-used previous query', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -339,7 +338,7 @@ void main() { expect(delegate.query, 'Foo'); }); - testWidgetsWithLeakTracking('Changing query shows up in search field', (WidgetTester tester) async { + testWidgets('Changing query shows up in search field', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -361,7 +360,7 @@ void main() { expect(find.text('Bar'), findsOneWidget); }); - testWidgetsWithLeakTracking('transitionAnimation runs while search fades in/out', (WidgetTester tester) async { + testWidgets('transitionAnimation runs while search fades in/out', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -390,7 +389,7 @@ void main() { expect(delegate.transitionAnimation.status, AnimationStatus.dismissed); }); - testWidgetsWithLeakTracking('Closing nested search returns to search', (WidgetTester tester) async { + testWidgets('Closing nested search returns to search', (WidgetTester tester) async { final List<String?> nestedSearchResults = <String?>[]; final _TestSearchDelegate nestedSearchDelegate = _TestSearchDelegate( suggestions: 'Nested Suggestions', @@ -456,7 +455,7 @@ void main() { expect(selectedResults, <String>['Result']); }); - testWidgetsWithLeakTracking('Closing search with nested search shown goes back to underlying route', (WidgetTester tester) async { + testWidgets('Closing search with nested search shown goes back to underlying route', (WidgetTester tester) async { late _TestSearchDelegate delegate; addTearDown(() => delegate.dispose()); final List<String?> nestedSearchResults = <String?>[]; @@ -530,7 +529,7 @@ void main() { expect(selectedResults, <String>['Result Foo']); }); - testWidgetsWithLeakTracking('Custom searchFieldLabel value', (WidgetTester tester) async { + testWidgets('Custom searchFieldLabel value', (WidgetTester tester) async { const String searchHint = 'custom search hint'; final String defaultSearchHint = const DefaultMaterialLocalizations().searchFieldLabel; @@ -547,7 +546,7 @@ void main() { expect(find.text(defaultSearchHint), findsNothing); }); - testWidgetsWithLeakTracking('Default searchFieldLabel is used when it is set to null', (WidgetTester tester) async { + testWidgets('Default searchFieldLabel is used when it is set to null', (WidgetTester tester) async { final String searchHint = const DefaultMaterialLocalizations().searchFieldLabel; final _TestSearchDelegate delegate = _TestSearchDelegate(); @@ -562,7 +561,7 @@ void main() { expect(find.text(searchHint), findsOneWidget); }); - testWidgetsWithLeakTracking('Custom searchFieldStyle value', (WidgetTester tester) async { + testWidgets('Custom searchFieldStyle value', (WidgetTester tester) async { const String searchHintText = 'Enter search terms'; const TextStyle searchFieldStyle = TextStyle(color: Colors.red, fontSize: 3); @@ -583,7 +582,7 @@ void main() { }); - testWidgetsWithLeakTracking('keyboard show search button by default', (WidgetTester tester) async { + testWidgets('keyboard show search button by default', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -598,7 +597,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], TextInputAction.search.toString()); }); - testWidgetsWithLeakTracking('Custom textInputAction results in keyboard with corresponding button', (WidgetTester tester) async { + testWidgets('Custom textInputAction results in keyboard with corresponding button', (WidgetTester tester) async { final _TestSearchDelegate delegate = _TestSearchDelegate(textInputAction: TextInputAction.done); addTearDown(() => delegate.dispose()); @@ -611,7 +610,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], TextInputAction.done.toString()); }); - testWidgetsWithLeakTracking('Custom flexibleSpace value', (WidgetTester tester) async { + testWidgets('Custom flexibleSpace value', (WidgetTester tester) async { const Widget flexibleSpace = Text('custom flexibleSpace'); final _TestSearchDelegate delegate = _TestSearchDelegate(flexibleSpace: flexibleSpace); addTearDown(() => delegate.dispose()); @@ -731,7 +730,7 @@ void main() { ); } - testWidgetsWithLeakTracking('includes routeName on Android', (WidgetTester tester) async { + testWidgets('includes routeName on Android', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final _TestSearchDelegate delegate = _TestSearchDelegate(flexibleSpace: flexibleSpace); addTearDown(() => delegate.dispose()); @@ -753,7 +752,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('does not include routeName', (WidgetTester tester) async { + testWidgets('does not include routeName', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final _TestSearchDelegate delegate = _TestSearchDelegate(flexibleSpace: flexibleSpace); addTearDown(() => delegate.dispose()); @@ -867,7 +866,7 @@ void main() { ); } - testWidgetsWithLeakTracking('includes routeName on Android', (WidgetTester tester) async { + testWidgets('includes routeName on Android', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -889,7 +888,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('does not include routeName', (WidgetTester tester) async { + testWidgets('does not include routeName', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final _TestSearchDelegate delegate = _TestSearchDelegate(); addTearDown(() => delegate.dispose()); @@ -912,7 +911,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); }); - testWidgetsWithLeakTracking('Custom searchFieldDecorationTheme value', (WidgetTester tester) async { + testWidgets('Custom searchFieldDecorationTheme value', (WidgetTester tester) async { const InputDecorationTheme searchFieldDecorationTheme = InputDecorationTheme( hintStyle: TextStyle(color: _TestSearchDelegate.hintTextColor), ); @@ -930,7 +929,7 @@ void main() { }); // Regression test for: https://github.com/flutter/flutter/issues/66781 - testWidgetsWithLeakTracking('text in search bar contrasts background (light mode)', (WidgetTester tester) async { + testWidgets('text in search bar contrasts background (light mode)', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: false); final _TestSearchDelegate delegate = _TestSearchDelegate(defaultAppBarTheme: true); addTearDown(() => delegate.dispose()); @@ -958,7 +957,7 @@ void main() { }); // Regression test for: https://github.com/flutter/flutter/issues/66781 - testWidgetsWithLeakTracking('text in search bar contrasts background (dark mode)', (WidgetTester tester) async { + testWidgets('text in search bar contrasts background (dark mode)', (WidgetTester tester) async { final ThemeData themeData = ThemeData.dark(useMaterial3: false); final _TestSearchDelegate delegate = _TestSearchDelegate(defaultAppBarTheme: true); addTearDown(() => delegate.dispose()); @@ -986,7 +985,7 @@ void main() { }); // Regression test for: https://github.com/flutter/flutter/issues/78144 - testWidgetsWithLeakTracking('`Leading`, `Actions` and `FlexibleSpace` nullable test', (WidgetTester tester) async { + testWidgets('`Leading`, `Actions` and `FlexibleSpace` nullable test', (WidgetTester tester) async { // The search delegate page is displayed with no issues // even with a null return values for [buildLeading], [buildActions] and [flexibleSpace]. final _TestEmptySearchDelegate delegate = _TestEmptySearchDelegate(); @@ -1049,7 +1048,7 @@ void main() { expect(find.text('HomeBody'), findsOneWidget); }); - testWidgetsWithLeakTracking('showSearch with useRootNavigator', (WidgetTester tester) async { + testWidgets('showSearch with useRootNavigator', (WidgetTester tester) async { final _MyNavigatorObserver rootObserver = _MyNavigatorObserver(); final _MyNavigatorObserver localObserver = _MyNavigatorObserver(); @@ -1120,7 +1119,7 @@ void main() { expect(localObserver.pushCount, 1); }); - testWidgetsWithLeakTracking('Query text field shows toolbar initially', (WidgetTester tester) async { + testWidgets('Query text field shows toolbar initially', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/95588 final _TestSearchDelegate delegate = _TestSearchDelegate(); diff --git a/packages/flutter/test/material/search_view_theme_test.dart b/packages/flutter/test/material/search_view_theme_test.dart index a669d233900..b85c61ef57c 100644 --- a/packages/flutter/test/material/search_view_theme_test.dart +++ b/packages/flutter/test/material/search_view_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('SearchViewThemeData copyWith, ==, hashCode basics', () { @@ -45,7 +44,7 @@ void main() { expect(theme.data.dividerColor, null); }); - testWidgetsWithLeakTracking('Default SearchViewThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default SearchViewThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SearchViewThemeData().debugFillProperties(builder); @@ -57,7 +56,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('SearchViewThemeData implements debugFillProperties', ( + testWidgets('SearchViewThemeData implements debugFillProperties', ( WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SearchViewThemeData( @@ -196,21 +195,21 @@ void main() { expect(inputText.style.fontSize, headerTextStyle.fontSize); } - testWidgetsWithLeakTracking('SearchView properties overrides defaults', (WidgetTester tester) async { + testWidgets('SearchView properties overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(useSearchViewProperties: true)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchView(tester); }); - testWidgetsWithLeakTracking('SearchView theme data overrides defaults', (WidgetTester tester) async { + testWidgets('SearchView theme data overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(searchViewThemeData: searchViewTheme)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); checkSearchView(tester); }); - testWidgetsWithLeakTracking('Overall Theme SearchView theme overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme SearchView theme overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallTheme: searchViewTheme)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); @@ -219,7 +218,7 @@ void main() { // Same as the previous tests with empty SearchViewThemeData's instead of null. - testWidgetsWithLeakTracking('SearchView properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async { + testWidgets('SearchView properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(useSearchViewProperties: true, searchViewThemeData: const SearchViewThemeData(), overallTheme: const SearchViewThemeData())); @@ -228,7 +227,7 @@ void main() { checkSearchView(tester); }); - testWidgetsWithLeakTracking('SearchView theme overrides defaults and overall theme', (WidgetTester tester) async { + testWidgets('SearchView theme overrides defaults and overall theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(searchViewThemeData: searchViewTheme, overallTheme: const SearchViewThemeData())); await tester.tap(find.byIcon(Icons.search)); @@ -236,7 +235,7 @@ void main() { checkSearchView(tester); }); - testWidgetsWithLeakTracking('Overall Theme SearchView theme overrides defaults and null theme', (WidgetTester tester) async { + testWidgets('Overall Theme SearchView theme overrides defaults and null theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallTheme: searchViewTheme)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); // allow the animations to finish diff --git a/packages/flutter/test/material/segmented_button_test.dart b/packages/flutter/test/material/segmented_button_test.dart index f326479d3a2..61ff0498a7a 100644 --- a/packages/flutter/test/material/segmented_button_test.dart +++ b/packages/flutter/test/material/segmented_button_test.dart @@ -9,7 +9,6 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -21,7 +20,7 @@ Widget boilerplate({required Widget child}) { } void main() { - testWidgetsWithLeakTracking('SegmentsButton when compositing does not crash', (WidgetTester tester) async { + testWidgets('SegmentsButton when compositing does not crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/135747 // If the render object holds on to a stale canvas reference, this will // throw an exception. @@ -52,7 +51,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('SegmentedButton releases state controllers for deleted segments', (WidgetTester tester) async { + testWidgets('SegmentedButton releases state controllers for deleted segments', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final Key key = UniqueKey(); @@ -99,7 +98,7 @@ void main() { expect(state.statesControllers.keys.last.value, 3); }); - testWidgetsWithLeakTracking('SegmentedButton is built with Material of type MaterialType.transparency', (WidgetTester tester) async { + testWidgets('SegmentedButton is built with Material of type MaterialType.transparency', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -128,7 +127,7 @@ void main() { expect(material.type, MaterialType.transparency); }); - testWidgetsWithLeakTracking('SegmentedButton supports exclusive choice by default', (WidgetTester tester) async { + testWidgets('SegmentedButton supports exclusive choice by default', (WidgetTester tester) async { int callbackCount = 0; int selectedSegment = 2; @@ -178,7 +177,7 @@ void main() { expect(selectedSegment, 3); }); - testWidgetsWithLeakTracking('SegmentedButton supports multiple selected segments', (WidgetTester tester) async { + testWidgets('SegmentedButton supports multiple selected segments', (WidgetTester tester) async { int callbackCount = 0; Set<int> selection = <int>{1}; @@ -233,7 +232,7 @@ void main() { expect(selection, <int>{2, 3}); }); -testWidgetsWithLeakTracking('SegmentedButton allows for empty selection', (WidgetTester tester) async { +testWidgets('SegmentedButton allows for empty selection', (WidgetTester tester) async { int callbackCount = 0; int? selectedSegment = 1; @@ -286,7 +285,7 @@ testWidgetsWithLeakTracking('SegmentedButton allows for empty selection', (Widge expect(selectedSegment, 3); }); -testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segments', (WidgetTester tester) async { +testWidgets('SegmentedButton shows checkboxes for selected segments', (WidgetTester tester) async { Widget frameWithSelection(int selected) { return Material( child: boilerplate( @@ -323,7 +322,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme expect(find.byIcon(Icons.check), findsOneWidget); }); - testWidgetsWithLeakTracking('SegmentedButton shows selected checkboxes in place of icon if it has a label as well', (WidgetTester tester) async { + testWidgets('SegmentedButton shows selected checkboxes in place of icon if it has a label as well', (WidgetTester tester) async { Widget frameWithSelection(int selected) { return Material( child: boilerplate( @@ -366,7 +365,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme expect(find.byIcon(Icons.add_alarm), findsNothing); }); - testWidgetsWithLeakTracking('SegmentedButton shows selected checkboxes next to icon if there is no label', (WidgetTester tester) async { + testWidgets('SegmentedButton shows selected checkboxes next to icon if there is no label', (WidgetTester tester) async { Widget frameWithSelection(int selected) { return Material( child: boilerplate( @@ -407,7 +406,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme }); - testWidgetsWithLeakTracking('SegmentedButtons have correct semantics', (WidgetTester tester) async { + testWidgets('SegmentedButtons have correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -486,7 +485,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme }); - testWidgetsWithLeakTracking('Multi-select SegmentedButtons have correct semantics', (WidgetTester tester) async { + testWidgets('Multi-select SegmentedButtons have correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -563,7 +562,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme semantics.dispose(); }); - testWidgetsWithLeakTracking('SegmentedButton default overlayColor and foregroundColor resolve pressed state', (WidgetTester tester) async { + testWidgets('SegmentedButton default overlayColor and foregroundColor resolve pressed state', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -611,7 +610,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme expect(material.textStyle?.color, theme.colorScheme.onSurface); }); - testWidgetsWithLeakTracking('SegmentedButton has no tooltips by default', (WidgetTester tester) async { + testWidgets('SegmentedButton has no tooltips by default', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -635,7 +634,7 @@ testWidgetsWithLeakTracking('SegmentedButton shows checkboxes for selected segme expect(find.byType(Tooltip), findsNothing); }); - testWidgetsWithLeakTracking('SegmentedButton has correct tooltips', (WidgetTester tester) async { + testWidgets('SegmentedButton has correct tooltips', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/segmented_button_theme_test.dart b/packages/flutter/test/material/segmented_button_theme_test.dart index 5efee131502..f978b4bb4a7 100644 --- a/packages/flutter/test/material/segmented_button_theme_test.dart +++ b/packages/flutter/test/material/segmented_button_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -30,7 +29,7 @@ void main() { expect(identical(SegmentedButtonThemeData.lerp(theme, theme, 0.5), theme), true); }); - testWidgetsWithLeakTracking('Default SegmentedButtonThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default SegmentedButtonThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SegmentedButtonThemeData().debugFillProperties(builder); @@ -42,7 +41,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('With no other configuration, defaults are used', (WidgetTester tester) async { + testWidgets('With no other configuration, defaults are used', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -109,7 +108,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ThemeData.segmentedButtonTheme overrides defaults', (WidgetTester tester) async { + testWidgets('ThemeData.segmentedButtonTheme overrides defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData( useMaterial3: true, segmentedButtonTheme: SegmentedButtonThemeData( @@ -202,7 +201,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SegmentedButtonTheme overrides ThemeData and defaults', (WidgetTester tester) async { + testWidgets('SegmentedButtonTheme overrides ThemeData and defaults', (WidgetTester tester) async { final SegmentedButtonThemeData global = SegmentedButtonThemeData( style: ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) { @@ -329,7 +328,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Widget parameters overrides SegmentedTheme, ThemeData and defaults', (WidgetTester tester) async { + testWidgets('Widget parameters overrides SegmentedTheme, ThemeData and defaults', (WidgetTester tester) async { final SegmentedButtonThemeData global = SegmentedButtonThemeData( style: ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) { diff --git a/packages/flutter/test/material/selection_area_test.dart b/packages/flutter/test/material/selection_area_test.dart index 5fb653127a4..b26f17eaa60 100644 --- a/packages/flutter/test/material/selection_area_test.dart +++ b/packages/flutter/test/material/selection_area_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Offset textOffsetToPosition(RenderParagraph paragraph, int offset) { @@ -18,7 +17,7 @@ Offset textOffsetToPosition(RenderParagraph paragraph, int offset) { } void main() { - testWidgetsWithLeakTracking('SelectionArea uses correct selection controls', (WidgetTester tester) async { + testWidgets('SelectionArea uses correct selection controls', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: SelectionArea( child: Text('abc'), @@ -40,7 +39,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Does not crash when long pressing on padding after dragging', (WidgetTester tester) async { + testWidgets('Does not crash when long pressing on padding after dragging', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123378 await tester.pumpWidget( const MaterialApp( @@ -71,7 +70,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/111370 - testWidgetsWithLeakTracking('Handle is correctly transformed when the text is inside of a FittedBox ',(WidgetTester tester) async { + testWidgets('Handle is correctly transformed when the text is inside of a FittedBox ',(WidgetTester tester) async { final Key textKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -128,7 +127,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS}), ); - testWidgetsWithLeakTracking('builds the default context menu by default', (WidgetTester tester) async { + testWidgets('builds the default context menu by default', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -160,7 +159,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('builds a custom context menu if provided', (WidgetTester tester) async { + testWidgets('builds a custom context menu if provided', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -201,7 +200,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('onSelectionChange is called when the selection changes', (WidgetTester tester) async { + testWidgets('onSelectionChange is called when the selection changes', (WidgetTester tester) async { SelectedContent? content; await tester.pumpWidget(MaterialApp( @@ -239,7 +238,7 @@ void main() { expect(content!.plainText, 'How'); }); - testWidgetsWithLeakTracking('stopping drag of end handle will show the toolbar', (WidgetTester tester) async { + testWidgets('stopping drag of end handle will show the toolbar', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index e2193290ee0..45e03b2c564 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -13,7 +13,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter/src/physics/utils.dart' show nearEqual; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; @@ -101,7 +100,7 @@ class _StateDependentMouseCursor extends MaterialStateMouseCursor { } void main() { - testWidgetsWithLeakTracking('The initial value should respect the discrete value', (WidgetTester tester) async { + testWidgets('The initial value should respect the discrete value', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.20; final List<Offset> log = <Offset>[]; @@ -141,7 +140,7 @@ void main() { expect(log[0], const Offset(212.0, 300.0)); }); - testWidgetsWithLeakTracking('Slider can move when tapped (LTR)', (WidgetTester tester) async { + testWidgets('Slider can move when tapped (LTR)', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; double? startValue; @@ -200,7 +199,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider can move when tapped (RTL)', (WidgetTester tester) async { + testWidgets('Slider can move when tapped (RTL)', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; @@ -245,7 +244,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking("Slider doesn't send duplicate change events if tapped on the same value", (WidgetTester tester) async { + testWidgets("Slider doesn't send duplicate change events if tapped on the same value", (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; late double startValue; @@ -302,7 +301,7 @@ void main() { expect(endValueUpdates, equals(2)); }); - testWidgetsWithLeakTracking('Value indicator shows for a bit after being tapped', (WidgetTester tester) async { + testWidgets('Value indicator shows for a bit after being tapped', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; @@ -352,7 +351,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Discrete Slider repaints and animates when dragged', (WidgetTester tester) async { + testWidgets('Discrete Slider repaints and animates when dragged', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; final List<Offset> log = <Offset>[]; @@ -420,7 +419,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking("Slider doesn't send duplicate change events if tapped on the same value", (WidgetTester tester) async { + testWidgets("Slider doesn't send duplicate change events if tapped on the same value", (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; int updates = 0; @@ -461,7 +460,7 @@ void main() { expect(updates, equals(1)); }); - testWidgetsWithLeakTracking('discrete Slider repaints when dragged', (WidgetTester tester) async { + testWidgets('discrete Slider repaints when dragged', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; final List<Offset> log = <Offset>[]; @@ -529,7 +528,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Slider take on discrete values', (WidgetTester tester) async { + testWidgets('Slider take on discrete values', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; @@ -581,7 +580,7 @@ void main() { expect(SchedulerBinding.instance.transientCallbackCount, equals(0)); }); - testWidgetsWithLeakTracking('Slider can be given zero values', (WidgetTester tester) async { + testWidgets('Slider can be given zero values', (WidgetTester tester) async { final List<double> log = <double>[]; await tester.pumpWidget( MaterialApp( @@ -625,7 +624,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('Slider can tap in vertical scroller', (WidgetTester tester) async { + testWidgets('Slider can tap in vertical scroller', (WidgetTester tester) async { double value = 0.0; await tester.pumpWidget( MaterialApp( @@ -654,7 +653,7 @@ void main() { expect(value, equals(0.5)); }); - testWidgetsWithLeakTracking('Slider drags immediately (LTR)', (WidgetTester tester) async { + testWidgets('Slider drags immediately (LTR)', (WidgetTester tester) async { double value = 0.0; await tester.pumpWidget( MaterialApp( @@ -686,7 +685,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Slider drags immediately (RTL)', (WidgetTester tester) async { + testWidgets('Slider drags immediately (RTL)', (WidgetTester tester) async { double value = 0.0; await tester.pumpWidget( MaterialApp( @@ -718,7 +717,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Slider onChangeStart and onChangeEnd fire once', (WidgetTester tester) async { + testWidgets('Slider onChangeStart and onChangeEnd fire once', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28115 int startFired = 0; @@ -758,7 +757,7 @@ void main() { expect(endFired, equals(1)); }); - testWidgetsWithLeakTracking('Slider sizing', (WidgetTester tester) async { + testWidgets('Slider sizing', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Directionality( @@ -817,7 +816,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(Slider)).size, const Size(144.0 + 2.0 * 24.0, 48.0)); }); - testWidgetsWithLeakTracking('Slider respects textScaleFactor', (WidgetTester tester) async { + testWidgets('Slider respects textScaleFactor', (WidgetTester tester) async { debugDisableShadows = false; try { final Key sliderKey = UniqueKey(); @@ -972,7 +971,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Tick marks are skipped when they are too dense', (WidgetTester tester) async { + testWidgets('Tick marks are skipped when they are too dense', (WidgetTester tester) async { Widget buildSlider({ required int divisions, }) { @@ -1019,7 +1018,7 @@ void main() { expect(material, paintsExactlyCountTimes(#drawCircle, 1)); }); - testWidgetsWithLeakTracking('Slider has correct animations when reparented', (WidgetTester tester) async { + testWidgets('Slider has correct animations when reparented', (WidgetTester tester) async { final Key sliderKey = GlobalKey(debugLabel: 'A'); double value = 0.0; @@ -1148,7 +1147,7 @@ void main() { await testReparenting(true); }); - testWidgetsWithLeakTracking('Slider Semantics', (WidgetTester tester) async { + testWidgets('Slider Semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -1310,7 +1309,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux })); - testWidgetsWithLeakTracking('Slider Semantics', (WidgetTester tester) async { + testWidgets('Slider Semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1421,7 +1420,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Slider Semantics', (WidgetTester tester) async { + testWidgets('Slider Semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -1590,7 +1589,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.windows })); - testWidgetsWithLeakTracking('Slider semantics with custom formatter', (WidgetTester tester) async { + testWidgets('Slider semantics with custom formatter', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -1649,7 +1648,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/101868 - testWidgetsWithLeakTracking('Slider.label info should not write to semantic node', (WidgetTester tester) async { + testWidgets('Slider.label info should not write to semantic node', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -1708,7 +1707,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Slider is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Slider is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Slider'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1757,7 +1756,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider has correct focus color from overlayColor property', (WidgetTester tester) async { + testWidgets('Slider has correct focus color from overlayColor property', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Slider'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1811,7 +1810,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Slider can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final ThemeData theme = ThemeData(useMaterial3: true); double value = 0.5; @@ -1881,7 +1880,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider has correct hovered color from overlayColor property', (WidgetTester tester) async { + testWidgets('Slider has correct hovered color from overlayColor property', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double value = 0.5; Widget buildApp({bool enabled = true}) { @@ -1942,7 +1941,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('Slider is draggable and has correct dragged color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double value = 0.5; final ThemeData theme = ThemeData(useMaterial3: true); @@ -2017,7 +2016,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider has correct dragged color from overlayColor property', (WidgetTester tester) async { + testWidgets('Slider has correct dragged color from overlayColor property', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double value = 0.5; final Key sliderKey = UniqueKey(); @@ -2087,7 +2086,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('OverlayColor property is correctly applied when activeColor is also provided', (WidgetTester tester) async { + testWidgets('OverlayColor property is correctly applied when activeColor is also provided', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Slider'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -2145,7 +2144,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider can be incremented and decremented by keyboard shortcuts - LTR', (WidgetTester tester) async { + testWidgets('Slider can be incremented and decremented by keyboard shortcuts - LTR', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double startValue = 0.0; double currentValue = 0.5; @@ -2206,7 +2205,7 @@ void main() { expect(endValue, 0.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('Slider can be incremented and decremented by keyboard shortcuts - LTR', (WidgetTester tester) async { + testWidgets('Slider can be incremented and decremented by keyboard shortcuts - LTR', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double startValue = 0.0; double currentValue = 0.5; @@ -2267,7 +2266,7 @@ void main() { expect(endValue, 0.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Slider can be incremented and decremented by keyboard shortcuts - RTL', (WidgetTester tester) async { + testWidgets('Slider can be incremented and decremented by keyboard shortcuts - RTL', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double startValue = 0.0; double currentValue = 0.5; @@ -2331,7 +2330,7 @@ void main() { expect(endValue, 0.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('Slider can be incremented and decremented by keyboard shortcuts - RTL', (WidgetTester tester) async { + testWidgets('Slider can be incremented and decremented by keyboard shortcuts - RTL', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double startValue = 0.0; double currentValue = 0.5; @@ -2395,7 +2394,7 @@ void main() { expect(endValue, 0.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('In directional nav, Slider can be navigated out of by using up and down arrows', (WidgetTester tester) async { + testWidgets('In directional nav, Slider can be navigated out of by using up and down arrows', (WidgetTester tester) async { const Map<ShortcutActivator, Intent> shortcuts = <ShortcutActivator, Intent>{ SingleActivator(LogicalKeyboardKey.arrowLeft): DirectionalFocusIntent(TraversalDirection.left), SingleActivator(LogicalKeyboardKey.arrowRight): DirectionalFocusIntent(TraversalDirection.right), @@ -2491,7 +2490,7 @@ void main() { expect(bottomSliderValue, 0.5, reason: 'unfocused bottom Slider unaffected by third arrowRight'); }); - testWidgetsWithLeakTracking('Slider gains keyboard focus when it gains semantics focus on Windows', (WidgetTester tester) async { + testWidgets('Slider gains keyboard focus when it gains semantics focus on Windows', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final SemanticsOwner semanticsOwner = tester.binding.pipelineOwner.semanticsOwner!; final FocusNode focusNode = FocusNode(); @@ -2559,7 +2558,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.windows })); - testWidgetsWithLeakTracking('Value indicator appears when it should', (WidgetTester tester) async { + testWidgets('Value indicator appears when it should', (WidgetTester tester) async { final ThemeData baseTheme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, @@ -2643,7 +2642,7 @@ void main() { await expectValueIndicator(isVisible: false, theme: theme, enabled: false); }); - testWidgetsWithLeakTracking("Slider doesn't start any animations after dispose", (WidgetTester tester) async { + testWidgets("Slider doesn't start any animations after dispose", (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; await tester.pumpWidget( @@ -2683,7 +2682,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Slider removes value indicator from overlay if Slider gets disposed without value indicator animation completing.', (WidgetTester tester) async { + testWidgets('Slider removes value indicator from overlay if Slider gets disposed without value indicator animation completing.', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); const Color fillColor = Color(0xf55f5f5f); double value = 0.0; @@ -2780,7 +2779,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Slider.adaptive', (WidgetTester tester) async { + testWidgets('Slider.adaptive', (WidgetTester tester) async { double value = 0.5; Widget buildFrame(TargetPlatform platform) { @@ -2835,7 +2834,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Slider respects height from theme', (WidgetTester tester) async { + testWidgets('Slider respects height from theme', (WidgetTester tester) async { final Key sliderKey = UniqueKey(); double value = 0.0; await tester.pumpWidget( @@ -2874,7 +2873,7 @@ void main() { expect(renderObject.size.height, 200); }); - testWidgetsWithLeakTracking('Slider changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Slider changes mouse cursor when hovered', (WidgetTester tester) async { // Test Slider() constructor await tester.pumpWidget( MaterialApp( @@ -2949,7 +2948,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('Slider MaterialStateMouseCursor resolves correctly', (WidgetTester tester) async { + testWidgets('Slider MaterialStateMouseCursor resolves correctly', (WidgetTester tester) async { const MouseCursor disabledCursor = SystemMouseCursors.basic; const MouseCursor hoveredCursor = SystemMouseCursors.grab; const MouseCursor draggedCursor = SystemMouseCursors.move; @@ -2999,7 +2998,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.move); }); - testWidgetsWithLeakTracking('Slider implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Slider implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Slider( @@ -3032,7 +3031,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Slider track paints correctly when the shape is rectangular', (WidgetTester tester) async { + testWidgets('Slider track paints correctly when the shape is rectangular', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -3067,7 +3066,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SliderTheme change should trigger re-layout', (WidgetTester tester) async { + testWidgets('SliderTheme change should trigger re-layout', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/118955 double sliderValue = 0.0; Widget buildFrame(ThemeMode themeMode) { @@ -3112,7 +3111,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Slider can be painted in a narrower constraint', (WidgetTester tester) async { + testWidgets('Slider can be painted in a narrower constraint', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Directionality( @@ -3148,7 +3147,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Update the divisions and value at the same time for Slider', (WidgetTester tester) async { + testWidgets('Update the divisions and value at the same time for Slider', (WidgetTester tester) async { // Regress test for https://github.com/flutter/flutter/issues/65943 Widget buildFrame(double maxValue) { return MaterialApp( @@ -3189,7 +3188,7 @@ void main() { expect(nearEqual(activeTrackRRect.right, (800.0 - 24.0 - 24.0) * (5 / 15) + 24.0, 0.01), true); }); - testWidgetsWithLeakTracking('Slider paints thumbColor', (WidgetTester tester) async { + testWidgets('Slider paints thumbColor', (WidgetTester tester) async { const Color color = Color(0xffffc107); final Widget sliderAdaptive = MaterialApp( @@ -3211,7 +3210,7 @@ void main() { expect(material, paints..circle(color: color)); }); - testWidgetsWithLeakTracking('Slider.adaptive paints thumbColor on Android', + testWidgets('Slider.adaptive paints thumbColor on Android', (WidgetTester tester) async { const Color color = Color(0xffffc107); @@ -3234,7 +3233,7 @@ void main() { expect(material, paints..circle(color: color)); }); - testWidgetsWithLeakTracking('If thumbColor is null, it defaults to CupertinoColors.white', + testWidgets('If thumbColor is null, it defaults to CupertinoColors.white', (WidgetTester tester) async { final Widget sliderAdaptive = MaterialApp( theme: ThemeData(platform: TargetPlatform.iOS), @@ -3263,7 +3262,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider.adaptive passes thumbColor to CupertinoSlider', + testWidgets('Slider.adaptive passes thumbColor to CupertinoSlider', (WidgetTester tester) async { const Color color = Color(0xffffc107); @@ -3290,7 +3289,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/103566 - testWidgetsWithLeakTracking('Drag gesture uses provided gesture settings', (WidgetTester tester) async { + testWidgets('Drag gesture uses provided gesture settings', (WidgetTester tester) async { double value = 0.5; bool dragStarted = false; final Key sliderKey = UniqueKey(); @@ -3397,7 +3396,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/139281 - testWidgetsWithLeakTracking('Slider does not request focus when the value is changed', (WidgetTester tester) async { + testWidgets('Slider does not request focus when the value is changed', (WidgetTester tester) async { double value = 0.5; await tester.pumpWidget(MaterialApp( home: Material( @@ -3437,7 +3436,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/139281 - testWidgetsWithLeakTracking('Overlay remains when Slider thumb is interacted', (WidgetTester tester) async { + testWidgets('Overlay remains when Slider thumb is interacted', (WidgetTester tester) async { double value = 0.5; const Color overlayColor = Color(0xffff0000); await tester.pumpWidget(MaterialApp( @@ -3489,7 +3488,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Overlay appear only when hovered on the thumb on desktop', (WidgetTester tester) async { + testWidgets('Overlay appear only when hovered on the thumb on desktop', (WidgetTester tester) async { double value = 0.5; const Color overlayColor = Color(0xffff0000); @@ -3552,7 +3551,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Overlay remains when Slider is in focus on desktop', (WidgetTester tester) async { + testWidgets('Overlay remains when Slider is in focus on desktop', (WidgetTester tester) async { double value = 0.5; const Color overlayColor = Color(0xffff0000); final FocusNode focusNode = FocusNode(); @@ -3619,7 +3618,7 @@ void main() { }, variant: TargetPlatformVariant.desktop()); // Regression test for https://github.com/flutter/flutter/issues/123313, which only occurs on desktop platforms. - testWidgetsWithLeakTracking('Value indicator disappears after adjusting the slider on desktop', (WidgetTester tester) async { + testWidgets('Value indicator disappears after adjusting the slider on desktop', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const double currentValue = 0.5; await tester.pumpWidget(MaterialApp( @@ -3668,7 +3667,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Value indicator remains when Slider is in focus on desktop', (WidgetTester tester) async { + testWidgets('Value indicator remains when Slider is in focus on desktop', (WidgetTester tester) async { double value = 0.5; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3738,7 +3737,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Event on Slider should perform no-op if already unmounted', (WidgetTester tester) async { + testWidgets('Event on Slider should perform no-op if already unmounted', (WidgetTester tester) async { // Test covering crashing found in Google internal issue b/192329942. double value = 0.0; final ValueNotifier<bool> shouldShowSliderListenable = @@ -3804,7 +3803,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Slider can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Slider can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final ThemeData theme = ThemeData(useMaterial3: false); double value = 0.5; @@ -3860,7 +3859,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Slider is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Slider'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -3908,7 +3907,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('Slider is draggable and has correct dragged color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double value = 0.5; final ThemeData theme = ThemeData(); @@ -3974,7 +3973,7 @@ void main() { }); group('Slider.allowedInteraction', () { - testWidgetsWithLeakTracking('SliderInteraction.tapOnly', (WidgetTester tester) async { + testWidgets('SliderInteraction.tapOnly', (WidgetTester tester) async { double value = 1.0; final Key sliderKey = UniqueKey(); // (slider's left padding (overlayRadius), windowHeight / 2) @@ -4032,7 +4031,7 @@ void main() { expect(logs, <String>['onChangeStart', 'onChanged', 'onChangeEnd']); }); - testWidgetsWithLeakTracking('SliderInteraction.tapAndSlide (default)', (WidgetTester tester) async { + testWidgets('SliderInteraction.tapAndSlide (default)', (WidgetTester tester) async { double value = 1.0; final Key sliderKey = UniqueKey(); // (slider's left padding (overlayRadius), windowHeight / 2) @@ -4094,7 +4093,7 @@ void main() { expect(logs, <String>['onChangeStart', 'onChanged', 'onChanged', 'onChanged', 'onChangeEnd']); }); - testWidgetsWithLeakTracking('SliderInteraction.slideOnly', (WidgetTester tester) async { + testWidgets('SliderInteraction.slideOnly', (WidgetTester tester) async { double value = 1.0; final Key sliderKey = UniqueKey(); // (slider's left padding (overlayRadius), windowHeight / 2) @@ -4159,7 +4158,7 @@ void main() { expect(logs, <String>['onChangeStart', 'onChanged', 'onChanged', 'onChangeEnd']); }); - testWidgetsWithLeakTracking('SliderInteraction.slideThumb', (WidgetTester tester) async { + testWidgets('SliderInteraction.slideThumb', (WidgetTester tester) async { double value = 1.0; final Key sliderKey = UniqueKey(); // (slider's left padding (overlayRadius), windowHeight / 2) diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 62b0168c786..31d468a3acf 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('SliderThemeData copyWith, ==, hashCode basics', () { @@ -19,7 +18,7 @@ void main() { expect(identical(SliderThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Default SliderThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default SliderThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SliderThemeData().debugFillProperties(builder); @@ -31,7 +30,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('SliderThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('SliderThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SliderThemeData( trackHeight: 7.0, @@ -105,7 +104,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Slider defaults', (WidgetTester tester) async { + testWidgets('Slider defaults', (WidgetTester tester) async { debugDisableShadows = false; final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colorScheme = theme.colorScheme; @@ -236,7 +235,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Slider uses the right theme colors for the right components', (WidgetTester tester) async { + testWidgets('Slider uses the right theme colors for the right components', (WidgetTester tester) async { debugDisableShadows = false; try { const Color customColor1 = Color(0xcafefeed); @@ -503,7 +502,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Slider parameters overrides theme properties', (WidgetTester tester) async { + testWidgets('Slider parameters overrides theme properties', (WidgetTester tester) async { debugDisableShadows = false; const Color activeTrackColor = Color(0xffff0001); const Color inactiveTrackColor = Color(0xffff0002); @@ -557,7 +556,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Slider uses ThemeData slider theme if present', (WidgetTester tester) async { + testWidgets('Slider uses ThemeData slider theme if present', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.red, @@ -581,7 +580,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider overrides ThemeData theme if SliderTheme present', (WidgetTester tester) async { + testWidgets('Slider overrides ThemeData theme if SliderTheme present', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.red, @@ -605,7 +604,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SliderThemeData generates correct opacities for fromPrimaryColors', (WidgetTester tester) async { + testWidgets('SliderThemeData generates correct opacities for fromPrimaryColors', (WidgetTester tester) async { const Color customColor1 = Color(0xcafefeed); const Color customColor2 = Color(0xdeadbeef); const Color customColor3 = Color(0xdecaface); @@ -636,7 +635,7 @@ void main() { expect(sliderTheme.valueIndicatorTextStyle!.color, equals(customColor4)); }); - testWidgetsWithLeakTracking('SliderThemeData generates correct shapes for fromPrimaryColors', (WidgetTester tester) async { + testWidgets('SliderThemeData generates correct shapes for fromPrimaryColors', (WidgetTester tester) async { const Color customColor1 = Color(0xcafefeed); const Color customColor2 = Color(0xdeadbeef); const Color customColor3 = Color(0xdecaface); @@ -660,7 +659,7 @@ void main() { expect(sliderTheme.rangeValueIndicatorShape, const PaddleRangeSliderValueIndicatorShape()); }); - testWidgetsWithLeakTracking('SliderThemeData lerps correctly', (WidgetTester tester) async { + testWidgets('SliderThemeData lerps correctly', (WidgetTester tester) async { final SliderThemeData sliderThemeBlack = SliderThemeData.fromPrimaryColors( primaryColor: Colors.black, primaryColorDark: Colors.black, @@ -695,7 +694,7 @@ void main() { expect(lerp.valueIndicatorTextStyle!.color, equals(middleGrey.withAlpha(0xff))); }); - testWidgetsWithLeakTracking('Default slider track draws correctly', (WidgetTester tester) async { + testWidgets('Default slider track draws correctly', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, @@ -731,7 +730,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default slider overlay draws correctly', (WidgetTester tester) async { + testWidgets('Default slider overlay draws correctly', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, @@ -792,7 +791,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider can use theme overlay with material states', (WidgetTester tester) async { + testWidgets('Slider can use theme overlay with material states', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, @@ -852,7 +851,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default slider ticker and thumb shape draw correctly', (WidgetTester tester) async { + testWidgets('Default slider ticker and thumb shape draw correctly', (WidgetTester tester) async { final ThemeData theme = ThemeData( platform: TargetPlatform.android, primarySwatch: Colors.blue, @@ -896,7 +895,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default paddle slider value indicator shape draws correctly', (WidgetTester tester) async { + testWidgets('Default paddle slider value indicator shape draws correctly', (WidgetTester tester) async { debugDisableShadows = false; try { final ThemeData theme = ThemeData( @@ -1080,7 +1079,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Default paddle slider value indicator shape draws correctly', (WidgetTester tester) async { + testWidgets('Default paddle slider value indicator shape draws correctly', (WidgetTester tester) async { debugDisableShadows = false; try { final ThemeData theme = ThemeData( @@ -1264,7 +1263,7 @@ void main() { } }); - testWidgetsWithLeakTracking('The slider track height can be overridden', (WidgetTester tester) async { + testWidgets('The slider track height can be overridden', (WidgetTester tester) async { final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith(trackHeight: 16); const Radius radius = Radius.circular(8); const Radius activatedRadius = Radius.circular(9); @@ -1294,7 +1293,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The default slider thumb shape sizes can be overridden', (WidgetTester tester) async { + testWidgets('The default slider thumb shape sizes can be overridden', (WidgetTester tester) async { final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith( thumbShape: const RoundSliderThumbShape( enabledThumbRadius: 7, @@ -1319,7 +1318,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The default slider thumb shape disabled size can be inferred from the enabled size', (WidgetTester tester) async { + testWidgets('The default slider thumb shape disabled size can be inferred from the enabled size', (WidgetTester tester) async { final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith( thumbShape: const RoundSliderThumbShape( enabledThumbRadius: 9, @@ -1342,7 +1341,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The default slider tick mark shape size can be overridden', (WidgetTester tester) async { + testWidgets('The default slider tick mark shape size can be overridden', (WidgetTester tester) async { final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith( tickMarkShape: const RoundSliderTickMarkShape(tickMarkRadius: 5), activeTickMarkColor: const Color(0xfadedead), @@ -1375,7 +1374,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The default slider overlay shape size can be overridden', (WidgetTester tester) async { + testWidgets('The default slider overlay shape size can be overridden', (WidgetTester tester) async { const double uniqueOverlayRadius = 23; final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith( overlayShape: const RoundSliderOverlayShape( @@ -1406,7 +1405,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/74503 - testWidgetsWithLeakTracking('The slider track layout correctly when the overlay size is smaller than the thumb size', (WidgetTester tester) async { + testWidgets('The slider track layout correctly when the overlay size is smaller than the thumb size', (WidgetTester tester) async { final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith( overlayShape: SliderComponentShape.noOverlay, ); @@ -1447,7 +1446,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/125467 - testWidgetsWithLeakTracking('The RangeSlider track layout correctly when the overlay size is smaller than the thumb size', (WidgetTester tester) async { + testWidgets('The RangeSlider track layout correctly when the overlay size is smaller than the thumb size', (WidgetTester tester) async { final SliderThemeData sliderTheme = ThemeData().sliderTheme.copyWith( overlayShape: SliderComponentShape.noOverlay, ); @@ -1498,7 +1497,7 @@ void main() { // // The value indicator can be skipped by passing the appropriate // [ShowValueIndicator]. - testWidgetsWithLeakTracking('The slider can skip all of its component painting', (WidgetTester tester) async { + testWidgets('The slider can skip all of its component painting', (WidgetTester tester) async { // Pump a slider with all shapes skipped. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1519,7 +1518,7 @@ void main() { expect(material, paintsExactlyCountTimes(#drawPath, 0)); }); - testWidgetsWithLeakTracking('The slider can skip all component painting except the track', (WidgetTester tester) async { + testWidgets('The slider can skip all component painting except the track', (WidgetTester tester) async { // Pump a slider with just a track. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1540,7 +1539,7 @@ void main() { expect(material, paintsExactlyCountTimes(#drawPath, 0)); }); - testWidgetsWithLeakTracking('The slider can skip all component painting except the tick marks', (WidgetTester tester) async { + testWidgets('The slider can skip all component painting except the tick marks', (WidgetTester tester) async { // Pump a slider with just tick marks. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1564,7 +1563,7 @@ void main() { expect(material, paintsExactlyCountTimes(#drawPath, 0)); }); - testWidgetsWithLeakTracking('The slider can skip all component painting except the thumb', (WidgetTester tester) async { + testWidgets('The slider can skip all component painting except the thumb', (WidgetTester tester) async { debugDisableShadows = false; try { // Pump a slider with just a thumb. @@ -1590,7 +1589,7 @@ void main() { } }); - testWidgetsWithLeakTracking('The slider can skip all component painting except the overlay', (WidgetTester tester) async { + testWidgets('The slider can skip all component painting except the overlay', (WidgetTester tester) async { // Pump a slider with just an overlay. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1618,7 +1617,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('The slider can skip all component painting except the value indicator', (WidgetTester tester) async { + testWidgets('The slider can skip all component painting except the value indicator', (WidgetTester tester) async { // Pump a slider with just a value indicator. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1648,7 +1647,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('PaddleSliderValueIndicatorShape skips all painting at zero scale', (WidgetTester tester) async { + testWidgets('PaddleSliderValueIndicatorShape skips all painting at zero scale', (WidgetTester tester) async { // Pump a slider with just a value indicator. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1683,7 +1682,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Default slider value indicator shape skips all painting at zero scale', (WidgetTester tester) async { + testWidgets('Default slider value indicator shape skips all painting at zero scale', (WidgetTester tester) async { // Pump a slider with just a value indicator. await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( @@ -1715,7 +1714,7 @@ void main() { }); - testWidgetsWithLeakTracking('Default paddle range slider value indicator shape draws correctly', (WidgetTester tester) async { + testWidgets('Default paddle range slider value indicator shape draws correctly', (WidgetTester tester) async { debugDisableShadows = false; try { final ThemeData theme = ThemeData( @@ -1765,7 +1764,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Default paddle range slider value indicator shape draws correctly with debugDisableShadows', (WidgetTester tester) async { + testWidgets('Default paddle range slider value indicator shape draws correctly with debugDisableShadows', (WidgetTester tester) async { debugDisableShadows = true; final ThemeData theme = ThemeData( platform: TargetPlatform.android, @@ -1811,7 +1810,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('PaddleRangeSliderValueIndicatorShape skips all painting at zero scale', (WidgetTester tester) async { + testWidgets('PaddleRangeSliderValueIndicatorShape skips all painting at zero scale', (WidgetTester tester) async { debugDisableShadows = false; try { // Pump a slider with just a value indicator. @@ -1845,7 +1844,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Default range indicator shape skips all painting at zero scale', (WidgetTester tester) async { + testWidgets('Default range indicator shape skips all painting at zero scale', (WidgetTester tester) async { debugDisableShadows = false; try { // Pump a slider with just a value indicator. @@ -1881,7 +1880,7 @@ void main() { } }); - testWidgetsWithLeakTracking('activeTrackRadius is taken into account when painting the border of the active track', (WidgetTester tester) async { + testWidgets('activeTrackRadius is taken into account when painting the border of the active track', (WidgetTester tester) async { await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( trackShape: const RoundedRectSliderTrackShapeWithCustomAdditionalActiveTrackHeight( @@ -1912,7 +1911,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('The mouse cursor is themeable', (WidgetTester tester) async { + testWidgets('The mouse cursor is themeable', (WidgetTester tester) async { await tester.pumpWidget(_buildApp( ThemeData().sliderTheme.copyWith( mouseCursor: const MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.text), @@ -1927,7 +1926,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('SliderTheme.allowedInteraction is themeable', (WidgetTester tester) async { + testWidgets('SliderTheme.allowedInteraction is themeable', (WidgetTester tester) async { double value = 0.0; Widget buildApp({ @@ -2034,7 +2033,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Default value indicator color', (WidgetTester tester) async { + testWidgets('Default value indicator color', (WidgetTester tester) async { debugDisableShadows = false; try { final ThemeData theme = ThemeData( @@ -2092,7 +2091,7 @@ void main() { } }); - testWidgetsWithLeakTracking('RectangularSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { + testWidgets('RectangularSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2135,7 +2134,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PaddleSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { + testWidgets('PaddleSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2178,7 +2177,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DropSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { + testWidgets('DropSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2221,7 +2220,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RectangularRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { + testWidgets('RectangularRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2274,7 +2273,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('RectangularRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor on overlapping indicator', (WidgetTester tester) async { + testWidgets('RectangularRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor on overlapping indicator', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2328,7 +2327,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('PaddleRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { + testWidgets('PaddleRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2381,7 +2380,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('PaddleRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor on overlapping indicator', (WidgetTester tester) async { + testWidgets('PaddleRangeSliderValueIndicatorShape supports SliderTheme.valueIndicatorStrokeColor on overlapping indicator', (WidgetTester tester) async { final ThemeData theme = ThemeData( sliderTheme: const SliderThemeData( showValueIndicator: ShowValueIndicator.always, @@ -2440,7 +2439,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Slider defaults', (WidgetTester tester) async { + testWidgets('Slider defaults', (WidgetTester tester) async { debugDisableShadows = false; final ThemeData theme = ThemeData(useMaterial3: false); const double trackHeight = 4.0; @@ -2590,7 +2589,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Default value indicator color', (WidgetTester tester) async { + testWidgets('Default value indicator color', (WidgetTester tester) async { debugDisableShadows = false; try { final ThemeData theme = ThemeData( diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index c0f59b557ad..1112e626b37 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -14,10 +14,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SnackBar control test', (WidgetTester tester) async { + testWidgets('SnackBar control test', (WidgetTester tester) async { const String helloSnackBar = 'Hello SnackBar'; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( @@ -62,7 +61,7 @@ void main() { expect(find.text(helloSnackBar), findsNothing); }); - testWidgetsWithLeakTracking('SnackBar twice test', (WidgetTester tester) async { + testWidgets('SnackBar twice test', (WidgetTester tester) async { int snackBarCount = 0; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( @@ -137,7 +136,7 @@ void main() { expect(find.text('bar2'), findsNothing); }); - testWidgetsWithLeakTracking('SnackBar cancel test', (WidgetTester tester) async { + testWidgets('SnackBar cancel test', (WidgetTester tester) async { int snackBarCount = 0; const Key tapTarget = Key('tap-target'); late int time; @@ -223,7 +222,7 @@ void main() { expect(find.text('bar2'), findsNothing); }); - testWidgetsWithLeakTracking('SnackBar dismiss test', (WidgetTester tester) async { + testWidgets('SnackBar dismiss test', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); late DismissDirection dismissDirection; late double width; @@ -265,7 +264,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SnackBar dismissDirection can be customised from SnackBarThemeData', (WidgetTester tester) async { + testWidgets('SnackBar dismissDirection can be customised from SnackBarThemeData', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); late double width; @@ -312,7 +311,7 @@ void main() { expect(find.text('swipe ltr'), findsNothing); }); - testWidgetsWithLeakTracking('dismissDirection from SnackBar should be preferred over SnackBarThemeData', (WidgetTester tester) async { + testWidgets('dismissDirection from SnackBar should be preferred over SnackBarThemeData', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); late double width; @@ -360,7 +359,7 @@ void main() { expect(find.text('swipe rtl'), findsNothing); }); - testWidgetsWithLeakTracking('SnackBar cannot be tapped twice', (WidgetTester tester) async { + testWidgets('SnackBar cannot be tapped twice', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -399,7 +398,7 @@ void main() { expect(tapCount, equals(1)); }); - testWidgetsWithLeakTracking('Material2 - Light theme SnackBar has dark background', (WidgetTester tester) async { + testWidgets('Material2 - Light theme SnackBar has dark background', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.light(useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -441,7 +440,7 @@ void main() { expect(renderModel.color, equals(const Color(0xFF333333))); }); - testWidgetsWithLeakTracking('Material3 - Light theme SnackBar has dark background', (WidgetTester tester) async { + testWidgets('Material3 - Light theme SnackBar has dark background', (WidgetTester tester) async { final ThemeData lightTheme = ThemeData.light(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -480,7 +479,7 @@ void main() { expect(renderModel.color, equals(lightTheme.colorScheme.inverseSurface)); }); - testWidgetsWithLeakTracking('Dark theme SnackBar has light background', (WidgetTester tester) async { + testWidgets('Dark theme SnackBar has light background', (WidgetTester tester) async { final ThemeData darkTheme = ThemeData.dark(); await tester.pumpWidget( MaterialApp( @@ -519,7 +518,7 @@ void main() { expect(renderModel.color, equals(darkTheme.colorScheme.onSurface)); }); - testWidgetsWithLeakTracking('Material2 - Dark theme SnackBar has primary text buttons', (WidgetTester tester) async { + testWidgets('Material2 - Dark theme SnackBar has primary text buttons', (WidgetTester tester) async { final ThemeData darkTheme = ThemeData.dark(useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -558,7 +557,7 @@ void main() { expect(buttonTextStyle.color, equals(darkTheme.colorScheme.primary)); }); - testWidgetsWithLeakTracking('Material3 - Dark theme SnackBar has primary text buttons', (WidgetTester tester) async { + testWidgets('Material3 - Dark theme SnackBar has primary text buttons', (WidgetTester tester) async { final ThemeData darkTheme = ThemeData.dark(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -597,7 +596,7 @@ void main() { expect(buttonTextStyle.color, equals(darkTheme.colorScheme.inversePrimary)); }); - testWidgetsWithLeakTracking('SnackBar should inherit theme data from its ancestor.', (WidgetTester tester) async { + testWidgets('SnackBar should inherit theme data from its ancestor.', (WidgetTester tester) async { final SliderThemeData sliderTheme = SliderThemeData.fromPrimaryColors( primaryColor: Colors.black, primaryColorDark: Colors.black, @@ -731,7 +730,7 @@ void main() { expect(comparedTheme, themeAfterSnackBar); }); - testWidgetsWithLeakTracking('Snackbar margin can be customized', (WidgetTester tester) async { + testWidgets('Snackbar margin can be customized', (WidgetTester tester) async { const double padding = 20.0; await tester.pumpWidget( MaterialApp( @@ -771,7 +770,7 @@ void main() { expect(snackBarBottomRight.dx, 800 - padding); // Device width is 800. }); - testWidgetsWithLeakTracking('SnackbarBehavior.floating is positioned within safe area', (WidgetTester tester) async { + testWidgets('SnackbarBehavior.floating is positioned within safe area', (WidgetTester tester) async { const double viewPadding = 50.0; const double floatingSnackBarDefaultBottomMargin = 10.0; await tester.pumpWidget( @@ -818,7 +817,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Snackbar padding can be customized', (WidgetTester tester) async { + testWidgets('Snackbar padding can be customized', (WidgetTester tester) async { const double padding = 20.0; await tester.pumpWidget( MaterialApp( @@ -861,7 +860,7 @@ void main() { expect(textTopRight.dy - snackBarTopRight.dy, padding); }); - testWidgetsWithLeakTracking('Snackbar width can be customized', (WidgetTester tester) async { + testWidgets('Snackbar width can be customized', (WidgetTester tester) async { const double width = 200.0; await tester.pumpWidget( MaterialApp( @@ -900,7 +899,7 @@ void main() { expect(snackBarBottomRight.dx, (800 + width) / 2); // Device width is 800. }); - testWidgetsWithLeakTracking('Snackbar width can be customized from ThemeData', + testWidgets('Snackbar width can be customized from ThemeData', (WidgetTester tester) async { const double width = 200.0; await tester.pumpWidget( @@ -942,7 +941,7 @@ void main() { expect(snackBarBottomRight.dx, (800 + width) / 2); // Device width is 800. }); - testWidgetsWithLeakTracking('Snackbar width customization takes preference of widget over theme', (WidgetTester tester) async { + testWidgets('Snackbar width customization takes preference of widget over theme', (WidgetTester tester) async { const double themeWidth = 200.0; const double widgetWidth = 400.0; await tester.pumpWidget( @@ -985,7 +984,7 @@ void main() { expect(snackBarBottomRight.dx, (800 + widgetWidth) / 2); // Device width is 800. }); - testWidgetsWithLeakTracking('Material2 - Snackbar labels can be colored as MaterialColor', (WidgetTester tester) async { + testWidgets('Material2 - Snackbar labels can be colored as MaterialColor', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1030,7 +1029,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material3 - Snackbar labels can be colored as MaterialColor', (WidgetTester tester) async { + testWidgets('Material3 - Snackbar labels can be colored as MaterialColor', (WidgetTester tester) async { const MaterialColor usedColor = Colors.teal; await tester.pumpWidget( @@ -1081,7 +1080,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Snackbar labels can be colored as MaterialStateColor (Material 3)', + testWidgets('Snackbar labels can be colored as MaterialStateColor (Material 3)', (WidgetTester tester) async { const _TestMaterialStateColor usedColor = _TestMaterialStateColor(); @@ -1133,7 +1132,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material2 - SnackBar button text alignment', (WidgetTester tester) async { + testWidgets('Material2 - SnackBar button text alignment', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: MediaQuery( @@ -1181,7 +1180,7 @@ void main() { expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 17.0 + 40.0); // margin + bottom padding }); - testWidgetsWithLeakTracking('Material3 - SnackBar button text alignment', (WidgetTester tester) async { + testWidgets('Material3 - SnackBar button text alignment', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: MediaQuery( @@ -1229,7 +1228,7 @@ void main() { expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 14.0 + 40.0); // margin + bottom padding }); - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - Custom padding between SnackBar and its contents when set to SnackBarBehavior.fixed', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( @@ -1286,7 +1285,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - Custom padding between SnackBar and its contents when set to SnackBarBehavior.fixed', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( @@ -1343,7 +1342,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('SnackBar should push FloatingActionButton above', (WidgetTester tester) async { + testWidgets('SnackBar should push FloatingActionButton above', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: MediaQuery( data: const MediaQueryData( @@ -1398,7 +1397,7 @@ void main() { expect(fabRect.bottomRight.dy, snackBarTopRight.dy - defaultFabPadding); }); - testWidgetsWithLeakTracking('Material2 - Floating SnackBar button text alignment', (WidgetTester tester) async { + testWidgets('Material2 - Floating SnackBar button text alignment', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData( useMaterial3: false, @@ -1449,7 +1448,7 @@ void main() { expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 27.0); // margin (with no bottom padding) }); - testWidgetsWithLeakTracking('Material3 - Floating SnackBar button text alignment', (WidgetTester tester) async { + testWidgets('Material3 - Floating SnackBar button text alignment', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData( useMaterial3: true, @@ -1500,7 +1499,7 @@ void main() { expect(snackBarBottomRight.dy - actionTextBottomRight.dy, 24.0); // margin (with no bottom padding) }); - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - Custom padding between SnackBar and its contents when set to SnackBarBehavior.floating', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( @@ -1560,7 +1559,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - Custom padding between SnackBar and its contents when set to SnackBarBehavior.floating', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( @@ -1620,7 +1619,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('SnackBarClosedReason', (WidgetTester tester) async { + testWidgets('SnackBarClosedReason', (WidgetTester tester) async { final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>(); bool actionPressed = false; SnackBarClosedReason? closedReason; @@ -1698,7 +1697,7 @@ void main() { expect(closedReason, equals(SnackBarClosedReason.timeout)); }); - testWidgetsWithLeakTracking('accessible navigation behavior with action', (WidgetTester tester) async { + testWidgets('accessible navigation behavior with action', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget(MaterialApp( @@ -1741,7 +1740,7 @@ void main() { expect(find.text('ACTION'), findsNothing); }); - testWidgetsWithLeakTracking('contributes dismiss semantics', (WidgetTester tester) async { + testWidgets('contributes dismiss semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -1784,7 +1783,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('SnackBar default display duration test', (WidgetTester tester) async { + testWidgets('SnackBar default display duration test', (WidgetTester tester) async { const String helloSnackBar = 'Hello SnackBar'; const Key tapTarget = Key('tap-target'); await tester.pumpWidget(MaterialApp( @@ -1832,7 +1831,7 @@ void main() { expect(find.text(helloSnackBar), findsNothing); }); - testWidgetsWithLeakTracking('SnackBar handles updates to accessibleNavigation', (WidgetTester tester) async { + testWidgets('SnackBar handles updates to accessibleNavigation', (WidgetTester tester) async { Future<void> boilerplate({ required bool accessibleNavigation }) { return tester.pumpWidget(MaterialApp( home: MediaQuery( @@ -1880,7 +1879,7 @@ void main() { expect(find.text('test'), findsNothing); }); - testWidgetsWithLeakTracking('Snackbar calls onVisible once', (WidgetTester tester) async { + testWidgets('Snackbar calls onVisible once', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); int called = 0; await tester.pumpWidget(MaterialApp( @@ -1917,7 +1916,7 @@ void main() { expect(called, 1); }); - testWidgetsWithLeakTracking('Snackbar does not call onVisible when it is queued', (WidgetTester tester) async { + testWidgets('Snackbar does not call onVisible when it is queued', (WidgetTester tester) async { const Key tapTarget = Key('tap-target'); int called = 0; await tester.pumpWidget(MaterialApp( @@ -1968,7 +1967,7 @@ void main() { behavior: behavior, ); - testWidgetsWithLeakTracking( + testWidgets( '$behavior should align SnackBar with the bottom of Scaffold ' 'when Scaffold has no other elements', (WidgetTester tester) async { @@ -1997,7 +1996,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '$behavior should align SnackBar with the top of BottomNavigationBar ' 'when Scaffold has no FloatingActionButton', (WidgetTester tester) async { @@ -2029,7 +2028,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( 'Padding of ${SnackBarBehavior.fixed} is not consumed by viewInsets', (WidgetTester tester) async { final Widget child = MaterialApp( @@ -2092,7 +2091,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.fixed} should align SnackBar with the bottom of Scaffold ' 'when Scaffold has a FloatingActionButton', (WidgetTester tester) async { @@ -2127,7 +2126,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.floating} should align SnackBar with the top of FloatingActionButton when Scaffold has a FloatingActionButton', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( @@ -2167,7 +2166,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.floating} should not align SnackBar with the top of FloatingActionButton ' 'when Scaffold has a FloatingActionButton and floatingActionButtonLocation is set to a top position', (WidgetTester tester) async { @@ -2220,7 +2219,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.floating} should align SnackBar with the top of FloatingActionButton ' 'when Scaffold has a FloatingActionButton and floatingActionButtonLocation is not set to a top position', (WidgetTester tester) async { @@ -2288,7 +2287,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.fixed} should align SnackBar with the top of BottomNavigationBar ' 'when Scaffold has a BottomNavigationBar and FloatingActionButton', (WidgetTester tester) async { @@ -2325,7 +2324,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.floating} should align SnackBar with the top of FloatingActionButton ' 'when Scaffold has BottomNavigationBar and FloatingActionButton', (WidgetTester tester) async { @@ -2357,7 +2356,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( '${SnackBarBehavior.floating} should align SnackBar with the top of BottomNavigationBar ' 'when Scaffold has both BottomNavigationBar and FloatingActionButton and ' 'BottomNavigationBar.top is higher than FloatingActionButton.top', @@ -2413,7 +2412,7 @@ void main() { 'Scaffold.bottomNavigationBar take up too much vertical space.\n' 'Consider constraining the size of these widgets to allow room for the SnackBar to be visible.'; - testWidgetsWithLeakTracking('Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.floatingActionButton', (WidgetTester tester) async { + testWidgets('Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.floatingActionButton', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 Future<void> boilerplate({required double? fabHeight}) { return tester.pumpWidget( @@ -2450,7 +2449,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Material2 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.persistentFooterButtons', (WidgetTester tester) async { + testWidgets('Material2 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.persistentFooterButtons', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 await tester.pumpWidget( MaterialApp( @@ -2468,7 +2467,7 @@ void main() { expect(exception.message, offScreenMessage); }); - testWidgetsWithLeakTracking('Material3 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.persistentFooterButtons', (WidgetTester tester) async { + testWidgets('Material3 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.persistentFooterButtons', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 await tester.pumpWidget( MaterialApp( @@ -2492,7 +2491,7 @@ void main() { expect(errorMessages.contains(offScreenMessage), isTrue); }); - testWidgetsWithLeakTracking('Material2 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.bottomNavigationBar', (WidgetTester tester) async { + testWidgets('Material2 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.bottomNavigationBar', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 await tester.pumpWidget( MaterialApp( @@ -2509,7 +2508,7 @@ void main() { expect(exception.message, offScreenMessage); }); - testWidgetsWithLeakTracking('Material3 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.bottomNavigationBar', (WidgetTester tester) async { + testWidgets('Material3 - Snackbar with SnackBarBehavior.floating will assert when offset too high by a large Scaffold.bottomNavigationBar', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 await tester.pumpWidget( MaterialApp( @@ -2533,7 +2532,7 @@ void main() { expect(errorMessages.contains(offScreenMessage), isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'SnackBar has correct end padding when it contains an action with fixed behavior', (WidgetTester tester) async { await tester.pumpWidget( @@ -2570,7 +2569,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'SnackBar has correct end padding when it contains an action with floating behavior', (WidgetTester tester) async { await tester.pumpWidget( @@ -2607,7 +2606,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SnackBars hero across transitions when using ScaffoldMessenger', (WidgetTester tester) async { + testWidgets('SnackBars hero across transitions when using ScaffoldMessenger', (WidgetTester tester) async { const String snackBarText = 'hello snackbar'; const String firstHeader = 'home'; const String secondHeader = 'second'; @@ -2676,7 +2675,7 @@ void main() { expect(find.text(secondHeader), findsOneWidget); }); - testWidgetsWithLeakTracking('Should have only one SnackBar during back swipe navigation', + testWidgets('Should have only one SnackBar during back swipe navigation', (WidgetTester tester) async { const String snackBarText = 'hello snackbar'; const Key snackTarget = Key('snack-target'); @@ -2753,7 +2752,7 @@ void main() { expect(find.text(snackBarText), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - SnackBars should be shown above the bottomSheet', (WidgetTester tester) async { + testWidgets('Material2 - SnackBars should be shown above the bottomSheet', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -2779,7 +2778,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m2_snack_bar.goldenTest.workWithBottomSheet.png')); }); - testWidgetsWithLeakTracking('Material3 - SnackBars should be shown above the bottomSheet', (WidgetTester tester) async { + testWidgets('Material3 - SnackBars should be shown above the bottomSheet', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: const Scaffold( @@ -2805,7 +2804,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m3_snack_bar.goldenTest.workWithBottomSheet.png')); }); - testWidgetsWithLeakTracking('ScaffoldMessenger does not duplicate a SnackBar when presenting a MaterialBanner.', (WidgetTester tester) async { + testWidgets('ScaffoldMessenger does not duplicate a SnackBar when presenting a MaterialBanner.', (WidgetTester tester) async { const Key materialBannerTapTarget = Key('materialbanner-tap-target'); const Key snackBarTapTarget = Key('snackbar-tap-target'); const String snackBarText = 'SnackBar'; @@ -2862,7 +2861,7 @@ void main() { expect(find.text(materialBannerText), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - ScaffoldMessenger presents SnackBars to only the root Scaffold when Scaffolds are nested.', (WidgetTester tester) async { + testWidgets('Material2 - ScaffoldMessenger presents SnackBars to only the root Scaffold when Scaffolds are nested.', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: Scaffold( @@ -2895,7 +2894,7 @@ void main() { expect(snackBarTopRight.dy, 465.0); }); - testWidgetsWithLeakTracking('Material3 - ScaffoldMessenger presents SnackBars to only the root Scaffold when Scaffolds are nested.', (WidgetTester tester) async { + testWidgets('Material3 - ScaffoldMessenger presents SnackBars to only the root Scaffold when Scaffolds are nested.', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: Scaffold( @@ -2929,7 +2928,7 @@ void main() { }); - testWidgetsWithLeakTracking('ScaffoldMessengerState clearSnackBars works as expected', (WidgetTester tester) async { + testWidgets('ScaffoldMessengerState clearSnackBars works as expected', (WidgetTester tester) async { final List<String> snackBars = <String>['Hello Snackbar', 'Hi Snackbar', 'Bye Snackbar']; int snackBarCounter = 0; const Key tapTarget = Key('tap-target'); @@ -3013,7 +3012,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Setting SnackBarBehavior.fixed will still assert for margin', (WidgetTester tester) async { + testWidgets('Setting SnackBarBehavior.fixed will still assert for margin', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84935 await tester.pumpWidget(doBuildApp( behavior: SnackBarBehavior.fixed, @@ -3030,7 +3029,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default SnackBarBehavior will still assert for margin', (WidgetTester tester) async { + testWidgets('Default SnackBarBehavior will still assert for margin', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84935 await tester.pumpWidget(doBuildApp( behavior: null, @@ -3047,7 +3046,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Setting SnackBarBehavior.fixed will still assert for width', (WidgetTester tester) async { + testWidgets('Setting SnackBarBehavior.fixed will still assert for width', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84935 await tester.pumpWidget(doBuildApp( behavior: SnackBarBehavior.fixed, @@ -3064,7 +3063,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default SnackBarBehavior will still assert for width', (WidgetTester tester) async { + testWidgets('Default SnackBarBehavior will still assert for width', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84935 await tester.pumpWidget(doBuildApp( behavior: null, @@ -3082,7 +3081,7 @@ void main() { }); for (final double overflowThreshold in <double>[-1.0, -.0001, 1.000001, 5]) { - testWidgetsWithLeakTracking('SnackBar will assert for actionOverflowThreshold outside of 0-1 range', (WidgetTester tester) async { + testWidgets('SnackBar will assert for actionOverflowThreshold outside of 0-1 range', (WidgetTester tester) async { await tester.pumpWidget(doBuildApp( actionOverflowThreshold: overflowThreshold, behavior: SnackBarBehavior.fixed, @@ -3096,7 +3095,7 @@ void main() { }); } - testWidgetsWithLeakTracking('Material2 - Snackbar by default clips BackdropFilter', (WidgetTester tester) async { + testWidgets('Material2 - Snackbar by default clips BackdropFilter', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/98205 await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), @@ -3129,7 +3128,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m2_snack_bar.goldenTest.backdropFilter.png')); }); - testWidgetsWithLeakTracking('Material3 - Snackbar by default clips BackdropFilter', (WidgetTester tester) async { + testWidgets('Material3 - Snackbar by default clips BackdropFilter', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/98205 await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), @@ -3162,7 +3161,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m3_snack_bar.goldenTest.backdropFilter.png')); }); - testWidgetsWithLeakTracking('Floating snackbar can display optional icon', (WidgetTester tester) async { + testWidgets('Floating snackbar can display optional icon', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -3194,7 +3193,7 @@ void main() { 'snack_bar.goldenTest.floatingWithActionWithIcon.png')); }); - testWidgetsWithLeakTracking('Material2 - Fixed width snackbar can display optional icon', (WidgetTester tester) async { + testWidgets('Material2 - Fixed width snackbar can display optional icon', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -3221,7 +3220,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m2_snack_bar.goldenTest.fixedWithActionWithIcon.png')); }); - testWidgetsWithLeakTracking('Material3 - Fixed width snackbar can display optional icon', (WidgetTester tester) async { + testWidgets('Material3 - Fixed width snackbar can display optional icon', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: const Scaffold( @@ -3248,7 +3247,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m3_snack_bar.goldenTest.fixedWithActionWithIcon.png')); }); - testWidgetsWithLeakTracking('Material2 - Fixed snackbar can display optional icon without action', (WidgetTester tester) async { + testWidgets('Material2 - Fixed snackbar can display optional icon without action', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -3276,7 +3275,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m2_snack_bar.goldenTest.fixedWithIcon.png')); }); - testWidgetsWithLeakTracking('Material3 - Fixed snackbar can display optional icon without action', (WidgetTester tester) async { + testWidgets('Material3 - Fixed snackbar can display optional icon without action', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: const Scaffold( @@ -3304,7 +3303,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m3_snack_bar.goldenTest.fixedWithIcon.png')); }); - testWidgetsWithLeakTracking('Material2 - Floating width snackbar can display optional icon without action', (WidgetTester tester) async { + testWidgets('Material2 - Floating width snackbar can display optional icon without action', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -3330,7 +3329,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m2_snack_bar.goldenTest.floatingWithIcon.png')); }); - testWidgetsWithLeakTracking('Material3 - Floating width snackbar can display optional icon without action', (WidgetTester tester) async { + testWidgets('Material3 - Floating width snackbar can display optional icon without action', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: const Scaffold( @@ -3356,7 +3355,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m3_snack_bar.goldenTest.floatingWithIcon.png')); }); - testWidgetsWithLeakTracking('Material2 - Floating multi-line snackbar with icon is aligned correctly', (WidgetTester tester) async { + testWidgets('Material2 - Floating multi-line snackbar with icon is aligned correctly', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -3383,7 +3382,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m2_snack_bar.goldenTest.multiLineWithIcon.png')); }); - testWidgetsWithLeakTracking('Material3 - Floating multi-line snackbar with icon is aligned correctly', (WidgetTester tester) async { + testWidgets('Material3 - Floating multi-line snackbar with icon is aligned correctly', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: const Scaffold( @@ -3410,7 +3409,7 @@ void main() { await expectLater(find.byType(MaterialApp), matchesGoldenFile('m3_snack_bar.goldenTest.multiLineWithIcon.png')); }); - testWidgetsWithLeakTracking('Material2 - Floating multi-line snackbar with icon and actionOverflowThreshold=1 is aligned correctly', (WidgetTester tester) async { + testWidgets('Material2 - Floating multi-line snackbar with icon and actionOverflowThreshold=1 is aligned correctly', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: const Scaffold( @@ -3440,7 +3439,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Floating multi-line snackbar with icon and actionOverflowThreshold=1 is aligned correctly', (WidgetTester tester) async { + testWidgets('Material3 - Floating multi-line snackbar with icon and actionOverflowThreshold=1 is aligned correctly', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: true), home: const Scaffold( @@ -3470,7 +3469,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'ScaffoldMessenger will alert for snackbars that cannot be presented', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103004 await tester.pumpWidget(const MaterialApp( @@ -3499,7 +3498,7 @@ void main() { ); }); -testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', (WidgetTester tester) async { +testWidgets('SnackBarAction backgroundColor works as a Color', (WidgetTester tester) async { const Color backgroundColor = Colors.blue; await tester.pumpWidget( @@ -3548,7 +3547,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( expect(materialAfterDismissed.color, Colors.transparent); }); - testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a MaterialStateColor', (WidgetTester tester) async { + testWidgets('SnackBarAction backgroundColor works as a MaterialStateColor', (WidgetTester tester) async { final MaterialStateColor backgroundColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { if (states.contains(MaterialState.disabled)) { return Colors.blue; @@ -3602,7 +3601,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( expect(materialAfterDismissed.color, Colors.blue); }); - testWidgetsWithLeakTracking('SnackBarAction disabledBackgroundColor works as expected', (WidgetTester tester) async { + testWidgets('SnackBarAction disabledBackgroundColor works as expected', (WidgetTester tester) async { const Color backgroundColor = Colors.blue; const Color disabledBackgroundColor = Colors.red; @@ -3653,7 +3652,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( expect(materialAfterDismissed.color, disabledBackgroundColor); }); - testWidgetsWithLeakTracking('SnackBarAction asserts when backgroundColor is a MaterialStateColor and disabledBackgroundColor is also provided', (WidgetTester tester) async { + testWidgets('SnackBarAction asserts when backgroundColor is a MaterialStateColor and disabledBackgroundColor is also provided', (WidgetTester tester) async { final Color backgroundColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { if (states.contains(MaterialState.disabled)) { return Colors.blue; @@ -3700,7 +3699,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( ); }); - testWidgetsWithLeakTracking('SnackBar material applies SnackBar.clipBehavior', (WidgetTester tester) async { + testWidgets('SnackBar material applies SnackBar.clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -3744,7 +3743,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( expect(material.clipBehavior, Clip.antiAlias); }); - testWidgetsWithLeakTracking('Tap on button behind snack bar defined by width', (WidgetTester tester) async { + testWidgets('Tap on button behind snack bar defined by width', (WidgetTester tester) async { tester.view.physicalSize = const Size.square(200); tester.view.devicePixelRatio = 1; addTearDown(tester.view.resetPhysicalSize); @@ -3800,7 +3799,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( }); - testWidgetsWithLeakTracking('Tap on button behind snack bar defined by margin', (WidgetTester tester) async { + testWidgets('Tap on button behind snack bar defined by margin', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/78537. tester.view.physicalSize = const Size.square(200); tester.view.devicePixelRatio = 1; @@ -3856,7 +3855,7 @@ testWidgetsWithLeakTracking('SnackBarAction backgroundColor works as a Color', ( expect(completer.isCompleted, true); }); - testWidgetsWithLeakTracking("Can't tap on button behind snack bar defined by margin and HitTestBehavior.opaque", (WidgetTester tester) async { + testWidgets("Can't tap on button behind snack bar defined by margin and HitTestBehavior.opaque", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/78537. tester.view.physicalSize = const Size.square(200); tester.view.devicePixelRatio = 1; diff --git a/packages/flutter/test/material/snack_bar_theme_test.dart b/packages/flutter/test/material/snack_bar_theme_test.dart index 88dd74e8af2..baf5a7725fd 100644 --- a/packages/flutter/test/material/snack_bar_theme_test.dart +++ b/packages/flutter/test/material/snack_bar_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('SnackBarThemeData copyWith, ==, hashCode basics', () { @@ -46,7 +45,7 @@ void main() { throwsAssertionError); }); - testWidgetsWithLeakTracking('Default SnackBarThemeData debugFillProperties', + testWidgets('Default SnackBarThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SnackBarThemeData().debugFillProperties(builder); @@ -59,7 +58,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('SnackBarThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('SnackBarThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SnackBarThemeData( backgroundColor: Color(0xFFFFFFFF), @@ -99,7 +98,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Material2 - Passing no SnackBarThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Material2 - Passing no SnackBarThemeData returns defaults', (WidgetTester tester) async { const String text = 'I am a snack bar.'; await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), @@ -133,7 +132,7 @@ void main() { expect(material.shape, null); }); - testWidgetsWithLeakTracking('Material3 - Passing no SnackBarThemeData returns defaults', (WidgetTester tester) async { + testWidgets('Material3 - Passing no SnackBarThemeData returns defaults', (WidgetTester tester) async { const String text = 'I am a snack bar.'; final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget(MaterialApp( @@ -168,7 +167,7 @@ void main() { expect(material.shape, null); }); - testWidgetsWithLeakTracking('SnackBar uses values from SnackBarThemeData', (WidgetTester tester) async { + testWidgets('SnackBar uses values from SnackBarThemeData', (WidgetTester tester) async { const String text = 'I am a snack bar.'; const String action = 'ACTION'; final SnackBarThemeData snackBarTheme = _snackBarTheme(showCloseIcon: true); @@ -209,7 +208,7 @@ void main() { expect(icon.icon, Icons.close); }); - testWidgetsWithLeakTracking('SnackBar widget properties take priority over theme', (WidgetTester tester) async { + testWidgets('SnackBar widget properties take priority over theme', (WidgetTester tester) async { const Color backgroundColor = Colors.purple; const Color textColor = Colors.pink; const double elevation = 7.0; @@ -269,7 +268,7 @@ void main() { expect(snackBarBottomRight.dx, (800 + snackBarWidth) / 2); // Device width is 800. }); - testWidgetsWithLeakTracking('SnackBarAction uses actionBackgroundColor', (WidgetTester tester) async { + testWidgets('SnackBarAction uses actionBackgroundColor', (WidgetTester tester) async { final MaterialStateColor actionBackgroundColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { if (states.contains(MaterialState.disabled)) { return Colors.blue; @@ -318,7 +317,7 @@ void main() { expect(materialAfterDismissed.color, Colors.blue); }); - testWidgetsWithLeakTracking('SnackBarAction backgroundColor overrides SnackBarThemeData actionBackgroundColor', (WidgetTester tester) async { + testWidgets('SnackBarAction backgroundColor overrides SnackBarThemeData actionBackgroundColor', (WidgetTester tester) async { final MaterialStateColor snackBarActionBackgroundColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { if (states.contains(MaterialState.disabled)) { return Colors.amber; @@ -375,7 +374,7 @@ void main() { expect(materialAfterDismissed.color, Colors.amber); }); - testWidgetsWithLeakTracking('SnackBarThemeData asserts when actionBackgroundColor is a MaterialStateColor and disabledActionBackgroundColor is also provided', (WidgetTester tester) async { + testWidgets('SnackBarThemeData asserts when actionBackgroundColor is a MaterialStateColor and disabledActionBackgroundColor is also provided', (WidgetTester tester) async { final MaterialStateColor actionBackgroundColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { if (states.contains(MaterialState.disabled)) { return Colors.blue; @@ -411,7 +410,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SnackBar theme behavior is correct for floating', (WidgetTester tester) async { + testWidgets('SnackBar theme behavior is correct for floating', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData( snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating)), @@ -451,7 +450,7 @@ void main() { expect(snackBarBottomCenter.dy == floatingActionButtonTopCenter.dy, true); }); - testWidgetsWithLeakTracking('SnackBar theme behavior is correct for fixed', (WidgetTester tester) async { + testWidgets('SnackBar theme behavior is correct for fixed', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData( snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.fixed), @@ -532,7 +531,7 @@ void main() { ); } - testWidgetsWithLeakTracking('SnackBar theme behavior will assert properly for margin use', (WidgetTester tester) async { + testWidgets('SnackBar theme behavior will assert properly for margin use', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84935 // SnackBarBehavior.floating set in theme does not assert with margin await tester.pumpWidget(buildApp( @@ -571,7 +570,7 @@ void main() { }); } - testWidgetsWithLeakTracking('SnackBar theme behavior will assert properly for width use', (WidgetTester tester) async { + testWidgets('SnackBar theme behavior will assert properly for width use', (WidgetTester tester) async { // SnackBarBehavior.floating set in theme does not assert with width await tester.pumpWidget(buildApp( themedBehavior: SnackBarBehavior.floating, diff --git a/packages/flutter/test/material/spell_check_suggestions_toolbar_layout_delegate_test.dart b/packages/flutter/test/material/spell_check_suggestions_toolbar_layout_delegate_test.dart index 494dbe7308a..23465136512 100644 --- a/packages/flutter/test/material/spell_check_suggestions_toolbar_layout_delegate_test.dart +++ b/packages/flutter/test/material/spell_check_suggestions_toolbar_layout_delegate_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('positions itself at anchorAbove if it fits and shifts up when not', (WidgetTester tester) async { + testWidgets('positions itself at anchorAbove if it fits and shifts up when not', (WidgetTester tester) async { late StateSetter setState; const double toolbarOverlap = 100; const double height = 500; diff --git a/packages/flutter/test/material/spell_check_suggestions_toolbar_test.dart b/packages/flutter/test/material/spell_check_suggestions_toolbar_test.dart index e9bbc4950ea..66c668f671b 100644 --- a/packages/flutter/test/material/spell_check_suggestions_toolbar_test.dart +++ b/packages/flutter/test/material/spell_check_suggestions_toolbar_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // Vertical position at which to anchor the toolbar for testing. const double _kAnchor = 200; @@ -48,7 +47,7 @@ void main() { ); } - testWidgetsWithLeakTracking('positions toolbar below anchor when it fits above bottom view padding', (WidgetTester tester) async { + testWidgets('positions toolbar below anchor when it fits above bottom view padding', (WidgetTester tester) async { // We expect the toolbar to be positioned right below the anchor with padding accounted for. await tester.pumpWidget( MaterialApp( @@ -65,7 +64,7 @@ void main() { expect(toolbarY, equals(_kAnchor)); }); - testWidgetsWithLeakTracking('re-positions toolbar higher below anchor when it does not fit above bottom view padding', (WidgetTester tester) async { + testWidgets('re-positions toolbar higher below anchor when it does not fit above bottom view padding', (WidgetTester tester) async { // We expect the toolbar to be positioned _kTestToolbarOverlap pixels above the anchor. const double expectedToolbarY = _kAnchor - _kTestToolbarOverlap; @@ -84,7 +83,7 @@ void main() { expect(toolbarY, equals(expectedToolbarY)); }); - testWidgetsWithLeakTracking('more than three suggestions throws an error', (WidgetTester tester) async { + testWidgets('more than three suggestions throws an error', (WidgetTester tester) async { Future<void> pumpToolbar(List<String> suggestions) async { await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart index 405b7097a5e..4e80da4bd1e 100644 --- a/packages/flutter/test/material/stepper_test.dart +++ b/packages/flutter/test/material/stepper_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Material3 has sentence case labels', (WidgetTester tester) async { + testWidgets('Material3 has sentence case labels', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -39,7 +38,7 @@ void main() { expect(find.text('Cancel'), findsWidgets); }); - testWidgetsWithLeakTracking('Stepper tap callback test', (WidgetTester tester) async { + testWidgets('Stepper tap callback test', (WidgetTester tester) async { int index = 0; await tester.pumpWidget( @@ -73,7 +72,7 @@ void main() { expect(index, 1); }); - testWidgetsWithLeakTracking('Stepper expansion test', (WidgetTester tester) async { + testWidgets('Stepper expansion test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -140,7 +139,7 @@ void main() { expect(box.size.height, 432.0); }); - testWidgetsWithLeakTracking('Stepper horizontal size test', (WidgetTester tester) async { + testWidgets('Stepper horizontal size test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -166,7 +165,7 @@ void main() { expect(box.size.height, 600.0); }); - testWidgetsWithLeakTracking('Stepper visibility test', (WidgetTester tester) async { + testWidgets('Stepper visibility test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -215,7 +214,7 @@ void main() { expect(find.text('B'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - Stepper button test', (WidgetTester tester) async { + testWidgets('Material2 - Stepper button test', (WidgetTester tester) async { bool continuePressed = false; bool cancelPressed = false; @@ -259,7 +258,7 @@ void main() { expect(cancelPressed, isTrue); }); - testWidgetsWithLeakTracking('Material3 - Stepper button test', (WidgetTester tester) async { + testWidgets('Material3 - Stepper button test', (WidgetTester tester) async { bool continuePressed = false; bool cancelPressed = false; @@ -303,7 +302,7 @@ void main() { expect(cancelPressed, isTrue); }); - testWidgetsWithLeakTracking('Stepper disabled step test', (WidgetTester tester) async { + testWidgets('Stepper disabled step test', (WidgetTester tester) async { int index = 0; await tester.pumpWidget( @@ -339,7 +338,7 @@ void main() { expect(index, 0); }); - testWidgetsWithLeakTracking('Stepper scroll test', (WidgetTester tester) async { + testWidgets('Stepper scroll test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -413,7 +412,7 @@ void main() { expect(scrollableState.position.pixels, greaterThan(0.0)); }); - testWidgetsWithLeakTracking('Stepper index test', (WidgetTester tester) async { + testWidgets('Stepper index test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -446,7 +445,7 @@ void main() { expect(find.text('2'), findsOneWidget); }); - testWidgetsWithLeakTracking('Stepper custom controls test', (WidgetTester tester) async { + testWidgets('Stepper custom controls test', (WidgetTester tester) async { bool continuePressed = false; void setContinue() { continuePressed = true; @@ -525,7 +524,7 @@ void main() { expect(continuePressed, isTrue); }); -testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTester tester) async { +testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async { int currentStep = 0; void setContinue() { @@ -620,7 +619,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(find.text('Continue to 2'), findsNWidgets(1)); }); - testWidgetsWithLeakTracking('Stepper error test', (WidgetTester tester) async { + testWidgets('Stepper error test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -645,7 +644,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(find.text('!'), findsOneWidget); }); - testWidgetsWithLeakTracking('Nested stepper error test', (WidgetTester tester) async { + testWidgets('Nested stepper error test', (WidgetTester tester) async { late FlutterErrorDetails errorDetails; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails details) { @@ -712,7 +711,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste }); ///https://github.com/flutter/flutter/issues/16920 - testWidgetsWithLeakTracking('Stepper icons size test', (WidgetTester tester) async { + testWidgets('Stepper icons size test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -741,7 +740,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(renderObject.size, equals(const Size.square(18.0))); }); - testWidgetsWithLeakTracking('Stepper physics scroll error test', (WidgetTester tester) async { + testWidgets('Stepper physics scroll error test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -774,7 +773,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(find.text('Text After Stepper'), findsNothing); }); - testWidgetsWithLeakTracking("Vertical Stepper can't be focused when disabled.", (WidgetTester tester) async { + testWidgets("Vertical Stepper can't be focused when disabled.", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -798,7 +797,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(disabledNode.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking("Horizontal Stepper can't be focused when disabled.", (WidgetTester tester) async { + testWidgets("Horizontal Stepper can't be focused when disabled.", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -823,7 +822,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(disabledNode.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('Stepper header title should not overflow', (WidgetTester tester) async { + testWidgets('Stepper header title should not overflow', (WidgetTester tester) async { const String longText = 'A long long long long long long long long long long long long text'; @@ -849,7 +848,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Stepper header subtitle should not overflow', (WidgetTester tester) async { + testWidgets('Stepper header subtitle should not overflow', (WidgetTester tester) async { const String longText = 'A long long long long long long long long long long long long text'; @@ -876,7 +875,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Material2 - Stepper enabled button styles', (WidgetTester tester) async { + testWidgets('Material2 - Stepper enabled button styles', (WidgetTester tester) async { Widget buildFrame(ThemeData theme) { return MaterialApp( theme: theme, @@ -936,7 +935,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(tester.getRect(find.widgetWithText(TextButton, cancelStr)), cancelButtonRect); }); - testWidgetsWithLeakTracking('Material3 - Stepper enabled button styles', (WidgetTester tester) async { + testWidgets('Material3 - Stepper enabled button styles', (WidgetTester tester) async { Widget buildFrame(ThemeData theme) { return MaterialApp( theme: theme, @@ -1008,7 +1007,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste ); }); - testWidgetsWithLeakTracking('Material2 - Stepper disabled button styles', (WidgetTester tester) async { + testWidgets('Material2 - Stepper disabled button styles', (WidgetTester tester) async { Widget buildFrame(ThemeData theme) { return MaterialApp( theme: theme, @@ -1054,7 +1053,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(buttonMaterial(cancelStr).textStyle!.color!.value, 0x61ffffff); }); - testWidgetsWithLeakTracking('Material3 - Stepper disabled button styles', (WidgetTester tester) async { + testWidgets('Material3 - Stepper disabled button styles', (WidgetTester tester) async { Widget buildFrame(ThemeData theme) { return MaterialApp( theme: theme, @@ -1114,7 +1113,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste ); }); - testWidgetsWithLeakTracking('Vertical and Horizontal Stepper physics test', (WidgetTester tester) async { + testWidgets('Vertical and Horizontal Stepper physics test', (WidgetTester tester) async { const ScrollPhysics physics = NeverScrollableScrollPhysics(); for (final StepperType type in StepperType.values) { @@ -1143,7 +1142,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste } }); - testWidgetsWithLeakTracking('ScrollController is passed to the stepper listview', (WidgetTester tester) async { + testWidgets('ScrollController is passed to the stepper listview', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(() => controller.dispose()); for (final StepperType type in StepperType.values) { @@ -1175,7 +1174,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste } }); - testWidgetsWithLeakTracking('Stepper horizontal size test', (WidgetTester tester) async { + testWidgets('Stepper horizontal size test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/77732 Widget buildFrame({ bool isActive = true, Brightness? brightness }) { return MaterialApp( @@ -1220,7 +1219,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(circleFillColor(), dark.background); }); - testWidgetsWithLeakTracking('Stepper custom elevation', (WidgetTester tester) async { + testWidgets('Stepper custom elevation', (WidgetTester tester) async { const double elevation = 4.0; await tester.pumpWidget( @@ -1254,7 +1253,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(material.elevation, elevation); }); - testWidgetsWithLeakTracking('Stepper with default elevation', (WidgetTester tester) async { + testWidgets('Stepper with default elevation', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( @@ -1286,7 +1285,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(material.elevation, 2.0); }); - testWidgetsWithLeakTracking('Stepper horizontal preserves state', (WidgetTester tester) async { + testWidgets('Stepper horizontal preserves state', (WidgetTester tester) async { const Color untappedColor = Colors.blue; const Color tappedColor = Colors.red; int index = 0; @@ -1357,7 +1356,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste // The color should still be `tappedColor` expect(getColor(), tappedColor); }); - testWidgetsWithLeakTracking('Stepper custom margin', (WidgetTester tester) async { + testWidgets('Stepper custom margin', (WidgetTester tester) async { const EdgeInsetsGeometry margin = EdgeInsetsDirectional.only( bottom: 20, @@ -1394,7 +1393,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(material.margin, equals(margin)); }); - testWidgetsWithLeakTracking('Stepper with Alternative Label', (WidgetTester tester) async { + testWidgets('Stepper with Alternative Label', (WidgetTester tester) async { int index = 0; late TextStyle bodyLargeStyle; late TextStyle bodyMediumStyle; @@ -1478,7 +1477,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(bodyMediumStyle, nextLabelTextWidget.style); }); - testWidgetsWithLeakTracking('Stepper Connector Style', (WidgetTester tester) async { + testWidgets('Stepper Connector Style', (WidgetTester tester) async { const Color selectedColor = Colors.black; const Color disabledColor = Colors.white; int index = 0; @@ -1547,7 +1546,7 @@ testWidgetsWithLeakTracking('Stepper custom indexed controls test', (WidgetTeste expect(lineColor('line0'), selectedColor); }); - testWidgetsWithLeakTracking('Stepper stepIconBuilder test', (WidgetTester tester) async { + testWidgets('Stepper stepIconBuilder test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( diff --git a/packages/flutter/test/material/switch_list_tile_test.dart b/packages/flutter/test/material/switch_list_tile_test.dart index f9cf794b730..14c0c01af4c 100644 --- a/packages/flutter/test/material/switch_list_tile_test.dart +++ b/packages/flutter/test/material/switch_list_tile_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -23,7 +22,7 @@ Widget wrap({ required Widget child }) { } void main() { - testWidgetsWithLeakTracking('SwitchListTile control test', (WidgetTester tester) async { + testWidgets('SwitchListTile control test', (WidgetTester tester) async { final List<dynamic> log = <dynamic>[]; await tester.pumpWidget(wrap( child: SwitchListTile( @@ -38,7 +37,7 @@ void main() { expect(log, equals(<dynamic>[false, '-', false])); }); - testWidgetsWithLeakTracking('SwitchListTile semantics test', (WidgetTester tester) async { + testWidgets('SwitchListTile semantics test', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(wrap( child: Column( @@ -116,7 +115,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material2 - SwitchListTile has the right colors', (WidgetTester tester) async { + testWidgets('Material2 - SwitchListTile has the right colors', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( MediaQuery( @@ -172,7 +171,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - SwitchListTile has the right colors', (WidgetTester tester) async { + testWidgets('Material3 - SwitchListTile has the right colors', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( MediaQuery( @@ -223,7 +222,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SwitchListTile.adaptive only uses material switch', (WidgetTester tester) async { + testWidgets('SwitchListTile.adaptive only uses material switch', (WidgetTester tester) async { bool value = false; Widget buildFrame(TargetPlatform platform) { @@ -262,7 +261,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SwitchListTile contentPadding', (WidgetTester tester) async { + testWidgets('SwitchListTile contentPadding', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MediaQuery( data: const MediaQueryData(), @@ -300,7 +299,7 @@ void main() { expect(tester.getTopRight(find.text('L')).dx, 790.0); // 800 - contentPadding.start }); - testWidgetsWithLeakTracking('SwitchListTile can autofocus unless disabled.', (WidgetTester tester) async { + testWidgets('SwitchListTile can autofocus unless disabled.', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( @@ -344,7 +343,7 @@ void main() { expect(Focus.of(childKey.currentContext!).hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('SwitchListTile controlAffinity test', (WidgetTester tester) async { + testWidgets('SwitchListTile controlAffinity test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: SwitchListTile( @@ -364,7 +363,7 @@ void main() { expect(listTile.trailing.runtimeType, Icon); }); - testWidgetsWithLeakTracking('SwitchListTile controlAffinity default value test', (WidgetTester tester) async { + testWidgets('SwitchListTile controlAffinity default value test', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: SwitchListTile( @@ -384,7 +383,7 @@ void main() { expect(listTile.trailing.runtimeType, Switch); }); - testWidgetsWithLeakTracking('SwitchListTile respects shape', (WidgetTester tester) async { + testWidgets('SwitchListTile respects shape', (WidgetTester tester) async { const ShapeBorder shapeBorder = RoundedRectangleBorder( borderRadius: BorderRadius.horizontal(right: Radius.circular(100)), ); @@ -403,7 +402,7 @@ void main() { expect(tester.widget<InkWell>(find.byType(InkWell)).customBorder, shapeBorder); }); - testWidgetsWithLeakTracking('SwitchListTile respects tileColor', (WidgetTester tester) async { + testWidgets('SwitchListTile respects tileColor', (WidgetTester tester) async { final Color tileColor = Colors.red.shade500; await tester.pumpWidget( @@ -422,7 +421,7 @@ void main() { expect(find.byType(Material), paints..rect(color: tileColor)); }); - testWidgetsWithLeakTracking('SwitchListTile respects selectedTileColor', (WidgetTester tester) async { + testWidgets('SwitchListTile respects selectedTileColor', (WidgetTester tester) async { final Color selectedTileColor = Colors.green.shade500; await tester.pumpWidget( @@ -442,7 +441,7 @@ void main() { expect(find.byType(Material), paints..rect(color: selectedTileColor)); }); - testWidgetsWithLeakTracking('SwitchListTile selected item text Color', (WidgetTester tester) async { + testWidgets('SwitchListTile selected item text Color', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/76909 const Color activeColor = Color(0xff00ff00); @@ -481,7 +480,7 @@ void main() { expect(textColor('title'), activeColor); }); - testWidgetsWithLeakTracking('SwitchListTile respects visualDensity', (WidgetTester tester) async { + testWidgets('SwitchListTile respects visualDensity', (WidgetTester tester) async { const Key key = Key('test'); Future<void> buildTest(VisualDensity visualDensity) async { return tester.pumpWidget( @@ -505,7 +504,7 @@ void main() { expect(box.size, equals(const Size(800, 56))); }); - testWidgetsWithLeakTracking('SwitchListTile respects focusNode', (WidgetTester tester) async { + testWidgets('SwitchListTile respects focusNode', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); await tester.pumpWidget( wrap( @@ -527,7 +526,7 @@ void main() { expect(tileNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('SwitchListTile onFocusChange callback', (WidgetTester tester) async { + testWidgets('SwitchListTile onFocusChange callback', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'SwitchListTile onFocusChange'); bool gotFocus = false; await tester.pumpWidget( @@ -557,7 +556,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('SwitchListTile.adaptive onFocusChange Callback', (WidgetTester tester) async { + testWidgets('SwitchListTile.adaptive onFocusChange Callback', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'SwitchListTile.adaptive onFocusChange'); bool gotFocus = false; await tester.pumpWidget( @@ -598,7 +597,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('SwitchListTile respects enableFeedback', (WidgetTester tester) async { + testWidgets('SwitchListTile respects enableFeedback', (WidgetTester tester) async { Future<void> buildTest(bool enableFeedback) async { return tester.pumpWidget( wrap( @@ -627,7 +626,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('SwitchListTile respects hoverColor', (WidgetTester tester) async { + testWidgets('SwitchListTile respects hoverColor', (WidgetTester tester) async { const Key key = Key('test'); await tester.pumpWidget( wrap( @@ -667,7 +666,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - SwitchListTile respects thumbColor in active/enabled states', (WidgetTester tester) async { + testWidgets('Material2 - SwitchListTile respects thumbColor in active/enabled states', (WidgetTester tester) async { const Color activeEnabledThumbColor = Color(0xFF000001); const Color activeDisabledThumbColor = Color(0xFF000002); const Color inactiveEnabledThumbColor = Color(0xFF000003); @@ -735,7 +734,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - SwitchListTile respects thumbColor in active/enabled states', (WidgetTester tester) async { + testWidgets('Material3 - SwitchListTile respects thumbColor in active/enabled states', (WidgetTester tester) async { const Color activeEnabledThumbColor = Color(0xFF000001); const Color activeDisabledThumbColor = Color(0xFF000002); const Color inactiveEnabledThumbColor = Color(0xFF000003); @@ -803,7 +802,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - SwitchListTile respects thumbColor in hovered/pressed states', (WidgetTester tester) async { + testWidgets('Material2 - SwitchListTile respects thumbColor in hovered/pressed states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredThumbColor = Color(0xFF4caf50); const Color pressedThumbColor = Color(0xFFF44336); @@ -859,7 +858,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - SwitchListTile respects thumbColor in hovered/pressed states', (WidgetTester tester) async { + testWidgets('Material3 - SwitchListTile respects thumbColor in hovered/pressed states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredThumbColor = Color(0xFF4caf50); const Color pressedThumbColor = Color(0xFFF44336); @@ -915,7 +914,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SwitchListTile respects trackColor in active/enabled states', (WidgetTester tester) async { + testWidgets('SwitchListTile respects trackColor in active/enabled states', (WidgetTester tester) async { const Color activeEnabledTrackColor = Color(0xFF000001); const Color activeDisabledTrackColor = Color(0xFF000002); const Color inactiveEnabledTrackColor = Color(0xFF000003); @@ -980,7 +979,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SwitchListTile respects trackColor in hovered states', (WidgetTester tester) async { + testWidgets('SwitchListTile respects trackColor in hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredTrackColor = Color(0xFF4caf50); @@ -1021,7 +1020,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SwitchListTile respects thumbIcon - M3', (WidgetTester tester) async { + testWidgets('SwitchListTile respects thumbIcon - M3', (WidgetTester tester) async { const Icon activeIcon = Icon(Icons.check); const Icon inactiveIcon = Icon(Icons.close); @@ -1106,7 +1105,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Material2 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { Widget buildSwitchListTile(MaterialTapTargetSize materialTapTargetSize) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1134,7 +1133,7 @@ void main() { expect(tester.getSize(find.byType(Switch)), const Size(59.0, 40.0)); }); - testWidgetsWithLeakTracking('Material3 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Material3 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { Widget buildSwitchListTile(MaterialTapTargetSize materialTapTargetSize) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1162,7 +1161,7 @@ void main() { expect(tester.getSize(find.byType(Switch)), const Size(60.0, 40.0)); }); - testWidgetsWithLeakTracking('Material2 - SwitchListTile.adaptive respects applyCupertinoTheme', (WidgetTester tester) async { + testWidgets('Material2 - SwitchListTile.adaptive respects applyCupertinoTheme', (WidgetTester tester) async { Widget buildSwitchListTile(bool applyCupertinoTheme, TargetPlatform platform) { return MaterialApp( theme: ThemeData(useMaterial3: false, platform: platform), @@ -1198,7 +1197,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material3 - SwitchListTile.adaptive respects applyCupertinoTheme', (WidgetTester tester) async { + testWidgets('Material3 - SwitchListTile.adaptive respects applyCupertinoTheme', (WidgetTester tester) async { Widget buildSwitchListTile(bool applyCupertinoTheme, TargetPlatform platform) { return MaterialApp( theme: ThemeData(useMaterial3: true, platform: platform), @@ -1234,7 +1233,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Material2 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Material2 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { Widget buildSwitchListTile(MaterialTapTargetSize materialTapTargetSize) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1262,7 +1261,7 @@ void main() { expect(tester.getSize(find.byType(Switch)), const Size(59.0, 40.0)); }); - testWidgetsWithLeakTracking('Material3 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Material3 - SwitchListTile respects materialTapTargetSize', (WidgetTester tester) async { Widget buildSwitchListTile(MaterialTapTargetSize materialTapTargetSize) { return MaterialApp( theme: ThemeData(useMaterial3: true), @@ -1290,7 +1289,7 @@ void main() { expect(tester.getSize(find.byType(Switch)), const Size(60.0, 40.0)); }); - testWidgetsWithLeakTracking('SwitchListTile passes the value of dragStartBehavior to Switch', (WidgetTester tester) async { + testWidgets('SwitchListTile passes the value of dragStartBehavior to Switch', (WidgetTester tester) async { Widget buildSwitchListTile(DragStartBehavior dragStartBehavior) { return wrap( child: StatefulBuilder( @@ -1313,7 +1312,7 @@ void main() { expect(switchWidget1.dragStartBehavior, DragStartBehavior.down); }); - testWidgetsWithLeakTracking('Switch on SwitchListTile changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Switch on SwitchListTile changes mouse cursor when hovered', (WidgetTester tester) async { // Test SwitchListTile.adaptive() constructor await tester.pumpWidget(wrap( child: StatefulBuilder( @@ -1374,7 +1373,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('Switch with splash radius set', (WidgetTester tester) async { + testWidgets('Switch with splash radius set', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double splashRadius = 35; await tester.pumpWidget(wrap( @@ -1400,7 +1399,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The overlay color for the thumb of the switch resolves in active/pressed/hovered states', (WidgetTester tester) async { + testWidgets('The overlay color for the thumb of the switch resolves in active/pressed/hovered states', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color activeThumbColor = Color(0xFF000000); const Color inactiveThumbColor = Color(0xFF000010); @@ -1521,7 +1520,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SwitchListTile respects trackOutlineColor in active/enabled states', (WidgetTester tester) async { + testWidgets('SwitchListTile respects trackOutlineColor in active/enabled states', (WidgetTester tester) async { const Color activeEnabledTrackOutlineColor = Color(0xFF000001); const Color activeDisabledTrackOutlineColor = Color(0xFF000002); const Color inactiveEnabledTrackOutlineColor = Color(0xFF000003); @@ -1590,7 +1589,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SwitchListTile respects trackOutlineColor in hovered state', (WidgetTester tester) async { + testWidgets('SwitchListTile respects trackOutlineColor in hovered state', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredTrackColor = Color(0xFF4caf50); diff --git a/packages/flutter/test/material/switch_test.dart b/packages/flutter/test/material/switch_test.dart index fd8907fcd79..596a749c97a 100644 --- a/packages/flutter/test/material/switch_test.dart +++ b/packages/flutter/test/material/switch_test.dart @@ -17,13 +17,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { final ThemeData theme = ThemeData(); - testWidgetsWithLeakTracking('Switch can toggle on tap', (WidgetTester tester) async { + testWidgets('Switch can toggle on tap', (WidgetTester tester) async { final Key switchKey = UniqueKey(); bool value = false; @@ -59,7 +58,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('Switch size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Switch size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { final bool material3 = theme.useMaterial3; await tester.pumpWidget( Theme( @@ -105,7 +104,7 @@ void main() { expect(tester.getSize(find.byType(Switch)), material3 ? const Size(60.0, 40.0) : const Size(59.0, 40.0)); }); - testWidgetsWithLeakTracking('Material2 - Switch does not get distorted upon changing constraints with parent', (WidgetTester tester) async { + testWidgets('Material2 - Switch does not get distorted upon changing constraints with parent', (WidgetTester tester) async { const double maxWidth = 300; const double maxHeight = 100; @@ -157,7 +156,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch does not get distorted upon changing constraints with parent', (WidgetTester tester) async { + testWidgets('Material3 - Switch does not get distorted upon changing constraints with parent', (WidgetTester tester) async { const double maxWidth = 300; const double maxHeight = 100; @@ -209,7 +208,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch can drag (LTR)', (WidgetTester tester) async { + testWidgets('Switch can drag (LTR)', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -259,7 +258,7 @@ void main() { expect(value, isFalse); }); - testWidgetsWithLeakTracking('Switch can drag with dragStartBehavior', (WidgetTester tester) async { + testWidgets('Switch can drag with dragStartBehavior', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -351,7 +350,7 @@ void main() { expect(value, isFalse); }); - testWidgetsWithLeakTracking('Switch can drag (RTL)', (WidgetTester tester) async { + testWidgets('Switch can drag (RTL)', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -399,7 +398,7 @@ void main() { expect(value, isFalse); }); - testWidgetsWithLeakTracking('Material2 - Switch has default colors when enabled', (WidgetTester tester) async { + testWidgets('Material2 - Switch has default colors when enabled', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( MaterialApp( @@ -460,7 +459,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch has default colors when enabled', (WidgetTester tester) async { + testWidgets('Material3 - Switch has default colors when enabled', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colors = theme.colorScheme; bool value = false; @@ -525,7 +524,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch.adaptive(Cupertino) has default colors when enabled', (WidgetTester tester) async { + testWidgets('Switch.adaptive(Cupertino) has default colors when enabled', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colors = theme.colorScheme; bool value = false; @@ -590,7 +589,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch has default colors when disabled', (WidgetTester tester) async { + testWidgets('Material2 - Switch has default colors when disabled', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -656,7 +655,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Inactive Switch has default colors when disabled', (WidgetTester tester) async { + testWidgets('Material3 - Inactive Switch has default colors when disabled', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; @@ -694,7 +693,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Active Switch has default colors when disabled', (WidgetTester tester) async { + testWidgets('Material3 - Active Switch has default colors when disabled', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; await tester.pumpWidget(MaterialApp( @@ -727,7 +726,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch default overlayColor resolves hovered/focused state', (WidgetTester tester) async { + testWidgets('Material2 - Switch default overlayColor resolves hovered/focused state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; Finder findSwitch() { @@ -773,7 +772,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Switch default overlayColor resolves hovered/focused state', (WidgetTester tester) async { + testWidgets('Material3 - Switch default overlayColor resolves hovered/focused state', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -820,7 +819,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Switch can be set color', (WidgetTester tester) async { + testWidgets('Material2 - Switch can be set color', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( MaterialApp( @@ -883,7 +882,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch can be set color', (WidgetTester tester) async { + testWidgets('Material3 - Switch can be set color', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; @@ -948,7 +947,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Drag ends after animation completes', (WidgetTester tester) async { + testWidgets('Drag ends after animation completes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17773 bool value = false; @@ -993,7 +992,7 @@ void main() { expect(tester.hasRunningAnimations, false); }); - testWidgetsWithLeakTracking('can veto switch dragging result', (WidgetTester tester) async { + testWidgets('can veto switch dragging result', (WidgetTester tester) async { bool value = false; await tester.pumpWidget( @@ -1074,7 +1073,7 @@ void main() { expect(state.position.value, 1.0); }); - testWidgetsWithLeakTracking('switch has semantic events', (WidgetTester tester) async { + testWidgets('switch has semantic events', (WidgetTester tester) async { dynamic semanticEvent; bool value = false; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { @@ -1121,7 +1120,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('switch sends semantic events from parent if fully merged', (WidgetTester tester) async { + testWidgets('switch sends semantic events from parent if fully merged', (WidgetTester tester) async { dynamic semanticEvent; bool value = false; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { @@ -1172,7 +1171,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('Switch.adaptive', (WidgetTester tester) async { + testWidgets('Switch.adaptive', (WidgetTester tester) async { bool value = false; const Color activeTrackColor = Color(0xffff1200); const Color inactiveTrackColor = Color(0xffff12ff); @@ -1233,7 +1232,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Switch.adaptive default mouse cursor(Cupertino)', (WidgetTester tester) async { + testWidgets('Switch.adaptive default mouse cursor(Cupertino)', (WidgetTester tester) async { for (final TargetPlatform platform in <TargetPlatform>[ TargetPlatform.iOS, TargetPlatform.macOS ]) { await tester.pumpWidget(buildAdaptiveSwitch( platform: platform, @@ -1260,7 +1259,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Switch.adaptive default thumb/track color and size(Cupertino)', (WidgetTester tester) async { + testWidgets('Switch.adaptive default thumb/track color and size(Cupertino)', (WidgetTester tester) async { const Color thumbColor = Colors.white; const Color inactiveTrackColor = Color.fromARGB(40, 120, 120, 128); // Default inactive track color. const Color activeTrackColor = Color.fromARGB(255, 52, 199, 89); // Default active track color. @@ -1379,7 +1378,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Default Switch.adaptive are not affected by ' + testWidgets('Default Switch.adaptive are not affected by ' 'ThemeData.switchThemeData on iOS/macOS', (WidgetTester tester) async { const Color defaultThumbColor = Colors.white; const Color defaultInactiveTrackColor = Color.fromARGB(40, 120, 120, 128); @@ -1485,7 +1484,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default Switch.adaptive are not affected by ' + testWidgets('Default Switch.adaptive are not affected by ' 'SwitchThemeData on iOS/macOS', (WidgetTester tester) async { const Color defaultThumbColor = Colors.white; const Color defaultInactiveTrackColor = Color.fromARGB(40, 120, 120, 128); @@ -1591,7 +1590,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Override default adaptive SwitchThemeData on iOS/macOS', (WidgetTester tester) async { + testWidgets('Override default adaptive SwitchThemeData on iOS/macOS', (WidgetTester tester) async { for (final TargetPlatform platform in <TargetPlatform>[ TargetPlatform.iOS, TargetPlatform.macOS ]) { await tester.pumpWidget(Container()); await tester.pumpWidget( @@ -1644,7 +1643,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Switch.adaptive default focus color(Cupertino)', (WidgetTester tester) async { + testWidgets('Switch.adaptive default focus color(Cupertino)', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final FocusNode node = FocusNode(); addTearDown(node.dispose); @@ -1690,7 +1689,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material2 - Switch is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool value = true; @@ -1775,7 +1774,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Switch is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material3 - Switch is focusable and has correct focus color', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); @@ -1864,7 +1863,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Switch with splash radius set', (WidgetTester tester) async { + testWidgets('Switch with splash radius set', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double splashRadius = 30; Widget buildApp() { @@ -1891,7 +1890,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Material2 - Switch can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool value = true; Widget buildApp({bool enabled = true}) { @@ -1969,7 +1968,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch can be hovered and has correct hover color', (WidgetTester tester) async { + testWidgets('Material3 - Switch can be hovered and has correct hover color', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -2041,7 +2040,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch can be toggled by keyboard shortcuts', (WidgetTester tester) async { + testWidgets('Switch can be toggled by keyboard shortcuts', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool value = true; Widget buildApp({bool enabled = true}) { @@ -2082,7 +2081,7 @@ void main() { expect(value, isTrue); }); - testWidgetsWithLeakTracking('Switch changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Switch changes mouse cursor when hovered', (WidgetTester tester) async { // Test Switch.adaptive() constructor await tester.pumpWidget( MaterialApp( @@ -2186,7 +2185,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Material switch should not recreate its render object when disabled', (WidgetTester tester) async { + testWidgets('Material switch should not recreate its render object when disabled', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/61247. bool value = true; bool enabled = true; @@ -2233,7 +2232,7 @@ void main() { expect(updatedSwitchState.position.isDismissed, false); }); - testWidgetsWithLeakTracking('Material2 - Switch thumb color resolves in active/enabled states', (WidgetTester tester) async { + testWidgets('Material2 - Switch thumb color resolves in active/enabled states', (WidgetTester tester) async { const Color activeEnabledThumbColor = Color(0xFF000001); const Color activeDisabledThumbColor = Color(0xFF000002); const Color inactiveEnabledThumbColor = Color(0xFF000003); @@ -2345,7 +2344,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch thumb color resolves in active/enabled states', (WidgetTester tester) async { + testWidgets('Material3 - Switch thumb color resolves in active/enabled states', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; const Color activeEnabledThumbColor = Color(0xFF000001); @@ -2454,7 +2453,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch thumb color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Material2 - Switch thumb color resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredThumbColor = Color(0xFF000001); @@ -2532,7 +2531,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Switch thumb color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Material3 - Switch thumb color resolves in hovered/focused states', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); @@ -2610,7 +2609,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Track color resolves in active/enabled states', (WidgetTester tester) async { + testWidgets('Material2 - Track color resolves in active/enabled states', (WidgetTester tester) async { const Color activeEnabledTrackColor = Color(0xFF000001); const Color activeDisabledTrackColor = Color(0xFF000002); const Color inactiveEnabledTrackColor = Color(0xFF000003); @@ -2699,7 +2698,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Track color resolves in active/enabled states', (WidgetTester tester) async { + testWidgets('Material3 - Track color resolves in active/enabled states', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); const Color activeEnabledTrackColor = Color(0xFF000001); const Color activeDisabledTrackColor = Color(0xFF000002); @@ -2792,7 +2791,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch track color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Material2 - Switch track color resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredTrackColor = Color(0xFF000001); @@ -2863,7 +2862,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material3 - Switch track color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Material3 - Switch track color resolves in hovered/focused states', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -2935,7 +2934,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Switch thumb color is blended against surface color', (WidgetTester tester) async { + testWidgets('Material2 - Switch thumb color is blended against surface color', (WidgetTester tester) async { final Color activeDisabledThumbColor = Colors.blue.withOpacity(.60); final ThemeData theme = ThemeData.light(useMaterial3: false); @@ -2987,7 +2986,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch thumb color is blended against surface color', (WidgetTester tester) async { + testWidgets('Material3 - Switch thumb color is blended against surface color', (WidgetTester tester) async { final Color activeDisabledThumbColor = Colors.blue.withOpacity(.60); final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colors = theme.colorScheme; @@ -3037,7 +3036,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch overlay color resolves in active/pressed/focused/hovered states', (WidgetTester tester) async { + testWidgets('Switch overlay color resolves in active/pressed/focused/hovered states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -3190,7 +3189,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { + testWidgets('Do not crash when widget disappears while pointer is down', (WidgetTester tester) async { Widget buildSwitch(bool show) { return MaterialApp( theme: theme, @@ -3214,7 +3213,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('disabled switch shows tooltip', (WidgetTester tester) async { + testWidgets('disabled switch shows tooltip', (WidgetTester tester) async { const String longPressTooltip = 'long press tooltip'; const String tapTooltip = 'tap tooltip'; await tester.pumpWidget( @@ -3281,7 +3280,7 @@ void main() { image = await createTestImage(width: 100, height: 100); }); - testWidgetsWithLeakTracking('thumb image shows up', (WidgetTester tester) async { + testWidgets('thumb image shows up', (WidgetTester tester) async { imageCache.clear(); final _TestImageProvider provider1 = _TestImageProvider(); final _TestImageProvider provider2 = _TestImageProvider(); @@ -3322,7 +3321,7 @@ void main() { expect(imageCache.liveImageCount, 2); }); - testWidgetsWithLeakTracking('do not crash when imageProvider completes after Switch is disposed', (WidgetTester tester) async { + testWidgets('do not crash when imageProvider completes after Switch is disposed', (WidgetTester tester) async { final DelayedImageProvider imageProvider = DelayedImageProvider(image); await tester.pumpWidget( @@ -3350,7 +3349,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('do not crash when previous imageProvider completes after Switch is disposed', (WidgetTester tester) async { + testWidgets('do not crash when previous imageProvider completes after Switch is disposed', (WidgetTester tester) async { final DelayedImageProvider imageProvider1 = DelayedImageProvider(image); final DelayedImageProvider imageProvider2 = DelayedImageProvider(image); @@ -3391,7 +3390,7 @@ void main() { }); group('Switch M3 only tests', () { - testWidgetsWithLeakTracking('M3 Switch has a 300-millisecond animation in total', (WidgetTester tester) async { + testWidgets('M3 Switch has a 300-millisecond animation in total', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); bool value = false; await tester.pumpWidget( @@ -3431,7 +3430,7 @@ void main() { expect(tester.hasRunningAnimations, false); }); - testWidgetsWithLeakTracking('M3 Switch has a stadium shape in the middle of the track', (WidgetTester tester) async { + testWidgets('M3 Switch has a stadium shape in the middle of the track', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true, colorSchemeSeed: Colors.deepPurple); bool value = false; await tester.pumpWidget( @@ -3476,7 +3475,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('M3 Switch thumb bounces in the end of the animation', (WidgetTester tester) async { + testWidgets('M3 Switch thumb bounces in the end of the animation', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); bool value = false; await tester.pumpWidget( @@ -3525,7 +3524,7 @@ void main() { expect(state.position.value, greaterThan(1)); }); - testWidgetsWithLeakTracking('Switch thumb shows correct pressed color - M3', (WidgetTester tester) async { + testWidgets('Switch thumb shows correct pressed color - M3', (WidgetTester tester) async { final ThemeData themeData = ThemeData(useMaterial3: true); final ColorScheme colors = themeData.colorScheme; Widget buildApp({bool enabled = true, bool value = true}) { @@ -3608,7 +3607,7 @@ void main() { ); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('Track outline color resolves in active/enabled states', (WidgetTester tester) async { + testWidgets('Track outline color resolves in active/enabled states', (WidgetTester tester) async { const Color activeEnabledTrackOutlineColor = Color(0xFF000001); const Color activeDisabledTrackOutlineColor = Color(0xFF000002); const Color inactiveEnabledTrackOutlineColor = Color(0xFF000003); @@ -3684,7 +3683,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch track outline color resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Switch track outline color resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredTrackOutlineColor = Color(0xFF000001); @@ -3745,7 +3744,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Track outline width resolves in active/enabled states', (WidgetTester tester) async { + testWidgets('Track outline width resolves in active/enabled states', (WidgetTester tester) async { const double activeEnabledTrackOutlineWidth = 1.0; const double activeDisabledTrackOutlineWidth = 2.0; const double inactiveEnabledTrackOutlineWidth = 3.0; @@ -3821,7 +3820,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch track outline width resolves in hovered/focused states', (WidgetTester tester) async { + testWidgets('Switch track outline width resolves in hovered/focused states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const double hoveredTrackOutlineWidth = 4.0; @@ -3882,7 +3881,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Switch can set icon - M3', (WidgetTester tester) async { + testWidgets('Switch can set icon - M3', (WidgetTester tester) async { final ThemeData themeData = ThemeData( useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4), @@ -3963,7 +3962,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Switch.adaptive(Cupertino) is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Switch.adaptive(Cupertino) is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch.adaptive'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -4049,7 +4048,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Switch.onFocusChange callback', (WidgetTester tester) async { + testWidgets('Switch.onFocusChange callback', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); bool focused = false; await tester.pumpWidget(MaterialApp( diff --git a/packages/flutter/test/material/switch_theme_test.dart b/packages/flutter/test/material/switch_theme_test.dart index 6ddd3bcb162..cd4337383b7 100644 --- a/packages/flutter/test/material/switch_theme_test.dart +++ b/packages/flutter/test/material/switch_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('SwitchThemeData copyWith, ==, hashCode basics', () { @@ -43,7 +42,7 @@ void main() { expect(theme.data.thumbIcon, null); }); - testWidgetsWithLeakTracking('Default SwitchThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default SwitchThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SwitchThemeData().debugFillProperties(builder); @@ -55,7 +54,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('SwitchThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('SwitchThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SwitchThemeData( thumbColor: MaterialStatePropertyAll<Color>(Color(0xfffffff0)), @@ -85,7 +84,7 @@ void main() { expect(description[8], 'thumbIcon: MaterialStatePropertyAll(Icon(IconData(U+0007B)))'); }); - testWidgetsWithLeakTracking('Material2 - Switch is themeable', (WidgetTester tester) async { + testWidgets('Material2 - Switch is themeable', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color defaultThumbColor = Color(0xfffffff0); @@ -208,7 +207,7 @@ void main() { expect(_getSwitchMaterial(tester), paints..circle(color: focusOverlayColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Material3 - Switch is themeable', (WidgetTester tester) async { + testWidgets('Material3 - Switch is themeable', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color defaultThumbColor = Color(0xfffffff0); @@ -326,7 +325,7 @@ void main() { expect(_getSwitchMaterial(tester), paints..circle(color: focusOverlayColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Material2 - Switch properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('Material2 - Switch properties are taken over the theme values', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color themeDefaultThumbColor = Color(0xfffffff0); @@ -496,7 +495,7 @@ void main() { expect(_getSwitchMaterial(tester), paints..circle(color: focusColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Material3 - Switch properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('Material3 - Switch properties are taken over the theme values', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color themeDefaultThumbColor = Color(0xfffffff0); @@ -659,7 +658,7 @@ void main() { expect(_getSwitchMaterial(tester), paints..circle(color: focusColor, radius: splashRadius)); }); - testWidgetsWithLeakTracking('Material2 - Switch active and inactive properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('Material2 - Switch active and inactive properties are taken over the theme values', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color themeDefaultThumbColor = Color(0xfffffff0); @@ -736,7 +735,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch active and inactive properties are taken over the theme values', (WidgetTester tester) async { + testWidgets('Material3 - Switch active and inactive properties are taken over the theme values', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color themeDefaultThumbColor = Color(0xfffffff0); @@ -807,7 +806,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Switch theme overlay color resolves in active/pressed states', (WidgetTester tester) async { + testWidgets('Material2 - Switch theme overlay color resolves in active/pressed states', (WidgetTester tester) async { const Color activePressedOverlayColor = Color(0xFF000001); const Color inactivePressedOverlayColor = Color(0xFF000002); @@ -872,7 +871,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Switch theme overlay color resolves in active/pressed states', (WidgetTester tester) async { + testWidgets('Material3 - Switch theme overlay color resolves in active/pressed states', (WidgetTester tester) async { const Color activePressedOverlayColor = Color(0xFF000001); const Color inactivePressedOverlayColor = Color(0xFF000002); @@ -938,7 +937,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Local SwitchTheme can override global SwitchTheme', (WidgetTester tester) async { + testWidgets('Material2 - Local SwitchTheme can override global SwitchTheme', (WidgetTester tester) async { const Color globalThemeThumbColor = Color(0xfffffff1); const Color globalThemeTrackColor = Color(0xfffffff2); const Color globalThemeOutlineColor = Color(0xfffffff3); @@ -992,7 +991,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Local SwitchTheme can override global SwitchTheme', (WidgetTester tester) async { + testWidgets('Material3 - Local SwitchTheme can override global SwitchTheme', (WidgetTester tester) async { const Color globalThemeThumbColor = Color(0xfffffff1); const Color globalThemeTrackColor = Color(0xfffffff2); const Color globalThemeOutlineColor = Color(0xfffffff3); diff --git a/packages/flutter/test/material/tab_bar_theme_test.dart b/packages/flutter/test/material/tab_bar_theme_test.dart index 22ca9da2617..2516e0d2114 100644 --- a/packages/flutter/test/material/tab_bar_theme_test.dart +++ b/packages/flutter/test/material/tab_bar_theme_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const String _tab1Text = 'tab 1'; const String _tab2Text = 'tab 2'; @@ -110,7 +109,7 @@ void main() { expect(identical(TabBarTheme.lerp(theme, theme, 0.5), theme), true); }); - testWidgetsWithLeakTracking('Tab bar defaults (primary)', (WidgetTester tester) async { + testWidgets('Tab bar defaults (primary)', (WidgetTester tester) async { // Test default label color and label styles. await tester.pumpWidget(buildTabBar(useMaterial3: true)); @@ -161,7 +160,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar defaults (secondary)', (WidgetTester tester) async { + testWidgets('Tab bar defaults (secondary)', (WidgetTester tester) async { // Test default label color and label styles. await tester.pumpWidget(buildTabBar(secondaryTabBar: true, useMaterial3: true)); @@ -217,7 +216,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar theme overrides label color (selected)', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides label color (selected)', (WidgetTester tester) async { const Color labelColor = Colors.black; const TabBarTheme tabBarTheme = TabBarTheme(labelColor: labelColor); @@ -229,7 +228,7 @@ void main() { expect(tabIcon.text.style!.color, equals(labelColor)); }); - testWidgetsWithLeakTracking('Tab bar theme overrides label padding', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides label padding', (WidgetTester tester) async { const double topPadding = 10.0; const double bottomPadding = 7.0; const double rightPadding = 13.0; @@ -266,7 +265,7 @@ void main() { expect(tabOneRect.right, equals(tabTwoRect.left - leftPadding - rightPadding)); }); - testWidgetsWithLeakTracking('Tab bar theme overrides label styles', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides label styles', (WidgetTester tester) async { const TextStyle labelStyle = TextStyle(fontFamily: 'foobar'); const TextStyle unselectedLabelStyle = TextStyle(fontFamily: 'baz'); const TabBarTheme tabBarTheme = TabBarTheme( @@ -282,7 +281,7 @@ void main() { expect(unselectedLabel.text.style!.fontFamily, equals(unselectedLabelStyle.fontFamily)); }); - testWidgetsWithLeakTracking('Tab bar theme with just label style specified', (WidgetTester tester) async { + testWidgets('Tab bar theme with just label style specified', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28784 const TextStyle labelStyle = TextStyle(fontFamily: 'foobar'); const TabBarTheme tabBarTheme = TabBarTheme( @@ -299,7 +298,7 @@ void main() { expect(unselectedLabel.text.style!.color, equals(Colors.white.withAlpha(0xB2))); }); - testWidgetsWithLeakTracking('Tab bar label styles override theme label styles', (WidgetTester tester) async { + testWidgets('Tab bar label styles override theme label styles', (WidgetTester tester) async { const TextStyle labelStyle = TextStyle(fontFamily: '1'); const TextStyle unselectedLabelStyle = TextStyle(fontFamily: '2'); const TextStyle themeLabelStyle = TextStyle(fontFamily: '3'); @@ -334,7 +333,7 @@ void main() { expect(unselectedLabel.text.style!.fontFamily, equals(unselectedLabelStyle.fontFamily)); }); - testWidgetsWithLeakTracking('Material2 - Tab bar label padding overrides theme label padding', (WidgetTester tester) async { + testWidgets('Material2 - Tab bar label padding overrides theme label padding', (WidgetTester tester) async { const double verticalPadding = 10.0; const double horizontalPadding = 10.0; const EdgeInsetsGeometry labelPadding = EdgeInsets.symmetric( @@ -394,7 +393,7 @@ void main() { expect(tabOneRect.right, equals(tabTwoRect.left - (2 * horizontalPadding))); }); - testWidgetsWithLeakTracking('Material3 - Tab bar label padding overrides theme label padding', (WidgetTester tester) async { + testWidgets('Material3 - Tab bar label padding overrides theme label padding', (WidgetTester tester) async { const double tabStartOffset = 52.0; const double verticalPadding = 10.0; const double horizontalPadding = 10.0; @@ -455,7 +454,7 @@ void main() { expect(tabOneRect.right, equals(tabTwoRect.left - (2 * horizontalPadding))); }); - testWidgetsWithLeakTracking('Tab bar theme overrides label color (unselected)', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides label color (unselected)', (WidgetTester tester) async { const Color unselectedLabelColor = Colors.black; const TabBarTheme tabBarTheme = TabBarTheme(unselectedLabelColor: unselectedLabelColor); @@ -467,7 +466,7 @@ void main() { expect(iconRenderObject.text.style!.color, equals(unselectedLabelColor)); }); - testWidgetsWithLeakTracking('Tab bar default tab indicator size (primary)', (WidgetTester tester) async { + testWidgets('Tab bar default tab indicator size (primary)', (WidgetTester tester) async { await tester.pumpWidget(buildTabBar(useMaterial3: true, isScrollable: true)); await expectLater( @@ -476,7 +475,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar default tab indicator size (secondary)', (WidgetTester tester) async { + testWidgets('Tab bar default tab indicator size (secondary)', (WidgetTester tester) async { await tester.pumpWidget(buildTabBar(useMaterial3: true, isScrollable: true)); await expectLater( @@ -485,7 +484,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar theme overrides tab indicator size (tab)', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides tab indicator size (tab)', (WidgetTester tester) async { const TabBarTheme tabBarTheme = TabBarTheme(indicatorSize: TabBarIndicatorSize.tab); await tester.pumpWidget(buildTabBar(tabBarTheme: tabBarTheme)); @@ -496,7 +495,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar theme overrides tab indicator size (label)', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides tab indicator size (label)', (WidgetTester tester) async { const TabBarTheme tabBarTheme = TabBarTheme(indicatorSize: TabBarIndicatorSize.label); await tester.pumpWidget(buildTabBar(tabBarTheme: tabBarTheme)); @@ -507,7 +506,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar theme overrides tab mouse cursor', (WidgetTester tester) async { + testWidgets('Tab bar theme overrides tab mouse cursor', (WidgetTester tester) async { const TabBarTheme tabBarTheme = TabBarTheme(mouseCursor: MaterialStateMouseCursor.textable); await tester.pumpWidget(buildTabBar(tabBarTheme: tabBarTheme)); @@ -522,7 +521,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('Tab bar theme - custom tab indicator', (WidgetTester tester) async { + testWidgets('Tab bar theme - custom tab indicator', (WidgetTester tester) async { final TabBarTheme tabBarTheme = TabBarTheme( indicator: BoxDecoration( border: Border.all(), @@ -537,7 +536,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab bar theme - beveled rect indicator', (WidgetTester tester) async { + testWidgets('Tab bar theme - beveled rect indicator', (WidgetTester tester) async { const TabBarTheme tabBarTheme = TabBarTheme( indicator: ShapeDecoration( shape: BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))), @@ -553,7 +552,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabAlignment.fill from TabBarTheme only supports non-scrollable tab bar', (WidgetTester tester) async { + testWidgets('TabAlignment.fill from TabBarTheme only supports non-scrollable tab bar', (WidgetTester tester) async { const TabBarTheme tabBarTheme = TabBarTheme(tabAlignment: TabAlignment.fill); // Test TabAlignment.fill from TabBarTheme with non-scrollable tab bar. @@ -567,7 +566,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking( + testWidgets( 'TabAlignment.start & TabAlignment.startOffset from TabBarTheme only supports scrollable tab bar', (WidgetTester tester) async { TabBarTheme tabBarTheme = const TabBarTheme(tabAlignment: TabAlignment.start); @@ -595,7 +594,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('TabBarTheme.indicatorSize provides correct tab indicator (primary)', (WidgetTester tester) async { + testWidgets('TabBarTheme.indicatorSize provides correct tab indicator (primary)', (WidgetTester tester) async { final ThemeData theme = ThemeData( tabBarTheme: const TabBarTheme(indicatorSize: TabBarIndicatorSize.tab), useMaterial3: true, @@ -651,7 +650,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBarTheme.indicatorSize provides correct tab indicator (secondary)', (WidgetTester tester) async { + testWidgets('TabBarTheme.indicatorSize provides correct tab indicator (secondary)', (WidgetTester tester) async { final ThemeData theme = ThemeData( tabBarTheme: const TabBarTheme(indicatorSize: TabBarIndicatorSize.label), useMaterial3: true, @@ -705,7 +704,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBar divider can use TabBarTheme.dividerColor & TabBarTheme.dividerHeight', (WidgetTester tester) async { + testWidgets('TabBar divider can use TabBarTheme.dividerColor & TabBarTheme.dividerHeight', (WidgetTester tester) async { const Color dividerColor = Color(0xff00ff00); const double dividerHeight = 10.0; @@ -744,7 +743,7 @@ void main() { expect(tabBarBox, paints..line(color: dividerColor, strokeWidth: dividerHeight)); }); - testWidgetsWithLeakTracking('dividerColor & dividerHeight overrides TabBarTheme.dividerColor', (WidgetTester tester) async { + testWidgets('dividerColor & dividerHeight overrides TabBarTheme.dividerColor', (WidgetTester tester) async { const Color dividerColor = Color(0xff0000ff); const double dividerHeight = 8.0; @@ -785,7 +784,7 @@ void main() { expect(tabBarBox, paints..line(color: dividerColor, strokeWidth: dividerHeight)); }); - testWidgetsWithLeakTracking('TabBar respects TabBarTheme.tabAlignment', (WidgetTester tester) async { + testWidgets('TabBar respects TabBarTheme.tabAlignment', (WidgetTester tester) async { final TabController controller1 = TabController( length: 2, vsync: const TestVSync(), @@ -860,7 +859,7 @@ void main() { expect(tabTwoRect.right, equals(tabTwoRight)); }); - testWidgetsWithLeakTracking('TabBar.tabAlignment overrides TabBarTheme.tabAlignment', (WidgetTester tester) async { + testWidgets('TabBar.tabAlignment overrides TabBarTheme.tabAlignment', (WidgetTester tester) async { final TabController controller1 = TabController( length: 2, vsync: const TestVSync(), @@ -937,7 +936,7 @@ void main() { expect(tabTwoRect.right, equals(tabTwoRight)); }); - testWidgetsWithLeakTracking( + testWidgets( 'TabBar labels use colors from TabBarTheme.labelStyle & TabBarTheme.unselectedLabelStyle', (WidgetTester tester) async { const TextStyle labelStyle = TextStyle( @@ -973,7 +972,7 @@ void main() { expect(unselectedTextStyle.fontStyle, unselectedLabelStyle.fontStyle); }); - testWidgetsWithLeakTracking( + testWidgets( "TabBarTheme's labelColor & unselectedLabelColor override labelStyle & unselectedLabelStyle colors", (WidgetTester tester) async { const Color labelColor = Color(0xfff00000); @@ -1037,7 +1036,7 @@ void main() { expect(unselectedTextStyle.fontStyle, unselectedLabelStyle.fontStyle); }); - testWidgetsWithLeakTracking( + testWidgets( "TabBarTheme's labelColor & unselectedLabelColor override TabBar.labelStyle & TabBar.unselectedLabelStyle colors", (WidgetTester tester) async { const Color labelColor = Color(0xfff00000); @@ -1116,7 +1115,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Tab bar defaults (primary)', (WidgetTester tester) async { + testWidgets('Tab bar defaults (primary)', (WidgetTester tester) async { // Test default label color and label styles. await tester.pumpWidget(buildTabBar()); @@ -1156,7 +1155,7 @@ void main() { expect(tabBarBox, paints..line(color: theme.indicatorColor)); }); - testWidgetsWithLeakTracking('Tab bar defaults (secondary)', (WidgetTester tester) async { + testWidgets('Tab bar defaults (secondary)', (WidgetTester tester) async { // Test default label color and label styles. await tester.pumpWidget(buildTabBar(secondaryTabBar: true)); @@ -1196,7 +1195,7 @@ void main() { expect(tabBarBox, paints..line(color: theme.indicatorColor)); }); - testWidgetsWithLeakTracking('Tab bar default tab indicator size', (WidgetTester tester) async { + testWidgets('Tab bar default tab indicator size', (WidgetTester tester) async { await tester.pumpWidget(buildTabBar()); await expectLater( @@ -1205,7 +1204,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBarTheme.indicatorSize provides correct tab indicator (primary)', (WidgetTester tester) async { + testWidgets('TabBarTheme.indicatorSize provides correct tab indicator (primary)', (WidgetTester tester) async { final ThemeData theme = ThemeData( tabBarTheme: const TabBarTheme(indicatorSize: TabBarIndicatorSize.tab), useMaterial3: false, @@ -1256,7 +1255,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBarTheme.indicatorSize provides correct tab indicator (secondary)', (WidgetTester tester) async { + testWidgets('TabBarTheme.indicatorSize provides correct tab indicator (secondary)', (WidgetTester tester) async { final ThemeData theme = ThemeData( tabBarTheme: const TabBarTheme(indicatorSize: TabBarIndicatorSize.label), useMaterial3: false, @@ -1305,7 +1304,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBar respects TabBarTheme.tabAlignment', (WidgetTester tester) async { + testWidgets('TabBar respects TabBarTheme.tabAlignment', (WidgetTester tester) async { final TabController controller = TabController( length: 2, vsync: const TestVSync(), @@ -1342,7 +1341,7 @@ void main() { expect(tabTwoRect.right, equals(tabTwoRight)); }); - testWidgetsWithLeakTracking('TabBar.tabAlignment overrides TabBarTheme.tabAlignment', (WidgetTester tester) async { + testWidgets('TabBar.tabAlignment overrides TabBarTheme.tabAlignment', (WidgetTester tester) async { final TabController controller = TabController( length: 2, vsync: const TestVSync(), @@ -1381,7 +1380,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Material3 - TabBar indicator respects TabBarTheme.indicatorColor', (WidgetTester tester) async { + testWidgets('Material3 - TabBar indicator respects TabBarTheme.indicatorColor', (WidgetTester tester) async { final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); }); @@ -1424,7 +1423,7 @@ void main() { expect(tabBarBox,paints..rrect(color: tabBarThemeIndicatorColor)); }); - testWidgetsWithLeakTracking('Material2 - TabBar indicator respects TabBarTheme.indicatorColor', (WidgetTester tester) async { + testWidgets('Material2 - TabBar indicator respects TabBarTheme.indicatorColor', (WidgetTester tester) async { final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); }); @@ -1469,7 +1468,7 @@ void main() { expect(tabBarBox,paints..line(color: tabBarThemeIndicatorColor)); }); - testWidgetsWithLeakTracking('TabBarTheme.labelColor resolves material states', (WidgetTester tester) async { + testWidgets('TabBarTheme.labelColor resolves material states', (WidgetTester tester) async { const Color selectedColor = Color(0xff00ff00); const Color unselectedColor = Color(0xffff0000); final MaterialStateColor labelColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { @@ -1495,7 +1494,7 @@ void main() { expect(unselectedTextStyle.color, unselectedColor); }); - testWidgetsWithLeakTracking('TabBarTheme.labelColor & TabBarTheme.unselectedLabelColor override material state TabBarTheme.labelColor', + testWidgets('TabBarTheme.labelColor & TabBarTheme.unselectedLabelColor override material state TabBarTheme.labelColor', (WidgetTester tester) async { const Color selectedStateColor = Color(0xff00ff00); const Color unselectedStateColor = Color(0xffff0000); diff --git a/packages/flutter/test/material/tab_controller_test.dart b/packages/flutter/test/material/tab_controller_test.dart index 50d266e8120..9d4751ce914 100644 --- a/packages/flutter/test/material/tab_controller_test.dart +++ b/packages/flutter/test/material/tab_controller_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('$TabController dispatches creation in constructor.', (WidgetTester widgetTester) async { + testWidgets('$TabController dispatches creation in constructor.', (WidgetTester widgetTester) async { await expectLater( await memoryEvents(() async => TabController(length: 1, vsync: const TestVSync()).dispose(), TabController), areCreateAndDispose, diff --git a/packages/flutter/test/material/tabbed_scrollview_warp_test.dart b/packages/flutter/test/material/tabbed_scrollview_warp_test.dart index 98e1dd8280b..176b7aee424 100644 --- a/packages/flutter/test/material/tabbed_scrollview_warp_test.dart +++ b/packages/flutter/test/material/tabbed_scrollview_warp_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // This is a regression test for https://github.com/flutter/flutter/issues/10549 // which was failing because _SliverPersistentHeaderElement.visitChildren() @@ -75,7 +74,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin { } void main() { - testWidgetsWithLeakTracking('Tabbed CustomScrollViews, warp from tab 1 to 3', (WidgetTester tester) async { + testWidgets('Tabbed CustomScrollViews, warp from tab 1 to 3', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: MyHomePage())); // should not crash. diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index d717f7406d3..d80af0f6692 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -283,7 +282,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('indicatorPadding update test', (WidgetTester tester) async { + testWidgets('indicatorPadding update test', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/108102 const Tab tab = Tab(text: 'A'); const EdgeInsets indicatorPadding = EdgeInsets.only(left: 7.0, right: 7.0); @@ -312,21 +311,21 @@ void main() { expect(tester.renderObject(find.byType(CustomPaint)).debugNeedsPaint, true); }); - testWidgetsWithLeakTracking('Tab sizing - icon', (WidgetTester tester) async { + testWidgets('Tab sizing - icon', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp(home: Center(child: Material(child: Tab(icon: SizedBox(width: 10.0, height: 10.0))))), ); expect(tester.getSize(find.byType(Tab)), const Size(10.0, 46.0)); }); - testWidgetsWithLeakTracking('Tab sizing - child', (WidgetTester tester) async { + testWidgets('Tab sizing - child', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp(home: Center(child: Material(child: Tab(child: SizedBox(width: 10.0, height: 10.0))))), ); expect(tester.getSize(find.byType(Tab)), const Size(10.0, 46.0)); }); - testWidgetsWithLeakTracking('Tab sizing - text', (WidgetTester tester) async { + testWidgets('Tab sizing - text', (WidgetTester tester) async { final ThemeData theme = ThemeData(fontFamily: 'FlutterTest'); final bool material3 = theme.useMaterial3; await tester.pumpWidget( @@ -339,7 +338,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab sizing - icon and text', (WidgetTester tester) async { + testWidgets('Tab sizing - icon and text', (WidgetTester tester) async { final ThemeData theme = ThemeData(fontFamily: 'FlutterTest'); final bool material3 = theme.useMaterial3; await tester.pumpWidget( @@ -351,7 +350,7 @@ void main() { material3 ? const Size(14.25, 72.0) : const Size(14.0, 72.0)); }); - testWidgetsWithLeakTracking('Tab sizing - icon, iconMargin and text', (WidgetTester tester) async { + testWidgets('Tab sizing - icon, iconMargin and text', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(fontFamily: 'FlutterTest'), @@ -375,7 +374,7 @@ void main() { expect(tester.getSize(find.byType(Tab)), const Size(210.0, 72.0)); }); - testWidgetsWithLeakTracking('Tab sizing - icon and child', (WidgetTester tester) async { + testWidgets('Tab sizing - icon and child', (WidgetTester tester) async { final ThemeData theme = ThemeData(fontFamily: 'FlutterTest'); final bool material3 = theme.useMaterial3; await tester.pumpWidget( @@ -387,7 +386,7 @@ void main() { material3 ? const Size(14.25, 72.0) : const Size(14.0, 72.0)); }); - testWidgetsWithLeakTracking('Tab color - normal', (WidgetTester tester) async { + testWidgets('Tab color - normal', (WidgetTester tester) async { final ThemeData theme = ThemeData(fontFamily: 'FlutterTest'); final bool material3 = theme.useMaterial3; final Widget tabBar = TabBar(tabs: const <Widget>[SizedBox.shrink()], controller: _tabController(length: 1, vsync: tester)); @@ -397,7 +396,7 @@ void main() { expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : Colors.blue[500])); }); - testWidgetsWithLeakTracking('Tab color - match', (WidgetTester tester) async { + testWidgets('Tab color - match', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final bool material3 = theme.useMaterial3; final Widget tabBar = TabBar(tabs: const <Widget>[SizedBox.shrink()], controller: _tabController(length: 1, vsync: tester)); @@ -407,7 +406,7 @@ void main() { expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : Colors.white)); }); - testWidgetsWithLeakTracking('Tab color - transparency', (WidgetTester tester) async { + testWidgets('Tab color - transparency', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final bool material3 = theme.useMaterial3; final Widget tabBar = TabBar(tabs: const <Widget>[SizedBox.shrink()], controller: _tabController(length: 1, vsync: tester)); @@ -417,7 +416,7 @@ void main() { expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : Colors.blue[500])); }); - testWidgetsWithLeakTracking('TabBar default selected/unselected label style (primary)', (WidgetTester tester) async { + testWidgets('TabBar default selected/unselected label style (primary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B', 'C']; @@ -443,7 +442,7 @@ void main() { expect(unselectedLabel.text.style!.color, theme.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('TabBar default selected/unselected label style (secondary)', (WidgetTester tester) async { + testWidgets('TabBar default selected/unselected label style (secondary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B', 'C']; @@ -469,7 +468,7 @@ void main() { expect(unselectedLabel.text.style!.color, theme.colorScheme.onSurfaceVariant); }); - testWidgetsWithLeakTracking('TabBar default tab indicator (primary)', (WidgetTester tester) async { + testWidgets('TabBar default tab indicator (primary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); @@ -518,7 +517,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar default tab indicator (secondary)', (WidgetTester tester) async { + testWidgets('TabBar default tab indicator (secondary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); @@ -569,7 +568,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBar default overlay (primary)', (WidgetTester tester) async { + testWidgets('TabBar default overlay (primary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B']; @@ -606,7 +605,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('TabBar default overlay (secondary)', (WidgetTester tester) async { + testWidgets('TabBar default overlay (secondary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B']; @@ -641,7 +640,7 @@ void main() { expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); }); - testWidgetsWithLeakTracking('TabBar tap selects tab', (WidgetTester tester) async { + testWidgets('TabBar tap selects tab', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C')); @@ -677,7 +676,7 @@ void main() { expect(controller.previousIndex, 2); }); - testWidgetsWithLeakTracking('Scrollable TabBar tap selects tab', (WidgetTester tester) async { + testWidgets('Scrollable TabBar tap selects tab', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C', isScrollable: true)); @@ -701,7 +700,7 @@ void main() { expect(controller.index, 0); }); - testWidgetsWithLeakTracking('Material2 - Scrollable TabBar tap centers selected tab', (WidgetTester tester) async { + testWidgets('Material2 - Scrollable TabBar tap centers selected tab', (WidgetTester tester) async { final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; const Key tabBarKey = Key('TabBar'); await tester.pumpWidget(buildFrame( @@ -726,7 +725,7 @@ void main() { expect(tester.getCenter(find.text('FFFFFF')).dx, moreOrLessEquals(400.0, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Material3 - Scrollable TabBar tap centers selected tab', (WidgetTester tester) async { + testWidgets('Material3 - Scrollable TabBar tap centers selected tab', (WidgetTester tester) async { final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; const Key tabBarKey = Key('TabBar'); await tester.pumpWidget(buildFrame( @@ -751,7 +750,7 @@ void main() { expect(tester.getCenter(find.text('FFFFFF')).dx, moreOrLessEquals(452.0, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Material2 - Scrollable TabBar, with padding, tap centers selected tab', (WidgetTester tester) async { + testWidgets('Material2 - Scrollable TabBar, with padding, tap centers selected tab', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/112776 final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; const Key tabBarKey = Key('TabBar'); @@ -779,7 +778,7 @@ void main() { expect(tester.getCenter(find.text('FFFFFF')).dx, moreOrLessEquals(400.0, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Material3 - Scrollable TabBar, with padding, tap centers selected tab', (WidgetTester tester) async { + testWidgets('Material3 - Scrollable TabBar, with padding, tap centers selected tab', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/112776 final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; const Key tabBarKey = Key('TabBar'); @@ -807,7 +806,7 @@ void main() { expect(tester.getCenter(find.text('FFFFFF')).dx, moreOrLessEquals(452.0, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Material2 - Scrollable TabBar, with padding and TextDirection.rtl, tap centers selected tab', (WidgetTester tester) async { + testWidgets('Material2 - Scrollable TabBar, with padding and TextDirection.rtl, tap centers selected tab', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/112776 final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; const Key tabBarKey = Key('TabBar'); @@ -836,7 +835,7 @@ void main() { expect(tester.getCenter(find.text('FFFFFF')).dx, moreOrLessEquals(400.0, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Material3 - Scrollable TabBar, with padding and TextDirection.rtl, tap centers selected tab', (WidgetTester tester) async { + testWidgets('Material3 - Scrollable TabBar, with padding and TextDirection.rtl, tap centers selected tab', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/112776 final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; const Key tabBarKey = Key('TabBar'); @@ -865,7 +864,7 @@ void main() { expect(tester.getCenter(find.text('FFFFFF')).dx, moreOrLessEquals(348.0, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Material2 - TabBar can be scrolled independent of the selection', (WidgetTester tester) async { + testWidgets('Material2 - TabBar can be scrolled independent of the selection', (WidgetTester tester) async { final List<String> tabs = <String>['AAAA', 'BBBB', 'CCCC', 'DDDD', 'EEEE', 'FFFF', 'GGGG', 'HHHH', 'IIII', 'JJJJ', 'KKKK', 'LLLL']; const Key tabBarKey = Key('TabBar'); await tester.pumpWidget(buildFrame( @@ -890,7 +889,7 @@ void main() { expect(controller.index, 0); }); - testWidgetsWithLeakTracking('Material3 - TabBar can be scrolled independent of the selection', (WidgetTester tester) async { + testWidgets('Material3 - TabBar can be scrolled independent of the selection', (WidgetTester tester) async { final List<String> tabs = <String>['AAAA', 'BBBB', 'CCCC', 'DDDD', 'EEEE', 'FFFF', 'GGGG', 'HHHH', 'IIII', 'JJJJ', 'KKKK', 'LLLL']; const Key tabBarKey = Key('TabBar'); await tester.pumpWidget(buildFrame( @@ -915,7 +914,7 @@ void main() { expect(controller.index, 0); }); - testWidgetsWithLeakTracking('TabBarView maintains state', (WidgetTester tester) async { + testWidgets('TabBarView maintains state', (WidgetTester tester) async { final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE']; String value = tabs[0]; @@ -988,7 +987,7 @@ void main() { expect(findStateMarkerState(tabs[1]).marker, equals('marked')); }); - testWidgetsWithLeakTracking('TabBar left/right fling', (WidgetTester tester) async { + testWidgets('TabBar left/right fling', (WidgetTester tester) async { final List<String> tabs = <String>['LEFT', 'RIGHT']; await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT')); @@ -1017,7 +1016,7 @@ void main() { expect(find.text('RIGHT CHILD'), findsNothing); }); - testWidgetsWithLeakTracking('TabBar left/right fling reverse (1)', (WidgetTester tester) async { + testWidgets('TabBar left/right fling reverse (1)', (WidgetTester tester) async { final List<String> tabs = <String>['LEFT', 'RIGHT']; await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT')); @@ -1038,7 +1037,7 @@ void main() { expect(find.text('RIGHT CHILD'), findsNothing); }); - testWidgetsWithLeakTracking('TabBar left/right fling reverse (2)', (WidgetTester tester) async { + testWidgets('TabBar left/right fling reverse (2)', (WidgetTester tester) async { final List<String> tabs = <String>['LEFT', 'RIGHT']; await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT')); @@ -1061,7 +1060,7 @@ void main() { }); // A regression test for https://github.com/flutter/flutter/issues/5095 - testWidgetsWithLeakTracking('TabBar left/right fling reverse (2)', (WidgetTester tester) async { + testWidgets('TabBar left/right fling reverse (2)', (WidgetTester tester) async { final List<String> tabs = <String>['LEFT', 'RIGHT']; await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT')); @@ -1095,7 +1094,7 @@ void main() { }); // A regression test for https://github.com/flutter/flutter/pull/88878. - testWidgetsWithLeakTracking('TabController notifies the index to change when left flinging', (WidgetTester tester) async { + testWidgets('TabController notifies the index to change when left flinging', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; late TabController tabController; @@ -1140,7 +1139,7 @@ void main() { }); // A regression test for https://github.com/flutter/flutter/issues/7133 - testWidgetsWithLeakTracking('TabBar fling velocity', (WidgetTester tester) async { + testWidgets('TabBar fling velocity', (WidgetTester tester) async { final List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL']; int index = 0; @@ -1179,7 +1178,7 @@ void main() { expect(box.localToGlobal(Offset.zero).dx, greaterThan(0.0)); }); - testWidgetsWithLeakTracking('TabController change notification', (WidgetTester tester) async { + testWidgets('TabController change notification', (WidgetTester tester) async { final List<String> tabs = <String>['LEFT', 'RIGHT']; await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT')); @@ -1212,7 +1211,7 @@ void main() { expect(value, 'LEFT'); }); - testWidgetsWithLeakTracking('Explicit TabController', (WidgetTester tester) async { + testWidgets('Explicit TabController', (WidgetTester tester) async { final List<String> tabs = <String>['LEFT', 'RIGHT']; late TabController tabController; @@ -1268,7 +1267,7 @@ void main() { expect(find.text('RIGHT CHILD'), findsOneWidget); }); - testWidgetsWithLeakTracking('TabController listener resets index', (WidgetTester tester) async { + testWidgets('TabController listener resets index', (WidgetTester tester) async { // This is a regression test for the scenario brought up here // https://github.com/flutter/flutter/pull/7387#pullrequestreview-15630946 @@ -1322,7 +1321,7 @@ void main() { expect(tabController.indexIsChanging, false); }); - testWidgetsWithLeakTracking('TabBar unselectedLabelColor control test', (WidgetTester tester) async { + testWidgets('TabBar unselectedLabelColor control test', (WidgetTester tester) async { final TabController controller = _tabController( vsync: const TestVSync(), length: 2, @@ -1359,7 +1358,7 @@ void main() { expect(secondColor, equals(Colors.blue[500])); }); - testWidgetsWithLeakTracking('TabBarView page left and right test', (WidgetTester tester) async { + testWidgets('TabBarView page left and right test', (WidgetTester tester) async { final TabController controller = _tabController( vsync: const TestVSync(), length: 2, @@ -1419,7 +1418,7 @@ void main() { expect(find.text('Second'), findsNothing); }); - testWidgetsWithLeakTracking('TabBar animationDuration sets indicator animation duration', (WidgetTester tester) async { + testWidgets('TabBar animationDuration sets indicator animation duration', (WidgetTester tester) async { const Duration animationDuration = Duration(milliseconds: 100); final List<String> tabs = <String>['A', 'B', 'C']; @@ -1447,7 +1446,7 @@ void main() { expect(controller.indexIsChanging, false); }); - testWidgetsWithLeakTracking('TabBarView controller sets animation duration', (WidgetTester tester) async { + testWidgets('TabBarView controller sets animation duration', (WidgetTester tester) async { const Duration animationDuration = Duration(milliseconds: 100); final List<String> tabs = <String>['A', 'B', 'C']; @@ -1497,7 +1496,7 @@ void main() { expect(position.pixels, 800); }); - testWidgetsWithLeakTracking('TabBarView animation can be interrupted', (WidgetTester tester) async { + testWidgets('TabBarView animation can be interrupted', (WidgetTester tester) async { const Duration animationDuration = Duration(seconds: 2); final List<String> tabs = <String>['A', 'B', 'C']; @@ -1556,7 +1555,7 @@ void main() { await tester.pumpAndSettle(); // Finish the animation. }); - testWidgetsWithLeakTracking('TabBarView viewportFraction sets PageView viewport fraction', (WidgetTester tester) async { + testWidgets('TabBarView viewportFraction sets PageView viewport fraction', (WidgetTester tester) async { const Duration animationDuration = Duration(milliseconds: 100); final List<String> tabs = <String>['A', 'B', 'C']; @@ -1600,7 +1599,7 @@ void main() { expect(pageController.viewportFraction, 0.8); }); - testWidgetsWithLeakTracking('TabBarView viewportFraction is 1 by default', (WidgetTester tester) async { + testWidgets('TabBarView viewportFraction is 1 by default', (WidgetTester tester) async { const Duration animationDuration = Duration(milliseconds: 100); final List<String> tabs = <String>['A', 'B', 'C']; @@ -1643,7 +1642,7 @@ void main() { expect(pageController.viewportFraction, 1); }); - testWidgetsWithLeakTracking('TabBarView viewportFraction can be updated', (WidgetTester tester) async { + testWidgets('TabBarView viewportFraction can be updated', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/135557. final List<String> tabs = <String>['A', 'B', 'C']; TabController? controller; @@ -1691,7 +1690,7 @@ void main() { expect(pageController.viewportFraction, 0.5); }); - testWidgetsWithLeakTracking('TabBarView has clipBehavior Clip.hardEdge by default', (WidgetTester tester) async { + testWidgets('TabBarView has clipBehavior Clip.hardEdge by default', (WidgetTester tester) async { final List<Widget> tabs = <Widget>[const Text('First'), const Text('Second')]; Widget builder() { @@ -1710,7 +1709,7 @@ void main() { expect(tabBarView.clipBehavior, Clip.hardEdge); }); - testWidgetsWithLeakTracking('TabBarView sets clipBehavior correctly', (WidgetTester tester) async { + testWidgets('TabBarView sets clipBehavior correctly', (WidgetTester tester) async { final List<Widget> tabs = <Widget>[const Text('First'), const Text('Second')]; Widget builder() { @@ -1730,7 +1729,7 @@ void main() { expect(pageView.clipBehavior, Clip.none); }); - testWidgetsWithLeakTracking('TabBar tap skips indicator animation when disabled in controller', (WidgetTester tester) async { + testWidgets('TabBar tap skips indicator animation when disabled in controller', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; const Color indicatorColor = Color(0xFFFF0000); @@ -1755,7 +1754,7 @@ void main() { expect(indicatorRect2.height, 2.0); }); - testWidgetsWithLeakTracking('TabBar tap changes index instantly when animation is disabled in controller', (WidgetTester tester) async { + testWidgets('TabBar tap changes index instantly when animation is disabled in controller', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; await tester.pumpWidget(buildFrame(tabs: tabs, value: 'B', animationDuration: Duration.zero)); @@ -1776,14 +1775,14 @@ void main() { expect(controller.indexIsChanging, false); }); - testWidgetsWithLeakTracking('Scrollable TabBar does not have overscroll indicator', (WidgetTester tester) async { + testWidgets('Scrollable TabBar does not have overscroll indicator', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; await tester.pumpWidget(buildFrame(tabs: tabs, value: 'A', isScrollable: true)); expect(find.byType(GlowingOverscrollIndicator), findsNothing); }); - testWidgetsWithLeakTracking('TabBar should not throw when animation is disabled in controller', (WidgetTester tester) async { + testWidgets('TabBar should not throw when animation is disabled in controller', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102600 final List<String> tabs = <String>['A']; @@ -1828,7 +1827,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('TabBarView skips animation when disabled in controller', (WidgetTester tester) async { + testWidgets('TabBarView skips animation when disabled in controller', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; final TabController tabController = _tabController( vsync: const TestVSync(), @@ -1873,7 +1872,7 @@ void main() { expect(position.pixels, 800); }); - testWidgetsWithLeakTracking('TabBarView skips animation when disabled in controller - skip tabs', (WidgetTester tester) async { + testWidgets('TabBarView skips animation when disabled in controller - skip tabs', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B', 'C']; final TabController tabController = _tabController( vsync: const TestVSync(), @@ -1917,7 +1916,7 @@ void main() { expect(position.pixels, 800); }); - testWidgetsWithLeakTracking('TabBarView skips animation when disabled in controller - skip tabs twice', (WidgetTester tester) async { + testWidgets('TabBarView skips animation when disabled in controller - skip tabs twice', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110970 final List<String> tabs = <String>['A', 'B', 'C']; final TabController tabController = _tabController( @@ -1966,7 +1965,7 @@ void main() { expect(position.pixels, 0); }); - testWidgetsWithLeakTracking('TabBarView skips animation when disabled in controller - skip tabs followed by single tab navigation', (WidgetTester tester) async { + testWidgets('TabBarView skips animation when disabled in controller - skip tabs followed by single tab navigation', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110970 final List<String> tabs = <String>['A', 'B', 'C']; final TabController tabController = _tabController( @@ -2019,7 +2018,7 @@ void main() { expect(position.pixels, 0); }); - testWidgetsWithLeakTracking('TabBarView skips animation when disabled in controller - two tabs', (WidgetTester tester) async { + testWidgets('TabBarView skips animation when disabled in controller - two tabs', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; final TabController tabController = _tabController( vsync: const TestVSync(), @@ -2062,7 +2061,7 @@ void main() { expect(position.pixels, 400); }); - testWidgetsWithLeakTracking('TabBar tap animates the selection indicator', (WidgetTester tester) async { + testWidgets('TabBar tap animates the selection indicator', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/7479 final List<String> tabs = <String>['A', 'B']; @@ -2097,7 +2096,7 @@ void main() { expect(indicatorRect2.height, 2.0); }); - testWidgetsWithLeakTracking('TabBarView child disposed during animation', (WidgetTester tester) async { + testWidgets('TabBarView child disposed during animation', (WidgetTester tester) async { // This is a regression test for this patch: // https://github.com/flutter/flutter/pull/9015 @@ -2157,7 +2156,7 @@ void main() { ); } - testWidgetsWithLeakTracking('TabBarView children can be updated during animation to an adjacent tab', (WidgetTester tester) async { + testWidgets('TabBarView children can be updated during animation to an adjacent tab', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/107399 final List<String> log = <String>[]; @@ -2186,7 +2185,7 @@ void main() { expect(find.text('1-$updatedMarker'), findsOneWidget); }); - testWidgetsWithLeakTracking('TabBarView children can be updated during animation to a non adjacent tab', (WidgetTester tester) async { + testWidgets('TabBarView children can be updated during animation to a non adjacent tab', (WidgetTester tester) async { final List<String> log = <String>[]; const String initialMarker = 'before'; @@ -2215,7 +2214,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('TabBarView scrolls end close to a new page', (WidgetTester tester) async { + testWidgets('TabBarView scrolls end close to a new page', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/9375 final TabController tabController = _tabController( @@ -2272,7 +2271,7 @@ void main() { expect(tabController.index, 0); }); - testWidgetsWithLeakTracking('On going TabBarView animation can be interrupted by a new animation', (WidgetTester tester) async { + testWidgets('On going TabBarView animation can be interrupted by a new animation', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/132293. final List<String> tabs = <String>['A', 'B', 'C']; @@ -2321,7 +2320,7 @@ void main() { expect(find.text('1'), findsNothing); }); - testWidgetsWithLeakTracking('Can switch to non-neighboring tab in nested TabBarView without crashing', (WidgetTester tester) async { + testWidgets('Can switch to non-neighboring tab in nested TabBarView without crashing', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/18756 final TabController mainTabController = _tabController(length: 4, vsync: const TestVSync()); final TabController nestedTabController = _tabController(length: 2, vsync: const TestVSync()); @@ -2365,7 +2364,7 @@ void main() { expect(mainTabController.index, 2); }); - testWidgetsWithLeakTracking('TabBarView can warp when child is kept alive and contains ink', (WidgetTester tester) async { + testWidgets('TabBarView can warp when child is kept alive and contains ink', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/57662. final TabController controller = _tabController( vsync: const TestVSync(), @@ -2402,7 +2401,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('TabBarView scrolls end close to a new page with custom physics', (WidgetTester tester) async { + testWidgets('TabBarView scrolls end close to a new page with custom physics', (WidgetTester tester) async { final TabController tabController = _tabController( vsync: const TestVSync(), initialIndex: 1, @@ -2458,7 +2457,7 @@ void main() { expect(tabController.index, 0); }); - testWidgetsWithLeakTracking('TabBar accepts custom physics', (WidgetTester tester) async { + testWidgets('TabBar accepts custom physics', (WidgetTester tester) async { final List<Tab> tabs = List<Tab>.generate(20, (int index) { return Tab(text: 'TAB #$index'); }); @@ -2486,7 +2485,7 @@ void main() { expect(position, equals(20)); }); - testWidgetsWithLeakTracking('Scrollable TabBar with a non-zero TabController initialIndex', (WidgetTester tester) async { + testWidgets('Scrollable TabBar with a non-zero TabController initialIndex', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/9374 final List<Tab> tabs = List<Tab>.generate(20, (int index) { @@ -2519,7 +2518,7 @@ void main() { expect(tester.getTopRight(find.widgetWithText(Tab, 'TAB #19')).dx, moreOrLessEquals(tabRight)); }); - testWidgetsWithLeakTracking('TabBar with indicatorWeight, indicatorPadding (LTR)', (WidgetTester tester) async { + testWidgets('TabBar with indicatorWeight, indicatorPadding (LTR)', (WidgetTester tester) async { const Color indicatorColor = Color(0xFF00FF00); const double indicatorWeight = 8.0; const double padLeft = 8.0; @@ -2579,7 +2578,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with indicatorWeight, indicatorPadding (RTL)', (WidgetTester tester) async { + testWidgets('TabBar with indicatorWeight, indicatorPadding (RTL)', (WidgetTester tester) async { const Color indicatorColor = Color(0xFF00FF00); const double indicatorWeight = 8.0; const double padLeft = 8.0; @@ -2641,7 +2640,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar changes indicator attributes', (WidgetTester tester) async { + testWidgets('TabBar changes indicator attributes', (WidgetTester tester) async { final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); }); @@ -2709,7 +2708,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with directional indicatorPadding (LTR)', (WidgetTester tester) async { + testWidgets('TabBar with directional indicatorPadding (LTR)', (WidgetTester tester) async { final List<Widget> tabs = <Widget>[ SizedBox(key: UniqueKey(), width: 130.0, height: 30.0), SizedBox(key: UniqueKey(), width: 140.0, height: 40.0), @@ -2779,7 +2778,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with directional indicatorPadding (RTL)', (WidgetTester tester) async { + testWidgets('TabBar with directional indicatorPadding (RTL)', (WidgetTester tester) async { final List<Widget> tabs = <Widget>[ SizedBox(key: UniqueKey(), width: 130.0, height: 30.0), SizedBox(key: UniqueKey(), width: 140.0, height: 40.0), @@ -2848,7 +2847,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with custom indicator and indicatorPadding(LTR)', (WidgetTester tester) async { + testWidgets('TabBar with custom indicator and indicatorPadding(LTR)', (WidgetTester tester) async { const Color indicatorColor = Color(0xFF00FF00); const double padTop = 10.0; const double padBottom = 12.0; @@ -2919,7 +2918,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with custom indicator and indicatorPadding (RTL)', (WidgetTester tester) async { + testWidgets('TabBar with custom indicator and indicatorPadding (RTL)', (WidgetTester tester) async { const Color indicatorColor = Color(0xFF00FF00); const double padTop = 10.0; const double padBottom = 12.0; @@ -2990,7 +2989,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with custom indicator - directional indicatorPadding (LTR)', (WidgetTester tester) async { + testWidgets('TabBar with custom indicator - directional indicatorPadding (LTR)', (WidgetTester tester) async { final List<Widget > tabs = <Widget>[ SizedBox(key: UniqueKey(), width: 130.0, height: 30.0), SizedBox(key: UniqueKey(), width: 140.0, height: 40.0), @@ -3069,7 +3068,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with custom indicator - directional indicatorPadding (RTL)', (WidgetTester tester) async { + testWidgets('TabBar with custom indicator - directional indicatorPadding (RTL)', (WidgetTester tester) async { final List<Widget> tabs = <Widget>[ SizedBox(key: UniqueKey(), width: 130.0, height: 30.0), SizedBox(key: UniqueKey(), width: 140.0, height: 40.0), @@ -3151,7 +3150,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with padding isScrollable: false', (WidgetTester tester) async { + testWidgets('TabBar with padding isScrollable: false', (WidgetTester tester) async { const double indicatorWeight = 2.0; // default indicator weight const EdgeInsets padding = EdgeInsets.only(left: 3.0, top: 7.0, right: 5.0, bottom: 3.0); @@ -3205,7 +3204,7 @@ void main() { expect(tabBarBox.size.width, tabRight); }); - testWidgetsWithLeakTracking('Material3 - TabBar with padding isScrollable: true', (WidgetTester tester) async { + testWidgets('Material3 - TabBar with padding isScrollable: true', (WidgetTester tester) async { const double indicatorWeight = 2.0; // default indicator weight const EdgeInsets padding = EdgeInsets.only(left: 3.0, top: 7.0, right: 5.0, bottom: 3.0); const double tabStartOffset = 52.0; @@ -3269,7 +3268,7 @@ void main() { expect(tabBarBox.size.width, tabRight + 320.0); // Right tab + remaining space of the stretched tab bar. }); - testWidgetsWithLeakTracking('TabBar with labelPadding', (WidgetTester tester) async { + testWidgets('TabBar with labelPadding', (WidgetTester tester) async { const double indicatorWeight = 2.0; // default indicator weight const EdgeInsets labelPadding = EdgeInsets.only(left: 3.0, right: 7.0); const EdgeInsets indicatorPadding = labelPadding; @@ -3340,7 +3339,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabBar with labelPadding(TabBarIndicatorSize.label)', (WidgetTester tester) async { + testWidgets('TabBar with labelPadding(TabBarIndicatorSize.label)', (WidgetTester tester) async { const double indicatorWeight = 2.0; // default indicator weight const EdgeInsets labelPadding = EdgeInsets.only(left: 7.0, right: 4.0); const EdgeInsets indicatorPadding = EdgeInsets.only(left: 3.0, right: 7.0); @@ -3412,7 +3411,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Overflowing RTL tab bar', (WidgetTester tester) async { + testWidgets('Overflowing RTL tab bar', (WidgetTester tester) async { final List<Widget> tabs = List<Widget>.filled(100, // For convenience padded width of each tab will equal 100: // 68 + kTabLabelPadding.horizontal(32) @@ -3477,7 +3476,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Tab indicator animation test', (WidgetTester tester) async { + testWidgets('Tab indicator animation test', (WidgetTester tester) async { const double indicatorWeight = 8.0; final List<Widget> tabs = List<Widget>.generate(4, (int index) { @@ -3554,7 +3553,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('correct semantics', (WidgetTester tester) async { + testWidgets('correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<Tab> tabs = List<Tab>.generate(2, (int index) { @@ -3628,7 +3627,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('correct scrolling semantics', (WidgetTester tester) async { + testWidgets('correct scrolling semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<Tab> tabs = List<Tab>.generate(20, (int index) { @@ -3683,7 +3682,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TabBar etc with zero tabs', (WidgetTester tester) async { + testWidgets('TabBar etc with zero tabs', (WidgetTester tester) async { final TabController controller = _tabController( vsync: const TestVSync(), length: 0, @@ -3723,7 +3722,7 @@ void main() { expect(controller.index, 0); }); - testWidgetsWithLeakTracking('TabBar etc with one tab', (WidgetTester tester) async { + testWidgets('TabBar etc with one tab', (WidgetTester tester) async { final TabController controller = _tabController( vsync: const TestVSync(), length: 1, @@ -3778,7 +3777,7 @@ void main() { expect(find.text('PAGE'), findsOneWidget); }); - testWidgetsWithLeakTracking('can tap on indicator at very bottom of TabBar to switch tabs', (WidgetTester tester) async { + testWidgets('can tap on indicator at very bottom of TabBar to switch tabs', (WidgetTester tester) async { final TabController controller = _tabController( vsync: const TestVSync(), length: 2, @@ -3814,7 +3813,7 @@ void main() { expect(controller.index, 1); }); - testWidgetsWithLeakTracking('can override semantics of tabs', (WidgetTester tester) async { + testWidgets('can override semantics of tabs', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<Tab> tabs = List<Tab>.generate(2, (int index) { @@ -3895,7 +3894,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can be notified of TabBar onTap behavior', (WidgetTester tester) async { + testWidgets('can be notified of TabBar onTap behavior', (WidgetTester tester) async { int tabIndex = -1; Widget buildFrame({ @@ -3980,7 +3979,7 @@ void main() { expect(() => Tab(text: 'foo', child: Container()), throwsAssertionError); }); - testWidgetsWithLeakTracking('Tabs changes mouse cursor when a tab is hovered', (WidgetTester tester) async { + testWidgets('Tabs changes mouse cursor when a tab is hovered', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; await tester.pumpWidget(MaterialApp(home: DefaultTabController( length: tabs.length, @@ -4019,7 +4018,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('TabController changes', (WidgetTester tester) async { + testWidgets('TabController changes', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/14812 Widget buildFrame(TabController controller) { @@ -4083,7 +4082,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TabController changes while flinging', (WidgetTester tester) async { + testWidgets('TabController changes while flinging', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/34744 Widget buildFrame(TabController controller) { @@ -4144,7 +4143,7 @@ void main() { expect(controller2.index, 1); }); - testWidgetsWithLeakTracking('TabController changes with different initialIndex', (WidgetTester tester) async { + testWidgets('TabController changes with different initialIndex', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/115917 const Key lastTabKey = Key('Last Tab'); TabController? controller; @@ -4187,7 +4186,7 @@ void main() { expect(tester.getCenter(find.byKey(lastTabKey)).dx, equals(750.0)); }); - testWidgetsWithLeakTracking('Do not throw when switching between a scrollable TabBar and a non-scrollable TabBar', (WidgetTester tester) async { + testWidgets('Do not throw when switching between a scrollable TabBar and a non-scrollable TabBar', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/120649 final TabController controller1 = _tabController( vsync: const TestVSync(), @@ -4227,7 +4226,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Default tab indicator color is white in M2 and surfaceVariant in M3', (WidgetTester tester) async { + testWidgets('Default tab indicator color is white in M2 and surfaceVariant in M3', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/15958 final List<String> tabs = <String>['LEFT', 'RIGHT']; final ThemeData theme = ThemeData(platform: TargetPlatform.android); @@ -4239,7 +4238,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Tab indicator color should not be adjusted when disable [automaticIndicatorColorAdjustment]', (WidgetTester tester) async { + testWidgets('Tab indicator color should not be adjusted when disable [automaticIndicatorColorAdjustment]', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/68077 final List<String> tabs = <String>['LEFT', 'RIGHT']; final ThemeData theme = ThemeData(platform: TargetPlatform.android); @@ -4262,7 +4261,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('Tab feedback is enabled (default)', (WidgetTester tester) async { + testWidgets('Tab feedback is enabled (default)', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: const DefaultTabController( @@ -4286,7 +4285,7 @@ void main() { expect(feedback.hapticCount, 0); }); - testWidgetsWithLeakTracking('Tab feedback is disabled', (WidgetTester tester) async { + testWidgets('Tab feedback is disabled', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: const DefaultTabController( @@ -4313,7 +4312,7 @@ void main() { }); group('Tab overlayColor affects ink response', () { - testWidgetsWithLeakTracking("Tab's ink well changes color on hover with Tab overlayColor", (WidgetTester tester) async { + testWidgets("Tab's ink well changes color on hover with Tab overlayColor", (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: DefaultTabController( @@ -4345,7 +4344,7 @@ void main() { expect(inkFeatures, paints..rect(rect: const Rect.fromLTRB(0.0, 276.0, 800.0, 324.0), color: const Color(0xff00ff00))); }); - testWidgetsWithLeakTracking( + testWidgets( "Tab's ink response splashColor matches resolved Tab overlayColor for MaterialState.pressed", (WidgetTester tester) async { const Color splashColor = Color(0xf00fffff); @@ -4383,7 +4382,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Skipping tabs with global key does not crash', (WidgetTester tester) async { + testWidgets('Skipping tabs with global key does not crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/24660 final List<String> tabs = <String>[ 'Tab1', @@ -4433,7 +4432,7 @@ void main() { expect(find.text('1'), findsNothing); }); - testWidgetsWithLeakTracking('Skipping tabs with a KeepAlive child works', (WidgetTester tester) async { + testWidgets('Skipping tabs with a KeepAlive child works', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/11895 final List<String> tabs = <String>[ 'Tab1', @@ -4486,7 +4485,7 @@ void main() { expect(find.text('4'), findsOneWidget); }); - testWidgetsWithLeakTracking('tabbar does not scroll when viewport dimensions initially change from zero to non-zero', (WidgetTester tester) async { + testWidgets('tabbar does not scroll when viewport dimensions initially change from zero to non-zero', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/10531. const List<Widget> tabs = <Widget>[ @@ -4548,7 +4547,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/20292. - testWidgetsWithLeakTracking('Number of tabs can be updated dynamically', (WidgetTester tester) async { + testWidgets('Number of tabs can be updated dynamically', (WidgetTester tester) async { final List<String> threeTabs = <String>['A', 'B', 'C']; final List<String> twoTabs = <String>['A', 'B']; final List<String> oneTab = <String>['A']; @@ -4594,7 +4593,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/15008. - testWidgetsWithLeakTracking('TabBar with one tab has correct color', (WidgetTester tester) async { + testWidgets('TabBar with one tab has correct color', (WidgetTester tester) async { const Tab tab = Tab(text: 'A'); const Color selectedTabColor = Color(0x00000001); const Color unselectedTabColor = Color(0x00000002); @@ -4614,7 +4613,7 @@ void main() { expect(iconTheme.color, equals(selectedTabColor)); }); - testWidgetsWithLeakTracking('TabBar.labelColor resolves material states', (WidgetTester tester) async { + testWidgets('TabBar.labelColor resolves material states', (WidgetTester tester) async { const String tab1 = 'Tab 1'; const String tab2 = 'Tab 2'; @@ -4652,7 +4651,7 @@ void main() { expect(unselectedTextStyle.color, unselectedColor); }); - testWidgetsWithLeakTracking('labelColor & unselectedLabelColor override material state labelColor', (WidgetTester tester) async { + testWidgets('labelColor & unselectedLabelColor override material state labelColor', (WidgetTester tester) async { const String tab1 = 'Tab 1'; const String tab2 = 'Tab 2'; @@ -4709,7 +4708,7 @@ void main() { expect(unselectedTextStyle.color, unselectedColor); }); - testWidgetsWithLeakTracking('Replacing the tabController after disposing the old one', (WidgetTester tester) async { + testWidgets('Replacing the tabController after disposing the old one', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/32428 TabController controller = TabController(vsync: const TestVSync(), length: 2); @@ -4760,7 +4759,7 @@ void main() { expect(find.text('Tab2'), findsOneWidget); }); - testWidgetsWithLeakTracking('DefaultTabController should allow for a length of zero', (WidgetTester tester) async { + testWidgets('DefaultTabController should allow for a length of zero', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/20292. List<String> tabTextContent = <String>[]; @@ -4832,7 +4831,7 @@ void main() { expect(find.text('No tabs'), findsOneWidget); }); - testWidgetsWithLeakTracking('DefaultTabController should allow dynamic length of tabs', (WidgetTester tester) async { + testWidgets('DefaultTabController should allow dynamic length of tabs', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/94504. final List<String> tabTitles = <String>[]; @@ -4906,7 +4905,7 @@ void main() { expect(find.text('Tab 2'), findsNothing); }); - testWidgetsWithLeakTracking('TabBar - updating to and from zero tabs', (WidgetTester tester) async { + testWidgets('TabBar - updating to and from zero tabs', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/68962. final List<String> tabTitles = <String>[]; TabController tabController = _tabController(length: tabTitles.length, vsync: const TestVSync()); @@ -4972,7 +4971,7 @@ void main() { expect(find.text('Tab 1'), findsNothing); }); - testWidgetsWithLeakTracking('TabBar expands vertically to accommodate the Icon and child Text() pair the same amount it would expand for Icon and text pair.', (WidgetTester tester) async { + testWidgets('TabBar expands vertically to accommodate the Icon and child Text() pair the same amount it would expand for Icon and text pair.', (WidgetTester tester) async { const List<Widget> tabListWithText = <Widget>[ Tab(icon: Icon(Icons.notifications), text: 'Test'), ]; @@ -4986,7 +4985,7 @@ void main() { expect(tabBarWithText.preferredSize, tabBarWithTextChild.preferredSize); }); - testWidgetsWithLeakTracking('Setting TabController index should make TabBar indicator immediately pop into the position', (WidgetTester tester) async { + testWidgets('Setting TabController index should make TabBar indicator immediately pop into the position', (WidgetTester tester) async { const List<Tab> tabs = <Tab>[ Tab(text: 'A'), Tab(text: 'B'), Tab(text: 'C'), ]; @@ -5051,7 +5050,7 @@ void main() { pageController.removeListener(pageControllerListener); }); - testWidgetsWithLeakTracking('Setting BouncingScrollPhysics on TabBarView does not include ClampingScrollPhysics', (WidgetTester tester) async { + testWidgets('Setting BouncingScrollPhysics on TabBarView does not include ClampingScrollPhysics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/57708 await tester.pumpWidget(MaterialApp( home: DefaultTabController( @@ -5069,7 +5068,7 @@ void main() { expect(pageView.physics.toString().contains('ClampingScrollPhysics'), isFalse); }); - testWidgetsWithLeakTracking('TabController.offset changes reflect labelColor', (WidgetTester tester) async { + testWidgets('TabController.offset changes reflect labelColor', (WidgetTester tester) async { final TabController controller = _tabController( vsync: const TestVSync(), length: 2, @@ -5154,14 +5153,14 @@ void main() { await testLabelColor(selectedColor: Colors.white, unselectedColor: Colors.transparent); }); - testWidgetsWithLeakTracking('Crash on dispose', (WidgetTester tester) async { + testWidgets('Crash on dispose', (WidgetTester tester) async { await tester.pumpWidget(const Padding(padding: EdgeInsets.only(right: 200.0), child: TabBarDemo())); await tester.tap(find.byIcon(Icons.directions_bike)); // There was a time where this would throw an exception // because we tried to send a notification on dispose. }); - testWidgetsWithLeakTracking("TabController's animation value should be in sync with TabBarView's scroll value when user interrupts ballistic scroll", (WidgetTester tester) async { + testWidgets("TabController's animation value should be in sync with TabBarView's scroll value when user interrupts ballistic scroll", (WidgetTester tester) async { final TabController tabController = _tabController( vsync: const TestVSync(), length: 3, @@ -5209,7 +5208,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Does not instantiate intermediate tabs during animation', (WidgetTester tester) async { + testWidgets('Does not instantiate intermediate tabs during animation', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/14316. final List<String> log = <String>[]; await tester.pumpWidget(MaterialApp( @@ -5255,7 +5254,7 @@ void main() { expect(log, <String>['init: 0', 'init: 3', 'dispose: 0']); }); - testWidgetsWithLeakTracking("TabController's animation value should be updated when TabController's index >= tabs's length", (WidgetTester tester) async { + testWidgets("TabController's animation value should be updated when TabController's index >= tabs's length", (WidgetTester tester) async { // This is a regression test for the issue brought up here // https://github.com/flutter/flutter/issues/79226 @@ -5311,7 +5310,7 @@ void main() { expect(controller.animation!.value, 1); }); - testWidgetsWithLeakTracking('Tab preferredSize gives correct value', (WidgetTester tester) async { + testWidgets('Tab preferredSize gives correct value', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -5335,7 +5334,7 @@ void main() { expect(thirdTab.preferredSize, const Size.fromHeight(72.0)); }); - testWidgetsWithLeakTracking('TabBar preferredSize gives correct value when there are both icon and text in tabs', (WidgetTester tester) async { + testWidgets('TabBar preferredSize gives correct value when there are both icon and text in tabs', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: DefaultTabController( length: 5, @@ -5361,7 +5360,7 @@ void main() { expect(tabBar.preferredSize, const Size.fromHeight(74.0)); }); - testWidgetsWithLeakTracking('TabBar preferredSize gives correct value when there is only icon or text in tabs', (WidgetTester tester) async { + testWidgets('TabBar preferredSize gives correct value when there is only icon or text in tabs', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: DefaultTabController( length: 5, @@ -5387,7 +5386,7 @@ void main() { expect(tabBar.preferredSize, const Size.fromHeight(48.0)); }); - testWidgetsWithLeakTracking('Tabs are given uniform padding in case of few tabs having both text and icon', (WidgetTester tester) async { + testWidgets('Tabs are given uniform padding in case of few tabs having both text and icon', (WidgetTester tester) async { const EdgeInsetsGeometry expectedPaddingAdjusted = EdgeInsets.symmetric(vertical: 13.0, horizontal: 16.0); const EdgeInsetsGeometry expectedPaddingDefault = EdgeInsets.symmetric(horizontal: 16.0); @@ -5417,7 +5416,7 @@ void main() { expect(tabThree.padding, expectedPaddingAdjusted); }); - testWidgetsWithLeakTracking('Tabs are given uniform padding when labelPadding is given', (WidgetTester tester) async { + testWidgets('Tabs are given uniform padding when labelPadding is given', (WidgetTester tester) async { const EdgeInsetsGeometry labelPadding = EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0); const EdgeInsetsGeometry expectedPaddingAdjusted = EdgeInsets.symmetric(vertical: 23.0, horizontal: 20.0); const EdgeInsetsGeometry expectedPaddingDefault = EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0); @@ -5449,7 +5448,7 @@ void main() { expect(tabThree.padding, expectedPaddingAdjusted); }); - testWidgetsWithLeakTracking('Tabs are given uniform padding TabBarTheme.labelPadding is given', (WidgetTester tester) async { + testWidgets('Tabs are given uniform padding TabBarTheme.labelPadding is given', (WidgetTester tester) async { const EdgeInsetsGeometry labelPadding = EdgeInsets.symmetric(vertical: 15.0, horizontal: 20); const EdgeInsetsGeometry expectedPaddingAdjusted = EdgeInsets.symmetric(vertical: 28.0, horizontal: 20.0); const EdgeInsetsGeometry expectedPaddingDefault = EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0); @@ -5483,7 +5482,7 @@ void main() { expect(tabThree.padding, expectedPaddingAdjusted); }); - testWidgetsWithLeakTracking('Change tab bar height', (WidgetTester tester) async { + testWidgets('Change tab bar height', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), home: DefaultTabController( @@ -5526,7 +5525,7 @@ void main() { expect(fourthTab.height, 85); }); - testWidgetsWithLeakTracking('Change tab bar height 2', (WidgetTester tester) async { + testWidgets('Change tab bar height 2', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: DefaultTabController( length: 1, @@ -5549,7 +5548,7 @@ void main() { expect(firstTab.height, 85); }); - testWidgetsWithLeakTracking('Test semantics of TabPageSelector', (WidgetTester tester) async { + testWidgets('Test semantics of TabPageSelector', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TabController controller = _tabController( @@ -5631,7 +5630,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Change the TabController should make both TabBar and TabBarView return to the initial index.', (WidgetTester tester) async { + testWidgets('Change the TabController should make both TabBar and TabBarView return to the initial index.', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/93237 Widget buildFrame(TabController controller, {required bool showLast}) { @@ -5703,7 +5702,7 @@ void main() { expect(pageController.page, 2); }); - testWidgetsWithLeakTracking('Do not crash when the new TabController.index is longer than the old length.', (WidgetTester tester) async { + testWidgets('Do not crash when the new TabController.index is longer than the old length.', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/97441 Widget buildFrame(TabController controller, {required bool showLast}) { @@ -5768,7 +5767,7 @@ void main() { expect(pageController.page, 2); }); - testWidgetsWithLeakTracking('TabBar InkWell splashFactory and overlayColor', (WidgetTester tester) async { + testWidgets('TabBar InkWell splashFactory and overlayColor', (WidgetTester tester) async { const InteractiveInkFeatureFactory splashFactory = NoSplash.splashFactory; final MaterialStateProperty<Color?> overlayColor = MaterialStateProperty.resolveWith<Color?>( (Set<MaterialState> states) => Colors.transparent, @@ -5824,7 +5823,7 @@ void main() { expect(tester.widget<InkWell>(find.byType(InkWell)).overlayColor, overlayColor); }); - testWidgetsWithLeakTracking('splashBorderRadius is passed to InkWell.borderRadius', (WidgetTester tester) async { + testWidgets('splashBorderRadius is passed to InkWell.borderRadius', (WidgetTester tester) async { const Color hoverColor = Color(0xfff44336); const double radius = 20; await tester.pumpWidget( @@ -5868,7 +5867,7 @@ void main() { gesture.removePointer(); }); - testWidgetsWithLeakTracking('Do not crash if the controller and TabBarView are updated at different phases(build and layout) of the same frame', (WidgetTester tester) async { + testWidgets('Do not crash if the controller and TabBarView are updated at different phases(build and layout) of the same frame', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104994. List<String> tabTextContent = <String>[]; @@ -5944,7 +5943,7 @@ void main() { expect(find.text('No tabs'), findsOneWidget); }); - testWidgetsWithLeakTracking("Throw if the controller's length mismatch the tabs count", (WidgetTester tester) async { + testWidgets("Throw if the controller's length mismatch the tabs count", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: DefaultTabController( @@ -5965,7 +5964,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking("Throw if the controller's length mismatch the TabBarView‘s children count", (WidgetTester tester) async { + testWidgets("Throw if the controller's length mismatch the TabBarView‘s children count", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: DefaultTabController( @@ -5993,7 +5992,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Tab has correct selected/unselected hover color', (WidgetTester tester) async { + testWidgets('Tab has correct selected/unselected hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B', 'C']; @@ -6043,7 +6042,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab has correct selected/unselected focus color', (WidgetTester tester) async { + testWidgets('Tab has correct selected/unselected focus color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B', 'C']; @@ -6093,7 +6092,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tab has correct selected/unselected pressed color', (WidgetTester tester) async { + testWidgets('Tab has correct selected/unselected pressed color', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B', 'C']; @@ -6139,7 +6138,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Default TabAlignment', (WidgetTester tester) async { + testWidgets('Material3 - Default TabAlignment', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; const double tabStartOffset = 52.0; @@ -6174,7 +6173,7 @@ void main() { expect(tabTwoRect.right, moreOrLessEquals(tabTwoRight)); }); - testWidgetsWithLeakTracking('TabAlignment.fill only supports non-scrollable tab bar', (WidgetTester tester) async { + testWidgets('TabAlignment.fill only supports non-scrollable tab bar', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B']; @@ -6195,7 +6194,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('TabAlignment.start & TabAlignment.startOffset only supports scrollable tab bar', (WidgetTester tester) async { + testWidgets('TabAlignment.start & TabAlignment.startOffset only supports scrollable tab bar', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final List<String> tabs = <String>['A', 'B']; @@ -6232,7 +6231,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Material3 - TabAlignment updates tabs alignment (non-scrollable TabBar)', (WidgetTester tester) async { + testWidgets('Material3 - TabAlignment updates tabs alignment (non-scrollable TabBar)', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; // Test TabAlignment.fill (default) when isScrollable is false. @@ -6267,7 +6266,7 @@ void main() { expect(tabTwoRect.right, moreOrLessEquals(tabTwoRight)); }); - testWidgetsWithLeakTracking('Material3 - TabAlignment updates tabs alignment (scrollable TabBar)', (WidgetTester tester) async { + testWidgets('Material3 - TabAlignment updates tabs alignment (scrollable TabBar)', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; const double tabStartOffset = 52.0; @@ -6351,7 +6350,7 @@ void main() { expect(tabTwoRect.right, equals(tabTwoRight)); }); - testWidgetsWithLeakTracking('Material3 - TabAlignment.start & TabAlignment.startOffset respects TextDirection.rtl', (WidgetTester tester) async { + testWidgets('Material3 - TabAlignment.start & TabAlignment.startOffset respects TextDirection.rtl', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; const double tabStartOffset = 52.0; @@ -6420,7 +6419,7 @@ void main() { expect(tabTwoRect.left, equals(tabTwoLeft)); }); - testWidgetsWithLeakTracking('Material3 - TabBar inherits the dividerColor of TabBarTheme', (WidgetTester tester) async { + testWidgets('Material3 - TabBar inherits the dividerColor of TabBarTheme', (WidgetTester tester) async { const Color dividerColor = Colors.yellow; await tester.pumpWidget( MaterialApp( @@ -6450,7 +6449,7 @@ void main() { }); // This is a regression test for https://github.com/flutter/flutter/pull/125974#discussion_r1239089151. - testWidgetsWithLeakTracking('Divider can be constrained', (WidgetTester tester) async { + testWidgets('Divider can be constrained', (WidgetTester tester) async { const Color dividerColor = Colors.yellow; await tester.pumpWidget( MaterialApp( @@ -6488,7 +6487,7 @@ void main() { expect(tester.getSize(find.byType(CustomPaint).at(1)).width, 360); }); - testWidgetsWithLeakTracking('TabBar labels use colors from labelStyle & unselectedLabelStyle', (WidgetTester tester) async { + testWidgets('TabBar labels use colors from labelStyle & unselectedLabelStyle', (WidgetTester tester) async { const String tab1 = 'Tab 1'; const String tab2 = 'Tab 2'; @@ -6531,7 +6530,7 @@ void main() { expect(unselectedTextStyle.fontStyle, unselectedLabelStyle.fontStyle); }); - testWidgetsWithLeakTracking('labelColor & unselectedLabelColor override labelStyle & unselectedLabelStyle colors', (WidgetTester tester) async { + testWidgets('labelColor & unselectedLabelColor override labelStyle & unselectedLabelStyle colors', (WidgetTester tester) async { const String tab1 = 'Tab 1'; const String tab2 = 'Tab 2'; @@ -6605,7 +6604,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('TabBar default selected/unselected text style', (WidgetTester tester) async { + testWidgets('TabBar default selected/unselected text style', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); final List<String> tabs = <String>['A', 'B', 'C']; @@ -6633,7 +6632,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBar default unselectedLabelColor inherits labelColor with 70% opacity', (WidgetTester tester) async { + testWidgets('TabBar default unselectedLabelColor inherits labelColor with 70% opacity', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/pull/116273 final List<String> tabs = <String>['A', 'B', 'C']; @@ -6660,7 +6659,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Default TabAlignment', (WidgetTester tester) async { + testWidgets('Material2 - Default TabAlignment', (WidgetTester tester) async { final List<String> tabs = <String>['A', 'B']; // Test default TabAlignment when isScrollable is false. @@ -6694,7 +6693,7 @@ void main() { expect(tabTwoRect.right, equals(tabTwoRight)); }); - testWidgetsWithLeakTracking('TabBar default tab indicator (primary)', (WidgetTester tester) async { + testWidgets('TabBar default tab indicator (primary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); @@ -6740,7 +6739,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TabBar default tab indicator (secondary)', (WidgetTester tester) async { + testWidgets('TabBar default tab indicator (secondary)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); final List<Widget> tabs = List<Widget>.generate(4, (int index) { return Tab(text: 'Tab $index'); @@ -6786,7 +6785,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - TabBar with padding isScrollable: true', (WidgetTester tester) async { + testWidgets('Material2 - TabBar with padding isScrollable: true', (WidgetTester tester) async { const double indicatorWeight = 2.0; // default indicator weight const EdgeInsets padding = EdgeInsets.only(left: 3.0, top: 7.0, right: 5.0, bottom: 3.0); @@ -6849,7 +6848,7 @@ void main() { expect(tabBarBox.size.width, tabRight); }); - testWidgetsWithLeakTracking('Material2 - TabAlignment updates tabs alignment (non-scrollable TabBar)', (WidgetTester tester) async { + testWidgets('Material2 - TabAlignment updates tabs alignment (non-scrollable TabBar)', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); final List<String> tabs = <String>['A', 'B']; diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index 5d74f774695..d7cf47c8a82 100644 --- a/packages/flutter/test/material/text_button_test.dart +++ b/packages/flutter/test/material/text_button_test.dart @@ -7,11 +7,10 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('TextButton, TextButton.icon defaults', (WidgetTester tester) async { + testWidgets('TextButton, TextButton.icon defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: colorScheme); final bool material3 = theme.useMaterial3; @@ -155,7 +154,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Default TextButton meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('Default TextButton meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -203,7 +202,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('TextButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { + testWidgets('TextButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); Color getTextColor(Set<MaterialState> states) { @@ -272,7 +271,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 ); - testWidgetsWithLeakTracking('TextButton default overlayColor resolves pressed state', (WidgetTester tester) async { + testWidgets('TextButton default overlayColor resolves pressed state', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final ThemeData theme = ThemeData(useMaterial3: true); @@ -327,7 +326,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('TextButton uses stateful color for text color in different states', (WidgetTester tester) async { + testWidgets('TextButton uses stateful color for text color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); const Color pressedColor = Color(0x00000001); @@ -396,7 +395,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('TextButton uses stateful color for icon color in different states', (WidgetTester tester) async { + testWidgets('TextButton uses stateful color for icon color in different states', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final Key buttonKey = UniqueKey(); @@ -465,7 +464,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('TextButton has no clip by default', (WidgetTester tester) async { + testWidgets('TextButton has no clip by default', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -482,7 +481,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Does TextButton work with hover', (WidgetTester tester) async { + testWidgets('Does TextButton work with hover', (WidgetTester tester) async { const Color hoverColor = Color(0xff001122); Color? getOverlayColor(Set<MaterialState> states) { @@ -511,7 +510,7 @@ void main() { expect(inkFeatures, paints..rect(color: hoverColor)); }); - testWidgetsWithLeakTracking('Does TextButton work with focus', (WidgetTester tester) async { + testWidgets('Does TextButton work with focus', (WidgetTester tester) async { const Color focusColor = Color(0xff001122); Color? getOverlayColor(Set<MaterialState> states) { @@ -543,7 +542,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Does TextButton contribute semantics', (WidgetTester tester) async { + testWidgets('Does TextButton contribute semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -588,7 +587,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Does TextButton scale with font scale changes', (WidgetTester tester) async { + testWidgets('Does TextButton scale with font scale changes', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -657,7 +656,7 @@ void main() { expect(tester.getSize(find.byType(Text)), const Size(126.0, 42.0)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/61016 - testWidgetsWithLeakTracking('TextButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('TextButton size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { Widget buildFrame(MaterialTapTargetSize tapTargetSize, Key key) { return Theme( data: ThemeData(useMaterial3: false, materialTapTargetSize: tapTargetSize), @@ -684,7 +683,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(66.0, 36.0)); }); - testWidgetsWithLeakTracking('TextButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { + testWidgets('TextButton onPressed and onLongPress callbacks are correctly called when non-null', (WidgetTester tester) async { bool wasPressed; Finder textButton; @@ -727,7 +726,7 @@ void main() { expect(tester.widget<TextButton>(textButton).enabled, false); }); - testWidgetsWithLeakTracking('TextButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { + testWidgets('TextButton onPressed and onLongPress callbacks are distinctly recognized', (WidgetTester tester) async { bool didPressButton = false; bool didLongPressButton = false; @@ -758,7 +757,7 @@ void main() { expect(didLongPressButton, isTrue); }); - testWidgetsWithLeakTracking("TextButton response doesn't hover when disabled", (WidgetTester tester) async { + testWidgets("TextButton response doesn't hover when disabled", (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTouch; final FocusNode focusNode = FocusNode(debugLabel: 'TextButton Focus'); final GlobalKey childKey = GlobalKey(); @@ -810,7 +809,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('disabled and hovered TextButton responds to mouse-exit', (WidgetTester tester) async { + testWidgets('disabled and hovered TextButton responds to mouse-exit', (WidgetTester tester) async { int onHoverCount = 0; late bool hover; @@ -872,7 +871,7 @@ void main() { expect(hover, false); }); - testWidgetsWithLeakTracking('Can set TextButton focus and Can set unFocus.', (WidgetTester tester) async { + testWidgets('Can set TextButton focus and Can set unFocus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'TextButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -903,7 +902,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('When TextButton disable, Can not set TextButton focus.', (WidgetTester tester) async { + testWidgets('When TextButton disable, Can not set TextButton focus.', (WidgetTester tester) async { final FocusNode node = FocusNode(debugLabel: 'TextButton Focus'); bool gotFocus = false; await tester.pumpWidget( @@ -928,7 +927,7 @@ void main() { node.dispose(); }); - testWidgetsWithLeakTracking('TextButton responds to density changes.', (WidgetTester tester) async { + testWidgets('TextButton responds to density changes.', (WidgetTester tester) async { const Key key = Key('test'); const Key childKey = Key('test child'); @@ -1071,7 +1070,7 @@ void main() { 'RTL', ].join(', '); - testWidgetsWithLeakTracking(testName, (WidgetTester tester) async { + testWidgets(testName, (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1219,7 +1218,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Override TextButton default padding', (WidgetTester tester) async { + testWidgets('Override TextButton default padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from(colorScheme: const ColorScheme.light()), @@ -1253,7 +1252,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.all(22)); }); - testWidgetsWithLeakTracking('Override theme fontSize changes padding', (WidgetTester tester) async { + testWidgets('Override theme fontSize changes padding', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.from( @@ -1284,7 +1283,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 8)); }); - testWidgetsWithLeakTracking('M3 TextButton has correct default padding', (WidgetTester tester) async { + testWidgets('M3 TextButton has correct default padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1310,7 +1309,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsets.symmetric(horizontal: 12,vertical: 8)); }); - testWidgetsWithLeakTracking('M3 TextButton.icon has correct default padding', (WidgetTester tester) async { + testWidgets('M3 TextButton.icon has correct default padding', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1337,7 +1336,7 @@ void main() { expect(paddingWidget.padding, const EdgeInsetsDirectional.fromSTEB(12, 8, 16, 8)); }); - testWidgetsWithLeakTracking('Fixed size TextButtons', (WidgetTester tester) async { + testWidgets('Fixed size TextButtons', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1370,7 +1369,7 @@ void main() { expect(tester.getSize(find.widgetWithText(TextButton, 'wx200')).height, 200); }); - testWidgetsWithLeakTracking('TextButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { + testWidgets('TextButton with NoSplash splashFactory paints nothing', (WidgetTester tester) async { Widget buildFrame({ InteractiveInkFeatureFactory? splashFactory }) { return MaterialApp( home: Scaffold( @@ -1410,7 +1409,7 @@ void main() { } }); - testWidgetsWithLeakTracking('TextButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { + testWidgets('TextButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); await tester.pumpWidget( @@ -1437,7 +1436,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('TextButton uses InkRipple when useMaterial3 is false', (WidgetTester tester) async { + testWidgets('TextButton uses InkRipple when useMaterial3 is false', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( @@ -1459,7 +1458,7 @@ void main() { expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('TextButton.icon does not overflow', (WidgetTester tester) async { + testWidgets('TextButton.icon does not overflow', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/77815 await tester.pumpWidget( MaterialApp( @@ -1480,7 +1479,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('TextButton.icon icon,label layout', (WidgetTester tester) async { + testWidgets('TextButton.icon icon,label layout', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); final Key iconKey = UniqueKey(); final Key labelKey = UniqueKey(); @@ -1517,7 +1516,7 @@ void main() { expect(tester.getRect(find.byKey(labelKey)), const Rect.fromLTRB(104.0, 0.0, 154.0, 100.0)); }); - testWidgetsWithLeakTracking('TextButton maximumSize', (WidgetTester tester) async { + testWidgets('TextButton maximumSize', (WidgetTester tester) async { final Key key0 = UniqueKey(); final Key key1 = UniqueKey(); @@ -1559,7 +1558,7 @@ void main() { expect(tester.getSize(find.byKey(key1)), const Size(104.0, 128.0)); }); - testWidgetsWithLeakTracking('Fixed size TextButton, same as minimumSize == maximumSize', (WidgetTester tester) async { + testWidgets('Fixed size TextButton, same as minimumSize == maximumSize', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1589,7 +1588,7 @@ void main() { expect(tester.getSize(find.widgetWithText(TextButton, '200,200')), const Size(200, 200)); }); - testWidgetsWithLeakTracking('TextButton changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('TextButton changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1667,7 +1666,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('TextButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('TextButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104595. await tester.pumpWidget(MaterialApp( home: SelectionArea( @@ -1690,7 +1689,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('TextButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { + testWidgets('TextButton.styleFrom can be used to set foreground and background colors', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1821,15 +1820,15 @@ void main() { await gesture.removePointer(); } - testWidgetsWithLeakTracking('TextButton statesController', (WidgetTester tester) async { + testWidgets('TextButton statesController', (WidgetTester tester) async { testStatesController(null, tester); }); - testWidgetsWithLeakTracking('TextButton.icon statesController', (WidgetTester tester) async { + testWidgets('TextButton.icon statesController', (WidgetTester tester) async { testStatesController(const Icon(Icons.add), tester); }); - testWidgetsWithLeakTracking('Disabled TextButton statesController', (WidgetTester tester) async { + testWidgets('Disabled TextButton statesController', (WidgetTester tester) async { int count = 0; void valueChanged() { count += 1; @@ -1853,7 +1852,7 @@ void main() { expect(count, 1); }); - testWidgetsWithLeakTracking('icon color can be different from the text color', (WidgetTester tester) async { + testWidgets('icon color can be different from the text color', (WidgetTester tester) async { final Key iconButtonKey = UniqueKey(); const ColorScheme colorScheme = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: colorScheme); @@ -1909,7 +1908,7 @@ void main() { expect(iconColor(), equals(Colors.blue)); }); - testWidgetsWithLeakTracking("TextButton.styleFrom doesn't throw exception on passing only one cursor", (WidgetTester tester) async { + testWidgets("TextButton.styleFrom doesn't throw exception on passing only one cursor", (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/118071. await tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/material/text_button_theme_test.dart b/packages/flutter/test/material/text_button_theme_test.dart index b9326fdcf10..473e0a64473 100644 --- a/packages/flutter/test/material/text_button_theme_test.dart +++ b/packages/flutter/test/material/text_button_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('TextButtonTheme lerp special cases', () { @@ -13,7 +12,7 @@ void main() { expect(identical(TextButtonThemeData.lerp(data, data, 0.5), data), true); }); - testWidgetsWithLeakTracking('Material3: Passing no TextButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material3: Passing no TextButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -50,7 +49,7 @@ void main() { expect(align.alignment, Alignment.center); }); - testWidgetsWithLeakTracking('Material2: Passing no TextButtonTheme returns defaults', (WidgetTester tester) async { + testWidgets('Material2: Passing no TextButtonTheme returns defaults', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( @@ -188,19 +187,19 @@ void main() { expect(align.alignment, alignment); } - testWidgetsWithLeakTracking('Button style overrides defaults', (WidgetTester tester) async { + testWidgets('Button style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(themeStyle: style)); await tester.pumpAndSettle(); checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallStyle: style)); await tester.pumpAndSettle(); checkButton(tester); @@ -208,26 +207,26 @@ void main() { // Same as the previous tests with empty ButtonStyle's instead of null. - testWidgetsWithLeakTracking('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { + testWidgets('Button style overrides defaults, empty theme and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: style, themeStyle: const ButtonStyle(), overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { + testWidgets('Button theme style overrides defaults, empty button and overall styles', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: style, overallStyle: const ButtonStyle())); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); - testWidgetsWithLeakTracking('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { + testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); }); - testWidgetsWithLeakTracking('Material3: Theme shadowColor', (WidgetTester tester) async { + testWidgets('Material3: Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); @@ -298,7 +297,7 @@ void main() { expect(material.shadowColor, shadowColor); }); - testWidgetsWithLeakTracking('Material2: Theme shadowColor', (WidgetTester tester) async { + testWidgets('Material2: Theme shadowColor', (WidgetTester tester) async { const ColorScheme colorScheme = ColorScheme.light(); const Color shadowColor = Color(0xff000001); const Color overriddenColor = Color(0xff000002); diff --git a/packages/flutter/test/material/text_field_focus_test.dart b/packages/flutter/test/material/text_field_focus_test.dart index e194a0bdac2..e70172ac021 100644 --- a/packages/flutter/test/material/text_field_focus_test.dart +++ b/packages/flutter/test/material/text_field_focus_test.dart @@ -7,11 +7,10 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/87099 - testWidgetsWithLeakTracking('TextField.autofocus should skip the element that never layout', (WidgetTester tester) async { + testWidgets('TextField.autofocus should skip the element that never layout', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -28,7 +27,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Dialog interaction', (WidgetTester tester) async { + testWidgets('Dialog interaction', (WidgetTester tester) async { expect(tester.testTextInput.isVisible, isFalse); final FocusNode focusNode = FocusNode(debugLabel: 'Editable Text Node'); @@ -72,7 +71,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('Request focus shows keyboard', (WidgetTester tester) async { + testWidgets('Request focus shows keyboard', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -100,7 +99,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('Autofocus shows keyboard', (WidgetTester tester) async { + testWidgets('Autofocus shows keyboard', (WidgetTester tester) async { expect(tester.testTextInput.isVisible, isFalse); await tester.pumpWidget( @@ -122,7 +121,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('Tap shows keyboard', (WidgetTester tester) async { + testWidgets('Tap shows keyboard', (WidgetTester tester) async { expect(tester.testTextInput.isVisible, isFalse); await tester.pumpWidget( @@ -161,7 +160,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('Focus triggers keep-alive', (WidgetTester tester) async { + testWidgets('Focus triggers keep-alive', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -202,7 +201,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('Focus keep-alive works with GlobalKey reparenting', (WidgetTester tester) async { + testWidgets('Focus keep-alive works with GlobalKey reparenting', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -238,7 +237,7 @@ void main() { expect(find.byType(TextField, skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('TextField with decoration:null', (WidgetTester tester) async { + testWidgets('TextField with decoration:null', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/16880 await tester.pumpWidget( @@ -259,7 +258,7 @@ void main() { expect(tester.testTextInput.isVisible, isTrue); }); - testWidgetsWithLeakTracking('Sibling FocusScopes', (WidgetTester tester) async { + testWidgets('Sibling FocusScopes', (WidgetTester tester) async { expect(tester.testTextInput.isVisible, isFalse); final FocusScopeNode focusScopeNode0 = FocusScopeNode(); @@ -328,7 +327,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('Sibling Navigators', (WidgetTester tester) async { + testWidgets('Sibling Navigators', (WidgetTester tester) async { expect(tester.testTextInput.isVisible, isFalse); final Key textField0 = UniqueKey(); @@ -403,7 +402,7 @@ void main() { expect(tester.testTextInput.isVisible, isFalse); }); - testWidgetsWithLeakTracking('A Focused text-field will lose focus when clicking outside of its hitbox with a mouse on desktop', (WidgetTester tester) async { + testWidgets('A Focused text-field will lose focus when clicking outside of its hitbox with a mouse on desktop', (WidgetTester tester) async { final FocusNode focusNodeA = FocusNode(); addTearDown(focusNodeA.dispose); final FocusNode focusNodeB = FocusNode(); @@ -463,7 +462,7 @@ void main() { expect(focusNodeB.hasFocus, true); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('A Focused text-field will not lose focus when clicking on its decoration', (WidgetTester tester) async { + testWidgets('A Focused text-field will not lose focus when clicking on its decoration', (WidgetTester tester) async { final FocusNode focusNodeA = FocusNode(); addTearDown(focusNodeA.dispose); final Key iconKey = UniqueKey(); @@ -501,7 +500,7 @@ void main() { expect(focusNodeA.hasFocus, true); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('A Focused text-field will lose focus when clicking outside of its hitbox with a mouse on desktop after tab navigation', (WidgetTester tester) async { + testWidgets('A Focused text-field will lose focus when clicking outside of its hitbox with a mouse on desktop after tab navigation', (WidgetTester tester) async { final FocusNode focusNodeA = FocusNode(debugLabel: 'A'); addTearDown(focusNodeA.dispose); final FocusNode focusNodeB = FocusNode(debugLabel: 'B'); diff --git a/packages/flutter/test/material/text_field_helper_text_test.dart b/packages/flutter/test/material/text_field_helper_text_test.dart index 962ea66a652..a5b4a06a421 100644 --- a/packages/flutter/test/material/text_field_helper_text_test.dart +++ b/packages/flutter/test/material/text_field_helper_text_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('TextField works correctly when changing helperText', (WidgetTester tester) async { + testWidgets('TextField works correctly when changing helperText', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: Material(child: TextField(decoration: InputDecoration(helperText: 'Awesome'))))); expect(find.text('Awesome'), findsNWidgets(1)); await tester.pump(const Duration(milliseconds: 100)); diff --git a/packages/flutter/test/material/text_field_restoration_test.dart b/packages/flutter/test/material/text_field_restoration_test.dart index 6e3a23d1d8d..acc7bddd4af 100644 --- a/packages/flutter/test/material/text_field_restoration_test.dart +++ b/packages/flutter/test/material/text_field_restoration_test.dart @@ -4,13 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const String text = 'Hello World! How are you? Life is good!'; const String alternativeText = 'Everything is awesome!!'; void main() { - testWidgetsWithLeakTracking('TextField restoration', (WidgetTester tester) async { + testWidgets('TextField restoration', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', @@ -21,7 +20,7 @@ void main() { await restoreAndVerify(tester); }); - testWidgetsWithLeakTracking('TextField restoration with external controller', (WidgetTester tester) async { + testWidgets('TextField restoration with external controller', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'root', diff --git a/packages/flutter/test/material/text_field_splash_test.dart b/packages/flutter/test/material/text_field_splash_test.dart index 28169c992ad..b16f0ced9b9 100644 --- a/packages/flutter/test/material/text_field_splash_test.dart +++ b/packages/flutter/test/material/text_field_splash_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/gestures.dart' show kPressTimeout; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; bool confirmCalled = false; bool cancelCalled = false; @@ -77,7 +76,7 @@ void main() { cancelCalled = false; }); - testWidgetsWithLeakTracking('Tapping should never cause a splash', (WidgetTester tester) async { + testWidgets('Tapping should never cause a splash', (WidgetTester tester) async { final Key textField1 = UniqueKey(); final Key textField2 = UniqueKey(); @@ -136,7 +135,7 @@ void main() { expect(cancelCalled, isFalse); }); - testWidgetsWithLeakTracking('Splash should never be created or canceled', (WidgetTester tester) async { + testWidgets('Splash should never be created or canceled', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Theme( diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 3cf292deb57..8d979cadb6e 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -23,7 +23,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart'; @@ -82,7 +81,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( 'Live Text button shows and hides correctly when LiveTextStatus changes', (WidgetTester tester) async { final LiveTextInputTester liveTextInputTester = LiveTextInputTester(); @@ -123,7 +122,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('text field selection toolbar should hide when the user starts typing', (WidgetTester tester) async { + testWidgets('text field selection toolbar should hide when the user starts typing', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -174,7 +173,7 @@ void main() { expect(state.selectionOverlay!.toolbarIsVisible, isFalse); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('Composing change does not hide selection handle caret', (WidgetTester tester) async { + testWidgets('Composing change does not hide selection handle caret', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/108673 final TextEditingController controller = _textEditingController(); @@ -264,7 +263,7 @@ void main() { expect(identical(handleRenderObjectBegin, handleRenderObjectEnd), true); }); - testWidgetsWithLeakTracking('can use the desktop cut/copy/paste buttons on Mac', (WidgetTester tester) async { + testWidgets('can use the desktop cut/copy/paste buttons on Mac', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'blah1 blah2', ); @@ -339,7 +338,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('can use the desktop cut/copy/paste buttons on Windows and Linux', (WidgetTester tester) async { + testWidgets('can use the desktop cut/copy/paste buttons on Windows and Linux', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'blah1 blah2', ); @@ -483,7 +482,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Look Up shows up on iOS only', (WidgetTester tester) async { + testWidgets('Look Up shows up on iOS only', (WidgetTester tester) async { String? lastLookUp; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -532,7 +531,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Search Web shows up on iOS only', (WidgetTester tester) async { + testWidgets('Search Web shows up on iOS only', (WidgetTester tester) async { String? lastSearch; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -581,7 +580,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Share shows up on iOS and Android', (WidgetTester tester) async { + testWidgets('Share shows up on iOS and Android', (WidgetTester tester) async { String? lastShare; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { @@ -633,7 +632,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('uses DefaultSelectionStyle for selection and cursor colors if provided', (WidgetTester tester) async { + testWidgets('uses DefaultSelectionStyle for selection and cursor colors if provided', (WidgetTester tester) async { const Color selectionColor = Colors.orange; const Color cursorColor = Colors.red; @@ -654,7 +653,7 @@ void main() { expect(state.widget.cursorColor, cursorColor); }); - testWidgetsWithLeakTracking('Use error cursor color when an InputDecoration with an errorText or error widget is provided', (WidgetTester tester) async { + testWidgets('Use error cursor color when an InputDecoration with an errorText or error widget is provided', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -690,7 +689,7 @@ void main() { expect(state.widget.cursorColor, Colors.teal); }); - testWidgetsWithLeakTracking('sets cursorOpacityAnimates on EditableText correctly', (WidgetTester tester) async { + testWidgets('sets cursorOpacityAnimates on EditableText correctly', (WidgetTester tester) async { // True @@ -719,7 +718,7 @@ void main() { expect(editableText.cursorOpacityAnimates, false); }); - testWidgetsWithLeakTracking('Activates the text field when receives semantics focus on desktops', (WidgetTester tester) async { + testWidgets('Activates the text field when receives semantics focus on desktops', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final SemanticsOwner semanticsOwner = tester.binding.pipelineOwner.semanticsOwner!; final FocusNode focusNode = _focusNode(); @@ -777,7 +776,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux })); - testWidgetsWithLeakTracking('TextField passes onEditingComplete to EditableText', (WidgetTester tester) async { + testWidgets('TextField passes onEditingComplete to EditableText', (WidgetTester tester) async { void onEditingComplete() { } await tester.pumpWidget( @@ -797,7 +796,7 @@ void main() { expect(editableTextWidget.onEditingComplete, onEditingComplete); }); - testWidgetsWithLeakTracking('TextField has consistent size', (WidgetTester tester) async { + testWidgets('TextField has consistent size', (WidgetTester tester) async { final Key textFieldKey = UniqueKey(); String? textFieldValue; @@ -840,7 +839,7 @@ void main() { expect(inputBox.size, equals(emptyInputSize)); }); - testWidgetsWithLeakTracking('Cursor blinks', (WidgetTester tester) async { + testWidgets('Cursor blinks', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField( @@ -883,7 +882,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/78918. - testWidgetsWithLeakTracking('RenderEditable sets correct text editing value', (WidgetTester tester) async { + testWidgets('RenderEditable sets correct text editing value', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'how are you'); final UniqueKey icon = UniqueKey(); await tester.pumpWidget( @@ -909,7 +908,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 0)); }); - testWidgetsWithLeakTracking('Cursor radius is 2.0', (WidgetTester tester) async { + testWidgets('Cursor radius is 2.0', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -924,7 +923,7 @@ void main() { expect(renderEditable.cursorRadius, const Radius.circular(2.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('cursor has expected defaults', (WidgetTester tester) async { + testWidgets('cursor has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField(), @@ -937,7 +936,7 @@ void main() { expect(textField.cursorRadius, null); }); - testWidgetsWithLeakTracking('cursor has expected radius value', (WidgetTester tester) async { + testWidgets('cursor has expected radius value', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField( @@ -951,7 +950,7 @@ void main() { expect(textField.cursorRadius, const Radius.circular(3.0)); }); - testWidgetsWithLeakTracking('clipBehavior has expected defaults', (WidgetTester tester) async { + testWidgets('clipBehavior has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField(), @@ -962,7 +961,7 @@ void main() { expect(textField.clipBehavior, Clip.hardEdge); }); - testWidgetsWithLeakTracking('Overflow clipBehavior none golden', (WidgetTester tester) async { + testWidgets('Overflow clipBehavior none golden', (WidgetTester tester) async { final OverflowWidgetTextEditingController controller = OverflowWidgetTextEditingController(); addTearDown(controller.dispose); final Widget widget = Theme( @@ -1001,7 +1000,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material cursor android golden', (WidgetTester tester) async { + testWidgets('Material cursor android golden', (WidgetTester tester) async { final Widget widget = Theme( data: ThemeData(useMaterial3: false), child: overlay( @@ -1030,7 +1029,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material cursor golden', (WidgetTester tester) async { + testWidgets('Material cursor golden', (WidgetTester tester) async { final Widget widget = Theme( data: ThemeData(useMaterial3: false), child: overlay( @@ -1061,7 +1060,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('TextInputFormatter gets correct selection value', (WidgetTester tester) async { + testWidgets('TextInputFormatter gets correct selection value', (WidgetTester tester) async { late TextEditingValue actualOldValue; late TextEditingValue actualNewValue; void callBack(TextEditingValue oldValue, TextEditingValue newValue) { @@ -1102,7 +1101,7 @@ void main() { ); }, skip: areKeyEventsHandledByPlatform); // [intended] only applies to platforms where we handle key events. - testWidgetsWithLeakTracking('text field selection toolbar renders correctly inside opacity', (WidgetTester tester) async { + testWidgets('text field selection toolbar renders correctly inside opacity', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1154,7 +1153,7 @@ void main() { ); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('text field toolbar options correctly changes options', + testWidgets('text field toolbar options correctly changes options', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', @@ -1205,7 +1204,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('text selection style 1', (WidgetTester tester) async { + testWidgets('text selection style 1', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure\nhi\nwasssup!', ); @@ -1254,7 +1253,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('text selection style 2', (WidgetTester tester) async { + testWidgets('text selection style 2', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure\nhi\nwasssup!', ); @@ -1319,7 +1318,7 @@ void main() { // Text selection styles are not fully supported on web. }, skip: isBrowser); // https://github.com/flutter/flutter/issues/93723 - testWidgetsWithLeakTracking( + testWidgets( 'text field toolbar options correctly changes options', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -1361,7 +1360,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('cursor layout has correct width', (WidgetTester tester) async { + testWidgets('cursor layout has correct width', (WidgetTester tester) async { final TextEditingController controller = TextEditingController.fromValue( const TextEditingValue(selection: TextSelection.collapsed(offset: 0)), ); @@ -1392,7 +1391,7 @@ void main() { EditableText.debugDeterministicCursor = false; }); - testWidgetsWithLeakTracking('cursor layout has correct radius', (WidgetTester tester) async { + testWidgets('cursor layout has correct radius', (WidgetTester tester) async { final TextEditingController controller = TextEditingController.fromValue( const TextEditingValue(selection: TextSelection.collapsed(offset: 0)), ); @@ -1424,7 +1423,7 @@ void main() { EditableText.debugDeterministicCursor = false; }); - testWidgetsWithLeakTracking('cursor layout has correct height', (WidgetTester tester) async { + testWidgets('cursor layout has correct height', (WidgetTester tester) async { final TextEditingController controller = TextEditingController.fromValue( const TextEditingValue(selection: TextSelection.collapsed(offset: 0)), ); @@ -1457,7 +1456,7 @@ void main() { EditableText.debugDeterministicCursor = false; }); - testWidgetsWithLeakTracking('Overflowing a line with spaces stops the cursor at the end', (WidgetTester tester) async { + testWidgets('Overflowing a line with spaces stops the cursor at the end', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1533,7 +1532,7 @@ void main() { expect(cursorOffsetSpaces.dx, inputWidth - kCaretGap); }); - testWidgetsWithLeakTracking('Overflowing a line with spaces stops the cursor at the end (rtl direction)', (WidgetTester tester) async { + testWidgets('Overflowing a line with spaces stops the cursor at the end (rtl direction)', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField( @@ -1560,7 +1559,7 @@ void main() { expect(cursorOffsetSpaces.dx >= 0, isTrue); }); - testWidgetsWithLeakTracking('mobile obscureText control test', (WidgetTester tester) async { + testWidgets('mobile obscureText control test', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField( @@ -1600,7 +1599,7 @@ void main() { expect(editText.substring(editText.length - 1), '\u2022'); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); - testWidgetsWithLeakTracking('desktop obscureText control test', (WidgetTester tester) async { + testWidgets('desktop obscureText control test', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField( @@ -1639,7 +1638,7 @@ void main() { TargetPlatform.windows, })); - testWidgetsWithLeakTracking('Caret position is updated on tap', (WidgetTester tester) async { + testWidgets('Caret position is updated on tap', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1666,7 +1665,7 @@ void main() { expect(controller.selection.extentOffset, tapIndex); }); - testWidgetsWithLeakTracking('enableInteractiveSelection = false, tap', (WidgetTester tester) async { + testWidgets('enableInteractiveSelection = false, tap', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1694,7 +1693,7 @@ void main() { expect(controller.selection.isCollapsed, isTrue); }); - testWidgetsWithLeakTracking('Can long press to select', (WidgetTester tester) async { + testWidgets('Can long press to select', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1729,7 +1728,7 @@ void main() { expect(controller.selection.baseOffset, testValue.indexOf('h')); }); - testWidgetsWithLeakTracking("Slight movements in longpress don't hide/show handles", (WidgetTester tester) async { + testWidgets("Slight movements in longpress don't hide/show handles", (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1768,7 +1767,7 @@ void main() { expect(handle.opacity.value, equals(1.0)); }); - testWidgetsWithLeakTracking('Long pressing a field with selection 0,0 shows the selection menu', (WidgetTester tester) async { + testWidgets('Long pressing a field with selection 0,0 shows the selection menu', (WidgetTester tester) async { late final TextEditingController controller; addTearDown(() => controller.dispose()); @@ -1789,7 +1788,7 @@ void main() { expect(find.text('Paste'), findsOneWidget); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('Entering text hides selection handle caret', (WidgetTester tester) async { + testWidgets('Entering text hides selection handle caret', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1831,7 +1830,7 @@ void main() { expect(handle.opacity.value, equals(0.0)); }); - testWidgetsWithLeakTracking('selection handles are excluded from the semantics', (WidgetTester tester) async { + testWidgets('selection handles are excluded from the semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); @@ -1877,7 +1876,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Mouse long press is just like a tap', (WidgetTester tester) async { + testWidgets('Mouse long press is just like a tap', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -1908,7 +1907,7 @@ void main() { expect(controller.selection.extentOffset, eIndex); }); - testWidgetsWithLeakTracking('Read only text field basic', (WidgetTester tester) async { + testWidgets('Read only text field basic', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'readonly'); await tester.pumpWidget( @@ -1946,7 +1945,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('does not paint toolbar when no options available', (WidgetTester tester) async { + testWidgets('does not paint toolbar when no options available', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -1967,7 +1966,7 @@ void main() { expect(find.byType(CupertinoTextSelectionToolbar), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('text field build empty toolbar when no options available', (WidgetTester tester) async { + testWidgets('text field build empty toolbar when no options available', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -1991,7 +1990,7 @@ void main() { expect(container.size, Size.zero); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('Swapping controllers should update selection', (WidgetTester tester) async { + testWidgets('Swapping controllers should update selection', (WidgetTester tester) async { TextEditingController controller = _textEditingController(text: 'readonly'); final OverlayEntry entry = OverlayEntry( builder: (BuildContext context) { @@ -2035,7 +2034,7 @@ void main() { expect(currentOverlaySelection.extentOffset, 7); }); - testWidgetsWithLeakTracking('Read only text should not compose', (WidgetTester tester) async { + testWidgets('Read only text should not compose', (WidgetTester tester) async { final TextEditingController controller = TextEditingController.fromValue( const TextEditingValue( text: 'readonly', @@ -2058,7 +2057,7 @@ void main() { expect(renderEditable.text, TextSpan(text:'readonly', style: renderEditable.text!.style)); }); - testWidgetsWithLeakTracking('Dynamically switching between read only and not read only should hide or show collapse cursor', (WidgetTester tester) async { + testWidgets('Dynamically switching between read only and not read only should hide or show collapse cursor', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'readonly'); bool readOnly = true; final OverlayEntry entry = OverlayEntry( @@ -2094,7 +2093,7 @@ void main() { expect(editableText.selectionOverlay!.handlesAreVisible, isFalse); }); - testWidgetsWithLeakTracking('Dynamically switching to read only should close input connection', (WidgetTester tester) async { + testWidgets('Dynamically switching to read only should close input connection', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'readonly'); bool readOnly = false; final OverlayEntry entry = OverlayEntry( @@ -2123,7 +2122,7 @@ void main() { expect(tester.testTextInput.hasAnyClients, isBrowser ? isTrue : isFalse); }); - testWidgetsWithLeakTracking('Dynamically switching to non read only should open input connection', (WidgetTester tester) async { + testWidgets('Dynamically switching to non read only should open input connection', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'readonly'); bool readOnly = true; final OverlayEntry entry = OverlayEntry( @@ -2152,7 +2151,7 @@ void main() { expect(tester.testTextInput.hasAnyClients, true); }); - testWidgetsWithLeakTracking('enableInteractiveSelection = false, long-press', (WidgetTester tester) async { + testWidgets('enableInteractiveSelection = false, long-press', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2180,7 +2179,7 @@ void main() { expect(controller.selection.baseOffset, testValue.length); }); - testWidgetsWithLeakTracking('Selection updates on tap down (Desktop platforms)', (WidgetTester tester) async { + testWidgets('Selection updates on tap down (Desktop platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2219,7 +2218,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking('Selection updates on tap up (Mobile platforms)', (WidgetTester tester) async { + testWidgets('Selection updates on tap up (Mobile platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); final bool isTargetPlatformApple = defaultTargetPlatform == TargetPlatform.iOS; @@ -2273,7 +2272,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking('Can select text with a mouse when wrapped in a GestureDetector with tap/double tap callbacks', (WidgetTester tester) async { + testWidgets('Can select text with a mouse when wrapped in a GestureDetector with tap/double tap callbacks', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/129161. final TextEditingController controller = _textEditingController(); @@ -2319,7 +2318,7 @@ void main() { expect(controller.selection.extentOffset, testValue.indexOf('g')); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Can select text by dragging with a mouse', (WidgetTester tester) async { + testWidgets('Can select text by dragging with a mouse', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2351,7 +2350,7 @@ void main() { expect(controller.selection.extentOffset, testValue.indexOf('g')); }); - testWidgetsWithLeakTracking('Can move cursor when dragging, when tap is on collapsed selection (iOS)', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging, when tap is on collapsed selection (iOS)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2403,7 +2402,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Cursor should not move on a quick touch drag when touch does not begin on previous selection (iOS)', (WidgetTester tester) async { + testWidgets('Cursor should not move on a quick touch drag when touch does not begin on previous selection (iOS)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2448,7 +2447,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2501,7 +2500,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging, when tap is on collapsed selection (iOS) - ListView', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging, when tap is on collapsed selection (iOS) - ListView', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/122519 final TextEditingController controller = _textEditingController(); @@ -2583,7 +2582,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging (Android)', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging (Android)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2627,7 +2626,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging (Android) - multiline', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging (Android) - multiline', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2672,7 +2671,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking('Can move cursor when dragging (Android) - ListView', (WidgetTester tester) async { + testWidgets('Can move cursor when dragging (Android) - ListView', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/122519 final TextEditingController controller = _textEditingController(); @@ -2743,7 +2742,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking('Continuous dragging does not cause flickering', (WidgetTester tester) async { + testWidgets('Continuous dragging does not cause flickering', (WidgetTester tester) async { int selectionChangedCount = 0; const String testValue = 'abc def ghi'; final TextEditingController controller = _textEditingController(text: testValue); @@ -2795,7 +2794,7 @@ void main() { expect(controller.selection.extentOffset, 9); }); - testWidgetsWithLeakTracking('Dragging in opposite direction also works', (WidgetTester tester) async { + testWidgets('Dragging in opposite direction also works', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2827,7 +2826,7 @@ void main() { expect(controller.selection.extentOffset, testValue.indexOf('e')); }); - testWidgetsWithLeakTracking('Slow mouse dragging also selects text', (WidgetTester tester) async { + testWidgets('Slow mouse dragging also selects text', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2858,7 +2857,7 @@ void main() { expect(controller.selection.extentOffset, testValue.indexOf('g')); }); - testWidgetsWithLeakTracking('Can drag handles to change selection on Apple platforms', (WidgetTester tester) async { + testWidgets('Can drag handles to change selection on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -2970,7 +2969,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('Can drag handles to change selection on non-Apple platforms', (WidgetTester tester) async { + testWidgets('Can drag handles to change selection on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -3075,7 +3074,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can drag the left handle while the right handle remains off-screen', (WidgetTester tester) async { // Text is longer than textfield width. @@ -3163,7 +3162,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Can drag the right handle while the left handle remains off-screen', (WidgetTester tester) async { // Text is longer than textfield width. @@ -3240,7 +3239,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Drag handles trigger feedback', (WidgetTester tester) async { + testWidgets('Drag handles trigger feedback', (WidgetTester tester) async { final FeedbackTester feedback = FeedbackTester(); addTearDown(feedback.dispose); final TextEditingController controller = _textEditingController(); @@ -3295,7 +3294,7 @@ void main() { expect(feedback.hapticCount, 2); }); - testWidgetsWithLeakTracking('Dragging a collapsed handle should trigger feedback.', (WidgetTester tester) async { + testWidgets('Dragging a collapsed handle should trigger feedback.', (WidgetTester tester) async { final FeedbackTester feedback = FeedbackTester(); addTearDown(feedback.dispose); final TextEditingController controller = _textEditingController(); @@ -3350,7 +3349,7 @@ void main() { expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('Cannot drag one handle past the other', (WidgetTester tester) async { + testWidgets('Cannot drag one handle past the other', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -3410,7 +3409,7 @@ void main() { expect(controller.selection.extentOffset, 5); }); - testWidgetsWithLeakTracking('Dragging between multiple lines keeps the contact point at the same place on the handle on Android', (WidgetTester tester) async { + testWidgets('Dragging between multiple lines keeps the contact point at the same place on the handle on Android', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( // 11 first line, 19 second line, 17 third line = length 49 text: 'a big house\njumped over a mouse\nOne more line yay', @@ -3598,7 +3597,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking('Dragging between multiple lines keeps the contact point at the same place on the handle on iOS', (WidgetTester tester) async { + testWidgets('Dragging between multiple lines keeps the contact point at the same place on the handle on iOS', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( // 11 first line, 19 second line, 17 third line = length 49 text: 'a big house\njumped over a mouse\nOne more line yay', @@ -3796,7 +3795,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking("dragging caret within a word doesn't affect composing region", (WidgetTester tester) async { + testWidgets("dragging caret within a word doesn't affect composing region", (WidgetTester tester) async { const String testValue = 'abc def ghi'; final TextEditingController controller = TextEditingController.fromValue( const TextEditingValue( @@ -3867,7 +3866,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS }) ); - testWidgetsWithLeakTracking('Can use selection toolbar', (WidgetTester tester) async { + testWidgets('Can use selection toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -3961,7 +3960,7 @@ void main() { await tester.pump(const Duration(milliseconds: 200)); // skip past the frame where the opacity is zero } - testWidgetsWithLeakTracking( + testWidgets( 'Check the toolbar appears below the TextField when there is not enough space above the TextField to show it', (WidgetTester tester) async { // This is a regression test for @@ -4015,7 +4014,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'the toolbar adjusts its position above/below when bottom inset changes', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -4083,7 +4082,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'Toolbar appears in the right places in multiline inputs', (WidgetTester tester) async { // This is a regression test for @@ -4140,7 +4139,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Selection toolbar fades in', (WidgetTester tester) async { + testWidgets('Selection toolbar fades in', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -4186,7 +4185,7 @@ void main() { // End the test here to ensure the animation is properly disposed of. }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('An obscured TextField is selectable by default', (WidgetTester tester) async { + testWidgets('An obscured TextField is selectable by default', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/32845 @@ -4213,7 +4212,7 @@ void main() { expect(controller.selection.isCollapsed, false); }); - testWidgetsWithLeakTracking('An obscured TextField is not selectable when disabled', (WidgetTester tester) async { + testWidgets('An obscured TextField is not selectable when disabled', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/32845 @@ -4241,7 +4240,7 @@ void main() { expect(controller.selection.isCollapsed, true); }); - testWidgetsWithLeakTracking('An obscured TextField is not selectable when read-only', (WidgetTester tester) async { + testWidgets('An obscured TextField is not selectable when read-only', (WidgetTester tester) async { // This is a regression test for // https://github.com/flutter/flutter/issues/32845 @@ -4269,7 +4268,7 @@ void main() { expect(controller.selection.isCollapsed, true); }); - testWidgetsWithLeakTracking('An obscured TextField is selected as one word', (WidgetTester tester) async { + testWidgets('An obscured TextField is selected as one word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget(overlay( @@ -4291,7 +4290,7 @@ void main() { expect(selection.extentOffset, 10); }); - testWidgetsWithLeakTracking('An obscured TextField has correct default context menu', (WidgetTester tester) async { + testWidgets('An obscured TextField has correct default context menu', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget(overlay( @@ -4327,7 +4326,7 @@ void main() { expect(find.text('Cut'), findsNothing); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('create selection overlay if none exists when toggleToolbar is called', (WidgetTester tester) async { + testWidgets('create selection overlay if none exists when toggleToolbar is called', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/111660 final Widget testWidget = MaterialApp( home: Scaffold( @@ -4376,7 +4375,7 @@ void main() { expect(tester.takeException(), isNull); }, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS})); - testWidgetsWithLeakTracking('TextField height with minLines unset', (WidgetTester tester) async { + testWidgets('TextField height with minLines unset', (WidgetTester tester) async { await tester.pumpWidget(textFieldBuilder()); RenderBox findInputBox() => tester.renderObject(find.byKey(textFieldKey)); @@ -4440,7 +4439,7 @@ void main() { expect(inputBox.size.width, fourLineInputSize.width); }); - testWidgetsWithLeakTracking('TextField height with minLines and maxLines', (WidgetTester tester) async { + testWidgets('TextField height with minLines and maxLines', (WidgetTester tester) async { await tester.pumpWidget(textFieldBuilder()); RenderBox findInputBox() => tester.renderObject(find.byKey(textFieldKey)); @@ -4491,7 +4490,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking('Multiline text when wrapped in Expanded', (WidgetTester tester) async { + testWidgets('Multiline text when wrapped in Expanded', (WidgetTester tester) async { Widget expandedTextFieldBuilder({ int? maxLines = 1, int? minLines, @@ -4548,7 +4547,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/pull/29093 - testWidgetsWithLeakTracking('Multiline text when wrapped in IntrinsicHeight', (WidgetTester tester) async { + testWidgets('Multiline text when wrapped in IntrinsicHeight', (WidgetTester tester) async { final Key intrinsicHeightKey = UniqueKey(); Widget intrinsicTextFieldBuilder(bool wrapInIntrinsic) { final TextFormField textField = TextFormField( @@ -4585,7 +4584,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/pull/29093 - testWidgetsWithLeakTracking('errorText empty string', (WidgetTester tester) async { + testWidgets('errorText empty string', (WidgetTester tester) async { Widget textFormFieldBuilder(String? errorText) { return boilerplate( child: Column( @@ -4630,7 +4629,7 @@ void main() { expect(inputBox.size.width, errorNullInputSize.width); }); - testWidgetsWithLeakTracking('Growable TextField when content height exceeds parent', (WidgetTester tester) async { + testWidgets('Growable TextField when content height exceeds parent', (WidgetTester tester) async { const double height = 200.0; const double padding = 24.0; @@ -4739,7 +4738,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Multiline hint text will wrap up to maxLines', (WidgetTester tester) async { + testWidgets('Multiline hint text will wrap up to maxLines', (WidgetTester tester) async { final Key textFieldKey = UniqueKey(); Widget builder(int? maxLines, final String hintMsg) { @@ -4776,7 +4775,7 @@ void main() { expect(findHintText(multipleLineText).size.height, greaterThanOrEqualTo(oneLineHintSize.height)); }); - testWidgetsWithLeakTracking('Can drag handles to change selection in multiline', (WidgetTester tester) async { + testWidgets('Can drag handles to change selection in multiline', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -4875,7 +4874,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Can scroll multiline input', (WidgetTester tester) async { + testWidgets('Can scroll multiline input', (WidgetTester tester) async { final Key textFieldKey = UniqueKey(); final TextEditingController controller = _textEditingController( text: kMoreThanFourLines, @@ -4971,7 +4970,7 @@ void main() { expect(inputBox.hitTest(BoxHitTestResult(), position: inputBox.globalToLocal(newFourthPos)), isFalse); }); - testWidgetsWithLeakTracking('TextField smoke test', (WidgetTester tester) async { + testWidgets('TextField smoke test', (WidgetTester tester) async { late String textFieldValue; await tester.pumpWidget( @@ -4999,7 +4998,7 @@ void main() { await checkText('Hello World'); }); - testWidgetsWithLeakTracking('TextField with global key', (WidgetTester tester) async { + testWidgets('TextField with global key', (WidgetTester tester) async { final GlobalKey textFieldKey = GlobalKey(debugLabel: 'textFieldKey'); late String textFieldValue; @@ -5029,7 +5028,7 @@ void main() { await checkText('Hello World'); }); - testWidgetsWithLeakTracking('TextField errorText trumps helperText', (WidgetTester tester) async { + testWidgets('TextField errorText trumps helperText', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -5047,7 +5046,7 @@ void main() { expect(find.text('error text'), findsOneWidget); }); - testWidgetsWithLeakTracking('TextField with default helperStyle', (WidgetTester tester) async { + testWidgets('TextField with default helperStyle', (WidgetTester tester) async { final ThemeData themeData = ThemeData(hintColor: Colors.blue[500], useMaterial3: false); await tester.pumpWidget( overlay( @@ -5066,7 +5065,7 @@ void main() { expect(helperText.style!.fontSize, Typography.englishLike2014.bodySmall!.fontSize); }); - testWidgetsWithLeakTracking('TextField with specified helperStyle', (WidgetTester tester) async { + testWidgets('TextField with specified helperStyle', (WidgetTester tester) async { final TextStyle style = TextStyle( inherit: false, color: Colors.pink[500], @@ -5087,7 +5086,7 @@ void main() { expect(helperText.style, style); }); - testWidgetsWithLeakTracking('TextField with default hintStyle', (WidgetTester tester) async { + testWidgets('TextField with default hintStyle', (WidgetTester tester) async { final TextStyle style = TextStyle( color: Colors.pink[500], fontSize: 10.0, @@ -5115,7 +5114,7 @@ void main() { expect(hintText.style!.fontSize, style.fontSize); }); - testWidgetsWithLeakTracking('TextField with specified hintStyle', (WidgetTester tester) async { + testWidgets('TextField with specified hintStyle', (WidgetTester tester) async { final TextStyle hintStyle = TextStyle( inherit: false, color: Colors.pink[500], @@ -5137,7 +5136,7 @@ void main() { expect(hintText.style, hintStyle); }); - testWidgetsWithLeakTracking('TextField with specified prefixStyle', (WidgetTester tester) async { + testWidgets('TextField with specified prefixStyle', (WidgetTester tester) async { final TextStyle prefixStyle = TextStyle( inherit: false, color: Colors.pink[500], @@ -5159,7 +5158,7 @@ void main() { expect(prefixText.style, prefixStyle); }); - testWidgetsWithLeakTracking('TextField prefix and suffix create a sibling node', (WidgetTester tester) async { + testWidgets('TextField prefix and suffix create a sibling node', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( overlay( @@ -5201,7 +5200,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField with specified suffixStyle', (WidgetTester tester) async { + testWidgets('TextField with specified suffixStyle', (WidgetTester tester) async { final TextStyle suffixStyle = TextStyle( color: Colors.pink[500], fontSize: 10.0, @@ -5222,7 +5221,7 @@ void main() { expect(suffixText.style, suffixStyle); }); - testWidgetsWithLeakTracking('TextField prefix and suffix appear correctly with no hint or label', (WidgetTester tester) async { + testWidgets('TextField prefix and suffix appear correctly with no hint or label', (WidgetTester tester) async { final Key secondKey = UniqueKey(); await tester.pumpWidget( @@ -5265,7 +5264,7 @@ void main() { expect(find.text('Suffix'), findsOneWidget); }); - testWidgetsWithLeakTracking('TextField prefix and suffix appear correctly with hint text', (WidgetTester tester) async { + testWidgets('TextField prefix and suffix appear correctly with hint text', (WidgetTester tester) async { final TextStyle hintStyle = TextStyle( inherit: false, color: Colors.pink[500], @@ -5325,7 +5324,7 @@ void main() { expect(suffixText.style, hintStyle); }); - testWidgetsWithLeakTracking('TextField prefix and suffix appear correctly with label text', (WidgetTester tester) async { + testWidgets('TextField prefix and suffix appear correctly with label text', (WidgetTester tester) async { final TextStyle prefixStyle = TextStyle( color: Colors.pink[500], fontSize: 10.0, @@ -5388,7 +5387,7 @@ void main() { expect(suffixText.style, suffixStyle); }); - testWidgetsWithLeakTracking('TextField label text animates', (WidgetTester tester) async { + testWidgets('TextField label text animates', (WidgetTester tester) async { final Key secondKey = UniqueKey(); await tester.pumpWidget( @@ -5429,7 +5428,7 @@ void main() { expect(newPos.dy, lessThan(pos.dy)); }); - testWidgetsWithLeakTracking('Icon is separated from input/label by 16+12', (WidgetTester tester) async { + testWidgets('Icon is separated from input/label by 16+12', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const TextField( @@ -5450,7 +5449,7 @@ void main() { expect(iconRight + 28.0, equals(tester.getTopLeft(find.byType(EditableText)).dx)); }); - testWidgetsWithLeakTracking('Collapsed hint text placement', (WidgetTester tester) async { + testWidgets('Collapsed hint text placement', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -5468,7 +5467,7 @@ void main() { expect(tester.getTopLeft(find.text('hint')), equals(tester.getTopLeft(find.byType(EditableText)))); }); - testWidgetsWithLeakTracking('Can align to center', (WidgetTester tester) async { + testWidgets('Can align to center', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SizedBox( @@ -5503,7 +5502,7 @@ void main() { expect(topLeft.dx, equals(399.0)); }); - testWidgetsWithLeakTracking('Can align to center within center', (WidgetTester tester) async { + testWidgets('Can align to center within center', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SizedBox( @@ -5539,7 +5538,7 @@ void main() { expect(topLeft.dx, equals(399.0)); }); - testWidgetsWithLeakTracking('Controller can update server', (WidgetTester tester) async { + testWidgets('Controller can update server', (WidgetTester tester) async { final TextEditingController controller1 = _textEditingController( text: 'Initial Text', ); @@ -5622,7 +5621,7 @@ void main() { expect(tester.testTextInput.editingState!['text'], equals('The Final Cut')); }); - testWidgetsWithLeakTracking('Cannot enter new lines onto single line TextField', (WidgetTester tester) async { + testWidgets('Cannot enter new lines onto single line TextField', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -5634,7 +5633,7 @@ void main() { expect(textController.text, 'abcdef'); }); - testWidgetsWithLeakTracking('Injected formatters are chained', (WidgetTester tester) async { + testWidgets('Injected formatters are chained', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -5655,7 +5654,7 @@ void main() { expect(textController.text, '#一#二#三#四#五#六'); }); - testWidgetsWithLeakTracking('Injected formatters are chained (deprecated names)', (WidgetTester tester) async { + testWidgets('Injected formatters are chained (deprecated names)', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -5676,7 +5675,7 @@ void main() { expect(textController.text, '#一#二#三#四#五#六'); }); - testWidgetsWithLeakTracking('Chained formatters are in sequence', (WidgetTester tester) async { + testWidgets('Chained formatters are in sequence', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -5703,7 +5702,7 @@ void main() { expect(textController.text, '\n1\n2\n3'); }); - testWidgetsWithLeakTracking('Chained formatters are in sequence (deprecated names)', (WidgetTester tester) async { + testWidgets('Chained formatters are in sequence (deprecated names)', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -5730,7 +5729,7 @@ void main() { expect(textController.text, '\n1\n2\n3'); }); - testWidgetsWithLeakTracking('Pasted values are formatted', (WidgetTester tester) async { + testWidgets('Pasted values are formatted', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget( @@ -5768,7 +5767,7 @@ void main() { expect(textController.text, '145623'); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('Pasted values are formatted (deprecated names)', (WidgetTester tester) async { + testWidgets('Pasted values are formatted (deprecated names)', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget( @@ -5806,7 +5805,7 @@ void main() { expect(textController.text, '145623'); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('Do not add LengthLimiting formatter to the user supplied list', (WidgetTester tester) async { + testWidgets('Do not add LengthLimiting formatter to the user supplied list', (WidgetTester tester) async { final List<TextInputFormatter> formatters = <TextInputFormatter>[]; await tester.pumpWidget( @@ -5822,7 +5821,7 @@ void main() { expect(formatters.isEmpty, isTrue); }); - testWidgetsWithLeakTracking('Text field scrolls the caret into view', (WidgetTester tester) async { + testWidgets('Text field scrolls the caret into view', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -5865,7 +5864,7 @@ void main() { expect(scrollableState.position.pixels, equals(222.0)); }); - testWidgetsWithLeakTracking('Multiline text field scrolls the caret into view', (WidgetTester tester) async { + testWidgets('Multiline text field scrolls the caret into view', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -5903,7 +5902,7 @@ void main() { expect(scrollableState.position.pixels, moreOrLessEquals(lineHeight, epsilon: 0.1)); }); - testWidgetsWithLeakTracking('haptic feedback', (WidgetTester tester) async { + testWidgets('haptic feedback', (WidgetTester tester) async { final FeedbackTester feedback = FeedbackTester(); addTearDown(feedback.dispose); final TextEditingController controller = _textEditingController(); @@ -5930,7 +5929,7 @@ void main() { expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('Text field drops selection color when losing focus', (WidgetTester tester) async { + testWidgets('Text field drops selection color when losing focus', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103341. final Key key1 = UniqueKey(); final Key key2 = UniqueKey(); @@ -5985,7 +5984,7 @@ void main() { expect(state2.widget.selectionColor, selectionColor); }); - testWidgetsWithLeakTracking('Selection is consistent with text length', (WidgetTester tester) async { + testWidgets('Selection is consistent with text length', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); controller.text = 'abcde'; @@ -6014,7 +6013,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/35848 - testWidgetsWithLeakTracking('Clearing text field with suffixIcon does not cause text selection exception', (WidgetTester tester) async { + testWidgets('Clearing text field with suffixIcon does not cause text selection exception', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Prefilled text.', ); @@ -6037,7 +6036,7 @@ void main() { expect(controller.text, ''); }); - testWidgetsWithLeakTracking('maxLength limits input.', (WidgetTester tester) async { + testWidgets('maxLength limits input.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6051,7 +6050,7 @@ void main() { expect(textController.text, '0123456789'); }); - testWidgetsWithLeakTracking('maxLength limits input with surrogate pairs.', (WidgetTester tester) async { + testWidgets('maxLength limits input with surrogate pairs.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6066,7 +6065,7 @@ void main() { expect(textController.text, '${surrogatePair}012345678'); }); - testWidgetsWithLeakTracking('maxLength limits input with grapheme clusters.', (WidgetTester tester) async { + testWidgets('maxLength limits input with grapheme clusters.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6081,7 +6080,7 @@ void main() { expect(textController.text, '${graphemeCluster}012345678'); }); - testWidgetsWithLeakTracking('maxLength limits input in the center of a maxed-out field.', (WidgetTester tester) async { + testWidgets('maxLength limits input in the center of a maxed-out field.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/37420. final TextEditingController textController = _textEditingController(); const String testValue = '0123456789'; @@ -6106,7 +6105,7 @@ void main() { expect(textController.text, testValue); }); - testWidgetsWithLeakTracking( + testWidgets( 'maxLength limits input in the center of a maxed-out field, with collapsed selection', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); @@ -6151,7 +6150,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'maxLength limits input in the center of a maxed-out field, with non-collapsed selection', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); @@ -6186,7 +6185,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('maxLength limits input length even if decoration is null.', (WidgetTester tester) async { + testWidgets('maxLength limits input length even if decoration is null.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6201,7 +6200,7 @@ void main() { expect(textController.text, '0123456789'); }); - testWidgetsWithLeakTracking('maxLength still works with other formatters', (WidgetTester tester) async { + testWidgets('maxLength still works with other formatters', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6222,7 +6221,7 @@ void main() { expect(textController.text, '#一#二#三#四#五'); }); - testWidgetsWithLeakTracking('maxLength still works with other formatters (deprecated names)', (WidgetTester tester) async { + testWidgets('maxLength still works with other formatters (deprecated names)', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6243,7 +6242,7 @@ void main() { expect(textController.text, '#一#二#三#四#五'); }); - testWidgetsWithLeakTracking("maxLength isn't enforced when maxLengthEnforcement.none.", (WidgetTester tester) async { + testWidgets("maxLength isn't enforced when maxLengthEnforcement.none.", (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6258,7 +6257,7 @@ void main() { expect(textController.text, '0123456789101112'); }); - testWidgetsWithLeakTracking('maxLength shows warning when maxLengthEnforcement.none.', (WidgetTester tester) async { + testWidgets('maxLength shows warning when maxLengthEnforcement.none.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); const TextStyle testStyle = TextStyle(color: Colors.deepPurpleAccent); @@ -6288,7 +6287,7 @@ void main() { expect(counterTextWidget.style!.color, isNot(equals(Colors.deepPurpleAccent))); }); - testWidgetsWithLeakTracking('maxLength shows warning in Material 3', (WidgetTester tester) async { + testWidgets('maxLength shows warning in Material 3', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); final ThemeData theme = ThemeData.from( colorScheme: const ColorScheme.light().copyWith(error: Colors.deepPurpleAccent), @@ -6320,7 +6319,7 @@ void main() { expect(counterTextWidget.style!.color, isNot(equals(Colors.deepPurpleAccent))); }); - testWidgetsWithLeakTracking('maxLength shows warning when maxLengthEnforcement.none with surrogate pairs.', (WidgetTester tester) async { + testWidgets('maxLength shows warning when maxLengthEnforcement.none with surrogate pairs.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); const TextStyle testStyle = TextStyle(color: Colors.deepPurpleAccent); @@ -6350,7 +6349,7 @@ void main() { expect(counterTextWidget.style!.color, isNot(equals(Colors.deepPurpleAccent))); }); - testWidgetsWithLeakTracking('maxLength shows warning when maxLengthEnforcement.none with grapheme clusters.', (WidgetTester tester) async { + testWidgets('maxLength shows warning when maxLengthEnforcement.none with grapheme clusters.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); const TextStyle testStyle = TextStyle(color: Colors.deepPurpleAccent); @@ -6380,7 +6379,7 @@ void main() { expect(counterTextWidget.style!.color, isNot(equals(Colors.deepPurpleAccent))); }); - testWidgetsWithLeakTracking('maxLength limits input with surrogate pairs.', (WidgetTester tester) async { + testWidgets('maxLength limits input with surrogate pairs.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6395,7 +6394,7 @@ void main() { expect(textController.text, '${surrogatePair}012345678'); }); - testWidgetsWithLeakTracking('maxLength limits input with grapheme clusters.', (WidgetTester tester) async { + testWidgets('maxLength limits input with grapheme clusters.', (WidgetTester tester) async { final TextEditingController textController = _textEditingController(); await tester.pumpWidget(boilerplate( @@ -6410,7 +6409,7 @@ void main() { expect(textController.text, '${graphemeCluster}012345678'); }); - testWidgetsWithLeakTracking('setting maxLength shows counter', (WidgetTester tester) async { + testWidgets('setting maxLength shows counter', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: Center( @@ -6430,7 +6429,7 @@ void main() { expect(find.text('5/10'), findsOneWidget); }); - testWidgetsWithLeakTracking('maxLength counter measures surrogate pairs as one character', (WidgetTester tester) async { + testWidgets('maxLength counter measures surrogate pairs as one character', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: Center( @@ -6451,7 +6450,7 @@ void main() { expect(find.text('1/10'), findsOneWidget); }); - testWidgetsWithLeakTracking('maxLength counter measures grapheme clusters as one character', (WidgetTester tester) async { + testWidgets('maxLength counter measures grapheme clusters as one character', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: Center( @@ -6472,7 +6471,7 @@ void main() { expect(find.text('1/10'), findsOneWidget); }); - testWidgetsWithLeakTracking('setting maxLength to TextField.noMaxLength shows only entered length', (WidgetTester tester) async { + testWidgets('setting maxLength to TextField.noMaxLength shows only entered length', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Material( child: Center( @@ -6492,7 +6491,7 @@ void main() { expect(find.text('5'), findsOneWidget); }); - testWidgetsWithLeakTracking('passing a buildCounter shows returned widget', (WidgetTester tester) async { + testWidgets('passing a buildCounter shows returned widget', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Center( @@ -6515,7 +6514,7 @@ void main() { expect(find.text('5 of 10'), findsOneWidget); }); - testWidgetsWithLeakTracking('TextField identifies as text field in semantics', (WidgetTester tester) async { + testWidgets('TextField identifies as text field in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -6535,7 +6534,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Disabled text field does not have tap action', (WidgetTester tester) async { + testWidgets('Disabled text field does not have tap action', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( const MaterialApp( @@ -6554,7 +6553,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Disabled text field semantics node still contains value', (WidgetTester tester) async { + testWidgets('Disabled text field semantics node still contains value', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -6575,7 +6574,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Readonly text field does not have tap action', (WidgetTester tester) async { + testWidgets('Readonly text field does not have tap action', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -6596,7 +6595,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Disabled text field hides helper and counter', (WidgetTester tester) async { + testWidgets('Disabled text field hides helper and counter', (WidgetTester tester) async { const String helperText = 'helper text'; const String counterText = 'counter text'; const String errorText = 'error text'; @@ -6643,7 +6642,7 @@ void main() { expect(errorWidget.style!.color, equals(Colors.transparent)); }); - testWidgetsWithLeakTracking('Disabled text field has default M2 disabled text style for the input text', (WidgetTester tester) async { + testWidgets('Disabled text field has default M2 disabled text style for the input text', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -6665,7 +6664,7 @@ void main() { expect(editableText.style.color, Colors.black38); // Colors.black38 is the default disabled color for ThemeData.light(). }); - testWidgetsWithLeakTracking('Disabled text field has default M3 disabled text style for the input text', (WidgetTester tester) async { + testWidgets('Disabled text field has default M3 disabled text style for the input text', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -6837,7 +6836,7 @@ void main() { expect(count, 1); }); - testWidgetsWithLeakTracking('Provided style correctly resolves for material states', (WidgetTester tester) async { + testWidgets('Provided style correctly resolves for material states', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -6872,7 +6871,7 @@ void main() { expect(editableText.style.color, Colors.blue); }); - testWidgetsWithLeakTracking('currentValueLength/maxValueLength are in the tree', (WidgetTester tester) async { + testWidgets('currentValueLength/maxValueLength are in the tree', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); @@ -6913,7 +6912,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Read only TextField identifies as read only text field in semantics', (WidgetTester tester) async { + testWidgets('Read only TextField identifies as read only text field in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -6937,7 +6936,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking("Disabled TextField can't be traversed to.", (WidgetTester tester) async { + testWidgets("Disabled TextField can't be traversed to.", (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'TextField 1'); addTearDown(focusNode1.dispose); final FocusNode focusNode2 = FocusNode(debugLabel: 'TextField 2'); @@ -7007,7 +7006,7 @@ void main() { await tester.pump(); } - testWidgetsWithLeakTracking('Shift test 1', (WidgetTester tester) async { + testWidgets('Shift test 1', (WidgetTester tester) async { await setupWidget(tester); const String testValue = 'a big house'; await tester.enterText(find.byType(TextField), testValue); @@ -7027,7 +7026,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Shift test 2', (WidgetTester tester) async { + testWidgets('Shift test 2', (WidgetTester tester) async { await setupWidget(tester); const String testValue = 'abcdefghi'; @@ -7048,7 +7047,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Control Shift test', (WidgetTester tester) async { + testWidgets('Control Shift test', (WidgetTester tester) async { await setupWidget(tester); const String testValue = 'their big house'; await tester.enterText(find.byType(TextField), testValue); @@ -7068,7 +7067,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Down and up test', (WidgetTester tester) async { + testWidgets('Down and up test', (WidgetTester tester) async { await setupWidget(tester); const String testValue = 'a big house'; await tester.enterText(find.byType(TextField), testValue); @@ -7098,7 +7097,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Down and up test 2', (WidgetTester tester) async { + testWidgets('Down and up test 2', (WidgetTester tester) async { await setupWidget(tester); const String testValue = 'a big house\njumped over a mouse\nOne more line yay'; // 11 \n 19 await tester.enterText(find.byType(TextField), testValue); @@ -7157,7 +7156,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Read only keyboard selection test', (WidgetTester tester) async { + testWidgets('Read only keyboard selection test', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'readonly'); await tester.pumpWidget( overlay( @@ -7181,7 +7180,7 @@ void main() { }, variant: KeySimulatorTransitModeVariant.all()); }, skip: areKeyEventsHandledByPlatform); // [intended] only applies to platforms where we handle key events. - testWidgetsWithLeakTracking('Copy paste test', (WidgetTester tester) async { + testWidgets('Copy paste test', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final TextEditingController controller = _textEditingController(); final TextField textField = @@ -7262,7 +7261,7 @@ void main() { ); // Regression test for https://github.com/flutter/flutter/issues/78219 - testWidgetsWithLeakTracking('Paste does not crash after calling TextController.text setter', (WidgetTester tester) async { + testWidgets('Paste does not crash after calling TextController.text setter', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final TextEditingController controller = _textEditingController(); final TextField textField = TextField( @@ -7317,7 +7316,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all(), ); - testWidgetsWithLeakTracking('Cut test', (WidgetTester tester) async { + testWidgets('Cut test', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final TextEditingController controller = _textEditingController(); final TextField textField = @@ -7399,7 +7398,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all() ); - testWidgetsWithLeakTracking('Select all test', (WidgetTester tester) async { + testWidgets('Select all test', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final TextEditingController controller = _textEditingController(); final TextField textField = @@ -7453,7 +7452,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all() ); - testWidgetsWithLeakTracking('Delete test', (WidgetTester tester) async { + testWidgets('Delete test', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final TextEditingController controller = _textEditingController(); final TextField textField = @@ -7510,7 +7509,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all(), ); - testWidgetsWithLeakTracking('Changing positions of text fields', (WidgetTester tester) async { + testWidgets('Changing positions of text fields', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final List<KeyEvent> events = <KeyEvent>[]; @@ -7608,7 +7607,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all() ); - testWidgetsWithLeakTracking('Changing focus test', (WidgetTester tester) async { + testWidgets('Changing focus test', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final List<KeyEvent> events = <KeyEvent>[]; @@ -7688,7 +7687,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all() ); - testWidgetsWithLeakTracking('Caret works when maxLines is null', (WidgetTester tester) async { + testWidgets('Caret works when maxLines is null', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -7715,7 +7714,7 @@ void main() { expect(controller.selection.baseOffset, 0); }); - testWidgetsWithLeakTracking('TextField baseline alignment no-strut', (WidgetTester tester) async { + testWidgets('TextField baseline alignment no-strut', (WidgetTester tester) async { final TextEditingController controllerA = _textEditingController(text: 'A'); final TextEditingController controllerB = _textEditingController(text: 'B'); final Key keyA = UniqueKey(); @@ -7777,7 +7776,7 @@ void main() { expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY); }); - testWidgetsWithLeakTracking('TextField baseline alignment', (WidgetTester tester) async { + testWidgets('TextField baseline alignment', (WidgetTester tester) async { final TextEditingController controllerA = _textEditingController(text: 'A'); final TextEditingController controllerB = _textEditingController(text: 'B'); final Key keyA = UniqueKey(); @@ -7838,7 +7837,7 @@ void main() { expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY); }); - testWidgetsWithLeakTracking('TextField semantics include label when unfocused and label/hint when focused if input is empty', (WidgetTester tester) async { + testWidgets('TextField semantics include label when unfocused and label/hint when focused if input is empty', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); final Key key = UniqueKey(); @@ -7870,7 +7869,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField semantics alway include label and not hint when input value is not empty', (WidgetTester tester) async { + testWidgets('TextField semantics alway include label and not hint when input value is not empty', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(text: 'value'); final Key key = UniqueKey(); @@ -7902,7 +7901,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField semantics always include label when no hint is given', (WidgetTester tester) async { + testWidgets('TextField semantics always include label when no hint is given', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(text: 'value'); final Key key = UniqueKey(); @@ -7933,7 +7932,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField semantics only include hint when it is visible', (WidgetTester tester) async { + testWidgets('TextField semantics only include hint when it is visible', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(text: 'value'); final Key key = UniqueKey(); @@ -7972,7 +7971,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField semantics', (WidgetTester tester) async { + testWidgets('TextField semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); final Key key = UniqueKey(); @@ -8105,7 +8104,7 @@ void main() { }); // Regressing test for https://github.com/flutter/flutter/issues/99763 - testWidgetsWithLeakTracking('Update textField semantics when obscureText changes', (WidgetTester tester) async { + testWidgets('Update textField semantics when obscureText changes', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); await tester.pumpWidget(_ObscureTextTestWidget(controller: controller)); @@ -8158,7 +8157,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField semantics, enableInteractiveSelection = false', (WidgetTester tester) async { + testWidgets('TextField semantics, enableInteractiveSelection = false', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); final Key key = UniqueKey(); @@ -8201,7 +8200,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField semantics for selections', (WidgetTester tester) async { + testWidgets('TextField semantics for selections', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController() ..text = 'Hello'; @@ -8292,7 +8291,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('TextField change selection with semantics', (WidgetTester tester) async { + testWidgets('TextField change selection with semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final SemanticsOwner semanticsOwner = tester.binding.pipelineOwner.semanticsOwner!; final TextEditingController controller = _textEditingController() @@ -8389,7 +8388,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Can activate TextField with explicit controller via semantics ', (WidgetTester tester) async { + testWidgets('Can activate TextField with explicit controller via semantics ', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17801 const String textInTextField = 'Hello'; @@ -8461,7 +8460,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('When clipboard empty, no semantics paste option', (WidgetTester tester) async { + testWidgets('When clipboard empty, no semantics paste option', (WidgetTester tester) async { const String textInTextField = 'Hello'; final SemanticsTester semantics = SemanticsTester(tester); @@ -8538,7 +8537,7 @@ void main() { // https://github.com/flutter/flutter/pull/57139#issuecomment-629048058 }, skip: isBrowser); // [intended] see above. - testWidgetsWithLeakTracking('TextField throws when not descended from a Material widget', (WidgetTester tester) async { + testWidgets('TextField throws when not descended from a Material widget', (WidgetTester tester) async { const Widget textField = TextField(); await tester.pumpWidget(textField); final dynamic exception = tester.takeException(); @@ -8546,7 +8545,7 @@ void main() { expect(exception.toString(), startsWith('No Material widget found.')); }); - testWidgetsWithLeakTracking('TextField loses focus when disabled', (WidgetTester tester) async { + testWidgets('TextField loses focus when disabled', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'TextField Focus Node'); addTearDown(focusNode.dispose); @@ -8614,7 +8613,7 @@ void main() { expect(focusNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('TextField displays text with text direction', (WidgetTester tester) async { + testWidgets('TextField displays text with text direction', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -8658,7 +8657,7 @@ void main() { expect(topLeft.dx, equals(160.0)); }); - testWidgetsWithLeakTracking('TextField semantics', (WidgetTester tester) async { + testWidgets('TextField semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); final Key key = UniqueKey(); @@ -8750,7 +8749,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('InputDecoration counterText can have a semanticCounterText', (WidgetTester tester) async { + testWidgets('InputDecoration counterText can have a semanticCounterText', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); final Key key = UniqueKey(); @@ -8799,7 +8798,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('InputDecoration errorText semantics', (WidgetTester tester) async { + testWidgets('InputDecoration errorText semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = _textEditingController(); final Key key = UniqueKey(); @@ -8842,7 +8841,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('floating label does not overlap with value at large textScaleFactors', (WidgetTester tester) async { + testWidgets('floating label does not overlap with value at large textScaleFactors', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(text: 'Just some text'); await tester.pumpWidget( MaterialApp( @@ -8867,7 +8866,7 @@ void main() { expect(labelRect.bottom, lessThanOrEqualTo(fieldRect.top)); }); - testWidgetsWithLeakTracking('TextField scrolls into view but does not bounce (SingleChildScrollView)', (WidgetTester tester) async { + testWidgets('TextField scrolls into view but does not bounce (SingleChildScrollView)', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/20485 final Key textField1 = UniqueKey(); @@ -8941,7 +8940,7 @@ void main() { expect(maxOffset, 200.0); }); - testWidgetsWithLeakTracking('TextField scrolls into view but does not bounce (ListView)', (WidgetTester tester) async { + testWidgets('TextField scrolls into view but does not bounce (ListView)', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/20485 final Key textField1 = UniqueKey(); @@ -9013,7 +9012,7 @@ void main() { expect(maxOffset, 50.0); }); - testWidgetsWithLeakTracking('onTap is called upon tap', (WidgetTester tester) async { + testWidgets('onTap is called upon tap', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( overlay( @@ -9036,7 +9035,7 @@ void main() { expect(tapCount, 3); }); - testWidgetsWithLeakTracking('onTap is not called, field is disabled', (WidgetTester tester) async { + testWidgets('onTap is not called, field is disabled', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( overlay( @@ -9056,7 +9055,7 @@ void main() { expect(tapCount, 0); }); - testWidgetsWithLeakTracking('Includes cursor for TextField', (WidgetTester tester) async { + testWidgets('Includes cursor for TextField', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/24612 Widget buildFrame({ @@ -9132,7 +9131,7 @@ void main() { expect(tester.getSize(find.byType(TextField)).width, WIDTH_OF_CHAR * text.length + 18.0 + CARET_GAP); }); - testWidgetsWithLeakTracking('TextField style is merged with theme', (WidgetTester tester) async { + testWidgets('TextField style is merged with theme', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/23994 final ThemeData themeData = ThemeData( @@ -9183,7 +9182,7 @@ void main() { expect(editableText.style.color, isNull); }); - testWidgetsWithLeakTracking('TextField style is merged with theme in Material 3', (WidgetTester tester) async { + testWidgets('TextField style is merged with theme in Material 3', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/23994 final ThemeData themeData = ThemeData( @@ -9238,7 +9237,7 @@ void main() { expect(editableText.style.color, isNull); }); - testWidgetsWithLeakTracking('style enforces required fields', (WidgetTester tester) async { + testWidgets('style enforces required fields', (WidgetTester tester) async { Widget buildFrame(TextStyle style) { return MaterialApp( home: Material( @@ -9269,7 +9268,7 @@ void main() { expect(tester.takeException(), isNotNull); }); - testWidgetsWithLeakTracking( + testWidgets( 'tap moves cursor to the edge of the word it tapped', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9304,7 +9303,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'tap with a mouse does not move cursor to the edge of the word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9340,7 +9339,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('tap moves cursor to the position tapped', (WidgetTester tester) async { + testWidgets('tap moves cursor to the position tapped', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -9371,7 +9370,7 @@ void main() { expectNoMaterialToolbar(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking( + testWidgets( 'two slow taps do not trigger a word selection', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9414,7 +9413,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Tapping on a collapsed selection toggles the toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9501,7 +9500,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Tapping on a non-collapsed selection toggles the toolbar and retains the selection', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9577,7 +9576,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word and first tap of double tap moves cursor (iOS)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9625,7 +9624,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking('iOS selectWordEdge works correctly', (WidgetTester tester) async { + testWidgets('iOS selectWordEdge works correctly', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'blah1 blah2', ); @@ -9656,7 +9655,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 0)); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking( + testWidgets( 'double tap does not select word on read-only obscured field', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9705,7 +9704,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word and first tap of double tap moves cursor and shows toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9752,7 +9751,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Custom toolbar test - Android text selection controls', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9790,7 +9789,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); - testWidgetsWithLeakTracking( + testWidgets( 'Custom toolbar test - Cupertino text selection controls', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -9824,7 +9823,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); - testWidgetsWithLeakTracking('selectionControls is passed to EditableText', (WidgetTester tester) async { + testWidgets('selectionControls is passed to EditableText', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -9841,7 +9840,7 @@ void main() { expect(widget.selectionControls, equals(materialTextSelectionControls)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Can double click + drag with a mouse to select word by word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -9890,7 +9889,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Can double tap + drag to select word by word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -9956,7 +9955,7 @@ void main() { 'all good people\n' // 22 + 16 => 38 'to come to the aid\n' // 38 + 19 => 57 'of their country.'; // 57 + 17 => 74 - testWidgetsWithLeakTracking( + testWidgets( 'Can triple tap to select a paragraph on mobile platforms when tapping at a word edge', (WidgetTester tester) async { // TODO(Renzo-Olivares): Enable for iOS, currently broken because selection overlay blocks the TextSelectionGestureDetector https://github.com/flutter/flutter/issues/123415. @@ -10014,7 +10013,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple tap to select a paragraph on mobile platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -10070,7 +10069,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Triple click at the beginning of a line should not select the previous paragraph', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132126 @@ -10125,7 +10124,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Triple click at the end of text should select the previous paragraph', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132126. @@ -10181,7 +10180,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple tap chains work on Non-Apple mobile platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -10272,7 +10271,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple tap chains work on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -10368,7 +10367,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple click chains work', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -10489,7 +10488,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'triple click after a click on desktop platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -10557,7 +10556,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple tap to select all on a single-line textfield on mobile platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -10612,7 +10611,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click to select all on a single-line textfield on desktop platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -10668,7 +10667,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click to select a line on Linux', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -10727,7 +10726,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.linux), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click to select a paragraph', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -10786,7 +10785,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click + drag to select line by line on Linux', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -10887,7 +10886,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.linux), ); - testWidgetsWithLeakTracking( + testWidgets( 'Can triple click + drag to select paragraph by paragraph', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -10988,7 +10987,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Going past triple click retains the selection on Apple platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11075,7 +11074,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Tap count resets when going past a triple tap on Android, Fuchsia, and Linux', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11189,7 +11188,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux }), ); - testWidgetsWithLeakTracking( + testWidgets( 'Double click and triple click alternate on Windows', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11307,7 +11306,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'double tap on top of cursor also selects word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11358,7 +11357,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double double tap just shows the selection menu', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11393,7 +11392,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); - testWidgetsWithLeakTracking( + testWidgets( 'double long press just shows the selection menu', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11424,7 +11423,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); - testWidgetsWithLeakTracking( + testWidgets( 'A single tap hides the selection menu', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11455,7 +11454,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); - testWidgetsWithLeakTracking('Drag selection hides the selection menu', (WidgetTester tester) async { + testWidgets('Drag selection hides the selection menu', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'blah1 blah2', ); @@ -11505,7 +11504,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'Long press on an autofocused field shows the selection menu', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11536,7 +11535,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu., ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap hold selects word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11586,7 +11585,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'tap after a double tap select is not affected', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11636,7 +11635,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press moves cursor to the exact long press position and shows toolbar when the field is focused', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11675,7 +11674,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press that starts on an unfocused TextField selects the word at the exact long press position and shows toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11710,7 +11709,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press selects word and shows toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11744,7 +11743,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press tap cannot initiate a double tap', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11790,7 +11789,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag extends the selection to the word under the drag and shows toolbar on lift on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11868,7 +11867,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag on a focused TextField moves the cursor under the drag and shows toolbar on lift', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -11940,7 +11939,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag on an unfocused TextField selects word-by-word and shows toolbar on lift', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -12008,7 +12007,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('long press drag can edge scroll on non-Apple platforms', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll on non-Apple platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12097,7 +12096,7 @@ void main() { expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-257.0, epsilon: 1)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('long press drag can edge scroll on Apple platforms - unfocused TextField', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll on Apple platforms - unfocused TextField', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12186,7 +12185,7 @@ void main() { expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-257.0, epsilon: 1)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('long press drag can edge scroll on Apple platforms - focused TextField', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll on Apple platforms - focused TextField', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12279,7 +12278,7 @@ void main() { expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-257.0, epsilon: 1)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('mouse click and drag can edge scroll', (WidgetTester tester) async { + testWidgets('mouse click and drag can edge scroll', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12348,7 +12347,7 @@ void main() { expect(textOffsetToPosition(tester, 0).dx, lessThan(-100.0)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('keyboard selection change scrolls the field', (WidgetTester tester) async { + testWidgets('keyboard selection change scrolls the field', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12419,7 +12418,7 @@ void main() { skip: isBrowser, // [intended] Browser handles arrow keys differently. ); - testWidgetsWithLeakTracking('long press drag can edge scroll vertically', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll vertically', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neigse Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12503,7 +12502,7 @@ void main() { await tester.pumpAndSettle(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('keyboard selection change scrolls the field vertically', (WidgetTester tester) async { + testWidgets('keyboard selection change scrolls the field vertically', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12577,7 +12576,7 @@ void main() { skip: isBrowser, // [intended] Browser handles arrow keys differently. ); - testWidgetsWithLeakTracking('mouse click and drag can edge scroll vertically', (WidgetTester tester) async { + testWidgets('mouse click and drag can edge scroll vertically', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges', ); @@ -12656,7 +12655,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking( + testWidgets( 'long tap after a double tap select is not affected', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -12705,7 +12704,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap after a long tap is not affected', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -12763,7 +12762,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double click after a click on desktop platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -12822,7 +12821,7 @@ void main() { variant: TargetPlatformVariant.desktop(), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap chains work', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -12897,7 +12896,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double click chains work', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -12989,7 +12988,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux }), ); - testWidgetsWithLeakTracking('double tapping a space selects the previous word on iOS', (WidgetTester tester) async { + testWidgets('double tapping a space selects the previous word on iOS', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: ' blah blah \n blah', ); @@ -13060,7 +13059,7 @@ void main() { expect(controller.value.selection.extentOffset, 14); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('selecting a space selects the space on non-iOS platforms', (WidgetTester tester) async { + testWidgets('selecting a space selects the space on non-iOS platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: ' blah blah', ); @@ -13115,7 +13114,7 @@ void main() { expect(controller.value.selection.extentOffset, 1); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux, TargetPlatform.fuchsia, TargetPlatform.android })); - testWidgetsWithLeakTracking('selecting a space selects the space on Desktop platforms', (WidgetTester tester) async { + testWidgets('selecting a space selects the space on Desktop platforms', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: ' blah blah', ); @@ -13187,7 +13186,7 @@ void main() { expect(controller.value.selection.extentOffset, 1); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux })); - testWidgetsWithLeakTracking('Force press does not set selection on Android or Fuchsia touch devices', (WidgetTester tester) async { + testWidgets('Force press does not set selection on Android or Fuchsia touch devices', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -13230,7 +13229,7 @@ void main() { expectNoMaterialToolbar(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('Force press sets selection on desktop platforms that do not support it', (WidgetTester tester) async { + testWidgets('Force press sets selection on desktop platforms that do not support it', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -13273,7 +13272,7 @@ void main() { expectNoMaterialToolbar(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('force press selects word', (WidgetTester tester) async { + testWidgets('force press selects word', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -13322,7 +13321,7 @@ void main() { expectCupertinoToolbarForPartialSelection(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('tap on non-force-press-supported devices work', (WidgetTester tester) async { + testWidgets('tap on non-force-press-supported devices work', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -13378,7 +13377,7 @@ void main() { // https://github.com/flutter/flutter/issues/43445 }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('default TextField debugFillProperties', (WidgetTester tester) async { + testWidgets('default TextField debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TextField().debugFillProperties(builder); @@ -13390,7 +13389,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('TextField implements debugFillProperties', (WidgetTester tester) async { + testWidgets('TextField implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); // Not checking controller, inputFormatters, focusNode @@ -13448,7 +13447,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking( + testWidgets( 'strut basic single line', (WidgetTester tester) async { await tester.pumpWidget( @@ -13473,7 +13472,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut TextStyle increases height', (WidgetTester tester) async { await tester.pumpWidget( @@ -13518,7 +13517,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut basic multi line', (WidgetTester tester) async { await tester.pumpWidget( @@ -13542,7 +13541,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut no force small strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -13573,7 +13572,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut no force large strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -13602,7 +13601,7 @@ void main() { skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 ); - testWidgetsWithLeakTracking( + testWidgets( 'strut height override', (WidgetTester tester) async { await tester.pumpWidget( @@ -13631,7 +13630,7 @@ void main() { skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 ); - testWidgetsWithLeakTracking( + testWidgets( 'strut forces field taller', (WidgetTester tester) async { await tester.pumpWidget( @@ -13662,7 +13661,7 @@ void main() { skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243 ); - testWidgetsWithLeakTracking('Caret center position', (WidgetTester tester) async { + testWidgets('Caret center position', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: Theme( @@ -13705,7 +13704,7 @@ void main() { expect(topLeft.dx, equals(383)); }); - testWidgetsWithLeakTracking('Caret indexes into trailing whitespace center align', (WidgetTester tester) async { + testWidgets('Caret indexes into trailing whitespace center align', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: Theme( @@ -13757,7 +13756,7 @@ void main() { expect(topLeft.dx, equals(383)); // Should be same as equivalent in 'Caret center position' }); - testWidgetsWithLeakTracking('selection handles are rendered and not faded away', (WidgetTester tester) async { + testWidgets('selection handles are rendered and not faded away', (WidgetTester tester) async { const String testText = 'lorem ipsum'; final TextEditingController controller = _textEditingController(text: testText); @@ -13790,7 +13789,7 @@ void main() { expect(right.opacity.value, equals(1.0)); }); - testWidgetsWithLeakTracking('iOS selection handles are rendered and not faded away', (WidgetTester tester) async { + testWidgets('iOS selection handles are rendered and not faded away', (WidgetTester tester) async { const String testText = 'lorem ipsum'; final TextEditingController controller = _textEditingController(text: testText); @@ -13821,7 +13820,7 @@ void main() { expect(right.opacity.value, equals(1.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('iPad Scribble selection change shows selection handles', (WidgetTester tester) async { + testWidgets('iPad Scribble selection change shows selection handles', (WidgetTester tester) async { const String testText = 'lorem ipsum'; final TextEditingController controller = _textEditingController(text: testText); @@ -13853,7 +13852,7 @@ void main() { expect(right.opacity.value, equals(1.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Tap shows handles but not toolbar', (WidgetTester tester) async { + testWidgets('Tap shows handles but not toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'abc def ghi', ); @@ -13875,7 +13874,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isFalse); }); - testWidgetsWithLeakTracking( + testWidgets( 'Tap in empty text field does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -13898,7 +13897,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Long press shows handles and toolbar', (WidgetTester tester) async { + testWidgets('Long press shows handles and toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'abc def ghi', ); @@ -13920,7 +13919,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isContextMenuProvidedByPlatform ? isFalse : isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'Long press in empty text field shows handles and toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -13943,7 +13942,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Double tap shows handles and toolbar', (WidgetTester tester) async { + testWidgets('Double tap shows handles and toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'abc def ghi', ); @@ -13967,7 +13966,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isContextMenuProvidedByPlatform ? isFalse : isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'Double tap in empty text field shows toolbar but not handles', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -13992,7 +13991,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse tap does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -14024,7 +14023,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse long press does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -14056,7 +14055,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse double tap does not show handles nor toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( @@ -14092,7 +14091,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Does not show handles when updated from the web engine', (WidgetTester tester) async { + testWidgets('Does not show handles when updated from the web engine', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'abc def ghi', ); @@ -14134,7 +14133,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Tapping selection handles toggles the toolbar', (WidgetTester tester) async { + testWidgets('Tapping selection handles toggles the toolbar', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'abc def ghi', ); @@ -14175,7 +14174,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isFalse); }); - testWidgetsWithLeakTracking('when TextField would be blocked by keyboard, it is shown with enough space for the selection handle', (WidgetTester tester) async { + testWidgets('when TextField would be blocked by keyboard, it is shown with enough space for the selection handle', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -14206,7 +14205,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/74566 - testWidgetsWithLeakTracking('TextField and last input character are visible on the screen when the cursor is not shown', (WidgetTester tester) async { + testWidgets('TextField and last input character are visible on the screen when the cursor is not shown', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); final ScrollController textFieldScrollController = ScrollController(); addTearDown(() { scrollController.dispose(); textFieldScrollController.dispose(); }); @@ -14252,7 +14251,7 @@ void main() { }); group('height', () { - testWidgetsWithLeakTracking('By default, TextField is at least kMinInteractiveDimension high', (WidgetTester tester) async { + testWidgets('By default, TextField is at least kMinInteractiveDimension high', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(), home: const Scaffold( @@ -14266,7 +14265,7 @@ void main() { expect(renderBox.size.height, greaterThanOrEqualTo(kMinInteractiveDimension)); }); - testWidgetsWithLeakTracking("When text is very small, TextField still doesn't go below kMinInteractiveDimension height", (WidgetTester tester) async { + testWidgets("When text is very small, TextField still doesn't go below kMinInteractiveDimension height", (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(), home: const Scaffold( @@ -14282,7 +14281,7 @@ void main() { expect(renderBox.size.height, kMinInteractiveDimension); }); - testWidgetsWithLeakTracking('When isDense, TextField can go below kMinInteractiveDimension height', (WidgetTester tester) async { + testWidgets('When isDense, TextField can go below kMinInteractiveDimension height', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( theme: ThemeData(), home: const Scaffold( @@ -14327,14 +14326,14 @@ void main() { ); } - testWidgetsWithLeakTracking('By default, intrinsic height is at least kMinInteractiveDimension high', (WidgetTester tester) async { + testWidgets('By default, intrinsic height is at least kMinInteractiveDimension high', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/54729 // If the intrinsic height does not match that of the height after // performLayout, this will fail. await tester.pumpWidget(buildTest(isDense: false)); }); - testWidgetsWithLeakTracking('When isDense, intrinsic height can go below kMinInteractiveDimension height', (WidgetTester tester) async { + testWidgets('When isDense, intrinsic height can go below kMinInteractiveDimension height', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/54729 // If the intrinsic height does not match that of the height after // performLayout, this will fail. @@ -14342,7 +14341,7 @@ void main() { }); }); }); - testWidgetsWithLeakTracking("Arrow keys don't move input focus", (WidgetTester tester) async { + testWidgets("Arrow keys don't move input focus", (WidgetTester tester) async { final TextEditingController controller1 = _textEditingController(); final TextEditingController controller2 = _textEditingController(); final TextEditingController controller3 = _textEditingController(); @@ -14439,7 +14438,7 @@ void main() { expect(focusNode3.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Scrolling shortcuts are disabled in text fields', (WidgetTester tester) async { + testWidgets('Scrolling shortcuts are disabled in text fields', (WidgetTester tester) async { bool scrollInvoked = false; await tester.pumpWidget( MaterialApp( @@ -14475,7 +14474,7 @@ void main() { expect(scrollInvoked, isFalse); }); - testWidgetsWithLeakTracking("A buildCounter that returns null doesn't affect the size of the TextField", (WidgetTester tester) async { + testWidgets("A buildCounter that returns null doesn't affect the size of the TextField", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/44909 final GlobalKey textField1Key = GlobalKey(); @@ -14505,7 +14504,7 @@ void main() { expect(textFieldSize1, equals(textFieldSize2)); }); - testWidgetsWithLeakTracking( + testWidgets( 'The selection menu displays in an Overlay without error', (WidgetTester tester) async { // This is a regression test for @@ -14549,7 +14548,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('clipboard status is checked via hasStrings without getting the full clipboard contents', (WidgetTester tester) async { + testWidgets('clipboard status is checked via hasStrings without getting the full clipboard contents', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -14597,7 +14596,7 @@ void main() { skip: kIsWeb, // [intended] web doesn't call hasStrings. ); - testWidgetsWithLeakTracking('TextField changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('TextField changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -14671,7 +14670,7 @@ void main() { await gesture.moveTo(center); }); - testWidgetsWithLeakTracking('TextField icons change mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('TextField icons change mouse cursor when hovered', (WidgetTester tester) async { // Test default cursor in icons area. await tester.pumpWidget( const MaterialApp( @@ -14759,7 +14758,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking('Text selection menu does not change mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('Text selection menu does not change mouse cursor when hovered', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -14797,7 +14796,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Caret rtl with changing width', (WidgetTester tester) async { + testWidgets('Caret rtl with changing width', (WidgetTester tester) async { late StateSetter setState; bool isWide = false; const double wideWidth = 300.0; @@ -14856,7 +14855,7 @@ void main() { expect(cursorRight, inputWidth - kCaretGap); }); - testWidgetsWithLeakTracking('Text selection menu hides after select all on desktop', (WidgetTester tester) async { + testWidgets('Text selection menu hides after select all on desktop', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -14907,7 +14906,7 @@ void main() { ); // Regressing test for https://github.com/flutter/flutter/issues/70625 - testWidgetsWithLeakTracking('TextFields can inherit [FloatingLabelBehaviour] from InputDecorationTheme.', (WidgetTester tester) async { + testWidgets('TextFields can inherit [FloatingLabelBehaviour] from InputDecorationTheme.', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); Widget textFieldBuilder({ FloatingLabelBehavior behavior = FloatingLabelBehavior.auto }) { return MaterialApp( @@ -14981,7 +14980,7 @@ void main() { await tester.pumpAndSettle(); } - testWidgetsWithLeakTracking('using none enforcement.', (WidgetTester tester) async { + testWidgets('using none enforcement.', (WidgetTester tester) async { const MaxLengthEnforcement enforcement = MaxLengthEnforcement.none; await setupWidget(tester, enforcement); @@ -15001,7 +15000,7 @@ void main() { expect(state.currentTextEditingValue.composing, TextRange.empty); }); - testWidgetsWithLeakTracking('using enforced.', (WidgetTester tester) async { + testWidgets('using enforced.', (WidgetTester tester) async { const MaxLengthEnforcement enforcement = MaxLengthEnforcement.enforced; await setupWidget(tester, enforcement); @@ -15025,7 +15024,7 @@ void main() { expect(state.currentTextEditingValue.composing, const TextRange(start: 3, end: 5)); }); - testWidgetsWithLeakTracking('using truncateAfterCompositionEnds.', (WidgetTester tester) async { + testWidgets('using truncateAfterCompositionEnds.', (WidgetTester tester) async { const MaxLengthEnforcement enforcement = MaxLengthEnforcement.truncateAfterCompositionEnds; await setupWidget(tester, enforcement); @@ -15049,7 +15048,7 @@ void main() { expect(state.currentTextEditingValue.composing, TextRange.empty); }); - testWidgetsWithLeakTracking('using default behavior for different platforms.', (WidgetTester tester) async { + testWidgets('using default behavior for different platforms.', (WidgetTester tester) async { await setupWidget(tester, null); final EditableTextState state = tester.state(find.byType(EditableText)); @@ -15082,7 +15081,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('TextField does not leak touch events when deadline has exceeded', (WidgetTester tester) async { + testWidgets('TextField does not leak touch events when deadline has exceeded', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/118340. int textFieldTapCount = 0; int prefixTapCount = 0; @@ -15133,7 +15132,7 @@ void main() { expect(suffixTapCount, 1); }); - testWidgetsWithLeakTracking('prefix/suffix buttons do not leak touch events', (WidgetTester tester) async { + testWidgets('prefix/suffix buttons do not leak touch events', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/39376. int textFieldTapCount = 0; @@ -15172,7 +15171,7 @@ void main() { expect(suffixTapCount, 1); }); - testWidgetsWithLeakTracking('autofill info has hint text', (WidgetTester tester) async { + testWidgets('autofill info has hint text', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -15195,7 +15194,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TextField at rest does not push any layers with alwaysNeedsAddToScene', (WidgetTester tester) async { + testWidgets('TextField at rest does not push any layers with alwaysNeedsAddToScene', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -15209,7 +15208,7 @@ void main() { expect(tester.layers.any((Layer layer) => layer.debugSubtreeNeedsAddToScene!), isFalse); }); - testWidgetsWithLeakTracking('Focused TextField does not push any layers with alwaysNeedsAddToScene', (WidgetTester tester) async { + testWidgets('Focused TextField does not push any layers with alwaysNeedsAddToScene', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); await tester.pumpWidget( MaterialApp( @@ -15226,7 +15225,7 @@ void main() { expect(tester.layers.any((Layer layer) => layer.debugSubtreeNeedsAddToScene!), isFalse); }); - testWidgetsWithLeakTracking('TextField does not push any layers with alwaysNeedsAddToScene after toolbar is dismissed', (WidgetTester tester) async { + testWidgets('TextField does not push any layers with alwaysNeedsAddToScene after toolbar is dismissed', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); await tester.pumpWidget( MaterialApp( @@ -15264,7 +15263,7 @@ void main() { expect(tester.layers.any((Layer layer) => layer.debugSubtreeNeedsAddToScene!), isFalse); }, skip: isContextMenuProvidedByPlatform); // [intended] only applies to platforms where we supply the context menu. - testWidgetsWithLeakTracking('cursor blinking respects TickerMode', (WidgetTester tester) async { + testWidgets('cursor blinking respects TickerMode', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); Widget builder({required bool tickerMode}) { return MaterialApp( @@ -15344,7 +15343,7 @@ void main() { expect(editable.showCursor.value, isTrue); }); - testWidgetsWithLeakTracking('can shift + tap to select with a keyboard (Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap to select with a keyboard (Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15387,7 +15386,7 @@ void main() { expect(controller.selection.extentOffset, 4); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can shift + tap to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15432,7 +15431,7 @@ void main() { expect(controller.selection.extentOffset, 4); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('shift tapping an unfocused field', (WidgetTester tester) async { + testWidgets('shift tapping an unfocused field', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15487,7 +15486,7 @@ void main() { expect(controller.selection.extentOffset, 20); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard (Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard (Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15592,7 +15591,7 @@ void main() { expect(controller.selection.extentOffset, 26); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard (non-Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15700,7 +15699,7 @@ void main() { expect(controller.selection.extentOffset, 26); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.windows })); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard, reversed (Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard, reversed (Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15804,7 +15803,7 @@ void main() { expect(controller.selection.extentOffset, 14); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can shift + tap + drag to select with a keyboard, reversed (non-Apple platforms)', (WidgetTester tester) async { + testWidgets('can shift + tap + drag to select with a keyboard, reversed (non-Apple platforms)', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); @@ -15913,7 +15912,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.windows })); // Regression test for https://github.com/flutter/flutter/issues/101587. - testWidgetsWithLeakTracking('Right clicking menu behavior', (WidgetTester tester) async { + testWidgets('Right clicking menu behavior', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'blah1 blah2', ); @@ -15992,7 +15991,7 @@ void main() { skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu. ); - testWidgetsWithLeakTracking('Cannot request focus when canRequestFocus is false', (WidgetTester tester) async { + testWidgets('Cannot request focus when canRequestFocus is false', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); // Default test. The canRequestFocus is true by default and the text field can be focused @@ -16035,7 +16034,7 @@ void main() { }); group('Right click focus', () { - testWidgetsWithLeakTracking('Can right click to focus multiple times', (WidgetTester tester) async { + testWidgets('Can right click to focus multiple times', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/103228 final FocusNode focusNode1 = _focusNode(); final FocusNode focusNode2 = _focusNode(); @@ -16090,7 +16089,7 @@ void main() { expect(focusNode2.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Can right click to focus on previously selected word on Apple platforms', (WidgetTester tester) async { + testWidgets('Can right click to focus on previously selected word on Apple platforms', (WidgetTester tester) async { final FocusNode focusNode1 = _focusNode(); final FocusNode focusNode2 = _focusNode(); final TextEditingController controller = _textEditingController( @@ -16189,7 +16188,7 @@ void main() { expect(controller.selection.extentOffset, 5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Right clicking cannot request focus if canRequestFocus is false', (WidgetTester tester) async { + testWidgets('Right clicking cannot request focus if canRequestFocus is false', (WidgetTester tester) async { final FocusNode focusNode = _focusNode(); final UniqueKey key = UniqueKey(); await tester.pumpWidget( @@ -16219,7 +16218,7 @@ void main() { }); group('context menu', () { - testWidgetsWithLeakTracking('builds AdaptiveTextSelectionToolbar by default', (WidgetTester tester) async { + testWidgets('builds AdaptiveTextSelectionToolbar by default', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( MaterialApp( @@ -16250,7 +16249,7 @@ void main() { skip: kIsWeb, // [intended] on web the browser handles the context menu. ); - testWidgetsWithLeakTracking('contextMenuBuilder is used in place of the default text selection toolbar', (WidgetTester tester) async { + testWidgets('contextMenuBuilder is used in place of the default text selection toolbar', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TextEditingController controller = _textEditingController(); await tester.pumpWidget( @@ -16288,7 +16287,7 @@ void main() { skip: kIsWeb, // [intended] on web the browser handles the context menu. ); - testWidgetsWithLeakTracking('contextMenuBuilder changes from default to null', (WidgetTester tester) async { + testWidgets('contextMenuBuilder changes from default to null', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TextEditingController controller = _textEditingController(); await tester.pumpWidget(MaterialApp(home: Material(child: TextField(key: key, controller: controller)))); @@ -16333,7 +16332,7 @@ void main() { }); group('magnifier builder', () { - testWidgetsWithLeakTracking('should build custom magnifier if given', + testWidgets('should build custom magnifier if given', (WidgetTester tester) async { final Widget customMagnifier = Container( key: UniqueKey(), @@ -16365,7 +16364,7 @@ void main() { }); group('defaults', () { - testWidgetsWithLeakTracking('should build Magnifier on Android', (WidgetTester tester) async { + testWidgets('should build Magnifier on Android', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Scaffold(body: TextField())) ); @@ -16384,7 +16383,7 @@ void main() { isA<TextMagnifier>()); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('should build CupertinoMagnifier on iOS', + testWidgets('should build CupertinoMagnifier on iOS', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Scaffold(body: TextField())) @@ -16404,7 +16403,7 @@ void main() { isA<CupertinoTextMagnifier>()); }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('should build nothing on Android and iOS', + testWidgets('should build nothing on Android and iOS', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Scaffold(body: TextField())) @@ -16434,7 +16433,7 @@ void main() { late ValueNotifier<MagnifierInfo> magnifierInfo; final Widget fakeMagnifier = Container(key: UniqueKey()); - testWidgetsWithLeakTracking( + testWidgets( 'Can drag handles to show, unshow, and update magnifier', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); @@ -16498,7 +16497,7 @@ void main() { expect(find.byKey(fakeMagnifier.key!), findsNothing); }); - testWidgetsWithLeakTracking('Can drag to show, unshow, and update magnifier', (WidgetTester tester) async { + testWidgets('Can drag to show, unshow, and update magnifier', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); await tester.pumpWidget( MaterialApp( @@ -16599,7 +16598,7 @@ void main() { expect(find.byKey(fakeMagnifier.key!), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Can long press to show, unshow, and update magnifier', (WidgetTester tester) async { + testWidgets('Can long press to show, unshow, and update magnifier', (WidgetTester tester) async { final TextEditingController controller = _textEditingController(); final bool isTargetPlatformAndroid = defaultTargetPlatform == TargetPlatform.android; await tester.pumpWidget( @@ -16663,7 +16662,7 @@ void main() { expect(find.byKey(fakeMagnifier.key!), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking('magnifier does not show when tapping outside field', (WidgetTester tester) async { + testWidgets('magnifier does not show when tapping outside field', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/128321 await tester.pumpWidget( MaterialApp( @@ -16713,7 +16712,7 @@ void main() { }); group('TapRegion integration', () { - testWidgetsWithLeakTracking('Tapping outside loses focus on desktop', (WidgetTester tester) async { + testWidgets('Tapping outside loses focus on desktop', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -16748,7 +16747,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isFalse); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking("Tapping outside doesn't lose focus on mobile", (WidgetTester tester) async { + testWidgets("Tapping outside doesn't lose focus on mobile", (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -16784,7 +16783,7 @@ void main() { expect(focusNode.hasPrimaryFocus, kIsWeb ? isFalse : isTrue); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking("Tapping on toolbar doesn't lose focus", (WidgetTester tester) async { + testWidgets("Tapping on toolbar doesn't lose focus", (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); final TextEditingController controller = _textEditingController(text: 'A B C'); addTearDown(focusNode.dispose); @@ -16839,7 +16838,7 @@ void main() { skip: isBrowser, // [intended] On the web, the toolbar isn't rendered by Flutter. ); - testWidgetsWithLeakTracking("Tapping on input decorator doesn't lose focus", (WidgetTester tester) async { + testWidgets("Tapping on input decorator doesn't lose focus", (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -16879,7 +16878,7 @@ void main() { // PointerDownEvents can't be trackpad events, apparently, so we skip that one. for (final PointerDeviceKind pointerDeviceKind in PointerDeviceKind.values.toSet()..remove(PointerDeviceKind.trackpad)) { - testWidgetsWithLeakTracking('Default TextField handling of onTapOutside follows platform conventions for ${pointerDeviceKind.name}', (WidgetTester tester) async { + testWidgets('Default TextField handling of onTapOutside follows platform conventions for ${pointerDeviceKind.name}', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -16935,7 +16934,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Builds the corresponding default spell check toolbar by platform', (WidgetTester tester) async { + testWidgets('Builds the corresponding default spell check toolbar by platform', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; late final BuildContext builderContext; @@ -16987,7 +16986,7 @@ void main() { } }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Builds the corresponding default spell check configuration by platform', (WidgetTester tester) async { + testWidgets('Builds the corresponding default spell check configuration by platform', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; @@ -17045,7 +17044,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking('text selection toolbar is hidden on tap down', (WidgetTester tester) async { + testWidgets('text selection toolbar is hidden on tap down', (WidgetTester tester) async { final TextEditingController controller = _textEditingController( text: 'blah1 blah2', ); diff --git a/packages/flutter/test/material/text_form_field_restoration_test.dart b/packages/flutter/test/material/text_form_field_restoration_test.dart index 570e8fa11c0..fd9d365e234 100644 --- a/packages/flutter/test/material/text_form_field_restoration_test.dart +++ b/packages/flutter/test/material/text_form_field_restoration_test.dart @@ -4,13 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const String text = 'Hello World! How are you? Life is good!'; const String alternativeText = 'Everything is awesome!!'; void main() { - testWidgetsWithLeakTracking('TextField restoration', (WidgetTester tester) async { + testWidgets('TextField restoration', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', @@ -21,7 +20,7 @@ void main() { await restoreAndVerify(tester); }); - testWidgetsWithLeakTracking('TextField restoration with external controller', (WidgetTester tester) async { + testWidgets('TextField restoration with external controller', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'root', @@ -34,7 +33,7 @@ void main() { await restoreAndVerify(tester); }); - testWidgetsWithLeakTracking('State restoration (No Form ancestor) - onUserInteraction error text validation', (WidgetTester tester) async { + testWidgets('State restoration (No Form ancestor) - onUserInteraction error text validation', (WidgetTester tester) async { String? errorText(String? value) => '$value/error'; late GlobalKey<FormFieldState<String>> formState; @@ -92,7 +91,7 @@ void main() { expect(find.text(errorText('bar')!), findsOneWidget); }); - testWidgetsWithLeakTracking('State Restoration (No Form ancestor) - validator sets the error text only when validate is called', (WidgetTester tester) async { + testWidgets('State Restoration (No Form ancestor) - validator sets the error text only when validate is called', (WidgetTester tester) async { String? errorText(String? value) => '$value/error'; late GlobalKey<FormFieldState<String>> formState; diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index 7d2a6755a50..99b739d56dd 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart'; @@ -26,7 +25,7 @@ void main() { await Clipboard.setData(const ClipboardData(text: 'Clipboard data')); }); - testWidgetsWithLeakTracking('can use the desktop cut/copy/paste buttons on Mac', (WidgetTester tester) async { + testWidgets('can use the desktop cut/copy/paste buttons on Mac', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -103,7 +102,7 @@ void main() { skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. ); - testWidgetsWithLeakTracking('can use the desktop cut/copy/paste buttons on Windows and Linux', (WidgetTester tester) async { + testWidgets('can use the desktop cut/copy/paste buttons on Windows and Linux', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -250,7 +249,7 @@ void main() { skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. ); - testWidgetsWithLeakTracking( + testWidgets( '$SelectionOverlay is not leaking', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( @@ -279,7 +278,7 @@ void main() { skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. ); - testWidgetsWithLeakTracking('the desktop cut/copy/paste buttons are disabled for read-only obscured form fields', (WidgetTester tester) async { + testWidgets('the desktop cut/copy/paste buttons are disabled for read-only obscured form fields', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -324,7 +323,7 @@ void main() { skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. ); - testWidgetsWithLeakTracking('the desktop cut/copy buttons are disabled for obscured form fields', (WidgetTester tester) async { + testWidgets('the desktop cut/copy buttons are disabled for obscured form fields', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -376,7 +375,7 @@ void main() { skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. ); - testWidgetsWithLeakTracking('TextFormField accepts TextField.noMaxLength as value to maxLength parameter', (WidgetTester tester) async { + testWidgets('TextFormField accepts TextField.noMaxLength as value to maxLength parameter', (WidgetTester tester) async { bool asserted; try { TextFormField( @@ -389,7 +388,7 @@ void main() { expect(asserted, false); }); - testWidgetsWithLeakTracking('Passes textAlign to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes textAlign to underlying TextField', (WidgetTester tester) async { const TextAlign alignment = TextAlign.center; await tester.pumpWidget( @@ -411,7 +410,7 @@ void main() { expect(textFieldWidget.textAlign, alignment); }); - testWidgetsWithLeakTracking('Passes scrollPhysics to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes scrollPhysics to underlying TextField', (WidgetTester tester) async { const ScrollPhysics scrollPhysics = ScrollPhysics(); await tester.pumpWidget( @@ -433,7 +432,7 @@ void main() { expect(textFieldWidget.scrollPhysics, scrollPhysics); }); - testWidgetsWithLeakTracking('Passes textAlignVertical to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes textAlignVertical to underlying TextField', (WidgetTester tester) async { const TextAlignVertical textAlignVertical = TextAlignVertical.bottom; await tester.pumpWidget( @@ -455,7 +454,7 @@ void main() { expect(textFieldWidget.textAlignVertical, textAlignVertical); }); - testWidgetsWithLeakTracking('Passes textInputAction to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes textInputAction to underlying TextField', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -475,7 +474,7 @@ void main() { expect(textFieldWidget.textInputAction, TextInputAction.next); }); - testWidgetsWithLeakTracking('Passes onEditingComplete to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes onEditingComplete to underlying TextField', (WidgetTester tester) async { void onEditingComplete() { } await tester.pumpWidget( @@ -497,7 +496,7 @@ void main() { expect(textFieldWidget.onEditingComplete, onEditingComplete); }); - testWidgetsWithLeakTracking('Passes cursor attributes to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes cursor attributes to underlying TextField', (WidgetTester tester) async { const double cursorWidth = 3.14; const double cursorHeight = 6.28; const Radius cursorRadius = Radius.circular(4); @@ -528,7 +527,7 @@ void main() { expect(textFieldWidget.cursorColor, cursorColor); }); - testWidgetsWithLeakTracking('onFieldSubmit callbacks are called', (WidgetTester tester) async { + testWidgets('onFieldSubmit callbacks are called', (WidgetTester tester) async { bool called = false; await tester.pumpWidget( @@ -549,7 +548,7 @@ void main() { expect(called, true); }); - testWidgetsWithLeakTracking('onChanged callbacks are called', (WidgetTester tester) async { + testWidgets('onChanged callbacks are called', (WidgetTester tester) async { late String value; await tester.pumpWidget( @@ -571,7 +570,7 @@ void main() { expect(value, 'Soup'); }); - testWidgetsWithLeakTracking('autovalidateMode is passed to super', (WidgetTester tester) async { + testWidgets('autovalidateMode is passed to super', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -596,7 +595,7 @@ void main() { expect(validateCalled, 2); }); - testWidgetsWithLeakTracking('validate is called if widget is enabled', (WidgetTester tester) async { + testWidgets('validate is called if widget is enabled', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -623,7 +622,7 @@ void main() { }); - testWidgetsWithLeakTracking('Disabled field hides helper and counter in M2', (WidgetTester tester) async { + testWidgets('Disabled field hides helper and counter in M2', (WidgetTester tester) async { const String helperText = 'helper text'; const String counterText = 'counter text'; const String errorText = 'error text'; @@ -671,7 +670,7 @@ void main() { expect(errorWidget.style!.color, equals(Colors.transparent)); }); - testWidgetsWithLeakTracking('passing a buildCounter shows returned widget', (WidgetTester tester) async { + testWidgets('passing a buildCounter shows returned widget', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Center( @@ -694,7 +693,7 @@ void main() { expect(find.text('5 of 10'), findsOneWidget); }); - testWidgetsWithLeakTracking('readonly text form field will hide cursor by default', (WidgetTester tester) async { + testWidgets('readonly text form field will hide cursor by default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -736,7 +735,7 @@ void main() { expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0)); }, skip: isBrowser); // [intended] We do not use Flutter-rendered context menu on the Web. - testWidgetsWithLeakTracking('onTap is called upon tap', (WidgetTester tester) async { + testWidgets('onTap is called upon tap', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( MaterialApp( @@ -763,7 +762,7 @@ void main() { expect(tapCount, 3); }); - testWidgetsWithLeakTracking('onTapOutside is called upon tap outside', (WidgetTester tester) async { + testWidgets('onTapOutside is called upon tap outside', (WidgetTester tester) async { int tapOutsideCount = 0; await tester.pumpWidget( MaterialApp( @@ -795,7 +794,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/134341. - testWidgetsWithLeakTracking('onTapOutside is not called upon tap outside when field is not focused', (WidgetTester tester) async { + testWidgets('onTapOutside is not called upon tap outside when field is not focused', (WidgetTester tester) async { int tapOutsideCount = 0; await tester.pumpWidget( MaterialApp( @@ -826,7 +825,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/54472. - testWidgetsWithLeakTracking('reset resets the text fields value to the initialValue', (WidgetTester tester) async { + testWidgets('reset resets the text fields value to the initialValue', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -848,7 +847,7 @@ void main() { expect(find.text('initialValue'), findsOneWidget); }); - testWidgetsWithLeakTracking('reset resets the text fields value to the controller initial value', (WidgetTester tester) async { + testWidgets('reset resets the text fields value to the controller initial value', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'initialValue'); addTearDown(controller.dispose); @@ -874,7 +873,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/34847. - testWidgetsWithLeakTracking("didChange resets the text field's value to empty when passed null", (WidgetTester tester) async { + testWidgets("didChange resets the text field's value to empty when passed null", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -897,7 +896,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/34847. - testWidgetsWithLeakTracking("reset resets the text field's value to empty when initialValue is null", (WidgetTester tester) async { + testWidgets("reset resets the text field's value to empty when initialValue is null", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -920,7 +919,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/54472. - testWidgetsWithLeakTracking('didChange changes text fields value', (WidgetTester tester) async { + testWidgets('didChange changes text fields value', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -942,7 +941,7 @@ void main() { expect(find.text('changedValue'), findsOneWidget); }); - testWidgetsWithLeakTracking('onChanged callbacks value and FormFieldState.value are sync', (WidgetTester tester) async { + testWidgets('onChanged callbacks value and FormFieldState.value are sync', (WidgetTester tester) async { bool called = false; late FormFieldState<String> state; @@ -969,7 +968,7 @@ void main() { expect(called, true); }); - testWidgetsWithLeakTracking('autofillHints is passed to super', (WidgetTester tester) async { + testWidgets('autofillHints is passed to super', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -986,7 +985,7 @@ void main() { expect(widget.autofillHints, equals(const <String>[AutofillHints.countryName])); }); - testWidgetsWithLeakTracking('autovalidateMode is passed to super', (WidgetTester tester) async { + testWidgets('autovalidateMode is passed to super', (WidgetTester tester) async { int validateCalled = 0; await tester.pumpWidget( @@ -1011,7 +1010,7 @@ void main() { expect(validateCalled, 1); }); - testWidgetsWithLeakTracking('textSelectionControls is passed to super', (WidgetTester tester) async { + testWidgets('textSelectionControls is passed to super', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1028,7 +1027,7 @@ void main() { expect(widget.selectionControls, equals(materialTextSelectionControls)); }); - testWidgetsWithLeakTracking('TextFormField respects hintTextDirection', (WidgetTester tester) async { + testWidgets('TextFormField respects hintTextDirection', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Directionality( @@ -1070,7 +1069,7 @@ void main() { expect(textDirection, TextDirection.rtl); }); - testWidgetsWithLeakTracking('Passes scrollController to underlying TextField', (WidgetTester tester) async { + testWidgets('Passes scrollController to underlying TextField', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1093,7 +1092,7 @@ void main() { expect(textFieldWidget.scrollController, scrollController); }); - testWidgetsWithLeakTracking('TextFormField changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('TextFormField changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1157,7 +1156,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/101587. - testWidgetsWithLeakTracking('Right clicking menu behavior', (WidgetTester tester) async { + testWidgets('Right clicking menu behavior', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'blah1 blah2', ); @@ -1239,7 +1238,7 @@ void main() { skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. ); - testWidgetsWithLeakTracking('spellCheckConfiguration passes through to EditableText', (WidgetTester tester) async { + testWidgets('spellCheckConfiguration passes through to EditableText', (WidgetTester tester) async { final SpellCheckConfiguration mySpellCheckConfiguration = SpellCheckConfiguration( spellCheckService: DefaultSpellCheckService(), misspelledTextStyle: TextField.materialMisspelledTextStyle, @@ -1269,7 +1268,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('magnifierConfiguration passes through to EditableText', (WidgetTester tester) async { + testWidgets('magnifierConfiguration passes through to EditableText', (WidgetTester tester) async { final TextMagnifierConfiguration myTextMagnifierConfiguration = TextMagnifierConfiguration( magnifierBuilder: (BuildContext context, MagnifierController controller, ValueNotifier<MagnifierInfo> notifier) { return const Placeholder(); @@ -1290,7 +1289,7 @@ void main() { expect(editableText.magnifierConfiguration, equals(myTextMagnifierConfiguration)); }); - testWidgetsWithLeakTracking('Passes undoController to undoController TextField', (WidgetTester tester) async { + testWidgets('Passes undoController to undoController TextField', (WidgetTester tester) async { final UndoHistoryController undoController = UndoHistoryController(value: UndoHistoryValue.empty); addTearDown(undoController.dispose); @@ -1313,7 +1312,7 @@ void main() { expect(textFieldWidget.undoController, undoController); }); - testWidgetsWithLeakTracking('Passes cursorOpacityAnimates to cursorOpacityAnimates TextField', (WidgetTester tester) async { + testWidgets('Passes cursorOpacityAnimates to cursorOpacityAnimates TextField', (WidgetTester tester) async { const bool cursorOpacityAnimates = true; await tester.pumpWidget( @@ -1335,7 +1334,7 @@ void main() { expect(textFieldWidget.cursorOpacityAnimates, cursorOpacityAnimates); }); - testWidgetsWithLeakTracking('Passes contentInsertionConfiguration to contentInsertionConfiguration TextField', (WidgetTester tester) async { + testWidgets('Passes contentInsertionConfiguration to contentInsertionConfiguration TextField', (WidgetTester tester) async { final ContentInsertionConfiguration contentInsertionConfiguration = ContentInsertionConfiguration(onContentInserted: (KeyboardInsertedContent value) {}); @@ -1358,7 +1357,7 @@ void main() { expect(textFieldWidget.contentInsertionConfiguration, contentInsertionConfiguration); }); - testWidgetsWithLeakTracking('Passes clipBehavior to clipBehavior TextField', (WidgetTester tester) async { + testWidgets('Passes clipBehavior to clipBehavior TextField', (WidgetTester tester) async { const Clip clipBehavior = Clip.antiAlias; await tester.pumpWidget( @@ -1380,7 +1379,7 @@ void main() { expect(textFieldWidget.clipBehavior, clipBehavior); }); - testWidgetsWithLeakTracking('Passes scribbleEnabled to scribbleEnabled TextField', (WidgetTester tester) async { + testWidgets('Passes scribbleEnabled to scribbleEnabled TextField', (WidgetTester tester) async { const bool scribbleEnabled = false; await tester.pumpWidget( @@ -1402,7 +1401,7 @@ void main() { expect(textFieldWidget.scribbleEnabled, scribbleEnabled); }); - testWidgetsWithLeakTracking('Passes canRequestFocus to canRequestFocus TextField', (WidgetTester tester) async { + testWidgets('Passes canRequestFocus to canRequestFocus TextField', (WidgetTester tester) async { const bool canRequestFocus = false; await tester.pumpWidget( @@ -1424,7 +1423,7 @@ void main() { expect(textFieldWidget.canRequestFocus, canRequestFocus); }); - testWidgetsWithLeakTracking('Passes onAppPrivateCommand to onAppPrivateCommand TextField', (WidgetTester tester) async { + testWidgets('Passes onAppPrivateCommand to onAppPrivateCommand TextField', (WidgetTester tester) async { void onAppPrivateCommand(String action, Map<String, dynamic> data) {} await tester.pumpWidget( @@ -1446,7 +1445,7 @@ void main() { expect(textFieldWidget.onAppPrivateCommand, onAppPrivateCommand); }); - testWidgetsWithLeakTracking('Passes selectionHeightStyle to selectionHeightStyle TextField', (WidgetTester tester) async { + testWidgets('Passes selectionHeightStyle to selectionHeightStyle TextField', (WidgetTester tester) async { const BoxHeightStyle selectionHeightStyle = BoxHeightStyle.max; await tester.pumpWidget( @@ -1468,7 +1467,7 @@ void main() { expect(textFieldWidget.selectionHeightStyle, selectionHeightStyle); }); - testWidgetsWithLeakTracking('Passes selectionWidthStyle to selectionWidthStyle TextField', (WidgetTester tester) async { + testWidgets('Passes selectionWidthStyle to selectionWidthStyle TextField', (WidgetTester tester) async { const BoxWidthStyle selectionWidthStyle = BoxWidthStyle.max; await tester.pumpWidget( @@ -1490,7 +1489,7 @@ void main() { expect(textFieldWidget.selectionWidthStyle, selectionWidthStyle); }); - testWidgetsWithLeakTracking('Passes dragStartBehavior to dragStartBehavior TextField', (WidgetTester tester) async { + testWidgets('Passes dragStartBehavior to dragStartBehavior TextField', (WidgetTester tester) async { const DragStartBehavior dragStartBehavior = DragStartBehavior.down; await tester.pumpWidget( @@ -1512,7 +1511,7 @@ void main() { expect(textFieldWidget.dragStartBehavior, dragStartBehavior); }); - testWidgetsWithLeakTracking('Passes onTapAlwaysCalled to onTapAlwaysCalled TextField', (WidgetTester tester) async { + testWidgets('Passes onTapAlwaysCalled to onTapAlwaysCalled TextField', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -1532,7 +1531,7 @@ void main() { expect(textFieldWidget.onTapAlwaysCalled, isTrue); }); - testWidgetsWithLeakTracking('Error color for cursor while validating', (WidgetTester tester) async { + testWidgets('Error color for cursor while validating', (WidgetTester tester) async { const Color themeErrorColor = Color(0xff111111); const Color errorStyleColor = Color(0xff777777); const Color cursorErrorColor = Color(0xffbbbbbb); @@ -1593,7 +1592,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TextFormField onChanged is called when the form is reset', (WidgetTester tester) async { + testWidgets('TextFormField onChanged is called when the form is reset', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123009. final GlobalKey<FormFieldState<String>> stateKey = GlobalKey<FormFieldState<String>>(); final GlobalKey<FormState> formKey = GlobalKey<FormState>(); diff --git a/packages/flutter/test/material/text_selection_test.dart b/packages/flutter/test/material/text_selection_test.dart index 608949e9a83..b1b5f4fddfe 100644 --- a/packages/flutter/test/material/text_selection_test.dart +++ b/packages/flutter/test/material/text_selection_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart' show findRenderEditable, globalize, textOffsetToPosition; @@ -62,13 +61,13 @@ void main() { ); } - testWidgetsWithLeakTracking('should return false when there is no text', (WidgetTester tester) async { + testWidgets('should return false when there is no text', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText(key: key)); expect(materialTextSelectionControls.canSelectAll(key.currentState!), false); }); - testWidgetsWithLeakTracking('should return true when there is text and collapsed selection', (WidgetTester tester) async { + testWidgets('should return true when there is text and collapsed selection', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText( key: key, @@ -77,7 +76,7 @@ void main() { expect(materialTextSelectionControls.canSelectAll(key.currentState!), true); }); - testWidgetsWithLeakTracking('should return true when there is text and partial uncollapsed selection', (WidgetTester tester) async { + testWidgets('should return true when there is text and partial uncollapsed selection', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText( key: key, @@ -87,7 +86,7 @@ void main() { expect(materialTextSelectionControls.canSelectAll(key.currentState!), true); }); - testWidgetsWithLeakTracking('should return false when there is text and full selection', (WidgetTester tester) async { + testWidgets('should return false when there is text and full selection', (WidgetTester tester) async { final GlobalKey<EditableTextState> key = GlobalKey(); await tester.pumpWidget(createEditableText( key: key, @@ -99,7 +98,7 @@ void main() { }); group('Text selection menu overflow (Android)', () { - testWidgetsWithLeakTracking('All menu items show when they fit.', (WidgetTester tester) async { + testWidgets('All menu items show when they fit.', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'abc def ghi'); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -162,7 +161,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking("When menu items don't fit, an overflow menu is used.", (WidgetTester tester) async { + testWidgets("When menu items don't fit, an overflow menu is used.", (WidgetTester tester) async { // Set the screen size to more narrow, so that Select all can't fit. tester.view.physicalSize = const Size(1000, 800); addTearDown(tester.view.reset); @@ -237,7 +236,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking('A smaller menu bumps more items to the overflow menu.', (WidgetTester tester) async { + testWidgets('A smaller menu bumps more items to the overflow menu.', (WidgetTester tester) async { // Set the screen size so narrow that only Cut and Copy can fit. tester.view.physicalSize = const Size(800, 800); addTearDown(tester.view.reset); @@ -303,7 +302,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking('When the menu renders below the text, the overflow menu back button is at the top.', (WidgetTester tester) async { + testWidgets('When the menu renders below the text, the overflow menu back button is at the top.', (WidgetTester tester) async { // Set the screen size to more narrow, so that Select all can't fit. tester.view.physicalSize = const Size(1000, 800); addTearDown(tester.view.reset); @@ -378,7 +377,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking('When the menu items change, the menu is closed and _closedWidth reset.', (WidgetTester tester) async { + testWidgets('When the menu items change, the menu is closed and _closedWidth reset.', (WidgetTester tester) async { // Set the screen size to more narrow, so that Select all can't fit. tester.view.physicalSize = const Size(1000, 800); addTearDown(tester.view.reset); @@ -492,7 +491,7 @@ void main() { }); group('menu position', () { - testWidgetsWithLeakTracking('When renders below a block of text, menu appears below bottom endpoint', (WidgetTester tester) async { + testWidgets('When renders below a block of text, menu appears below bottom endpoint', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'abc\ndef\nghi\njkl\nmno\npqr'); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -565,7 +564,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), ); - testWidgetsWithLeakTracking( + testWidgets( 'When selecting multiple lines over max lines', (WidgetTester tester) async { final TextEditingController controller = @@ -644,7 +643,7 @@ void main() { }); group('material handles', () { - testWidgetsWithLeakTracking('draws transparent handle correctly', (WidgetTester tester) async { + testWidgets('draws transparent handle correctly', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Theme( data: ThemeData( @@ -678,7 +677,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('works with 3 positional parameters', (WidgetTester tester) async { + testWidgets('works with 3 positional parameters', (WidgetTester tester) async { await tester.pumpWidget(Theme( data: ThemeData( textSelectionTheme: const TextSelectionThemeData( @@ -711,7 +710,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Paste only appears when clipboard has contents', (WidgetTester tester) async { + testWidgets('Paste only appears when clipboard has contents', (WidgetTester tester) async { final TextEditingController controller = TextEditingController( text: 'Atwater Peel Sherbrooke Bonaventure', ); diff --git a/packages/flutter/test/material/text_selection_theme_test.dart b/packages/flutter/test/material/text_selection_theme_test.dart index 8234f29daec..ad244b2e44d 100644 --- a/packages/flutter/test/material/text_selection_theme_test.dart +++ b/packages/flutter/test/material/text_selection_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('TextSelectionThemeData copyWith, ==, hashCode basics', () { @@ -26,7 +25,7 @@ void main() { expect(theme.selectionHandleColor, null); }); - testWidgetsWithLeakTracking('Default TextSelectionThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default TextSelectionThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TextSelectionThemeData().debugFillProperties(builder); @@ -38,7 +37,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('TextSelectionThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('TextSelectionThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TextSelectionThemeData( cursorColor: Color(0xffeeffaa), @@ -58,7 +57,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Material2 - Empty textSelectionTheme will use defaults', (WidgetTester tester) async { + testWidgets('Material2 - Empty textSelectionTheme will use defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); const Color defaultCursorColor = Color(0xff2196f3); const Color defaultSelectionColor = Color(0x662196f3); @@ -107,7 +106,7 @@ void main() { expect(handle, paints..path(color: defaultSelectionHandleColor)); }); - testWidgetsWithLeakTracking('Material3 - Empty textSelectionTheme will use defaults', (WidgetTester tester) async { + testWidgets('Material3 - Empty textSelectionTheme will use defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final Color defaultCursorColor = theme.colorScheme.primary; final Color defaultSelectionColor = theme.colorScheme.primary.withOpacity(0.40); @@ -156,7 +155,7 @@ void main() { expect(handle, paints..path(color: defaultSelectionHandleColor)); }); - testWidgetsWithLeakTracking('ThemeData.textSelectionTheme will be used if provided', (WidgetTester tester) async { + testWidgets('ThemeData.textSelectionTheme will be used if provided', (WidgetTester tester) async { const TextSelectionThemeData textSelectionTheme = TextSelectionThemeData( cursorColor: Color(0xffaabbcc), selectionColor: Color(0x88888888), @@ -209,7 +208,7 @@ void main() { expect(handle, paints..path(color: textSelectionTheme.selectionHandleColor)); }); - testWidgetsWithLeakTracking('TextSelectionTheme widget will override ThemeData.textSelectionTheme', (WidgetTester tester) async { + testWidgets('TextSelectionTheme widget will override ThemeData.textSelectionTheme', (WidgetTester tester) async { const TextSelectionThemeData defaultTextSelectionTheme = TextSelectionThemeData( cursorColor: Color(0xffaabbcc), selectionColor: Color(0x88888888), @@ -271,7 +270,7 @@ void main() { expect(handle, paints..path(color: widgetTextSelectionTheme.selectionHandleColor)); }); - testWidgetsWithLeakTracking('TextField parameters will override theme settings', (WidgetTester tester) async { + testWidgets('TextField parameters will override theme settings', (WidgetTester tester) async { const TextSelectionThemeData defaultTextSelectionTheme = TextSelectionThemeData( cursorColor: Color(0xffaabbcc), selectionHandleColor: Color(0x00ccbbaa), @@ -320,7 +319,7 @@ void main() { expect(renderSelectable.cursorColor, cursorColor.withAlpha(0)); }); - testWidgetsWithLeakTracking('TextSelectionThem overrides DefaultSelectionStyle', (WidgetTester tester) async { + testWidgets('TextSelectionThem overrides DefaultSelectionStyle', (WidgetTester tester) async { const Color themeSelectionColor = Color(0xffaabbcc); const Color themeCursorColor = Color(0x00ccbbaa); const Color defaultSelectionColor = Color(0xffaa1111); diff --git a/packages/flutter/test/material/text_selection_toolbar_test.dart b/packages/flutter/test/material/text_selection_toolbar_test.dart index 857ed6d0fcb..244942270d0 100644 --- a/packages/flutter/test/material/text_selection_toolbar_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/editable_text_utils.dart' show textOffsetToPosition; const double _kToolbarContentDistance = 8.0; @@ -75,7 +74,7 @@ void main() { Finder findOverflowButton() => findPrivate('_TextSelectionToolbarOverflowButton'); - testWidgetsWithLeakTracking('puts children in an overflow menu if they overflow', (WidgetTester tester) async { + testWidgets('puts children in an overflow menu if they overflow', (WidgetTester tester) async { late StateSetter setState; final List<Widget> children = List<Widget>.generate(7, (int i) => const TestBox()); @@ -123,7 +122,7 @@ void main() { expect(findOverflowButton(), findsOneWidget); }); - testWidgetsWithLeakTracking('positions itself at anchorAbove if it fits', (WidgetTester tester) async { + testWidgets('positions itself at anchorAbove if it fits', (WidgetTester tester) async { late StateSetter setState; const double height = 44.0; const double anchorBelowY = 500.0; @@ -172,7 +171,7 @@ void main() { expect(toolbarY, equals(anchorAboveY - height - _kToolbarContentDistance)); }); - testWidgetsWithLeakTracking('can create and use a custom toolbar', (WidgetTester tester) async { + testWidgets('can create and use a custom toolbar', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -205,7 +204,7 @@ void main() { }, skip: kIsWeb); // [intended] We don't show the toolbar on the web. for (final ColorScheme colorScheme in <ColorScheme>[ThemeData.light().colorScheme, ThemeData.dark().colorScheme]) { - testWidgetsWithLeakTracking('default background color', (WidgetTester tester) async { + testWidgets('default background color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -249,7 +248,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('custom background color', (WidgetTester tester) async { + testWidgets('custom background color', (WidgetTester tester) async { const Color customBackgroundColor = Colors.red; await tester.pumpWidget( diff --git a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart index 24de64a8000..b552d480f59 100644 --- a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('position in the toolbar changes width', (WidgetTester tester) async { + testWidgets('position in the toolbar changes width', (WidgetTester tester) async { late StateSetter setState; int index = 1; int total = 3; @@ -63,7 +62,7 @@ void main() { }); for (final ColorScheme colorScheme in <ColorScheme>[ThemeData.light().colorScheme, ThemeData.dark().colorScheme]) { - testWidgetsWithLeakTracking('foreground color by default', (WidgetTester tester) async { + testWidgets('foreground color by default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -94,7 +93,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('custom foreground color', (WidgetTester tester) async { + testWidgets('custom foreground color', (WidgetTester tester) async { const Color customForegroundColor = Colors.red; await tester.pumpWidget( @@ -124,7 +123,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('background color by default', (WidgetTester tester) async { + testWidgets('background color by default', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/133027 await tester.pumpWidget( MaterialApp( @@ -155,7 +154,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('textButtonTheme should not override default background color', (WidgetTester tester) async { + testWidgets('textButtonTheme should not override default background color', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/133027 await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index dd6cecf0d10..7d21bf9841b 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('Theme data control test', () { @@ -84,7 +83,7 @@ void main() { expect(fallbackTheme.typography, Typography.material2021(colorScheme: fallbackTheme.colorScheme)); }); - testWidgetsWithLeakTracking('Defaults to MaterialTapTargetBehavior.padded on mobile platforms and MaterialTapTargetBehavior.shrinkWrap on desktop', (WidgetTester tester) async { + testWidgets('Defaults to MaterialTapTargetBehavior.padded on mobile platforms and MaterialTapTargetBehavior.shrinkWrap on desktop', (WidgetTester tester) async { final ThemeData themeData = ThemeData(platform: defaultTargetPlatform); switch (defaultTargetPlatform) { case TargetPlatform.android: @@ -371,7 +370,7 @@ void main() { expect(theme.applyElevationOverlayColor, true); }); - testWidgetsWithLeakTracking('ThemeData.from a light color scheme sets appropriate values', (WidgetTester tester) async { + testWidgets('ThemeData.from a light color scheme sets appropriate values', (WidgetTester tester) async { const ColorScheme lightColors = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: lightColors); @@ -386,7 +385,7 @@ void main() { expect(theme.applyElevationOverlayColor, isFalse); }); - testWidgetsWithLeakTracking('ThemeData.from a dark color scheme sets appropriate values', (WidgetTester tester) async { + testWidgets('ThemeData.from a dark color scheme sets appropriate values', (WidgetTester tester) async { const ColorScheme darkColors = ColorScheme.dark(); final ThemeData theme = ThemeData.from(colorScheme: darkColors); @@ -402,7 +401,7 @@ void main() { expect(theme.applyElevationOverlayColor, isTrue); }); - testWidgetsWithLeakTracking('splashFactory is InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { + testWidgets('splashFactory is InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); // Basic check that this theme is in fact using material 3. @@ -424,7 +423,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('splashFactory is InkSplash for every platform scenario, including Android non-web, when useMaterial3 is false', (WidgetTester tester) async { + testWidgets('splashFactory is InkSplash for every platform scenario, including Android non-web, when useMaterial3 is false', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); switch (debugDefaultTargetPlatformOverride!) { @@ -438,7 +437,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('VisualDensity.adaptivePlatformDensity returns adaptive values', (WidgetTester tester) async { + testWidgets('VisualDensity.adaptivePlatformDensity returns adaptive values', (WidgetTester tester) async { switch (debugDefaultTargetPlatformOverride!) { case TargetPlatform.android: case TargetPlatform.iOS: @@ -451,7 +450,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('VisualDensity.getDensityForPlatform returns adaptive values', (WidgetTester tester) async { + testWidgets('VisualDensity.getDensityForPlatform returns adaptive values', (WidgetTester tester) async { switch (debugDefaultTargetPlatformOverride!) { case TargetPlatform.android: case TargetPlatform.iOS: @@ -464,7 +463,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('VisualDensity in ThemeData defaults to "compact" on desktop and "standard" on mobile', (WidgetTester tester) async { + testWidgets('VisualDensity in ThemeData defaults to "compact" on desktop and "standard" on mobile', (WidgetTester tester) async { final ThemeData themeData = ThemeData(); switch (debugDefaultTargetPlatformOverride!) { case TargetPlatform.android: @@ -478,7 +477,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('VisualDensity in ThemeData defaults to the right thing when a platform is supplied to it', (WidgetTester tester) async { + testWidgets('VisualDensity in ThemeData defaults to the right thing when a platform is supplied to it', (WidgetTester tester) async { final ThemeData themeData = ThemeData(platform: debugDefaultTargetPlatformOverride! == TargetPlatform.android ? TargetPlatform.linux : TargetPlatform.android); switch (debugDefaultTargetPlatformOverride!) { case TargetPlatform.iOS: @@ -492,7 +491,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Ensure Visual Density effective constraints are clamped', (WidgetTester tester) async { + testWidgets('Ensure Visual Density effective constraints are clamped', (WidgetTester tester) async { const BoxConstraints square = BoxConstraints.tightFor(width: 35, height: 35); BoxConstraints expanded = const VisualDensity(horizontal: 4.0, vertical: 4.0).effectiveConstraints(square); expect(expanded.minWidth, equals(35)); @@ -520,7 +519,7 @@ void main() { expect(expanded.maxHeight, equals(4)); }); - testWidgetsWithLeakTracking('Ensure Visual Density effective constraints expand and contract', (WidgetTester tester) async { + testWidgets('Ensure Visual Density effective constraints expand and contract', (WidgetTester tester) async { const BoxConstraints square = BoxConstraints(); final BoxConstraints expanded = const VisualDensity(horizontal: 4.0, vertical: 4.0).effectiveConstraints(square); expect(expanded.minWidth, equals(16)); @@ -538,7 +537,7 @@ void main() { group('Theme extensions', () { const Key containerKey = Key('container'); - testWidgetsWithLeakTracking('can be obtained', (WidgetTester tester) async { + testWidgets('can be obtained', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -565,7 +564,7 @@ void main() { expect(theme.extension<MyThemeExtensionB>()!.textStyle, const TextStyle(fontSize: 50)); }); - testWidgetsWithLeakTracking('can use copyWith', (WidgetTester tester) async { + testWidgets('can use copyWith', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -588,7 +587,7 @@ void main() { expect(theme.extension<MyThemeExtensionA>()!.color2, Colors.amber); }); - testWidgetsWithLeakTracking('can lerp', (WidgetTester tester) async { + testWidgets('can lerp', (WidgetTester tester) async { const MyThemeExtensionA extensionA1 = MyThemeExtensionA( color1: Colors.black, color2: Colors.amber, @@ -664,7 +663,7 @@ void main() { expect(lerped.extension<MyThemeExtensionB>()!.textStyle, const TextStyle(fontSize: 100)); // Not lerped }); - testWidgetsWithLeakTracking('should return null on extension not found', (WidgetTester tester) async { + testWidgets('should return null on extension not found', (WidgetTester tester) async { final ThemeData theme = ThemeData( extensions: const <ThemeExtension<dynamic>>{}, ); @@ -696,7 +695,7 @@ void main() { expect(hoverColorBlack.hashCode != hoverColorWhite.hashCode, true); }); - testWidgetsWithLeakTracking('ThemeData.copyWith correctly creates new ThemeData with all copied arguments', (WidgetTester tester) async { + testWidgets('ThemeData.copyWith correctly creates new ThemeData with all copied arguments', (WidgetTester tester) async { final SliderThemeData sliderTheme = SliderThemeData.fromPrimaryColors( primaryColor: Colors.black, primaryColorDark: Colors.black, @@ -1139,7 +1138,7 @@ void main() { expect(themeDataCopy.bottomAppBarColor, equals(otherTheme.bottomAppBarColor)); }); - testWidgetsWithLeakTracking('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async { + testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async { // This test makes sure that the ThemeData debug output doesn't get too // verbose, which has been a problem in the past. @@ -1154,12 +1153,12 @@ void main() { expect(lightTheme.toString().length, lessThan(200)); }); - testWidgetsWithLeakTracking('ThemeData brightness parameter overrides ColorScheme brightness', (WidgetTester tester) async { + testWidgets('ThemeData brightness parameter overrides ColorScheme brightness', (WidgetTester tester) async { const ColorScheme lightColors = ColorScheme.light(); expect(() => ThemeData(colorScheme: lightColors, brightness: Brightness.dark), throwsAssertionError); }); - testWidgetsWithLeakTracking('ThemeData.copyWith brightness parameter overrides ColorScheme brightness', (WidgetTester tester) async { + testWidgets('ThemeData.copyWith brightness parameter overrides ColorScheme brightness', (WidgetTester tester) async { const ColorScheme lightColors = ColorScheme.light(); final ThemeData theme = ThemeData.from(colorScheme: lightColors).copyWith(brightness: Brightness.dark); @@ -1290,7 +1289,7 @@ void main() { group('Theme adaptationMap', () { const Key containerKey = Key('container'); - testWidgetsWithLeakTracking('can be obtained', (WidgetTester tester) async { + testWidgets('can be obtained', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -1315,7 +1314,7 @@ void main() { isSameColorAs(Colors.brown)); }); - testWidgetsWithLeakTracking('should return null on extension not found', (WidgetTester tester) async { + testWidgets('should return null on extension not found', (WidgetTester tester) async { final ThemeData theme = ThemeData( adaptations: const <Adaptation<Object>>[ StringAdaptation(), @@ -1326,7 +1325,7 @@ void main() { }); }); - testWidgetsWithLeakTracking( + testWidgets( 'ThemeData.brightness not matching ColorScheme.brightness throws a helpful error message', (WidgetTester tester) async { AssertionError? error; diff --git a/packages/flutter/test/material/theme_defaults_test.dart b/packages/flutter/test/material/theme_defaults_test.dart index a6b94213a47..4f60fc17356 100644 --- a/packages/flutter/test/material/theme_defaults_test.dart +++ b/packages/flutter/test/material/theme_defaults_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Duration defaultButtonDuration = Duration(milliseconds: 200); @@ -15,7 +14,7 @@ void main() { const ShapeBorder defaultFABShapeM3 = RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))); const EdgeInsets defaultFABPadding = EdgeInsets.zero; - testWidgetsWithLeakTracking('Material2 - theme: ThemeData.light(), enabled: true', (WidgetTester tester) async { + testWidgets('Material2 - theme: ThemeData.light(), enabled: true', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -43,7 +42,7 @@ void main() { expect(raw.materialTapTargetSize, MaterialTapTargetSize.padded); }); - testWidgetsWithLeakTracking('Material3 - theme: ThemeData.light(), enabled: true', (WidgetTester tester) async { + testWidgets('Material3 - theme: ThemeData.light(), enabled: true', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: true); await tester.pumpWidget( MaterialApp( @@ -71,7 +70,7 @@ void main() { expect(raw.materialTapTargetSize, MaterialTapTargetSize.padded); }); - testWidgetsWithLeakTracking('Material2 - theme: ThemeData.light(), enabled: false', (WidgetTester tester) async { + testWidgets('Material2 - theme: ThemeData.light(), enabled: false', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: false); await tester.pumpWidget( MaterialApp( @@ -101,7 +100,7 @@ void main() { expect(raw.materialTapTargetSize, MaterialTapTargetSize.padded); }); - testWidgetsWithLeakTracking('Material3 - theme: ThemeData.light(), enabled: false', (WidgetTester tester) async { + testWidgets('Material3 - theme: ThemeData.light(), enabled: false', (WidgetTester tester) async { final ThemeData theme = ThemeData.light(useMaterial3: true); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index 48908e356e1..dfe5d1964ec 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { const TextTheme defaultGeometryTheme = Typography.englishLike2014; @@ -20,7 +19,7 @@ void main() { expect(tween.lerp(0.25), equals(ThemeData.lerp(light, dark, 0.25))); }); - testWidgetsWithLeakTracking('PopupMenu inherits app theme', (WidgetTester tester) async { + testWidgets('PopupMenu inherits app theme', (WidgetTester tester) async { final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -48,7 +47,7 @@ void main() { expect(Theme.of(tester.element(find.text('menuItem'))).brightness, equals(Brightness.dark)); }); - testWidgetsWithLeakTracking('Theme overrides selection style', (WidgetTester tester) async { + testWidgets('Theme overrides selection style', (WidgetTester tester) async { final Key key = UniqueKey(); const Color defaultSelectionColor = Color(0x11111111); const Color defaultCursorColor = Color(0x22222222); @@ -97,7 +96,7 @@ void main() { expect(tester.widget<EditableText>(find.byType(EditableText)).cursorColor, themeCursorColor); }); - testWidgetsWithLeakTracking('Material2 - Fallback theme', (WidgetTester tester) async { + testWidgets('Material2 - Fallback theme', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( Theme( @@ -114,7 +113,7 @@ void main() { expect(Theme.of(capturedContext), equals(ThemeData.localize(ThemeData.fallback(useMaterial3: false), defaultGeometryTheme))); }); - testWidgetsWithLeakTracking('Material3 - Fallback theme', (WidgetTester tester) async { + testWidgets('Material3 - Fallback theme', (WidgetTester tester) async { late BuildContext capturedContextM3; await tester.pumpWidget( Theme( @@ -131,7 +130,7 @@ void main() { expect(Theme.of(capturedContextM3), equals(ThemeData.localize(ThemeData.fallback(useMaterial3: true), defaultGeometryThemeM3))); }); - testWidgetsWithLeakTracking('ThemeData.localize memoizes the result', (WidgetTester tester) async { + testWidgets('ThemeData.localize memoizes the result', (WidgetTester tester) async { final ThemeData light = ThemeData.light(); final ThemeData dark = ThemeData.dark(); @@ -154,17 +153,17 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - ThemeData with null typography uses proper defaults', (WidgetTester tester) async { + testWidgets('Material2 - ThemeData with null typography uses proper defaults', (WidgetTester tester) async { final ThemeData m2Theme = ThemeData(useMaterial3: false); expect(m2Theme.typography, Typography.material2014()); }); - testWidgetsWithLeakTracking('Material3 - ThemeData with null typography uses proper defaults', (WidgetTester tester) async { + testWidgets('Material3 - ThemeData with null typography uses proper defaults', (WidgetTester tester) async { final ThemeData m3Theme = ThemeData(useMaterial3: true); expect(m3Theme.typography, Typography.material2021(colorScheme: m3Theme.colorScheme)); }); - testWidgetsWithLeakTracking('PopupMenu inherits shadowed app theme', (WidgetTester tester) async { + testWidgets('PopupMenu inherits shadowed app theme', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/5572 final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( @@ -196,7 +195,7 @@ void main() { expect(Theme.of(tester.element(find.text('menuItem'))).brightness, equals(Brightness.light)); }); - testWidgetsWithLeakTracking('DropdownMenu inherits shadowed app theme', (WidgetTester tester) async { + testWidgets('DropdownMenu inherits shadowed app theme', (WidgetTester tester) async { final Key dropdownMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -232,7 +231,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ModalBottomSheet inherits shadowed app theme', (WidgetTester tester) async { + testWidgets('ModalBottomSheet inherits shadowed app theme', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(brightness: Brightness.dark), @@ -265,7 +264,7 @@ void main() { expect(Theme.of(tester.element(find.text('bottomSheet'))).brightness, equals(Brightness.light)); }); - testWidgetsWithLeakTracking('Dialog inherits shadowed app theme', (WidgetTester tester) async { + testWidgets('Dialog inherits shadowed app theme', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -299,7 +298,7 @@ void main() { expect(Theme.of(tester.element(find.text('dialog'))).brightness, equals(Brightness.light)); }); - testWidgetsWithLeakTracking("Scaffold inherits theme's scaffoldBackgroundColor", (WidgetTester tester) async { + testWidgets("Scaffold inherits theme's scaffoldBackgroundColor", (WidgetTester tester) async { const Color green = Color(0xFF00FF00); await tester.pumpWidget( @@ -341,7 +340,7 @@ void main() { expect(materials[1].color, green); // dialog scaffold }); - testWidgetsWithLeakTracking('IconThemes are applied', (WidgetTester tester) async { + testWidgets('IconThemes are applied', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(iconTheme: const IconThemeData(color: Colors.green, size: 10.0)), @@ -374,7 +373,7 @@ void main() { expect(glyphText.text.style!.fontSize, 20.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'Same ThemeData reapplied does not trigger descendants rebuilds', (WidgetTester tester) async { testBuildCalled = 0; @@ -409,7 +408,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Text geometry set in Theme has higher precedence than that of Localizations', (WidgetTester tester) async { + testWidgets('Text geometry set in Theme has higher precedence than that of Localizations', (WidgetTester tester) async { const double kMagicFontSize = 4321.0; final ThemeData fallback = ThemeData.fallback(); final ThemeData customTheme = fallback.copyWith( @@ -440,7 +439,7 @@ void main() { expect(actualFontSize, kMagicFontSize); }); - testWidgetsWithLeakTracking('Material2 - Default Theme provides all basic TextStyle properties', (WidgetTester tester) async { + testWidgets('Material2 - Default Theme provides all basic TextStyle properties', (WidgetTester tester) async { late ThemeData theme; await tester.pumpWidget(Theme( data: ThemeData(useMaterial3: false), @@ -498,7 +497,7 @@ void main() { expect(theme.textTheme.displayLarge!.debugLabel, '(englishLike displayLarge 2014).merge(blackMountainView displayLarge)'); }); - testWidgetsWithLeakTracking('Material3 - Default Theme provides all basic TextStyle properties', (WidgetTester tester) async { + testWidgets('Material3 - Default Theme provides all basic TextStyle properties', (WidgetTester tester) async { late ThemeData theme; await tester.pumpWidget(Theme( data: ThemeData(useMaterial3: true), @@ -583,7 +582,7 @@ void main() { context = null; }); - testWidgetsWithLeakTracking('Material2 - Default light theme has defaults', (WidgetTester tester) async { + testWidgets('Material2 - Default light theme has defaults', (WidgetTester tester) async { final CupertinoThemeData themeM2 = await testTheme(tester, ThemeData(useMaterial3: false)); expect(themeM2.brightness, Brightness.light); @@ -594,7 +593,7 @@ void main() { expect(themeM2.textTheme.textStyle.fontSize, 17.0); }); - testWidgetsWithLeakTracking('Material3 - Default light theme has defaults', (WidgetTester tester) async { + testWidgets('Material3 - Default light theme has defaults', (WidgetTester tester) async { final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData(useMaterial3: true)); expect(themeM3.brightness, Brightness.light); @@ -605,7 +604,7 @@ void main() { expect(themeM3.textTheme.textStyle.fontSize, 17.0); }); - testWidgetsWithLeakTracking('Material2 - Dark theme has defaults', (WidgetTester tester) async { + testWidgets('Material2 - Dark theme has defaults', (WidgetTester tester) async { final CupertinoThemeData themeM2 = await testTheme(tester, ThemeData.dark(useMaterial3: false)); expect(themeM2.brightness, Brightness.dark); @@ -616,7 +615,7 @@ void main() { expect(themeM2.textTheme.textStyle.fontSize, 17.0); }); - testWidgetsWithLeakTracking('Material3 - Dark theme has defaults', (WidgetTester tester) async { + testWidgets('Material3 - Dark theme has defaults', (WidgetTester tester) async { final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData.dark(useMaterial3: true)); expect(themeM3.brightness, Brightness.dark); @@ -627,7 +626,7 @@ void main() { expect(themeM3.textTheme.textStyle.fontSize, 17.0); }); - testWidgetsWithLeakTracking('MaterialTheme overrides the brightness', (WidgetTester tester) async { + testWidgets('MaterialTheme overrides the brightness', (WidgetTester tester) async { await testTheme(tester, ThemeData.dark()); expect(CupertinoTheme.brightnessOf(context!), Brightness.dark); @@ -648,7 +647,7 @@ void main() { expect(CupertinoTheme.brightnessOf(context!), Brightness.light); }); - testWidgetsWithLeakTracking('Material2 - Can override material theme', (WidgetTester tester) async { + testWidgets('Material2 - Can override material theme', (WidgetTester tester) async { final CupertinoThemeData themeM2 = await testTheme(tester, ThemeData( cupertinoOverrideTheme: const CupertinoThemeData( scaffoldBackgroundColor: CupertinoColors.lightBackgroundGray, @@ -666,7 +665,7 @@ void main() { expect(themeM2.textTheme.textStyle.fontSize, 17.0); }); - testWidgetsWithLeakTracking('Material3 - Can override material theme', (WidgetTester tester) async { + testWidgets('Material3 - Can override material theme', (WidgetTester tester) async { final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData( cupertinoOverrideTheme: const CupertinoThemeData( scaffoldBackgroundColor: CupertinoColors.lightBackgroundGray, @@ -684,7 +683,7 @@ void main() { expect(themeM3.textTheme.textStyle.fontSize, 17.0); }); - testWidgetsWithLeakTracking('Material2 - Can override properties that are independent of material', (WidgetTester tester) async { + testWidgets('Material2 - Can override properties that are independent of material', (WidgetTester tester) async { final CupertinoThemeData themeM2 = await testTheme(tester, ThemeData( cupertinoOverrideTheme: const CupertinoThemeData( // The bar colors ignore all things material except brightness. @@ -698,7 +697,7 @@ void main() { expect(themeM2.barBackgroundColor, CupertinoColors.black); }); - testWidgetsWithLeakTracking('Material3 - Can override properties that are independent of material', (WidgetTester tester) async { + testWidgets('Material3 - Can override properties that are independent of material', (WidgetTester tester) async { final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData( cupertinoOverrideTheme: const CupertinoThemeData( // The bar colors ignore all things material except brightness. @@ -712,7 +711,7 @@ void main() { expect(themeM3.barBackgroundColor, CupertinoColors.black); }); - testWidgetsWithLeakTracking('Material2 - Changing material theme triggers rebuilds', (WidgetTester tester) async { + testWidgets('Material2 - Changing material theme triggers rebuilds', (WidgetTester tester) async { CupertinoThemeData themeM2 = await testTheme(tester, ThemeData( useMaterial3: false, primarySwatch: Colors.red, @@ -730,7 +729,7 @@ void main() { expect(themeM2.primaryColor, Colors.orange); }); - testWidgetsWithLeakTracking('Material3 - Changing material theme triggers rebuilds', (WidgetTester tester) async { + testWidgets('Material3 - Changing material theme triggers rebuilds', (WidgetTester tester) async { CupertinoThemeData themeM3 = await testTheme(tester, ThemeData( useMaterial3: true, colorScheme: const ColorScheme.light( @@ -752,7 +751,7 @@ void main() { expect(themeM3.primaryColor, Colors.orange); }); - testWidgetsWithLeakTracking( + testWidgets( "CupertinoThemeData does not override material theme's icon theme", (WidgetTester tester) async { const Color materialIconColor = Colors.blue; @@ -768,7 +767,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Changing cupertino theme override triggers rebuilds', (WidgetTester tester) async { CupertinoThemeData theme = await testTheme(tester, ThemeData( @@ -793,7 +792,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Cupertino theme override blocks derivative changes', (WidgetTester tester) async { CupertinoThemeData theme = await testTheme(tester, ThemeData( @@ -820,7 +819,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - Cupertino overrides do not block derivatives triggering rebuilds when derivatives are not overridden', (WidgetTester tester) async { CupertinoThemeData theme = await testTheme(tester, ThemeData( @@ -849,7 +848,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - Cupertino overrides do not block derivatives triggering rebuilds when derivatives are not overridden', (WidgetTester tester) async { CupertinoThemeData theme = await testTheme(tester, ThemeData( @@ -882,7 +881,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - copyWith only copies the overrides, not the material or cupertino derivatives', (WidgetTester tester) async { final CupertinoThemeData originalTheme = await testTheme(tester, ThemeData( @@ -909,7 +908,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - copyWith only copies the overrides, not the material or cupertino derivatives', (WidgetTester tester) async { final CupertinoThemeData originalTheme = await testTheme(tester, ThemeData( @@ -936,7 +935,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( "Material2 - Material themes with no cupertino overrides can also be copyWith'ed", (WidgetTester tester) async { final CupertinoThemeData originalTheme = await testTheme(tester, ThemeData( @@ -959,7 +958,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( "Material3 - Material themes with no cupertino overrides can also be copyWith'ed", (WidgetTester tester) async { final CupertinoThemeData originalTheme = await testTheme(tester, ThemeData( diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index d313ab452bb..661256a8948 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -11,7 +11,6 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -24,7 +23,7 @@ void main() { return tester.widget<Material>(find.descendant(of: find.byType(Dialog), matching: find.byType(Material)).first); } - testWidgetsWithLeakTracking('Material2 - Dialog size - dial mode', (WidgetTester tester) async { + testWidgets('Material2 - Dialog size - dial mode', (WidgetTester tester) async { addTearDown(tester.view.reset); const Size timePickerPortraitSize = Size(310, 468); @@ -66,7 +65,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Dialog size - input mode', (WidgetTester tester) async { + testWidgets('Material2 - Dialog size - input mode', (WidgetTester tester) async { const TimePickerEntryMode entryMode = TimePickerEntryMode.input; const Size timePickerInputSize = Size(312, 216); const Size dayPeriodPortraitSize = Size(52, 80); @@ -102,7 +101,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - respects MediaQueryData.alwaysUse24HourFormat == true', (WidgetTester tester) async { + testWidgets('Material2 - respects MediaQueryData.alwaysUse24HourFormat == true', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, alwaysUse24HourFormat: true, materialType: MaterialType.material2); final List<String> labels00To22 = List<String>.generate(12, (int index) { @@ -121,7 +120,7 @@ void main() { expect(selectedLabels.map<String>((dynamic tp) => tp.painter.text.text as String), labels00To22); }); - testWidgetsWithLeakTracking('Material3 - Dialog size - dial mode', (WidgetTester tester) async { + testWidgets('Material3 - Dialog size - dial mode', (WidgetTester tester) async { addTearDown(tester.view.reset); const Size timePickerPortraitSize = Size(310, 468); @@ -162,7 +161,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Dialog size - input mode', (WidgetTester tester) async { + testWidgets('Material3 - Dialog size - input mode', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); const TimePickerEntryMode entryMode = TimePickerEntryMode.input; const double textScaleFactor = 1.0; @@ -201,7 +200,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - respects MediaQueryData.alwaysUse24HourFormat == true', (WidgetTester tester) async { + testWidgets('Material3 - respects MediaQueryData.alwaysUse24HourFormat == true', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, alwaysUse24HourFormat: true, materialType: MaterialType.material3); final List<String> labels00To23 = List<String>.generate(24, (int index) { @@ -226,7 +225,7 @@ void main() { expect(selectedLabels.map<bool>((dynamic tp) => tp.inner as bool), inner0To23); }); - testWidgetsWithLeakTracking('Material3 - Dial background uses correct default color', (WidgetTester tester) async { + testWidgets('Material3 - Dial background uses correct default color', (WidgetTester tester) async { ThemeData theme = ThemeData(useMaterial3: true); Widget buildTimePicker(ThemeData themeData) { return MaterialApp( @@ -292,7 +291,7 @@ void main() { for (final MaterialType materialType in MaterialType.values) { group('Dial (${materialType.name})', () { - testWidgetsWithLeakTracking('tap-select an hour', (WidgetTester tester) async { + testWidgets('tap-select an hour', (WidgetTester tester) async { TimeOfDay? result; Offset center = (await startPicker(tester, (TimeOfDay? time) { @@ -325,7 +324,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 9, minute: 0))); }); - testWidgetsWithLeakTracking('drag-select an hour', (WidgetTester tester) async { + testWidgets('drag-select an hour', (WidgetTester tester) async { late TimeOfDay result; final Offset center = (await startPicker(tester, (TimeOfDay? time) { @@ -381,7 +380,7 @@ void main() { expect(result.hour, equals(9)); }); - testWidgetsWithLeakTracking('tap-select switches from hour to minute', (WidgetTester tester) async { + testWidgets('tap-select switches from hour to minute', (WidgetTester tester) async { late TimeOfDay result; final Offset center = (await startPicker(tester, (TimeOfDay? time) { @@ -397,7 +396,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 6, minute: 45))); }); - testWidgetsWithLeakTracking('drag-select switches from hour to minute', (WidgetTester tester) async { + testWidgets('drag-select switches from hour to minute', (WidgetTester tester) async { late TimeOfDay result; final Offset center = (await startPicker(tester, (TimeOfDay? time) { @@ -418,7 +417,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 9, minute: 15))); }); - testWidgetsWithLeakTracking('tap-select rounds down to nearest 5 minute increment', (WidgetTester tester) async { + testWidgets('tap-select rounds down to nearest 5 minute increment', (WidgetTester tester) async { late TimeOfDay result; final Offset center = (await startPicker(tester, (TimeOfDay? time) { @@ -434,7 +433,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 6, minute: 45))); }); - testWidgetsWithLeakTracking('tap-select rounds up to nearest 5 minute increment', (WidgetTester tester) async { + testWidgets('tap-select rounds up to nearest 5 minute increment', (WidgetTester tester) async { late TimeOfDay result; final Offset center = (await startPicker(tester, (TimeOfDay? time) { @@ -464,14 +463,14 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('tap-select vibrates once', (WidgetTester tester) async { + testWidgets('tap-select vibrates once', (WidgetTester tester) async { final Offset center = (await startPicker(tester, (TimeOfDay? time) {}, materialType: materialType))!; await tester.tapAt(Offset(center.dx, center.dy - 50)); await finishPicker(tester); expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('quick successive tap-selects vibrate once', (WidgetTester tester) async { + testWidgets('quick successive tap-selects vibrate once', (WidgetTester tester) async { final Offset center = (await startPicker(tester, (TimeOfDay? time) {}, materialType: materialType))!; await tester.tapAt(Offset(center.dx, center.dy - 50)); await tester.pump(kFastFeedbackInterval); @@ -480,7 +479,7 @@ void main() { expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('slow successive tap-selects vibrate once per tap', (WidgetTester tester) async { + testWidgets('slow successive tap-selects vibrate once per tap', (WidgetTester tester) async { final Offset center = (await startPicker(tester, (TimeOfDay? time) {}, materialType: materialType))!; await tester.tapAt(Offset(center.dx, center.dy - 50)); await tester.pump(kSlowFeedbackInterval); @@ -491,7 +490,7 @@ void main() { expect(feedback.hapticCount, 3); }); - testWidgetsWithLeakTracking('drag-select vibrates once', (WidgetTester tester) async { + testWidgets('drag-select vibrates once', (WidgetTester tester) async { final Offset center = (await startPicker(tester, (TimeOfDay? time) {}, materialType: materialType))!; final Offset hour0 = Offset(center.dx, center.dy - 50); final Offset hour3 = Offset(center.dx + 50, center.dy); @@ -503,7 +502,7 @@ void main() { expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('quick drag-select vibrates once', (WidgetTester tester) async { + testWidgets('quick drag-select vibrates once', (WidgetTester tester) async { final Offset center = (await startPicker(tester, (TimeOfDay? time) {}, materialType: materialType))!; final Offset hour0 = Offset(center.dx, center.dy - 50); final Offset hour3 = Offset(center.dx + 50, center.dy); @@ -519,7 +518,7 @@ void main() { expect(feedback.hapticCount, 1); }); - testWidgetsWithLeakTracking('slow drag-select vibrates once', (WidgetTester tester) async { + testWidgets('slow drag-select vibrates once', (WidgetTester tester) async { final Offset center = (await startPicker(tester, (TimeOfDay? time) {}, materialType: materialType))!; final Offset hour0 = Offset(center.dx, center.dy - 50); final Offset hour3 = Offset(center.dx + 50, center.dy); @@ -537,19 +536,19 @@ void main() { }); group('Dialog (${materialType.name})', () { - testWidgetsWithLeakTracking('Material2 - Widgets have correct label capitalization', (WidgetTester tester) async { + testWidgets('Material2 - Widgets have correct label capitalization', (WidgetTester tester) async { await startPicker(tester, (TimeOfDay? time) {}, materialType: MaterialType.material2); expect(find.text('SELECT TIME'), findsOneWidget); expect(find.text('CANCEL'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - Widgets have correct label capitalization', (WidgetTester tester) async { + testWidgets('Material3 - Widgets have correct label capitalization', (WidgetTester tester) async { await startPicker(tester, (TimeOfDay? time) {}, materialType: MaterialType.material3); expect(find.text('Select time'), findsOneWidget); expect(find.text('Cancel'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - Widgets have correct label capitalization in input mode', (WidgetTester tester) async { + testWidgets('Material2 - Widgets have correct label capitalization in input mode', (WidgetTester tester) async { await startPicker(tester, (TimeOfDay? time) {}, entryMode: TimePickerEntryMode.input, materialType: MaterialType.material2 ); @@ -557,7 +556,7 @@ void main() { expect(find.text('CANCEL'), findsOneWidget); }); - testWidgetsWithLeakTracking('Material3 - Widgets have correct label capitalization in input mode', (WidgetTester tester) async { + testWidgets('Material3 - Widgets have correct label capitalization in input mode', (WidgetTester tester) async { await startPicker(tester, (TimeOfDay? time) {}, entryMode: TimePickerEntryMode.input, materialType: MaterialType.material3 ); @@ -565,7 +564,7 @@ void main() { expect(find.text('Cancel'), findsOneWidget); }); - testWidgetsWithLeakTracking('respects MediaQueryData.alwaysUse24HourFormat == false', (WidgetTester tester) async { + testWidgets('respects MediaQueryData.alwaysUse24HourFormat == false', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, materialType: materialType); const List<String> labels12To11 = <String>['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; @@ -582,7 +581,7 @@ void main() { expect(selectedLabels.map<String>((dynamic tp) => tp.painter.text.text as String), labels12To11); }); - testWidgetsWithLeakTracking('when change orientation, should reflect in render objects', (WidgetTester tester) async { + testWidgets('when change orientation, should reflect in render objects', (WidgetTester tester) async { addTearDown(tester.view.reset); // portrait @@ -606,7 +605,7 @@ void main() { expect((render as dynamic).orientation, Orientation.landscape); // ignore: avoid_dynamic_calls }); - testWidgetsWithLeakTracking('setting orientation should override MediaQuery orientation', (WidgetTester tester) async { + testWidgets('setting orientation should override MediaQuery orientation', (WidgetTester tester) async { addTearDown(tester.view.reset); // portrait media query @@ -620,7 +619,7 @@ void main() { expect((render as dynamic).orientation, Orientation.landscape); // ignore: avoid_dynamic_calls }); - testWidgetsWithLeakTracking('builder parameter', (WidgetTester tester) async { + testWidgets('builder parameter', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( home: Material( @@ -675,7 +674,7 @@ void main() { rootObserver = PickerObserver(); }); - testWidgetsWithLeakTracking('Barrier is dismissible with default parameter', (WidgetTester tester) async { + testWidgets('Barrier is dismissible with default parameter', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( navigatorObservers: <NavigatorObserver>[rootObserver], @@ -709,7 +708,7 @@ void main() { expect(rootObserver.pickerCount, 0); }); - testWidgetsWithLeakTracking('Barrier is not dismissible with barrierDismissible is false', (WidgetTester tester) async { + testWidgets('Barrier is not dismissible with barrierDismissible is false', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( navigatorObservers: <NavigatorObserver>[rootObserver], @@ -745,7 +744,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Barrier color', (WidgetTester tester) async { + testWidgets('Barrier color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -801,7 +800,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).color, Colors.pink); }); - testWidgetsWithLeakTracking('Barrier Label', (WidgetTester tester) async { + testWidgets('Barrier Label', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -829,7 +828,7 @@ void main() { expect(tester.widget<ModalBarrier>(find.byType(ModalBarrier).last).semanticsLabel, 'Custom Label'); }); - testWidgetsWithLeakTracking('uses root navigator by default', (WidgetTester tester) async { + testWidgets('uses root navigator by default', (WidgetTester tester) async { final PickerObserver rootObserver = PickerObserver(); final PickerObserver nestedObserver = PickerObserver(); @@ -862,7 +861,7 @@ void main() { expect(nestedObserver.pickerCount, 0); }); - testWidgetsWithLeakTracking('uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final PickerObserver rootObserver = PickerObserver(); final PickerObserver nestedObserver = PickerObserver(); @@ -896,7 +895,7 @@ void main() { expect(nestedObserver.pickerCount, 1); }); - testWidgetsWithLeakTracking('optional text parameters are utilized', (WidgetTester tester) async { + testWidgets('optional text parameters are utilized', (WidgetTester tester) async { const String cancelText = 'Custom Cancel'; const String confirmText = 'Custom OK'; const String helperText = 'Custom Help'; @@ -932,7 +931,7 @@ void main() { expect(find.text(helperText), findsOneWidget); }); - testWidgetsWithLeakTracking('Material2 - OK Cancel button and helpText layout', (WidgetTester tester) async { + testWidgets('Material2 - OK Cancel button and helpText layout', (WidgetTester tester) async { const String selectTimeString = 'SELECT TIME'; const String cancelString = 'CANCEL'; Widget buildFrame(TextDirection textDirection) { @@ -995,7 +994,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Material3 - OK Cancel button and helpText layout', (WidgetTester tester) async { + testWidgets('Material3 - OK Cancel button and helpText layout', (WidgetTester tester) async { const String selectTimeString = 'Select time'; const String cancelString = 'Cancel'; Widget buildFrame(TextDirection textDirection) { @@ -1068,7 +1067,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('text scale affects certain elements and not others', (WidgetTester tester) async { + testWidgets('text scale affects certain elements and not others', (WidgetTester tester) async { await mediaQueryBoilerplate( tester, initialTime: const TimeOfDay(hour: 7, minute: 41), @@ -1109,7 +1108,7 @@ void main() { }); group('showTimePicker avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning with anchorPoint', (WidgetTester tester) async { + testWidgets('positioning with anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1145,7 +1144,7 @@ void main() { expect(tester.getBottomRight(find.byType(TimePickerDialog)), const Offset(800, 600)); }); - testWidgetsWithLeakTracking('positioning with Directionality', (WidgetTester tester) async { + testWidgets('positioning with Directionality', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1183,7 +1182,7 @@ void main() { expect(tester.getBottomRight(find.byType(TimePickerDialog)), const Offset(800, 600)); }); - testWidgetsWithLeakTracking('positioning with defaults', (WidgetTester tester) async { + testWidgets('positioning with defaults', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1221,7 +1220,7 @@ void main() { group('Works for various view sizes', () { for (final Size size in const <Size>[Size(100, 100), Size(300, 300), Size(800, 600)]) { - testWidgetsWithLeakTracking('Draws dial without overflows at $size', (WidgetTester tester) async { + testWidgets('Draws dial without overflows at $size', (WidgetTester tester) async { tester.view.physicalSize = size; addTearDown(tester.view.reset); @@ -1230,7 +1229,7 @@ void main() { expect(tester.takeException(), isNot(throwsAssertionError)); }); - testWidgetsWithLeakTracking('Draws input without overflows at $size', (WidgetTester tester) async { + testWidgets('Draws input without overflows at $size', (WidgetTester tester) async { tester.view.physicalSize = size; addTearDown(tester.view.reset); @@ -1243,7 +1242,7 @@ void main() { }); group('Time picker - A11y and Semantics (${materialType.name})', () { - testWidgetsWithLeakTracking('provides semantics information for AM/PM indicator', (WidgetTester tester) async { + testWidgets('provides semantics information for AM/PM indicator', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await mediaQueryBoilerplate(tester, materialType: materialType); @@ -1278,7 +1277,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material2 - provides semantics information for header and footer', (WidgetTester tester) async { + testWidgets('Material2 - provides semantics information for header and footer', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await mediaQueryBoilerplate(tester, alwaysUse24HourFormat: true, materialType: MaterialType.material2); @@ -1303,7 +1302,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material3 - provides semantics information for header and footer', (WidgetTester tester) async { + testWidgets('Material3 - provides semantics information for header and footer', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await mediaQueryBoilerplate(tester, alwaysUse24HourFormat: true, materialType: MaterialType.material3); @@ -1328,7 +1327,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('provides semantics information for text fields', (WidgetTester tester) async { + testWidgets('provides semantics information for text fields', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await mediaQueryBoilerplate( tester, @@ -1360,7 +1359,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can increment and decrement hours', (WidgetTester tester) async { + testWidgets('can increment and decrement hours', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); Future<void> actAndExpect({ @@ -1442,7 +1441,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can increment and decrement minutes', (WidgetTester tester) async { + testWidgets('can increment and decrement minutes', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); Future<void> actAndExpect({ @@ -1499,7 +1498,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('header touch regions are large enough', (WidgetTester tester) async { + testWidgets('header touch regions are large enough', (WidgetTester tester) async { // Ensure picker is displayed in portrait mode. tester.view.physicalSize = const Size(400, 800); tester.view.devicePixelRatio = 1; @@ -1530,7 +1529,7 @@ void main() { }); group('Time picker - Input (${materialType.name})', () { - testWidgetsWithLeakTracking('Initial entry mode is used', (WidgetTester tester) async { + testWidgets('Initial entry mode is used', (WidgetTester tester) async { await mediaQueryBoilerplate( tester, alwaysUse24HourFormat: true, @@ -1540,7 +1539,7 @@ void main() { expect(find.byType(TextField), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('Initial time is the default', (WidgetTester tester) async { + testWidgets('Initial time is the default', (WidgetTester tester) async { late TimeOfDay result; await startPicker(tester, (TimeOfDay? time) { result = time!; @@ -1549,7 +1548,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 7, minute: 0))); }); - testWidgetsWithLeakTracking('Help text is used - Input', (WidgetTester tester) async { + testWidgets('Help text is used - Input', (WidgetTester tester) async { const String helpText = 'help'; await mediaQueryBoilerplate( tester, @@ -1561,7 +1560,7 @@ void main() { expect(find.text(helpText), findsOneWidget); }); - testWidgetsWithLeakTracking('Help text is used in Material3 - Input', (WidgetTester tester) async { + testWidgets('Help text is used in Material3 - Input', (WidgetTester tester) async { const String helpText = 'help'; await mediaQueryBoilerplate( tester, @@ -1573,7 +1572,7 @@ void main() { expect(find.text(helpText), findsOneWidget); }); - testWidgetsWithLeakTracking('Hour label text is used - Input', (WidgetTester tester) async { + testWidgets('Hour label text is used - Input', (WidgetTester tester) async { const String hourLabelText = 'Custom hour label'; await mediaQueryBoilerplate( tester, @@ -1585,7 +1584,7 @@ void main() { expect(find.text(hourLabelText), findsOneWidget); }); - testWidgetsWithLeakTracking('Minute label text is used - Input', (WidgetTester tester) async { + testWidgets('Minute label text is used - Input', (WidgetTester tester) async { const String minuteLabelText = 'Custom minute label'; await mediaQueryBoilerplate( tester, @@ -1597,7 +1596,7 @@ void main() { expect(find.text(minuteLabelText), findsOneWidget); }); - testWidgetsWithLeakTracking('Invalid error text is used - Input', (WidgetTester tester) async { + testWidgets('Invalid error text is used - Input', (WidgetTester tester) async { const String errorInvalidText = 'Custom validation error'; await mediaQueryBoilerplate( tester, @@ -1617,7 +1616,7 @@ void main() { expect(find.text(errorInvalidText), findsOneWidget); }); - testWidgetsWithLeakTracking('Can switch from input to dial entry mode', (WidgetTester tester) async { + testWidgets('Can switch from input to dial entry mode', (WidgetTester tester) async { await mediaQueryBoilerplate( tester, alwaysUse24HourFormat: true, @@ -1629,14 +1628,14 @@ void main() { expect(find.byType(TextField), findsNothing); }); - testWidgetsWithLeakTracking('Can switch from dial to input entry mode', (WidgetTester tester) async { + testWidgets('Can switch from dial to input entry mode', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, alwaysUse24HourFormat: true, materialType: materialType); await tester.tap(find.byIcon(Icons.keyboard_outlined)); await tester.pumpAndSettle(); expect(find.byType(TextField), findsWidgets); }); - testWidgetsWithLeakTracking('Can not switch out of inputOnly mode', (WidgetTester tester) async { + testWidgets('Can not switch out of inputOnly mode', (WidgetTester tester) async { await mediaQueryBoilerplate( tester, alwaysUse24HourFormat: true, @@ -1647,7 +1646,7 @@ void main() { expect(find.byIcon(Icons.access_time), findsNothing); }); - testWidgetsWithLeakTracking('Can not switch out of dialOnly mode', (WidgetTester tester) async { + testWidgets('Can not switch out of dialOnly mode', (WidgetTester tester) async { await mediaQueryBoilerplate( tester, alwaysUse24HourFormat: true, @@ -1658,7 +1657,7 @@ void main() { expect(find.byIcon(Icons.keyboard_outlined), findsNothing); }); - testWidgetsWithLeakTracking('Switching to dial entry mode triggers entry callback', (WidgetTester tester) async { + testWidgets('Switching to dial entry mode triggers entry callback', (WidgetTester tester) async { bool triggeredCallback = false; await mediaQueryBoilerplate( @@ -1678,7 +1677,7 @@ void main() { expect(triggeredCallback, true); }); - testWidgetsWithLeakTracking('Switching to input entry mode triggers entry callback', (WidgetTester tester) async { + testWidgets('Switching to input entry mode triggers entry callback', (WidgetTester tester) async { bool triggeredCallback = false; await mediaQueryBoilerplate(tester, alwaysUse24HourFormat: true, onEntryModeChange: (TimePickerEntryMode mode) { @@ -1692,7 +1691,7 @@ void main() { expect(triggeredCallback, true); }); - testWidgetsWithLeakTracking('Can double tap hours (when selected) to enter input mode', (WidgetTester tester) async { + testWidgets('Can double tap hours (when selected) to enter input mode', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, materialType: materialType); final Finder hourFinder = find.ancestor( of: find.text('7'), @@ -1710,7 +1709,7 @@ void main() { expect(find.byType(TextField), findsWidgets); }); - testWidgetsWithLeakTracking('Can not double tap hours (when not selected) to enter input mode', (WidgetTester tester) async { + testWidgets('Can not double tap hours (when not selected) to enter input mode', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, materialType: materialType); final Finder hourFinder = find.ancestor( of: find.text('7'), @@ -1736,7 +1735,7 @@ void main() { expect(find.byType(TextField), findsNothing); }); - testWidgetsWithLeakTracking('Can double tap minutes (when selected) to enter input mode', (WidgetTester tester) async { + testWidgets('Can double tap minutes (when selected) to enter input mode', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, materialType: materialType); final Finder minuteFinder = find.ancestor( of: find.text('00'), @@ -1758,7 +1757,7 @@ void main() { expect(find.byType(TextField), findsWidgets); }); - testWidgetsWithLeakTracking('Can not double tap minutes (when not selected) to enter input mode', (WidgetTester tester) async { + testWidgets('Can not double tap minutes (when not selected) to enter input mode', (WidgetTester tester) async { await mediaQueryBoilerplate(tester, materialType: materialType); final Finder minuteFinder = find.ancestor( of: find.text('00'), @@ -1776,7 +1775,7 @@ void main() { expect(find.byType(TextField), findsNothing); }); - testWidgetsWithLeakTracking('Entered text returns time', (WidgetTester tester) async { + testWidgets('Entered text returns time', (WidgetTester tester) async { late TimeOfDay result; await startPicker(tester, (TimeOfDay? time) { result = time!; @@ -1787,7 +1786,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 9, minute: 12))); }); - testWidgetsWithLeakTracking('Toggle to dial mode keeps selected time', (WidgetTester tester) async { + testWidgets('Toggle to dial mode keeps selected time', (WidgetTester tester) async { late TimeOfDay result; await startPicker(tester, (TimeOfDay? time) { result = time!; @@ -1799,7 +1798,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 8, minute: 15))); }); - testWidgetsWithLeakTracking('Invalid text prevents dismissing', (WidgetTester tester) async { + testWidgets('Invalid text prevents dismissing', (WidgetTester tester) async { TimeOfDay? result; await startPicker(tester, (TimeOfDay? time) { result = time; @@ -1824,7 +1823,7 @@ void main() { }); // Fixes regression that was reverted in https://github.com/flutter/flutter/pull/64094#pullrequestreview-469836378. - testWidgetsWithLeakTracking('Ensure hour/minute fields are top-aligned with the separator', (WidgetTester tester) async { + testWidgets('Ensure hour/minute fields are top-aligned with the separator', (WidgetTester tester) async { await startPicker(tester, (TimeOfDay? time) {}, entryMode: TimePickerEntryMode.input, materialType: materialType); final double hourFieldTop = @@ -1837,7 +1836,7 @@ void main() { expect(minuteFieldTop, separatorTop); }); - testWidgetsWithLeakTracking('Can switch between hour/minute fields using keyboard input action', (WidgetTester tester) async { + testWidgets('Can switch between hour/minute fields using keyboard input action', (WidgetTester tester) async { await startPicker(tester, (TimeOfDay? time) {}, entryMode: TimePickerEntryMode.input, materialType: materialType); @@ -1860,7 +1859,7 @@ void main() { }); group('Time picker - Restoration (${materialType.name})', () { - testWidgetsWithLeakTracking('Time Picker state restoration test - dial mode', (WidgetTester tester) async { + testWidgets('Time Picker state restoration test - dial mode', (WidgetTester tester) async { TimeOfDay? result; final Offset center = (await startPicker( tester, @@ -1893,7 +1892,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 6, minute: 45))); }); - testWidgetsWithLeakTracking('Time Picker state restoration test - input mode', (WidgetTester tester) async { + testWidgets('Time Picker state restoration test - input mode', (WidgetTester tester) async { TimeOfDay? result; await startPicker( tester, @@ -1927,7 +1926,7 @@ void main() { expect(result, equals(const TimeOfDay(hour: 9, minute: 12))); }); - testWidgetsWithLeakTracking('Time Picker state restoration test - switching modes', (WidgetTester tester) async { + testWidgets('Time Picker state restoration test - switching modes', (WidgetTester tester) async { TimeOfDay? result; final Offset center = (await startPicker( tester, diff --git a/packages/flutter/test/material/time_picker_theme_test.dart b/packages/flutter/test/material/time_picker_theme_test.dart index a2085920f8b..3c893765e8d 100644 --- a/packages/flutter/test/material/time_picker_theme_test.dart +++ b/packages/flutter/test/material/time_picker_theme_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('TimePickerThemeData copyWith, ==, hashCode basics', () { @@ -45,7 +44,7 @@ void main() { expect(timePickerTheme.shape, null); }); - testWidgetsWithLeakTracking('Default TimePickerThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default TimePickerThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TimePickerThemeData().debugFillProperties(builder); @@ -57,7 +56,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('TimePickerThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('TimePickerThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TimePickerThemeData( backgroundColor: Color(0xfffffff0), @@ -123,7 +122,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('Material2 - Passing no TimePickerThemeData uses defaults', (WidgetTester tester) async { + testWidgets('Material2 - Passing no TimePickerThemeData uses defaults', (WidgetTester tester) async { final ThemeData defaultTheme = ThemeData(useMaterial3: false); await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme)); await tester.tap(find.text('X')); @@ -256,7 +255,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString())); }); - testWidgetsWithLeakTracking('Material3 - Passing no TimePickerThemeData uses defaults', (WidgetTester tester) async { + testWidgets('Material3 - Passing no TimePickerThemeData uses defaults', (WidgetTester tester) async { final ThemeData defaultTheme = ThemeData(useMaterial3: true); await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme)); await tester.tap(find.text('X')); @@ -404,7 +403,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString())); }); - testWidgetsWithLeakTracking('Material2 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async { + testWidgets('Material2 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async { final ThemeData defaultTheme = ThemeData(useMaterial3: false); await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme, entryMode: TimePickerEntryMode.input)); await tester.tap(find.text('X')); @@ -446,7 +445,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString())); }); - testWidgetsWithLeakTracking('Material3 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async { + testWidgets('Material3 - Passing no TimePickerThemeData uses defaults - input mode', (WidgetTester tester) async { final ThemeData defaultTheme = ThemeData(useMaterial3: true); await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme, entryMode: TimePickerEntryMode.input)); await tester.tap(find.text('X')); @@ -491,7 +490,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(TextButton.styleFrom().toString())); }); - testWidgetsWithLeakTracking('Material2 - Time picker uses values from TimePickerThemeData', (WidgetTester tester) async { + testWidgets('Material2 - Time picker uses values from TimePickerThemeData', (WidgetTester tester) async { final TimePickerThemeData timePickerTheme = _timePickerTheme(); final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme, useMaterial3: false); await tester.pumpWidget(_TimePickerLauncher(themeData: theme)); @@ -614,7 +613,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(timePickerTheme.confirmButtonStyle.toString())); }); - testWidgetsWithLeakTracking('Material3 - Time picker uses values from TimePickerThemeData', (WidgetTester tester) async { + testWidgets('Material3 - Time picker uses values from TimePickerThemeData', (WidgetTester tester) async { final TimePickerThemeData timePickerTheme = _timePickerTheme(); final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme, useMaterial3: true); await tester.pumpWidget(_TimePickerLauncher(themeData: theme)); @@ -737,7 +736,7 @@ void main() { expect(confirmButtonStyle.toString(), equalsIgnoringHashCodes(timePickerTheme.confirmButtonStyle.toString())); }); - testWidgetsWithLeakTracking('Time picker uses values from TimePickerThemeData with InputDecorationTheme - input mode', (WidgetTester tester) async { + testWidgets('Time picker uses values from TimePickerThemeData with InputDecorationTheme - input mode', (WidgetTester tester) async { final TimePickerThemeData timePickerTheme = _timePickerTheme(includeInputDecoration: true); final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme); await tester.pumpWidget(_TimePickerLauncher(themeData: theme, entryMode: TimePickerEntryMode.input)); @@ -754,7 +753,7 @@ void main() { expect(hourDecoration.hintStyle, timePickerTheme.inputDecorationTheme!.hintStyle); }); - testWidgetsWithLeakTracking('Time picker uses values from TimePickerThemeData without InputDecorationTheme - input mode', (WidgetTester tester) async { + testWidgets('Time picker uses values from TimePickerThemeData without InputDecorationTheme - input mode', (WidgetTester tester) async { final TimePickerThemeData timePickerTheme = _timePickerTheme(); final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme); await tester.pumpWidget(_TimePickerLauncher(themeData: theme, entryMode: TimePickerEntryMode.input)); @@ -765,7 +764,7 @@ void main() { expect(hourDecoration.fillColor?.value, timePickerTheme.hourMinuteColor?.value); }); - testWidgetsWithLeakTracking('Time picker dayPeriodColor does the right thing with non-MaterialStateColor', (WidgetTester tester) async { + testWidgets('Time picker dayPeriodColor does the right thing with non-MaterialStateColor', (WidgetTester tester) async { final TimePickerThemeData timePickerTheme = _timePickerTheme().copyWith(dayPeriodColor: Colors.red); final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme); await tester.pumpWidget(_TimePickerLauncher(themeData: theme, entryMode: TimePickerEntryMode.input)); @@ -779,7 +778,7 @@ void main() { expect(pmMaterial.color, Colors.transparent); }); - testWidgetsWithLeakTracking('Time picker dayPeriodColor does the right thing with MaterialStateColor', (WidgetTester tester) async { + testWidgets('Time picker dayPeriodColor does the right thing with MaterialStateColor', (WidgetTester tester) async { final MaterialStateColor testColor = MaterialStateColor.resolveWith((Set<MaterialState> states) { if (states.contains(MaterialState.selected)) { return Colors.green; diff --git a/packages/flutter/test/material/time_test.dart b/packages/flutter/test/material/time_test.dart index 97bb94617a1..150634b4e71 100644 --- a/packages/flutter/test/material/time_test.dart +++ b/packages/flutter/test/material/time_test.dart @@ -4,11 +4,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('TimeOfDay.format', () { - testWidgetsWithLeakTracking('respects alwaysUse24HourFormat option', (WidgetTester tester) async { + testWidgets('respects alwaysUse24HourFormat option', (WidgetTester tester) async { Future<String> pumpTest(bool alwaysUse24HourFormat) async { late String formattedValue; await tester.pumpWidget(MaterialApp( @@ -28,7 +27,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('hourOfPeriod returns correct value', (WidgetTester tester) async { + testWidgets('hourOfPeriod returns correct value', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/59158. expect(const TimeOfDay(minute: 0, hour: 0).hourOfPeriod, 12); expect(const TimeOfDay(minute: 0, hour: 1).hourOfPeriod, 1); @@ -57,13 +56,13 @@ void main() { }); group('RestorableTimeOfDay tests', () { - testWidgetsWithLeakTracking('value is not accessible when not registered', (WidgetTester tester) async { + testWidgets('value is not accessible when not registered', (WidgetTester tester) async { final RestorableTimeOfDay property = RestorableTimeOfDay(const TimeOfDay(hour: 20, minute: 4)); addTearDown(property.dispose); expect(() => property.value, throwsAssertionError); }); - testWidgetsWithLeakTracking('work when not in restoration scope', (WidgetTester tester) async { + testWidgets('work when not in restoration scope', (WidgetTester tester) async { await tester.pumpWidget(const _RestorableWidget()); final _RestorableWidgetState state = tester.state(find.byType(_RestorableWidget)); @@ -80,7 +79,7 @@ void main() { expect(state.timeOfDay.value, const TimeOfDay(hour: 2, minute: 2)); }); - testWidgetsWithLeakTracking('restart and restore', (WidgetTester tester) async { + testWidgets('restart and restore', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), @@ -108,7 +107,7 @@ void main() { expect(state.timeOfDay.value, const TimeOfDay(hour: 2, minute: 2)); }); - testWidgetsWithLeakTracking('restore to older state', (WidgetTester tester) async { + testWidgets('restore to older state', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), @@ -139,7 +138,7 @@ void main() { expect(state.timeOfDay.value, const TimeOfDay(hour: 10, minute: 5)); }); - testWidgetsWithLeakTracking('call notifiers when value changes', (WidgetTester tester) async { + testWidgets('call notifiers when value changes', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), diff --git a/packages/flutter/test/material/toggle_buttons_test.dart b/packages/flutter/test/material/toggle_buttons_test.dart index 0a31859bd8f..5bc6b533e5d 100644 --- a/packages/flutter/test/material/toggle_buttons_test.dart +++ b/packages/flutter/test/material/toggle_buttons_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; const double _defaultBorderWidth = 1.0; @@ -36,7 +35,7 @@ Widget boilerplate({ } void main() { - testWidgetsWithLeakTracking('Initial toggle state is reflected', (WidgetTester tester) async { + testWidgets('Initial toggle state is reflected', (WidgetTester tester) async { TextStyle buttonTextStyle(String text) { return tester.widget<DefaultTextStyle>(find.descendant( of: find.widgetWithText(TextButton, text), @@ -67,7 +66,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'onPressed is triggered on button tap', (WidgetTester tester) async { TextStyle buttonTextStyle(String text) { @@ -126,7 +125,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'onPressed that is null disables buttons', (WidgetTester tester) async { TextStyle buttonTextStyle(String text) { @@ -178,7 +177,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'children and isSelected properties have to be the same length', (WidgetTester tester) async { await expectLater( @@ -205,7 +204,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Default text style is applied', (WidgetTester tester) async { + testWidgets('Default text style is applied', (WidgetTester tester) async { final ThemeData theme = ThemeData(); await tester.pumpWidget( boilerplate( @@ -236,7 +235,7 @@ void main() { expect(textStyle.decoration, theme.textTheme.bodyMedium!.decoration); }); - testWidgetsWithLeakTracking('Custom text style except color is applied', (WidgetTester tester) async { + testWidgets('Custom text style except color is applied', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: ToggleButtons( @@ -273,7 +272,7 @@ void main() { expect(textStyle.color, isNot(Colors.orange)); }); - testWidgetsWithLeakTracking('Default BoxConstraints', (WidgetTester tester) async { + testWidgets('Default BoxConstraints', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: ToggleButtons( @@ -299,7 +298,7 @@ void main() { expect(thirdRect.height, 48.0); }); - testWidgetsWithLeakTracking('Custom BoxConstraints', (WidgetTester tester) async { + testWidgets('Custom BoxConstraints', (WidgetTester tester) async { // Test for minimum constraints await tester.pumpWidget( boilerplate( @@ -360,7 +359,7 @@ void main() { expect(thirdRect.height, 10.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'Default text/icon colors for enabled, selected and disabled states', (WidgetTester tester) async { TextStyle buttonTextStyle(String text) { @@ -452,7 +451,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Custom text/icon colors for enabled, selected and disabled states', (WidgetTester tester) async { TextStyle buttonTextStyle(String text) { @@ -538,7 +537,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Default button fillColor - unselected', (WidgetTester tester) async { + testWidgets('Default button fillColor - unselected', (WidgetTester tester) async { final ThemeData theme = ThemeData(); await tester.pumpWidget( boilerplate( @@ -565,7 +564,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Default button fillColor - selected', (WidgetTester tester) async { + testWidgets('Default button fillColor - selected', (WidgetTester tester) async { final ThemeData theme = ThemeData(); await tester.pumpWidget( boilerplate( @@ -592,7 +591,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Default button fillColor - disabled', (WidgetTester tester) async { + testWidgets('Default button fillColor - disabled', (WidgetTester tester) async { final ThemeData theme = ThemeData(); await tester.pumpWidget( boilerplate( @@ -618,7 +617,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Custom button fillColor', (WidgetTester tester) async { + testWidgets('Custom button fillColor', (WidgetTester tester) async { const Color customFillColor = Colors.green; await tester.pumpWidget( boilerplate( @@ -643,7 +642,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Custom button fillColor - Non MaterialState', (WidgetTester tester) async { + testWidgets('Custom button fillColor - Non MaterialState', (WidgetTester tester) async { Material buttonColor(String text) { return tester.widget<Material>( find.descendant( @@ -694,7 +693,7 @@ void main() { expect(buttonColor('Second child').color, theme.colorScheme.surface.withOpacity(0.0)); }); - testWidgetsWithLeakTracking('Custom button fillColor - MaterialState', (WidgetTester tester) async { + testWidgets('Custom button fillColor - MaterialState', (WidgetTester tester) async { Material buttonColor(String text) { return tester.widget<Material>( find.descendant( @@ -753,7 +752,7 @@ void main() { expect(buttonColor('Second child').color, defaultFillColor); }); - testWidgetsWithLeakTracking('Default InkWell colors - unselected', (WidgetTester tester) async { + testWidgets('Default InkWell colors - unselected', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -820,7 +819,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Default InkWell colors - selected', (WidgetTester tester) async { + testWidgets('Default InkWell colors - selected', (WidgetTester tester) async { final ThemeData theme = ThemeData(); final FocusNode focusNode = FocusNode(); await tester.pumpWidget( @@ -887,7 +886,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('Custom InkWell colors', (WidgetTester tester) async { + testWidgets('Custom InkWell colors', (WidgetTester tester) async { const Color splashColor = Color(0xff4caf50); const Color highlightColor = Color(0xffcddc39); const Color hoverColor = Color(0xffffeb3b); @@ -958,7 +957,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'Default border width and border colors for enabled, selected and disabled states', (WidgetTester tester) async { final ThemeData theme = ThemeData(); @@ -1046,7 +1045,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Custom border width and border colors for enabled, selected and disabled states', (WidgetTester tester) async { const Color borderColor = Color(0xff4caf50); @@ -1143,7 +1142,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Height of segmented control is determined by tallest widget', (WidgetTester tester) async { + testWidgets('Height of segmented control is determined by tallest widget', (WidgetTester tester) async { final List<Widget> children = <Widget>[ Container( constraints: const BoxConstraints.tightFor(height: 100.0), @@ -1175,7 +1174,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Sizes of toggle buttons rebuilds with the correct dimensions', (WidgetTester tester) async { + testWidgets('Sizes of toggle buttons rebuilds with the correct dimensions', (WidgetTester tester) async { final List<Widget> children = <Widget>[ Container( constraints: const BoxConstraints.tightFor( @@ -1274,7 +1273,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ToggleButtons text baseline alignment', (WidgetTester tester) async { + testWidgets('ToggleButtons text baseline alignment', (WidgetTester tester) async { // The point size of the fonts must be a multiple of 4 until // https://github.com/flutter/flutter/issues/122066 is resolved. await tester.pumpWidget( @@ -1324,7 +1323,7 @@ void main() { expect(firstToggleButtonDy, textDy - 5.0); }); - testWidgetsWithLeakTracking('Directionality test', (WidgetTester tester) async { + testWidgets('Directionality test', (WidgetTester tester) async { await tester.pumpWidget( Material( child: Directionality( @@ -1372,7 +1371,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Properly draws borders based on state', (WidgetTester tester) async { final ThemeData theme = ThemeData(); @@ -1452,7 +1451,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Properly draws borders based on state when direction is vertical and verticalDirection is down.', (WidgetTester tester) async { final ThemeData theme = ThemeData(); @@ -1539,7 +1538,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'VerticalDirection test when direction is vertical.', (WidgetTester tester) async { await tester.pumpWidget( @@ -1565,7 +1564,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Tap target size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { + testWidgets('Tap target size is configurable by ThemeData.materialTapTargetSize', (WidgetTester tester) async { Widget buildFrame(MaterialTapTargetSize tapTargetSize, Key key) { return boilerplate( useMaterial3: false, @@ -1593,7 +1592,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(228.0, 34.0)); }); - testWidgetsWithLeakTracking('Tap target size is configurable', (WidgetTester tester) async { + testWidgets('Tap target size is configurable', (WidgetTester tester) async { Widget buildFrame(MaterialTapTargetSize tapTargetSize, Key key) { return boilerplate( useMaterial3: false, @@ -1621,7 +1620,7 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(228.0, 34.0)); }); - testWidgetsWithLeakTracking('Tap target size is configurable for vertical axis', (WidgetTester tester) async { + testWidgets('Tap target size is configurable for vertical axis', (WidgetTester tester) async { Widget buildFrame(MaterialTapTargetSize tapTargetSize, Key key) { return boilerplate( child: ToggleButtons( @@ -1650,7 +1649,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/73725 - testWidgetsWithLeakTracking('Border radius paint test when there is only one button', (WidgetTester tester) async { + testWidgets('Border radius paint test when there is only one button', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: false); await tester.pumpWidget( boilerplate( @@ -1695,7 +1694,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Border radius paint test when Radius.x or Radius.y equal 0.0', (WidgetTester tester) async { + testWidgets('Border radius paint test when Radius.x or Radius.y equal 0.0', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( useMaterial3: false, @@ -1723,7 +1722,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ToggleButtons implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ToggleButtons implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); ToggleButtons( @@ -1761,7 +1760,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('ToggleButtons changes mouse cursor when the button is hovered', (WidgetTester tester) async { + testWidgets('ToggleButtons changes mouse cursor when the button is hovered', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: MouseRegion( @@ -1824,7 +1823,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('ToggleButtons focus, hover, and highlight elevations are 0', (WidgetTester tester) async { + testWidgets('ToggleButtons focus, hover, and highlight elevations are 0', (WidgetTester tester) async { final List<FocusNode> focusNodes = <FocusNode>[FocusNode(), FocusNode()]; await tester.pumpWidget( boilerplate( @@ -1874,7 +1873,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Toggle buttons height matches MaterialTapTargetSize.padded height', (WidgetTester tester) async { + testWidgets('Toggle buttons height matches MaterialTapTargetSize.padded height', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: ToggleButtons( @@ -1897,7 +1896,7 @@ void main() { expect(thirdRect.height, 48.0); }); - testWidgetsWithLeakTracking('Toggle buttons constraints size does not affect minimum input padding', (WidgetTester tester) async { + testWidgets('Toggle buttons constraints size does not affect minimum input padding', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/97302 final SemanticsTester semantics = SemanticsTester(tester); @@ -1984,7 +1983,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Toggle buttons have correct semantics', (WidgetTester tester) async { + testWidgets('Toggle buttons have correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/material/toggle_buttons_theme_test.dart b/packages/flutter/test/material/toggle_buttons_theme_test.dart index a041f1d7679..37e9a9c0d33 100644 --- a/packages/flutter/test/material/toggle_buttons_theme_test.dart +++ b/packages/flutter/test/material/toggle_buttons_theme_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Widget boilerplate({required Widget child}) { return Directionality( @@ -63,7 +62,7 @@ void main() { expect(theme.data.borderWidth, null); }); - testWidgetsWithLeakTracking('Default ToggleButtonsThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default ToggleButtonsThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ToggleButtonsThemeData().debugFillProperties(builder); @@ -75,7 +74,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('ToggleButtonsThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('ToggleButtonsThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const ToggleButtonsThemeData( textStyle: TextStyle(fontSize: 10), @@ -120,7 +119,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Theme text style, except color, is applied', (WidgetTester tester) async { + testWidgets('Theme text style, except color, is applied', (WidgetTester tester) async { await tester.pumpWidget( Material( child: boilerplate( @@ -163,7 +162,7 @@ void main() { expect(textStyle.color, isNot(Colors.orange)); }); - testWidgetsWithLeakTracking('Custom BoxConstraints', (WidgetTester tester) async { + testWidgets('Custom BoxConstraints', (WidgetTester tester) async { // Test for minimum constraints await tester.pumpWidget( Material( @@ -237,7 +236,7 @@ void main() { expect(thirdRect.height, 10.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'Theme text/icon colors for enabled, selected and disabled states', (WidgetTester tester) async { TextStyle buttonTextStyle(String text) { @@ -341,7 +340,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Theme button fillColor', (WidgetTester tester) async { + testWidgets('Theme button fillColor', (WidgetTester tester) async { const Color customFillColor = Colors.green; await tester.pumpWidget( Material( @@ -370,7 +369,7 @@ void main() { expect(material.type, MaterialType.button); }); - testWidgetsWithLeakTracking('Custom Theme button fillColor in different states', (WidgetTester tester) async { + testWidgets('Custom Theme button fillColor in different states', (WidgetTester tester) async { Material buttonColor(String text) { return tester.widget<Material>( find.descendant( @@ -437,7 +436,7 @@ void main() { expect(buttonColor('Second child').color, disabledFillColor); }); - testWidgetsWithLeakTracking('Theme InkWell colors', (WidgetTester tester) async { + testWidgets('Theme InkWell colors', (WidgetTester tester) async { const Color splashColor = Color(0xff4caf50); const Color highlightColor = Color(0xffcddc39); const Color hoverColor = Color(0xffffeb3b); @@ -515,7 +514,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking( + testWidgets( 'Theme border width and border colors for enabled, selected and disabled states', (WidgetTester tester) async { const Color borderColor = Color(0xff4caf50); diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart index 079b0bbfc9d..d48bc4aa0cd 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; import 'feedback_tester.dart'; @@ -24,7 +23,7 @@ Finder _findTooltipContainer(String tooltipText) { } void main() { - testWidgetsWithLeakTracking('Does tooltip end up in the right place - center', (WidgetTester tester) async { + testWidgets('Does tooltip end up in the right place - center', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -80,7 +79,7 @@ void main() { expect(tipInGlobal.dy, 20.0); }); - testWidgetsWithLeakTracking('Does tooltip end up in the right place - center with padding outside overlay', (WidgetTester tester) async { + testWidgets('Does tooltip end up in the right place - center with padding outside overlay', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -141,7 +140,7 @@ void main() { expect(tipInGlobal.dy, 40.0); }); - testWidgetsWithLeakTracking('Material2 - Does tooltip end up in the right place - top left', (WidgetTester tester) async { + testWidgets('Material2 - Does tooltip end up in the right place - top left', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -195,7 +194,7 @@ void main() { expect(tip.localToGlobal(tip.size.topLeft(Offset.zero)), equals(const Offset(10.0, 20.0))); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Material3 - Does tooltip end up in the right place - top left', (WidgetTester tester) async { + testWidgets('Material3 - Does tooltip end up in the right place - top left', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -248,7 +247,7 @@ void main() { expect(tip.localToGlobal(tip.size.topLeft(Offset.zero)), equals(const Offset(10.0, 20.0))); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Does tooltip end up in the right place - center prefer above fits', (WidgetTester tester) async { + testWidgets('Does tooltip end up in the right place - center prefer above fits', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -303,7 +302,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(200.0)); }); - testWidgetsWithLeakTracking('Does tooltip end up in the right place - center prefer above does not fit', (WidgetTester tester) async { + testWidgets('Does tooltip end up in the right place - center prefer above does not fit', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -369,7 +368,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(589.0)); }); - testWidgetsWithLeakTracking('Does tooltip end up in the right place - center prefer below fits', (WidgetTester tester) async { + testWidgets('Does tooltip end up in the right place - center prefer below fits', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -423,7 +422,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(590.0)); }); - testWidgetsWithLeakTracking('Material2 - Does tooltip end up in the right place - way off to the right', (WidgetTester tester) async { + testWidgets('Material2 - Does tooltip end up in the right place - way off to the right', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -480,7 +479,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(324.0)); }); - testWidgetsWithLeakTracking('Material3 - Does tooltip end up in the right place - way off to the right', (WidgetTester tester) async { + testWidgets('Material3 - Does tooltip end up in the right place - way off to the right', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -536,7 +535,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(330.0)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Material2 - Does tooltip end up in the right place - near the edge', (WidgetTester tester) async { + testWidgets('Material2 - Does tooltip end up in the right place - near the edge', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -593,7 +592,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(324.0)); }); - testWidgetsWithLeakTracking('Material3 - Does tooltip end up in the right place - near the edge', (WidgetTester tester) async { + testWidgets('Material3 - Does tooltip end up in the right place - near the edge', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -649,7 +648,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(330.0)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Tooltip should be fully visible when MediaQuery.viewInsets > 0', (WidgetTester tester) async { + testWidgets('Tooltip should be fully visible when MediaQuery.viewInsets > 0', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/23666 Widget materialAppWithViewInsets(double viewInsetsHeight) { final Widget scaffold = Scaffold( @@ -704,7 +703,7 @@ void main() { expect(tooltipTopRight.dy, lessThan(fabTopRight.dy)); }); - testWidgetsWithLeakTracking('Custom tooltip margin', (WidgetTester tester) async { + testWidgets('Custom tooltip margin', (WidgetTester tester) async { const double customMarginValue = 10.0; final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -761,7 +760,7 @@ void main() { expect(bottomRightTooltipContentInGlobal.dy, bottomRightTipInGlobal.dy - customMarginValue); }); - testWidgetsWithLeakTracking('Material2 - Default tooltip message textStyle - light', (WidgetTester tester) async { + testWidgets('Material2 - Default tooltip message textStyle - light', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( theme: ThemeData(useMaterial3: false), @@ -785,7 +784,7 @@ void main() { expect(textStyle.debugLabel, '((englishLike bodyMedium 2014).merge(blackMountainView bodyMedium)).copyWith'); }); - testWidgetsWithLeakTracking('Material3 - Default tooltip message textStyle - light', (WidgetTester tester) async { + testWidgets('Material3 - Default tooltip message textStyle - light', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( home: Tooltip( @@ -811,7 +810,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - Default tooltip message textStyle - dark', (WidgetTester tester) async { + testWidgets('Material2 - Default tooltip message textStyle - dark', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -838,7 +837,7 @@ void main() { expect(textStyle.debugLabel, '((englishLike bodyMedium 2014).merge(whiteMountainView bodyMedium)).copyWith'); }); - testWidgetsWithLeakTracking('Material3 - Default tooltip message textStyle - dark', (WidgetTester tester) async { + testWidgets('Material3 - Default tooltip message textStyle - dark', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( theme: ThemeData(brightness: Brightness.dark), @@ -862,7 +861,7 @@ void main() { expect(textStyle.debugLabel, '((englishLike bodyMedium 2021).merge((whiteMountainView bodyMedium).apply)).copyWith'); }); - testWidgetsWithLeakTracking('Custom tooltip message textStyle', (WidgetTester tester) async { + testWidgets('Custom tooltip message textStyle', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( home: Tooltip( @@ -888,7 +887,7 @@ void main() { expect(textStyle.decoration, TextDecoration.underline); }); - testWidgetsWithLeakTracking('Custom tooltip message textAlign', (WidgetTester tester) async { + testWidgets('Custom tooltip message textAlign', (WidgetTester tester) async { Future<void> pumpTooltipWithTextAlign({TextAlign? textAlign}) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget( @@ -923,7 +922,7 @@ void main() { expect(textAlign, TextAlign.end); }); - testWidgetsWithLeakTracking('Tooltip overlay respects ambient Directionality', (WidgetTester tester) async { + testWidgets('Tooltip overlay respects ambient Directionality', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/40702. Widget buildApp(String text, TextDirection textDirection) { return MaterialApp( @@ -960,7 +959,7 @@ void main() { expect(tooltipRenderParagraph.textDirection, TextDirection.ltr); }); - testWidgetsWithLeakTracking('Tooltip overlay wrapped with a non-fallback DefaultTextStyle widget', (WidgetTester tester) async { + testWidgets('Tooltip overlay wrapped with a non-fallback DefaultTextStyle widget', (WidgetTester tester) async { // A Material widget is needed as an ancestor of the Text widget. // It is invalid to have text in a Material application that // does not have a Material ancestor. @@ -993,7 +992,7 @@ void main() { expect(textStyle.decorationStyle, isNot(TextDecorationStyle.double)); }); - testWidgetsWithLeakTracking('Material2 - Does tooltip end up with the right default size, shape, and color', (WidgetTester tester) async { + testWidgets('Material2 - Does tooltip end up with the right default size, shape, and color', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -1031,7 +1030,7 @@ void main() { expect(tooltipContainer.padding, const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0)); }); - testWidgetsWithLeakTracking('Material3 - Does tooltip end up with the right default size, shape, and color', (WidgetTester tester) async { + testWidgets('Material3 - Does tooltip end up with the right default size, shape, and color', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -1068,7 +1067,7 @@ void main() { expect(tooltipContainer.padding, const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0)); }); - testWidgetsWithLeakTracking('Material2 - Tooltip default size, shape, and color test for Desktop', (WidgetTester tester) async { + testWidgets('Material2 - Tooltip default size, shape, and color test for Desktop', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/68601 final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget( @@ -1098,7 +1097,7 @@ void main() { expect(tooltipContainer.padding, const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.macOS, TargetPlatform.linux, TargetPlatform.windows})); - testWidgetsWithLeakTracking('Material3 - Tooltip default size, shape, and color test for Desktop', (WidgetTester tester) async { + testWidgets('Material3 - Tooltip default size, shape, and color test for Desktop', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/68601 final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget( @@ -1129,7 +1128,7 @@ void main() { skip: kIsWeb && !isCanvasKit, // https://github.com/flutter/flutter/issues/99933 ); - testWidgetsWithLeakTracking('Material2 - Can tooltip decoration be customized', (WidgetTester tester) async { + testWidgets('Material2 - Can tooltip decoration be customized', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); const Decoration customDecoration = ShapeDecoration( shape: StadiumBorder(), @@ -1168,7 +1167,7 @@ void main() { expect(tip, paints..rrect(color: const Color(0x80800000))); }); - testWidgetsWithLeakTracking('Material3 - Can tooltip decoration be customized', (WidgetTester tester) async { + testWidgets('Material3 - Can tooltip decoration be customized', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); const Decoration customDecoration = ShapeDecoration( shape: StadiumBorder(), @@ -1206,7 +1205,7 @@ void main() { expect(tip, paints..rrect(color: const Color(0x80800000))); }); - testWidgetsWithLeakTracking('Tooltip stays after long press', (WidgetTester tester) async { + testWidgets('Tooltip stays after long press', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Center( @@ -1255,7 +1254,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Tooltip dismiss countdown begins on long press release', (WidgetTester tester) async { + testWidgets('Tooltip dismiss countdown begins on long press release', (WidgetTester tester) async { // Specs: https://github.com/flutter/flutter/issues/4182 const Duration showDuration = Duration(seconds: 1); const Duration eternity = Duration(days: 9999); @@ -1281,7 +1280,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip is dismissed after a long press and showDuration expired', (WidgetTester tester) async { + testWidgets('Tooltip is dismissed after a long press and showDuration expired', (WidgetTester tester) async { const Duration showDuration = Duration(seconds: 3); await setWidgetForTooltipMode(tester, TooltipTriggerMode.longPress, showDuration: showDuration); @@ -1300,7 +1299,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip is dismissed after a tap and showDuration expired', (WidgetTester tester) async { + testWidgets('Tooltip is dismissed after a tap and showDuration expired', (WidgetTester tester) async { const Duration showDuration = Duration(seconds: 3); await setWidgetForTooltipMode(tester, TooltipTriggerMode.tap, showDuration: showDuration); @@ -1316,7 +1315,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip is dismissed after tap to dismiss immediately', (WidgetTester tester) async { + testWidgets('Tooltip is dismissed after tap to dismiss immediately', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.tap); @@ -1333,7 +1332,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip is not dismissed after tap if enableTapToDismiss is false', (WidgetTester tester) async { + testWidgets('Tooltip is not dismissed after tap if enableTapToDismiss is false', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.tap, enableTapToDismiss: false); final Finder tooltip = find.byType(Tooltip); @@ -1349,7 +1348,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); }); - testWidgetsWithLeakTracking('Tooltip is dismissed after a tap and showDuration expired when competing with a GestureDetector', (WidgetTester tester) async { + testWidgets('Tooltip is dismissed after a tap and showDuration expired when competing with a GestureDetector', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/98854 const Duration showDuration = Duration(seconds: 3); await tester.pumpWidget( @@ -1380,7 +1379,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Dispatch the mouse events before tip overlay detached', (WidgetTester tester) async { + testWidgets('Dispatch the mouse events before tip overlay detached', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/96890 const Duration waitDuration = Duration.zero; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -1428,7 +1427,7 @@ void main() { expect(find.byTooltip(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Calling ensureTooltipVisible on an unmounted TooltipState returns false', (WidgetTester tester) async { + testWidgets('Calling ensureTooltipVisible on an unmounted TooltipState returns false', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/95851 await tester.pumpWidget( const MaterialApp( @@ -1459,7 +1458,7 @@ void main() { expect(tooltipState.ensureTooltipVisible(), false); }); - testWidgetsWithLeakTracking('Tooltip shows/hides when hovered', (WidgetTester tester) async { + testWidgets('Tooltip shows/hides when hovered', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); addTearDown(() async { @@ -1509,7 +1508,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip text is also hoverable', (WidgetTester tester) async { + testWidgets('Tooltip text is also hoverable', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); addTearDown(() async { @@ -1562,7 +1561,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip should not show more than one tooltip when hovered', (WidgetTester tester) async { + testWidgets('Tooltip should not show more than one tooltip when hovered', (WidgetTester tester) async { const Duration waitDuration = Duration(milliseconds: 500); final UniqueKey innerKey = UniqueKey(); final UniqueKey outerKey = UniqueKey(); @@ -1626,7 +1625,7 @@ void main() { expect(find.text('Inner'), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip can be dismissed by escape key', (WidgetTester tester) async { + testWidgets('Tooltip can be dismissed by escape key', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); addTearDown(() async { @@ -1671,7 +1670,7 @@ void main() { gesture = null; }); - testWidgetsWithLeakTracking('Multiple Tooltips are dismissed by escape key', (WidgetTester tester) async { + testWidgets('Multiple Tooltips are dismissed by escape key', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; await tester.pumpWidget( const MaterialApp( @@ -1712,7 +1711,7 @@ void main() { expect(find.text('message2'), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip does not attempt to show after unmount', (WidgetTester tester) async { + testWidgets('Tooltip does not attempt to show after unmount', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/54096. const Duration waitDuration = Duration(seconds: 1); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -1758,7 +1757,7 @@ void main() { await tester.pump(waitDuration); }); - testWidgetsWithLeakTracking('Does tooltip contribute semantics', (WidgetTester tester) async { + testWidgets('Does tooltip contribute semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -1813,7 +1812,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Tooltip semantics does not merge into child', (WidgetTester tester) async { + testWidgets('Tooltip semantics does not merge into child', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -1877,7 +1876,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Material2 - Tooltip text scales with textScaleFactor', (WidgetTester tester) async { + testWidgets('Material2 - Tooltip text scales with textScaleFactor', (WidgetTester tester) async { Widget buildApp(String text, { required double textScaleFactor }) { return MaterialApp( theme: ThemeData(useMaterial3: false), @@ -1927,7 +1926,7 @@ void main() { expect(tip.size.height, equals(64.0)); }); - testWidgetsWithLeakTracking('Material3 - Tooltip text scales with textScaleFactor', (WidgetTester tester) async { + testWidgets('Material3 - Tooltip text scales with textScaleFactor', (WidgetTester tester) async { Widget buildApp(String text, { required double textScaleFactor }) { return MaterialApp( home: MediaQuery( @@ -1975,7 +1974,7 @@ void main() { expect(tip.size.height, equals(88.0)); }, skip: kIsWeb && !isCanvasKit); // https://github.com/flutter/flutter/issues/99933 - testWidgetsWithLeakTracking('Tooltip text displays with richMessage', (WidgetTester tester) async { + testWidgets('Tooltip text displays with richMessage', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); const String textSpan1Text = 'I am a rich tooltip message. '; const String textSpan2Text = 'I am another span of a rich tooltip message'; @@ -2006,7 +2005,7 @@ void main() { expect(richText.text.toPlainText(), equals('$textSpan1Text$textSpan2Text')); }); - testWidgetsWithLeakTracking('Tooltip throws assertion error when both message and richMessage are specified', (WidgetTester tester) async { + testWidgets('Tooltip throws assertion error when both message and richMessage are specified', (WidgetTester tester) async { expect( () { MaterialApp( @@ -2032,7 +2031,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Haptic feedback', (WidgetTester tester) async { + testWidgets('Haptic feedback', (WidgetTester tester) async { final FeedbackTester feedback = FeedbackTester(); await tester.pumpWidget( MaterialApp( @@ -2056,7 +2055,7 @@ void main() { feedback.dispose(); }); - testWidgetsWithLeakTracking('Semantics included', (WidgetTester tester) async { + testWidgets('Semantics included', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2096,7 +2095,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics excluded', (WidgetTester tester) async { + testWidgets('Semantics excluded', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -2136,7 +2135,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('has semantic events', (WidgetTester tester) async { + testWidgets('has semantic events', (WidgetTester tester) async { final List<dynamic> semanticEvents = <dynamic>[]; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { semanticEvents.add(message); @@ -2177,7 +2176,7 @@ void main() { semantics.dispose(); tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('default Tooltip debugFillProperties', (WidgetTester tester) async { + testWidgets('default Tooltip debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Tooltip(message: 'message').debugFillProperties(builder); @@ -2190,7 +2189,7 @@ void main() { '"message"', ]); }); - testWidgetsWithLeakTracking('default Tooltip debugFillProperties with richMessage', (WidgetTester tester) async { + testWidgets('default Tooltip debugFillProperties with richMessage', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Tooltip( @@ -2212,7 +2211,7 @@ void main() { '"This is a richMessage"', ]); }); - testWidgetsWithLeakTracking('Tooltip implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Tooltip implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); // Not checking controller, inputFormatters, focusNode @@ -2251,7 +2250,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Tooltip triggers on tap when trigger mode is tap', (WidgetTester tester) async { + testWidgets('Tooltip triggers on tap when trigger mode is tap', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.tap); final Finder tooltip = find.byType(Tooltip); @@ -2261,7 +2260,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); }); - testWidgetsWithLeakTracking('Tooltip triggers on long press when mode is long press', (WidgetTester tester) async { + testWidgets('Tooltip triggers on long press when mode is long press', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.longPress); final Finder tooltip = find.byType(Tooltip); @@ -2274,7 +2273,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); }); - testWidgetsWithLeakTracking('Tooltip does not trigger on tap when trigger mode is longPress', (WidgetTester tester) async { + testWidgets('Tooltip does not trigger on tap when trigger mode is longPress', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.longPress); final Finder tooltip = find.byType(Tooltip); @@ -2284,7 +2283,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip does not trigger when trigger mode is manual', (WidgetTester tester) async { + testWidgets('Tooltip does not trigger when trigger mode is manual', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.manual); final Finder tooltip = find.byType(Tooltip); @@ -2297,7 +2296,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip onTriggered is called when Tooltip triggers', (WidgetTester tester) async { + testWidgets('Tooltip onTriggered is called when Tooltip triggers', (WidgetTester tester) async { bool onTriggeredCalled = false; void onTriggered() => onTriggeredCalled = true; @@ -2313,7 +2312,7 @@ void main() { expect(onTriggeredCalled, true); }); - testWidgetsWithLeakTracking('Tooltip onTriggered is not called when Tooltip is hovered', (WidgetTester tester) async { + testWidgets('Tooltip onTriggered is not called when Tooltip is hovered', (WidgetTester tester) async { bool onTriggeredCalled = false; void onTriggered() => onTriggeredCalled = true; @@ -2346,7 +2345,7 @@ void main() { expect(onTriggeredCalled, false); }); - testWidgetsWithLeakTracking('dismissAllToolTips dismisses hovered tooltips', (WidgetTester tester) async { + testWidgets('dismissAllToolTips dismisses hovered tooltips', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -2382,7 +2381,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Hovered tooltips do not dismiss after showDuration', (WidgetTester tester) async { + testWidgets('Hovered tooltips do not dismiss after showDuration', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -2431,7 +2430,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Hovered tooltips with showDuration set do dismiss when hovering elswhere', (WidgetTester tester) async { + testWidgets('Hovered tooltips with showDuration set do dismiss when hovering elswhere', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; const Duration showDuration = Duration(seconds: 1); @@ -2466,7 +2465,7 @@ void main() { reason: 'Tooltip should not wait for showDuration before it hides itself.'); }); - testWidgetsWithLeakTracking('Hovered tooltips hide after stopping the hover', (WidgetTester tester) async { + testWidgets('Hovered tooltips hide after stopping the hover', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( @@ -2494,7 +2493,7 @@ void main() { expect(find.text(tooltipText), findsNothing, reason: 'Tooltip should be hidden when no longer hovered.'); }); - testWidgetsWithLeakTracking('Hovered tooltips hide after stopping the hover and exitDuration expires', (WidgetTester tester) async { + testWidgets('Hovered tooltips hide after stopping the hover and exitDuration expires', (WidgetTester tester) async { const Duration exitDuration = Duration(seconds: 1); await tester.pumpWidget( const MaterialApp( @@ -2529,7 +2528,7 @@ void main() { expect(find.text(tooltipText), findsNothing, reason: 'Tooltip should be hidden when no longer hovered.'); }); - testWidgetsWithLeakTracking('Tooltip should not be shown with empty message (with child)', (WidgetTester tester) async { + testWidgets('Tooltip should not be shown with empty message (with child)', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Tooltip( @@ -2541,7 +2540,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); }); - testWidgetsWithLeakTracking('Tooltip should not be shown with empty message (without child)', (WidgetTester tester) async { + testWidgets('Tooltip should not be shown with empty message (without child)', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Tooltip( @@ -2555,7 +2554,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Tooltip trigger mode ignores mouse events', (WidgetTester tester) async { + testWidgets('Tooltip trigger mode ignores mouse events', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Tooltip( @@ -2583,7 +2582,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); }); - testWidgetsWithLeakTracking('Tooltip does not block other mouse regions', (WidgetTester tester) async { + testWidgets('Tooltip does not block other mouse regions', (WidgetTester tester) async { bool entered = false; await tester.pumpWidget( @@ -2608,7 +2607,7 @@ void main() { expect(entered, isTrue); }); - testWidgetsWithLeakTracking('Does not rebuild on mouse connect/disconnect', (WidgetTester tester) async { + testWidgets('Does not rebuild on mouse connect/disconnect', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/117627 int buildCount = 0; await tester.pumpWidget( @@ -2633,7 +2632,7 @@ void main() { expect(buildCount, 1); }); - testWidgetsWithLeakTracking('Tooltip should not ignore users tap on richMessage', (WidgetTester tester) async { + testWidgets('Tooltip should not ignore users tap on richMessage', (WidgetTester tester) async { bool isTapped = false; final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -2665,7 +2664,7 @@ void main() { expect(isTapped, isTrue); }); - testWidgetsWithLeakTracking('Hold mouse button down and hover over the Tooltip widget', (WidgetTester tester) async { + testWidgets('Hold mouse button down and hover over the Tooltip widget', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( @@ -2708,7 +2707,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Hovered text should dismiss when clicked outside', (WidgetTester tester) async { + testWidgets('Hovered text should dismiss when clicked outside', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( @@ -2753,7 +2752,7 @@ void main() { expect(find.text(tooltipText), findsNothing, reason: 'Tapping outside of the Tooltip widget should dismiss the tooltip.'); }); - testWidgetsWithLeakTracking('Mouse tap and hover over the Tooltip widget', (WidgetTester tester) async { + testWidgets('Mouse tap and hover over the Tooltip widget', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/127575 . await tester.pumpWidget( const MaterialApp( @@ -2824,7 +2823,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Tooltip does not rebuild for fade in / fade out animation', (WidgetTester tester) async { + testWidgets('Tooltip does not rebuild for fade in / fade out animation', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( @@ -2857,7 +2856,7 @@ void main() { expect(element.dirty, isFalse); }); - testWidgetsWithLeakTracking('Tooltip does not initialize animation controller in dispose process', (WidgetTester tester) async { + testWidgets('Tooltip does not initialize animation controller in dispose process', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Center( @@ -2880,7 +2879,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Tooltip does not crash when showing the tooltip but the OverlayPortal is unmounted, during dispose', (WidgetTester tester) async { + testWidgets('Tooltip does not crash when showing the tooltip but the OverlayPortal is unmounted, during dispose', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: SelectionArea( @@ -2907,7 +2906,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Tooltip is not selectable', (WidgetTester tester) async { + testWidgets('Tooltip is not selectable', (WidgetTester tester) async { const String tooltipText = 'AAAAAAAAAAAAAAAAAAAAAAA'; String? selectedText; await tester.pumpWidget( diff --git a/packages/flutter/test/material/tooltip_theme_test.dart b/packages/flutter/test/material/tooltip_theme_test.dart index 84bd29fa1a0..56a356db85d 100644 --- a/packages/flutter/test/material/tooltip_theme_test.dart +++ b/packages/flutter/test/material/tooltip_theme_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; const String tooltipText = 'TIP'; @@ -42,7 +41,7 @@ void main() { expect(theme.enableFeedback, null); }); - testWidgetsWithLeakTracking('Default TooltipThemeData debugFillProperties', (WidgetTester tester) async { + testWidgets('Default TooltipThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const TooltipThemeData().debugFillProperties(builder); @@ -54,7 +53,7 @@ void main() { expect(description, <String>[]); }); - testWidgetsWithLeakTracking('TooltipThemeData implements debugFillProperties', (WidgetTester tester) async { + testWidgets('TooltipThemeData implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Duration wait = Duration(milliseconds: 100); const Duration show = Duration(milliseconds: 200); @@ -99,7 +98,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Tooltip verticalOffset, preferBelow; center prefer above fits - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip verticalOffset, preferBelow; center prefer above fits - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -155,7 +154,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(200.0)); }); - testWidgetsWithLeakTracking('Tooltip verticalOffset, preferBelow; center prefer above fits - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip verticalOffset, preferBelow; center prefer above fits - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -213,7 +212,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(200.0)); }); - testWidgetsWithLeakTracking('Tooltip verticalOffset, preferBelow; center prefer above does not fit - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip verticalOffset, preferBelow; center prefer above does not fit - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -281,7 +280,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(589.0)); }); - testWidgetsWithLeakTracking('Tooltip verticalOffset, preferBelow; center prefer above does not fit - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip verticalOffset, preferBelow; center prefer above does not fit - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -350,7 +349,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(589.0)); }); - testWidgetsWithLeakTracking('Tooltip verticalOffset, preferBelow; center preferBelow fits - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip verticalOffset, preferBelow; center preferBelow fits - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -405,7 +404,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(590.0)); }); - testWidgetsWithLeakTracking('Tooltip verticalOffset, preferBelow; center prefer below fits - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip verticalOffset, preferBelow; center prefer below fits - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -462,7 +461,7 @@ void main() { expect(tip.localToGlobal(tip.size.bottomRight(Offset.zero)).dy, equals(590.0)); }); - testWidgetsWithLeakTracking('Tooltip margin - ThemeData', (WidgetTester tester) async { + testWidgets('Tooltip margin - ThemeData', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; @@ -520,7 +519,7 @@ void main() { expect(bottomRightTooltipContentInGlobal.dy, bottomRightTipInGlobal.dy - _customPaddingValue); }); - testWidgetsWithLeakTracking('Tooltip margin - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip margin - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -575,7 +574,7 @@ void main() { expect(bottomRightTooltipContentInGlobal.dy, bottomRightTipInGlobal.dy - _customPaddingValue); }); - testWidgetsWithLeakTracking('Tooltip message textStyle - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip message textStyle - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -605,7 +604,7 @@ void main() { expect(textStyle.decoration, TextDecoration.underline); }); - testWidgetsWithLeakTracking('Tooltip message textStyle - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip message textStyle - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); await tester.pumpWidget(MaterialApp( home: TooltipTheme( @@ -634,7 +633,7 @@ void main() { expect(textStyle.decoration, TextDecoration.underline); }); - testWidgetsWithLeakTracking('Tooltip message textAlign - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip message textAlign - TooltipTheme', (WidgetTester tester) async { Future<void> pumpTooltipWithTextAlign({TextAlign? textAlign}) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget( @@ -673,7 +672,7 @@ void main() { expect(textAlign, TextAlign.end); }); - testWidgetsWithLeakTracking('Material2 - Tooltip decoration - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Material2 - Tooltip decoration - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); const Decoration customDecoration = ShapeDecoration( shape: StadiumBorder(), @@ -714,7 +713,7 @@ void main() { expect(tip, paints..rrect(color: const Color(0x80800000))); }); - testWidgetsWithLeakTracking('Material3 - Tooltip decoration - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Material3 - Tooltip decoration - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); const Decoration customDecoration = ShapeDecoration( shape: StadiumBorder(), @@ -754,7 +753,7 @@ void main() { expect(tip, paints..rrect(color: const Color(0x80800000))); }); - testWidgetsWithLeakTracking('Material2 - Tooltip decoration - TooltipTheme', (WidgetTester tester) async { + testWidgets('Material2 - Tooltip decoration - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); const Decoration customDecoration = ShapeDecoration( shape: StadiumBorder(), @@ -795,7 +794,7 @@ void main() { expect(tip, paints..rrect(color: const Color(0x80800000))); }); - testWidgetsWithLeakTracking('Material3 - Tooltip decoration - TooltipTheme', (WidgetTester tester) async { + testWidgets('Material3 - Tooltip decoration - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); const Decoration customDecoration = ShapeDecoration( shape: StadiumBorder(), @@ -835,7 +834,7 @@ void main() { expect(tip, paints..rrect(color: const Color(0x80800000))); }); - testWidgetsWithLeakTracking('Tooltip height and padding - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip height and padding - ThemeData.tooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); const double customTooltipHeight = 100.0; const double customPaddingVal = 20.0; @@ -882,7 +881,7 @@ void main() { expect(content.size.width, equals(tip.size.width - 2 * customPaddingVal)); }); - testWidgetsWithLeakTracking('Tooltip height and padding - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip height and padding - TooltipTheme', (WidgetTester tester) async { final GlobalKey<TooltipState> key = GlobalKey<TooltipState>(); const double customTooltipHeight = 100.0; const double customPaddingValue = 20.0; @@ -928,7 +927,7 @@ void main() { expect(content.size.width, equals(tip.size.width - 2 * customPaddingValue)); }); - testWidgetsWithLeakTracking('Tooltip waitDuration - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip waitDuration - ThemeData.tooltipTheme', (WidgetTester tester) async { const Duration customWaitDuration = Duration(milliseconds: 500); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -975,7 +974,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip waitDuration - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip waitDuration - TooltipTheme', (WidgetTester tester) async { const Duration customWaitDuration = Duration(milliseconds: 500); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -1018,7 +1017,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip showDuration - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip showDuration - ThemeData.tooltipTheme', (WidgetTester tester) async { const Duration customShowDuration = Duration(milliseconds: 3000); await tester.pumpWidget( MaterialApp( @@ -1055,7 +1054,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip showDuration - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip showDuration - TooltipTheme', (WidgetTester tester) async { const Duration customShowDuration = Duration(milliseconds: 3000); await tester.pumpWidget( const MaterialApp( @@ -1088,7 +1087,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip exitDuration - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip exitDuration - ThemeData.tooltipTheme', (WidgetTester tester) async { const Duration customExitDuration = Duration(milliseconds: 500); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -1133,7 +1132,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip exitDuration - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip exitDuration - TooltipTheme', (WidgetTester tester) async { const Duration customExitDuration = Duration(milliseconds: 500); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -1174,7 +1173,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip triggerMode - ThemeData.triggerMode', (WidgetTester tester) async { + testWidgets('Tooltip triggerMode - ThemeData.triggerMode', (WidgetTester tester) async { const TooltipTriggerMode triggerMode = TooltipTriggerMode.tap; await tester.pumpWidget( MaterialApp( @@ -1199,7 +1198,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); // Tooltip should show immediately after tap }); - testWidgetsWithLeakTracking('Tooltip triggerMode - TooltipTheme', (WidgetTester tester) async { + testWidgets('Tooltip triggerMode - TooltipTheme', (WidgetTester tester) async { const TooltipTriggerMode triggerMode = TooltipTriggerMode.tap; await tester.pumpWidget( const MaterialApp( @@ -1222,7 +1221,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); // Tooltip should show immediately after tap }); - testWidgetsWithLeakTracking('Semantics included by default - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Semantics included by default - ThemeData.tooltipTheme', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1263,7 +1262,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics included by default - TooltipTheme', (WidgetTester tester) async { + testWidgets('Semantics included by default - TooltipTheme', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1306,7 +1305,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics excluded - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('Semantics excluded - ThemeData.tooltipTheme', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1350,7 +1349,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics excluded - TooltipTheme', (WidgetTester tester) async { + testWidgets('Semantics excluded - TooltipTheme', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1392,7 +1391,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('has semantic events by default - ThemeData.tooltipTheme', (WidgetTester tester) async { + testWidgets('has semantic events by default - ThemeData.tooltipTheme', (WidgetTester tester) async { final List<dynamic> semanticEvents = <dynamic>[]; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { semanticEvents.add(message); @@ -1435,7 +1434,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('has semantic events by default - TooltipTheme', (WidgetTester tester) async { + testWidgets('has semantic events by default - TooltipTheme', (WidgetTester tester) async { final List<dynamic> semanticEvents = <dynamic>[]; tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, (dynamic message) async { semanticEvents.add(message); @@ -1480,7 +1479,7 @@ void main() { tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler<dynamic>(SystemChannels.accessibility, null); }); - testWidgetsWithLeakTracking('default Tooltip debugFillProperties', (WidgetTester tester) async { + testWidgets('default Tooltip debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Tooltip(message: 'message').debugFillProperties(builder); diff --git a/packages/flutter/test/material/tooltip_visibility_test.dart b/packages/flutter/test/material/tooltip_visibility_test.dart index e607bd9f7e1..ec5764271f2 100644 --- a/packages/flutter/test/material/tooltip_visibility_test.dart +++ b/packages/flutter/test/material/tooltip_visibility_test.dart @@ -7,12 +7,11 @@ import 'dart:ui'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const String tooltipText = 'TIP'; void main() { - testWidgetsWithLeakTracking('Tooltip does not build MouseRegion when mouse is detected and in TooltipVisibility with visibility = false', (WidgetTester tester) async { + testWidgets('Tooltip does not build MouseRegion when mouse is detected and in TooltipVisibility with visibility = false', (WidgetTester tester) async { final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); addTearDown(() async { return gesture.removePointer(); @@ -40,7 +39,7 @@ void main() { expect(find.descendant(of: find.byType(Tooltip), matching: find.byType(MouseRegion)), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip does not show when hovered when in TooltipVisibility with visible = false', (WidgetTester tester) async { + testWidgets('Tooltip does not show when hovered when in TooltipVisibility with visible = false', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); addTearDown(() async { @@ -79,7 +78,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip shows when hovered when in TooltipVisibility with visible = true', (WidgetTester tester) async { + testWidgets('Tooltip shows when hovered when in TooltipVisibility with visible = true', (WidgetTester tester) async { const Duration waitDuration = Duration.zero; TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); addTearDown(() async { @@ -127,13 +126,13 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip does not build GestureDetector when in TooltipVisibility with visibility = false', (WidgetTester tester) async { + testWidgets('Tooltip does not build GestureDetector when in TooltipVisibility with visibility = false', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.tap, false); expect(find.byType(GestureDetector), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip triggers on tap when trigger mode is tap and in TooltipVisibility with visible = true', (WidgetTester tester) async { + testWidgets('Tooltip triggers on tap when trigger mode is tap and in TooltipVisibility with visible = true', (WidgetTester tester) async { await setWidgetForTooltipMode(tester, TooltipTriggerMode.tap, true); final Finder tooltip = find.byType(Tooltip); @@ -143,7 +142,7 @@ void main() { expect(find.text(tooltipText), findsOneWidget); }); - testWidgetsWithLeakTracking('Tooltip does not trigger manually when in TooltipVisibility with visible = false', (WidgetTester tester) async { + testWidgets('Tooltip does not trigger manually when in TooltipVisibility with visible = false', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget( MaterialApp( @@ -163,7 +162,7 @@ void main() { expect(find.text(tooltipText), findsNothing); }); - testWidgetsWithLeakTracking('Tooltip triggers manually when in TooltipVisibility with visible = true', (WidgetTester tester) async { + testWidgets('Tooltip triggers manually when in TooltipVisibility with visible = true', (WidgetTester tester) async { final GlobalKey<TooltipState> tooltipKey = GlobalKey<TooltipState>(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/typography_test.dart b/packages/flutter/test/material/typography_test.dart index 6b40c96cf8d..c641979f037 100644 --- a/packages/flutter/test/material/typography_test.dart +++ b/packages/flutter/test/material/typography_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('Typography is defined for all target platforms', () { @@ -90,7 +89,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Typography implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Typography implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); Typography.material2014( black: Typography.blackCupertino, diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart index 004c801d0b4..a106eaabf8f 100644 --- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart +++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; const Key avatarA = Key('A'); @@ -82,7 +81,7 @@ void main() { matching: find.byType(Transform), ); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader inherits ColorScheme.primary', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader inherits ColorScheme.primary', (WidgetTester tester) async { const Color primaryColor = Color(0xff00ff00); const Color colorSchemePrimary = Color(0xff0000ff); @@ -95,7 +94,7 @@ void main() { expect(boxDecoration?.color == colorSchemePrimary, true); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader test', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader test', (WidgetTester tester) async { await pumpTestWidget(tester); expect(find.text('A'), findsOneWidget); @@ -133,7 +132,7 @@ void main() { expect(avatarDTopRight.dx - avatarCTopRight.dx, equals(40.0 + 16.0)); // size + space between }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader change default size test', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader change default size test', (WidgetTester tester) async { const Size currentAccountPictureSize = Size.square(60.0); const Size otherAccountsPictureSize = Size.square(30.0); @@ -150,7 +149,7 @@ void main() { expect(otherAccountRenderBox.size, otherAccountsPictureSize); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader icon rotation test', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader icon rotation test', (WidgetTester tester) async { await pumpTestWidget(tester); Transform transformWidget = tester.firstWidget(findTransform); @@ -186,7 +185,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/25801. - testWidgetsWithLeakTracking('UserAccountsDrawerHeader icon does not rotate after setState', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader icon does not rotate after setState', (WidgetTester tester) async { late StateSetter testSetState; await tester.pumpWidget(MaterialApp( home: Material( @@ -221,7 +220,7 @@ void main() { expect(transformWidget.transform.getRotation()[4], 1.0); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader icon rotation test speeeeeedy', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader icon rotation test speeeeeedy', (WidgetTester tester) async { await pumpTestWidget(tester); Transform transformWidget = tester.firstWidget(findTransform); @@ -262,7 +261,7 @@ void main() { expect(transformWidget.transform.getRotation()[4], 1.0); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader icon color changes', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader icon color changes', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: UserAccountsDrawerHeader( @@ -293,7 +292,7 @@ void main() { expect(iconWidget.color, arrowColor); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader null parameters LTR', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader null parameters LTR', (WidgetTester tester) async { Widget buildFrame({ Widget? currentAccountPicture, List<Widget>? otherAccountsPictures, @@ -401,7 +400,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader null parameters RTL', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader null parameters RTL', (WidgetTester tester) async { Widget buildFrame({ Widget? currentAccountPicture, List<Widget>? otherAccountsPictures, @@ -512,7 +511,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader provides semantics', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader provides semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await pumpTestWidget(tester); @@ -568,7 +567,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('alternative account selectors have sufficient tap targets', (WidgetTester tester) async { + testWidgets('alternative account selectors have sufficient tap targets', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await pumpTestWidget(tester); @@ -589,7 +588,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('UserAccountsDrawerHeader provides semantics with missing properties', (WidgetTester tester) async { + testWidgets('UserAccountsDrawerHeader provides semantics with missing properties', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await pumpTestWidget( tester, diff --git a/packages/flutter/test/material/value_indicating_slider_test.dart b/packages/flutter/test/material/value_indicating_slider_test.dart index b9324df786d..8db17de2578 100644 --- a/packages/flutter/test/material/value_indicating_slider_test.dart +++ b/packages/flutter/test/material/value_indicating_slider_test.dart @@ -9,11 +9,10 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Slider value indicator', (WidgetTester tester) async { + testWidgets('Slider value indicator', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, value: 0, @@ -54,7 +53,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider value indicator wide text', (WidgetTester tester) async { + testWidgets('Slider value indicator wide text', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, value: 0, @@ -98,7 +97,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider value indicator large text scale', (WidgetTester tester) async { + testWidgets('Slider value indicator large text scale', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, value: 0, @@ -142,7 +141,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider value indicator large text scale and wide text', + testWidgets('Slider value indicator large text scale and wide text', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, @@ -195,7 +194,7 @@ void main() { // support is deprecated and the APIs are removed, these tests // can be deleted. - testWidgetsWithLeakTracking('Slider value indicator', (WidgetTester tester) async { + testWidgets('Slider value indicator', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, value: 0, @@ -233,7 +232,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider value indicator wide text', (WidgetTester tester) async { + testWidgets('Slider value indicator wide text', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, value: 0, @@ -274,7 +273,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider value indicator large text scale', (WidgetTester tester) async { + testWidgets('Slider value indicator large text scale', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, value: 0, @@ -315,7 +314,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Slider value indicator large text scale and wide text', + testWidgets('Slider value indicator large text scale and wide text', (WidgetTester tester) async { await _buildValueIndicatorStaticSlider( tester, diff --git a/packages/flutter/test/material/will_pop_test.dart b/packages/flutter/test/material/will_pop_test.dart index b5e584e6575..b99e473d65b 100644 --- a/packages/flutter/test/material/will_pop_test.dart +++ b/packages/flutter/test/material/will_pop_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; bool willPopValue = false; @@ -97,7 +96,7 @@ class _TestPage extends Page<dynamic> { } void main() { - testWidgetsWithLeakTracking('ModalRoute scopedWillPopupCallback can inhibit back button', (WidgetTester tester) async { + testWidgets('ModalRoute scopedWillPopupCallback can inhibit back button', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -152,7 +151,7 @@ void main() { expect(find.text('Sample Page'), findsNothing); }); - testWidgetsWithLeakTracking('willPop will only pop if the callback returns true', (WidgetTester tester) async { + testWidgets('willPop will only pop if the callback returns true', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( home: Scaffold( @@ -191,7 +190,7 @@ void main() { expect(find.text('Sample Form'), findsNothing); }); - testWidgetsWithLeakTracking('Form.willPop can inhibit back button', (WidgetTester tester) async { + testWidgets('Form.willPop can inhibit back button', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( home: Scaffold( @@ -245,7 +244,7 @@ void main() { expect(willPopCount, 1); }); - testWidgetsWithLeakTracking('Form.willPop callbacks do not accumulate', (WidgetTester tester) async { + testWidgets('Form.willPop callbacks do not accumulate', (WidgetTester tester) async { Future<bool> showYesNoAlert(BuildContext context) async { return (await showDialog<bool>( context: context, @@ -337,7 +336,7 @@ void main() { expect(find.text('Sample Form'), findsNothing); }); - testWidgetsWithLeakTracking('Route.scopedWillPop callbacks do not accumulate', (WidgetTester tester) async { + testWidgets('Route.scopedWillPop callbacks do not accumulate', (WidgetTester tester) async { late StateSetter contentsSetState; // call this to rebuild the route's SampleForm contents bool contentsEmpty = false; // when true, don't include the SampleForm in the route @@ -397,7 +396,7 @@ void main() { expect(route.hasCallback, isFalse); }); - testWidgetsWithLeakTracking('should handle new route if page moved from one navigator to another', (WidgetTester tester) async { + testWidgets('should handle new route if page moved from one navigator to another', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/89133 late StateSetter contentsSetState; bool moveToAnotherNavigator = false; diff --git a/packages/flutter/test/painting/_network_image_test_web.dart b/packages/flutter/test/painting/_network_image_test_web.dart index 2ded5349e99..a5aa25881e7 100644 --- a/packages/flutter/test/painting/_network_image_test_web.dart +++ b/packages/flutter/test/painting/_network_image_test_web.dart @@ -7,7 +7,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/src/painting/_network_image_web.dart'; import 'package:flutter/src/web.dart' as web_shim; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:web/web.dart' as web; import '../image_data.dart'; @@ -17,7 +16,7 @@ void runTests() { debugRestoreHttpRequestFactory(); }); - testWidgetsWithLeakTracking('loads an image from the network with headers', + testWidgets('loads an image from the network with headers', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 200 @@ -43,7 +42,7 @@ void runTests() { assert(mapEquals(testHttpRequest.responseHeaders, headers), true); }); - testWidgetsWithLeakTracking('loads an image from the network with unsuccessful HTTP code', + testWidgets('loads an image from the network with unsuccessful HTTP code', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 404 @@ -68,7 +67,7 @@ void runTests() { expect((tester.takeException() as web.ProgressEvent).type, 'test error'); }); - testWidgetsWithLeakTracking('loads an image from the network with empty response', + testWidgets('loads an image from the network with empty response', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 200 diff --git a/packages/flutter/test/painting/binding_test.dart b/packages/flutter/test/painting/binding_test.dart index f865fbde0ee..b594ac8097c 100644 --- a/packages/flutter/test/painting/binding_test.dart +++ b/packages/flutter/test/painting/binding_test.dart @@ -10,12 +10,11 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Future<void> main() async { final ui.Image image = await createTestImage(); - testWidgetsWithLeakTracking('didHaveMemoryPressure clears imageCache', (WidgetTester tester) async { + testWidgets('didHaveMemoryPressure clears imageCache', (WidgetTester tester) async { imageCache.putIfAbsent(1, () => OneFrameImageStreamCompleter( Future<ImageInfo>.value(ImageInfo( image: image, diff --git a/packages/flutter/test/painting/border_test.dart b/packages/flutter/test/painting/border_test.dart index 96079e0c4f8..e4298f8c549 100644 --- a/packages/flutter/test/painting/border_test.dart +++ b/packages/flutter/test/painting/border_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestCanvas implements Canvas { final List<Invocation> invocations = <Invocation>[]; @@ -317,7 +316,7 @@ void main() { expect(nonUniformBorderDirectional.dimensions, const EdgeInsetsDirectional.fromSTEB(5, 5, 0, 20)); }); - testWidgetsWithLeakTracking('Non-Uniform Border variations', (WidgetTester tester) async { + testWidgets('Non-Uniform Border variations', (WidgetTester tester) async { Widget buildWidget({ required BoxBorder border, BorderRadius? borderRadius, BoxShape boxShape = BoxShape.rectangle}) { return Directionality( diff --git a/packages/flutter/test/painting/box_painter_test.dart b/packages/flutter/test/painting/box_painter_test.dart index dbf334d833b..3087119c9f4 100644 --- a/packages/flutter/test/painting/box_painter_test.dart +++ b/packages/flutter/test/painting/box_painter_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { tearDown(() { @@ -161,7 +160,7 @@ void main() { expect(const BoxShadow(blurRadius: 4.0, blurStyle: BlurStyle.solid).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0, BlurStyle.solid)')); }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.solid', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.solid', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -193,7 +192,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.outer', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.outer', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -225,7 +224,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.inner', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.inner', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -257,7 +256,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.normal', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.normal', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -289,7 +288,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.normal.wide_radius', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.normal.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -322,7 +321,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.outer.wide_radius', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.outer.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -355,7 +354,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.solid.wide_radius', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.solid.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -387,7 +386,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('BoxShadow BoxStyle.inner.wide_radius', (WidgetTester tester) async { + testWidgets('BoxShadow BoxStyle.inner.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( diff --git a/packages/flutter/test/painting/continuous_rectangle_border_test.dart b/packages/flutter/test/painting/continuous_rectangle_border_test.dart index b0e6ebdc429..47c48cd4e64 100644 --- a/packages/flutter/test/painting/continuous_rectangle_border_test.dart +++ b/packages/flutter/test/painting/continuous_rectangle_border_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('ContinuousRectangleBorder defaults', () { @@ -109,7 +108,7 @@ void main() { expect(border.getInnerPath(rect,textDirection: TextDirection.rtl), looksLikeRectRtl); }); - testWidgetsWithLeakTracking('Golden test even radii', (WidgetTester tester) async { + testWidgets('Golden test even radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.blueAccent[400], @@ -127,7 +126,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden test varying radii', (WidgetTester tester) async { + testWidgets('Golden test varying radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[100], @@ -150,7 +149,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden test topLeft radii', (WidgetTester tester) async { + testWidgets('Golden test topLeft radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[200], @@ -170,7 +169,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden test topRight radii', (WidgetTester tester) async { + testWidgets('Golden test topRight radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[300], @@ -190,7 +189,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden test bottomLeft radii', (WidgetTester tester) async { + testWidgets('Golden test bottomLeft radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[400], @@ -210,7 +209,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden test bottomRight radii', (WidgetTester tester) async { + testWidgets('Golden test bottomRight radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[500], @@ -230,7 +229,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Golden test large radii', (WidgetTester tester) async { + testWidgets('Golden test large radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.redAccent[400], diff --git a/packages/flutter/test/painting/decoration_image_lerp_test.dart b/packages/flutter/test/painting/decoration_image_lerp_test.dart index 490e09f9bc9..4a833da7578 100644 --- a/packages/flutter/test/painting/decoration_image_lerp_test.dart +++ b/packages/flutter/test/painting/decoration_image_lerp_test.dart @@ -14,10 +14,9 @@ import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ImageDecoration.lerp', (WidgetTester tester) async { + testWidgets('ImageDecoration.lerp', (WidgetTester tester) async { final MemoryImage green = MemoryImage(Uint8List.fromList(<int>[ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, @@ -191,7 +190,7 @@ void main() { } }, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609 - testWidgetsWithLeakTracking('ImageDecoration.lerp', (WidgetTester tester) async { + testWidgets('ImageDecoration.lerp', (WidgetTester tester) async { final MemoryImage cmyk = MemoryImage(Uint8List.fromList(<int>[ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x02, 0x03, 0x00, 0x00, 0x00, 0xd4, 0x9f, 0x76, @@ -409,7 +408,7 @@ void main() { } }, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609 - testWidgetsWithLeakTracking('ImageDecoration.lerp with colored background', (WidgetTester tester) async { + testWidgets('ImageDecoration.lerp with colored background', (WidgetTester tester) async { final MemoryImage cmyk = MemoryImage(Uint8List.fromList(<int>[ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x02, 0x03, 0x00, 0x00, 0x00, 0xd4, 0x9f, 0x76, diff --git a/packages/flutter/test/painting/flutter_logo_test.dart b/packages/flutter/test/painting/flutter_logo_test.dart index 220137bb7d5..434e2d9d478 100644 --- a/packages/flutter/test/painting/flutter_logo_test.dart +++ b/packages/flutter/test/painting/flutter_logo_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Here and below, see: https://github.com/dart-lang/sdk/issues/26980 @@ -86,7 +85,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Flutter Logo golden test', (WidgetTester tester) async { + testWidgets('Flutter Logo golden test', (WidgetTester tester) async { final Key logo = UniqueKey(); await tester.pumpWidget(Container( key: logo, diff --git a/packages/flutter/test/painting/gradient_test.dart b/packages/flutter/test/painting/gradient_test.dart index 60b59190346..bd4d2b85e0d 100644 --- a/packages/flutter/test/painting/gradient_test.dart +++ b/packages/flutter/test/painting/gradient_test.dart @@ -11,7 +11,6 @@ import 'dart:math' as math; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('LinearGradient scale test', () { @@ -882,7 +881,7 @@ void main() { group('Gradients - 45 degrees', () { for (final Gradient gradient in gradients45) { - testWidgetsWithLeakTracking('$gradient', (WidgetTester tester) async { + testWidgets('$gradient', (WidgetTester tester) async { await runTest(tester, gradient, 45); }); } @@ -890,7 +889,7 @@ void main() { group('Gradients - 90 degrees', () { for (final Gradient gradient in gradients90) { - testWidgetsWithLeakTracking('$gradient', (WidgetTester tester) async { + testWidgets('$gradient', (WidgetTester tester) async { await runTest(tester, gradient, 90); }); } diff --git a/packages/flutter/test/painting/image_stream_test.dart b/packages/flutter/test/painting/image_stream_test.dart index 75675223156..35677fcc84a 100644 --- a/packages/flutter/test/painting/image_stream_test.dart +++ b/packages/flutter/test/painting/image_stream_test.dart @@ -85,7 +85,7 @@ void main() { image200x100 = await createTestImage(width: 200, height: 100); }); - testWidgetsWithLeakTracking('Codec future fails', (WidgetTester tester) async { + testWidgets('Codec future fails', (WidgetTester tester) async { final Completer<Codec> completer = Completer<Codec>(); MultiFrameImageStreamCompleter( codec: completer.future, @@ -96,7 +96,7 @@ void main() { expect(tester.takeException(), 'failure message'); }); - testWidgetsWithLeakTracking('Decoding starts when a listener is added after codec is ready', (WidgetTester tester) async { + testWidgets('Decoding starts when a listener is added after codec is ready', (WidgetTester tester) async { final Completer<Codec> completer = Completer<Codec>(); final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 1; @@ -115,7 +115,7 @@ void main() { expect(mockCodec.numFramesAsked, 1); }); - testWidgetsWithLeakTracking('Decoding starts when a codec is ready after a listener is added', (WidgetTester tester) async { + testWidgets('Decoding starts when a codec is ready after a listener is added', (WidgetTester tester) async { final Completer<Codec> completer = Completer<Codec>(); final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 1; @@ -134,7 +134,7 @@ void main() { expect(mockCodec.numFramesAsked, 1); }); - testWidgetsWithLeakTracking('Decoding does not crash when disposed', (WidgetTester tester) async { + testWidgets('Decoding does not crash when disposed', (WidgetTester tester) async { final Completer<Codec> completer = Completer<Codec>(); final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 1; @@ -159,7 +159,7 @@ void main() { await tester.idle(); }); - testWidgetsWithLeakTracking('Chunk events of base ImageStreamCompleter are delivered', (WidgetTester tester) async { + testWidgets('Chunk events of base ImageStreamCompleter are delivered', (WidgetTester tester) async { final List<ImageChunkEvent> chunkEvents = <ImageChunkEvent>[]; final StreamController<ImageChunkEvent> streamController = StreamController<ImageChunkEvent>(); final ImageStreamCompleter imageStream = FakeEventReportingImageStreamCompleter( @@ -183,7 +183,7 @@ void main() { expect(chunkEvents[1].expectedTotalBytes, 3); }); - testWidgetsWithLeakTracking('Chunk events of base ImageStreamCompleter are not buffered before listener registration', (WidgetTester tester) async { + testWidgets('Chunk events of base ImageStreamCompleter are not buffered before listener registration', (WidgetTester tester) async { final List<ImageChunkEvent> chunkEvents = <ImageChunkEvent>[]; final StreamController<ImageChunkEvent> streamController = StreamController<ImageChunkEvent>(); final ImageStreamCompleter imageStream = FakeEventReportingImageStreamCompleter( @@ -206,7 +206,7 @@ void main() { expect(chunkEvents[0].expectedTotalBytes, 3); }); - testWidgetsWithLeakTracking('Chunk events of MultiFrameImageStreamCompleter are delivered', (WidgetTester tester) async { + testWidgets('Chunk events of MultiFrameImageStreamCompleter are delivered', (WidgetTester tester) async { final List<ImageChunkEvent> chunkEvents = <ImageChunkEvent>[]; final Completer<Codec> completer = Completer<Codec>(); final StreamController<ImageChunkEvent> streamController = StreamController<ImageChunkEvent>(); @@ -233,7 +233,7 @@ void main() { expect(chunkEvents[1].expectedTotalBytes, 3); }); - testWidgetsWithLeakTracking('Chunk events of MultiFrameImageStreamCompleter are not buffered before listener registration', (WidgetTester tester) async { + testWidgets('Chunk events of MultiFrameImageStreamCompleter are not buffered before listener registration', (WidgetTester tester) async { final List<ImageChunkEvent> chunkEvents = <ImageChunkEvent>[]; final Completer<Codec> completer = Completer<Codec>(); final StreamController<ImageChunkEvent> streamController = StreamController<ImageChunkEvent>(); @@ -259,7 +259,7 @@ void main() { expect(chunkEvents[0].expectedTotalBytes, 3); }); - testWidgetsWithLeakTracking('Chunk errors are reported', (WidgetTester tester) async { + testWidgets('Chunk errors are reported', (WidgetTester tester) async { final List<ImageChunkEvent> chunkEvents = <ImageChunkEvent>[]; final Completer<Codec> completer = Completer<Codec>(); final StreamController<ImageChunkEvent> streamController = StreamController<ImageChunkEvent>(); @@ -285,7 +285,7 @@ void main() { expect(chunkEvents[0].expectedTotalBytes, 3); }); - testWidgetsWithLeakTracking('getNextFrame future fails', (WidgetTester tester) async { + testWidgets('getNextFrame future fails', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 1; final Completer<Codec> codecCompleter = Completer<Codec>(); @@ -310,7 +310,7 @@ void main() { expect(tester.takeException(), 'frame completion error'); }); - testWidgetsWithLeakTracking('ImageStream emits frame (static image)', (WidgetTester tester) async { + testWidgets('ImageStream emits frame (static image)', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 1; final Completer<Codec> codecCompleter = Completer<Codec>(); @@ -335,7 +335,7 @@ void main() { expect(emittedImages.every((ImageInfo info) => info.image.isCloneOf(frame.image)), true); }); - testWidgetsWithLeakTracking('ImageStream emits frames (animated images)', (WidgetTester tester) async { + testWidgets('ImageStream emits frames (animated images)', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = -1; @@ -381,7 +381,7 @@ void main() { await tester.pump(const Duration(milliseconds: 400)); }); - testWidgetsWithLeakTracking('animation wraps back', (WidgetTester tester) async { + testWidgets('animation wraps back', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = -1; @@ -422,7 +422,7 @@ void main() { await tester.pump(const Duration(milliseconds: 200)); }); - testWidgetsWithLeakTracking("animation doesn't repeat more than specified", (WidgetTester tester) async { + testWidgets("animation doesn't repeat more than specified", (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = 0; @@ -460,7 +460,7 @@ void main() { expect(emittedImages[1].image.isCloneOf(frame2.image), true); }); - testWidgetsWithLeakTracking('frames are only decoded when there are listeners', (WidgetTester tester) async { + testWidgets('frames are only decoded when there are listeners', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = -1; @@ -500,7 +500,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('multiple stream listeners', (WidgetTester tester) async { + testWidgets('multiple stream listeners', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = -1; @@ -547,7 +547,7 @@ void main() { }); - testWidgetsWithLeakTracking('timer is canceled when listeners are removed', (WidgetTester tester) async { + testWidgets('timer is canceled when listeners are removed', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = -1; @@ -580,7 +580,7 @@ void main() { // point. }); - testWidgetsWithLeakTracking('timeDilation affects animation frame timers', (WidgetTester tester) async { + testWidgets('timeDilation affects animation frame timers', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; mockCodec.repetitionCount = -1; @@ -617,7 +617,7 @@ void main() { timeDilation = 1.0; // restore time dilation, or it will affect other tests }); - testWidgetsWithLeakTracking('error handlers can intercept errors', (WidgetTester tester) async { + testWidgets('error handlers can intercept errors', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 1; final Completer<Codec> codecCompleter = Completer<Codec>(); @@ -652,7 +652,7 @@ void main() { expect(capturedException, 'frame completion error'); }); - testWidgetsWithLeakTracking('remove and add listener ', (WidgetTester tester) async { + testWidgets('remove and add listener ', (WidgetTester tester) async { final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 3; mockCodec.repetitionCount = 0; @@ -683,7 +683,7 @@ void main() { await tester.pump(const Duration(milliseconds: 200)); // emit 2nd frame. }); - testWidgetsWithLeakTracking('ImageStreamListener hashCode and equals', (WidgetTester tester) async { + testWidgets('ImageStreamListener hashCode and equals', (WidgetTester tester) async { void handleImage(ImageInfo image, bool synchronousCall) { } void handleImageDifferently(ImageInfo image, bool synchronousCall) { } void handleError(dynamic error, StackTrace? stackTrace) { } @@ -715,7 +715,7 @@ void main() { compare(onImage1: handleImage, onChunk1: handleChunk, onError1: handleError, onImage2: handleImage, onError2: handleError, areEqual: false); }); - testWidgetsWithLeakTracking('Keep alive handles do not drive frames or prevent last listener callbacks', (WidgetTester tester) async { + testWidgets('Keep alive handles do not drive frames or prevent last listener callbacks', (WidgetTester tester) async { final Image image10x10 = (await tester.runAsync(() => createTestImage(width: 10, height: 10)))!; final MockCodec mockCodec = MockCodec(); mockCodec.frameCount = 2; diff --git a/packages/flutter/test/painting/paint_image_test.dart b/packages/flutter/test/painting/paint_image_test.dart index 0b5295838af..bc83e465c42 100644 --- a/packages/flutter/test/painting/paint_image_test.dart +++ b/packages/flutter/test/painting/paint_image_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestCanvas implements Canvas { final List<Invocation> invocations = <Invocation>[]; @@ -161,7 +160,7 @@ void main() { expect(command.positionalArguments[2], equals(const Rect.fromLTRB(20.0, 40.0, 860.0, 840.0))); }); - testWidgetsWithLeakTracking('Reports Image painting', (WidgetTester tester) async { + testWidgets('Reports Image painting', (WidgetTester tester) async { late ImageSizeInfo imageSizeInfo; int count = 0; debugOnPaintImage = (ImageSizeInfo info) { @@ -200,7 +199,7 @@ void main() { debugOnPaintImage = null; }); - testWidgetsWithLeakTracking('Reports Image painting - change per frame', (WidgetTester tester) async { + testWidgets('Reports Image painting - change per frame', (WidgetTester tester) async { late ImageSizeInfo imageSizeInfo; int count = 0; debugOnPaintImage = (ImageSizeInfo info) { @@ -243,7 +242,7 @@ void main() { debugOnPaintImage = null; }); - testWidgetsWithLeakTracking('Reports Image painting - no debug label', (WidgetTester tester) async { + testWidgets('Reports Image painting - no debug label', (WidgetTester tester) async { late ImageSizeInfo imageSizeInfo; int count = 0; debugOnPaintImage = (ImageSizeInfo info) { diff --git a/packages/flutter/test/painting/star_border_test.dart b/packages/flutter/test/painting/star_border_test.dart index 59c8b316a8d..a9d91cbdf0c 100644 --- a/packages/flutter/test/painting/star_border_test.dart +++ b/packages/flutter/test/painting/star_border_test.dart @@ -7,7 +7,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { Future<void> testBorder(WidgetTester tester, String name, StarBorder border, @@ -115,12 +114,12 @@ void main() { expect(copy, isNot(equals(copy.copyWith(squash: 0.0)))); }); - testWidgetsWithLeakTracking('StarBorder basic geometry', (WidgetTester tester) async { + testWidgets('StarBorder basic geometry', (WidgetTester tester) async { await testBorder(tester, 'basic_star', const StarBorder()); await testBorder(tester, 'basic_polygon', const StarBorder.polygon()); }); - testWidgetsWithLeakTracking('StarBorder parameters', (WidgetTester tester) async { + testWidgets('StarBorder parameters', (WidgetTester tester) async { await testBorder(tester, 'points_6', const StarBorder(points: 6)); await testBorder(tester, 'points_2', const StarBorder(points: 2)); await testBorder(tester, 'inner_radius_0', const StarBorder(innerRadiusRatio: 0.0)); @@ -145,7 +144,7 @@ void main() { await testBorder(tester, 'side_align_outside', const StarBorder(side: BorderSide(color: Color(0xffff0000), strokeAlign: BorderSide.strokeAlignOutside))); }); - testWidgetsWithLeakTracking('StarBorder.polygon parameters', (WidgetTester tester) async { + testWidgets('StarBorder.polygon parameters', (WidgetTester tester) async { await testBorder(tester, 'poly_sides_6', const StarBorder.polygon(sides: 6)); await testBorder(tester, 'poly_sides_2', const StarBorder.polygon(sides: 2)); await testBorder(tester, 'poly_point_rounding_20', const StarBorder.polygon(pointRounding: 0.2)); @@ -164,7 +163,7 @@ void main() { await testBorder(tester, 'poly_side_align_outside', const StarBorder.polygon(side: BorderSide(color: Color(0xffff0000), strokeAlign: BorderSide.strokeAlignOutside))); }); - testWidgetsWithLeakTracking("StarBorder doesn't try to scale an infinite scale matrix", (WidgetTester tester) async { + testWidgets("StarBorder doesn't try to scale an infinite scale matrix", (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -192,7 +191,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('StarBorder lerped with StarBorder', (WidgetTester tester) async { + testWidgets('StarBorder lerped with StarBorder', (WidgetTester tester) async { const StarBorder from = StarBorder(); const ShapeBorder otherBorder = StarBorder( points: 6, @@ -209,7 +208,7 @@ void main() { await testBorder(tester, 'from_star_border_100', from, lerpFrom: otherBorder, lerpAmount: 1.0); }); - testWidgetsWithLeakTracking('StarBorder lerped with CircleBorder', (WidgetTester tester) async { + testWidgets('StarBorder lerped with CircleBorder', (WidgetTester tester) async { const StarBorder from = StarBorder(); const ShapeBorder otherBorder = CircleBorder(); const ShapeBorder eccentricCircle = CircleBorder(eccentricity: 0.6); @@ -227,7 +226,7 @@ void main() { await testBorder(tester, 'from_eccentric_circle_border_100', from, lerpFrom: eccentricCircle, lerpAmount: 1.0); }); - testWidgetsWithLeakTracking('StarBorder lerped with RoundedRectangleBorder', (WidgetTester tester) async { + testWidgets('StarBorder lerped with RoundedRectangleBorder', (WidgetTester tester) async { const StarBorder from = StarBorder(); const RoundedRectangleBorder rectangleBorder = RoundedRectangleBorder(); await testBorder(tester, 'to_rect_border_20', from, lerpTo: rectangleBorder, lerpAmount: 0.2); @@ -251,7 +250,7 @@ void main() { await testBorder(tester, 'from_rrect_border_100', from, lerpFrom: roundedRectBorder, lerpAmount: 1.0); }); - testWidgetsWithLeakTracking('StarBorder lerped with StadiumBorder', (WidgetTester tester) async { + testWidgets('StarBorder lerped with StadiumBorder', (WidgetTester tester) async { const StarBorder from = StarBorder(); const StadiumBorder stadiumBorder = StadiumBorder(); diff --git a/packages/flutter/test/painting/system_fonts_test.dart b/packages/flutter/test/painting/system_fonts_test.dart index 035fb42600e..480e6517c56 100644 --- a/packages/flutter/test/painting/system_fonts_test.dart +++ b/packages/flutter/test/painting/system_fonts_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Future<void> verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(WidgetTester tester, RenderObject renderObject) async { assert(!renderObject.debugNeedsLayout); @@ -37,7 +36,7 @@ Future<void> verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(WidgetTester t } void main() { - testWidgetsWithLeakTracking('RenderParagraph relayout upon system fonts changes', (WidgetTester tester) async { + testWidgets('RenderParagraph relayout upon system fonts changes', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Text('text widget'), @@ -47,7 +46,7 @@ void main() { await verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(tester, renderObject); }); - testWidgetsWithLeakTracking( + testWidgets( 'Safe to query a RelayoutWhenSystemFontsChangeMixin for text layout after system fonts changes', (WidgetTester tester) async { final _RenderCustomRelayoutWhenSystemFontsChange child = _RenderCustomRelayoutWhenSystemFontsChange(); @@ -69,7 +68,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('RenderEditable relayout upon system fonts changes', (WidgetTester tester) async { + testWidgets('RenderEditable relayout upon system fonts changes', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: SelectableText('text widget'), @@ -80,7 +79,7 @@ void main() { await verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(tester, state.renderEditable); }); - testWidgetsWithLeakTracking('Banner repaint upon system fonts changes', (WidgetTester tester) async { + testWidgets('Banner repaint upon system fonts changes', (WidgetTester tester) async { await tester.pumpWidget( const Banner( message: 'message', @@ -101,7 +100,7 @@ void main() { expect(renderObject.debugNeedsPaint, isTrue); }); - testWidgetsWithLeakTracking('CupertinoDatePicker reset cache upon system fonts change - date time mode', (WidgetTester tester) async { + testWidgets('CupertinoDatePicker reset cache upon system fonts change - date time mode', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoDatePicker( @@ -127,7 +126,7 @@ void main() { expect(element.dirty, isTrue); }, skip: isBrowser); // TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920 - testWidgetsWithLeakTracking('CupertinoDatePicker reset cache upon system fonts change - date mode', (WidgetTester tester) async { + testWidgets('CupertinoDatePicker reset cache upon system fonts change - date mode', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoDatePicker( @@ -155,7 +154,7 @@ void main() { expect(element.dirty, isTrue); }, skip: isBrowser); // TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920 - testWidgetsWithLeakTracking('CupertinoDatePicker reset cache upon system fonts change - time mode', (WidgetTester tester) async { + testWidgets('CupertinoDatePicker reset cache upon system fonts change - time mode', (WidgetTester tester) async { await tester.pumpWidget( CupertinoApp( home: CupertinoTimerPicker( @@ -190,7 +189,7 @@ void main() { expect(element.dirty, isTrue); }, skip: isBrowser); // TODO(yjbanov): cupertino does not work on the Web yet: https://github.com/flutter/flutter/issues/41920 - testWidgetsWithLeakTracking('RangeSlider relayout upon system fonts changes', (WidgetTester tester) async { + testWidgets('RangeSlider relayout upon system fonts changes', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -213,7 +212,7 @@ void main() { await verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(tester, renderObject); }); - testWidgetsWithLeakTracking('Slider relayout upon system fonts changes', (WidgetTester tester) async { + testWidgets('Slider relayout upon system fonts changes', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -229,7 +228,7 @@ void main() { await verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(tester, renderObject); }); - testWidgetsWithLeakTracking('TimePicker relayout upon system fonts changes', (WidgetTester tester) async { + testWidgets('TimePicker relayout upon system fonts changes', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( diff --git a/packages/flutter/test/painting/text_span_test.dart b/packages/flutter/test/painting/text_span_test.dart index 186ccf757ad..43056c79867 100644 --- a/packages/flutter/test/painting/text_span_test.dart +++ b/packages/flutter/test/painting/text_span_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('TextSpan equals', () { @@ -328,7 +327,7 @@ void main() { expect(indexInTree(const TextSpan(text: 'foobar')), null); }); - testWidgetsWithLeakTracking('handles mouse cursor', (WidgetTester tester) async { + testWidgets('handles mouse cursor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -365,7 +364,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('handles onEnter and onExit', (WidgetTester tester) async { + testWidgets('handles onEnter and onExit', (WidgetTester tester) async { final List<PointerEvent> logEvents = <PointerEvent>[]; await tester.pumpWidget( Directionality( @@ -410,7 +409,7 @@ void main() { expect(logEvents[1], isA<PointerExitEvent>()); }); - testWidgetsWithLeakTracking('TextSpan can compute StringAttributes', (WidgetTester tester) async { + testWidgets('TextSpan can compute StringAttributes', (WidgetTester tester) async { const TextSpan span = TextSpan( text: 'aaaaa', spellOut: true, diff --git a/packages/flutter/test/rendering/debug_overflow_indicator_test.dart b/packages/flutter/test/rendering/debug_overflow_indicator_test.dart index 4e7b7df34f9..7e49c164fa9 100644 --- a/packages/flutter/test/rendering/debug_overflow_indicator_test.dart +++ b/packages/flutter/test/rendering/debug_overflow_indicator_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('overflow indicator is not shown when not overflowing', (WidgetTester tester) async { + testWidgets('overflow indicator is not shown when not overflowing', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: UnconstrainedBox( @@ -19,7 +18,7 @@ void main() { expect(find.byType(UnconstrainedBox), isNot(paints..rect())); }); - testWidgetsWithLeakTracking('overflow indicator is shown when overflowing', (WidgetTester tester) async { + testWidgets('overflow indicator is shown when overflowing', (WidgetTester tester) async { const UnconstrainedBox box = UnconstrainedBox( child: SizedBox(width: 200.0, height: 200.0), ); @@ -55,7 +54,7 @@ void main() { expect(find.byType(UnconstrainedBox), paints..rect()); }); - testWidgetsWithLeakTracking('overflow indicator is not shown when constraint size is zero.', (WidgetTester tester) async { + testWidgets('overflow indicator is not shown when constraint size is zero.', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( diff --git a/packages/flutter/test/rendering/error_test.dart b/packages/flutter/test/rendering/error_test.dart index fbfbf35ad90..8804f3319c6 100644 --- a/packages/flutter/test/rendering/error_test.dart +++ b/packages/flutter/test/rendering/error_test.dart @@ -5,13 +5,12 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; /// Unit tests error.dart's usage via ErrorWidget. void main() { const String errorMessage = 'Some error message'; - testWidgetsWithLeakTracking('test draw error paragraph', (WidgetTester tester) async { + testWidgets('test draw error paragraph', (WidgetTester tester) async { await tester.pumpWidget(ErrorWidget(Exception(errorMessage))); expect( find.byType(ErrorWidget), diff --git a/packages/flutter/test/rendering/flex_overflow_test.dart b/packages/flutter/test/rendering/flex_overflow_test.dart index c0aff93becc..0119c839195 100644 --- a/packages/flutter/test/rendering/flex_overflow_test.dart +++ b/packages/flutter/test/rendering/flex_overflow_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Flex overflow indicator', (WidgetTester tester) async { + testWidgets('Flex overflow indicator', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: Column( diff --git a/packages/flutter/test/rendering/localized_fonts_test.dart b/packages/flutter/test/rendering/localized_fonts_test.dart index 83afd88416c..07ecf5c8753 100644 --- a/packages/flutter/test/rendering/localized_fonts_test.dart +++ b/packages/flutter/test/rendering/localized_fonts_test.dart @@ -9,12 +9,11 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // TODO(hansmuller): when https://github.com/flutter/flutter/issues/17700 // is fixed, these tests should be updated to use a real font (not Ahem). void main() { - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - RichText TextSpan styles with different locales', (WidgetTester tester) async { @@ -60,7 +59,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - RichText TextSpan styles with different locales', (WidgetTester tester) async { @@ -106,7 +105,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - Text with locale-specific glyphs, ambient locale', (WidgetTester tester) async { await tester.pumpWidget( @@ -158,7 +157,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - Text with locale-specific glyphs, ambient locale', (WidgetTester tester) async { await tester.pumpWidget( @@ -210,7 +209,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material2 - Text with locale-specific glyphs, explicit locale', (WidgetTester tester) async { await tester.pumpWidget( @@ -254,7 +253,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Material3 - Text with locale-specific glyphs, explicit locale', (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/rendering/non_normalized_constraints_test.dart b/packages/flutter/test/rendering/non_normalized_constraints_test.dart index 33d1802e97a..ecd69ce15c8 100644 --- a/packages/flutter/test/rendering/non_normalized_constraints_test.dart +++ b/packages/flutter/test/rendering/non_normalized_constraints_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class RenderFoo extends RenderShiftedBox { RenderFoo({ RenderBox? child }) : super(child); @@ -32,12 +31,12 @@ class Foo extends SingleChildRenderObjectWidget { // END OF SENSITIVE SECTION void main() { - testWidgetsWithLeakTracking('Stack parsing in non-normalized constraints error', (WidgetTester tester) async { + testWidgets('Stack parsing in non-normalized constraints error', (WidgetTester tester) async { await tester.pumpWidget(const Foo(child: Placeholder()), Duration.zero, EnginePhase.layout); final Object? exception = tester.takeException(); final String text = exception.toString(); expect(text, contains('BoxConstraints has non-normalized width constraints.')); expect(text, contains('which probably computed the invalid constraints in question:\n RenderFoo.performLayout (')); - expect(text, contains('non_normalized_constraints_test.dart:17:12')); + expect(text, contains('non_normalized_constraints_test.dart:')); }, skip: kIsWeb); // [intended] stack traces on web are insufficiently predictable } diff --git a/packages/flutter/test/rendering/object_paint_dispose_test.dart b/packages/flutter/test/rendering/object_paint_dispose_test.dart index faf1957786e..2f0f777a50c 100644 --- a/packages/flutter/test/rendering/object_paint_dispose_test.dart +++ b/packages/flutter/test/rendering/object_paint_dispose_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Tracks picture layers accurately when painting is interleaved with a pushLayer', (WidgetTester tester) async { + testWidgets('Tracks picture layers accurately when painting is interleaved with a pushLayer', (WidgetTester tester) async { // Creates a RenderObject that will paint into multiple picture layers. // Asserts that both layers get a handle, and that all layers get correctly // released. diff --git a/packages/flutter/test/rendering/relayout_boundary_test.dart b/packages/flutter/test/rendering/relayout_boundary_test.dart index 8a28e6ad38f..b282e8bf88c 100644 --- a/packages/flutter/test/rendering/relayout_boundary_test.dart +++ b/packages/flutter/test/rendering/relayout_boundary_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('relayout boundary change does not trigger relayout', (WidgetTester tester) async { + testWidgets('relayout boundary change does not trigger relayout', (WidgetTester tester) async { final RenderLayoutCount renderLayoutCount = RenderLayoutCount(); final Widget layoutCounter = Center( key: GlobalKey(), diff --git a/packages/flutter/test/rendering/repaint_boundary_2_test.dart b/packages/flutter/test/rendering/repaint_boundary_2_test.dart index 13dc1bd38fc..dd8db5cf7c6 100644 --- a/packages/flutter/test/rendering/repaint_boundary_2_test.dart +++ b/packages/flutter/test/rendering/repaint_boundary_2_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('repaint boundary with constraint changes', (WidgetTester tester) async { + testWidgets('repaint boundary with constraint changes', (WidgetTester tester) async { // Regression test for as https://github.com/flutter/flutter/issues/39151. await tester.pumpWidget(const RelayoutBoundariesCrash()); tester.state<RelayoutBoundariesCrashState>(find.byType(RelayoutBoundariesCrash))._toggleMode(); diff --git a/packages/flutter/test/rendering/view_chrome_style_test.dart b/packages/flutter/test/rendering/view_chrome_style_test.dart index 2c74e712a06..0f82e7b5876 100644 --- a/packages/flutter/test/rendering/view_chrome_style_test.dart +++ b/packages/flutter/test/rendering/view_chrome_style_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('SystemChrome - style', () { @@ -38,7 +37,7 @@ void main() { }); group('status bar', () { - testWidgetsWithLeakTracking("statusBarColor isn't set for unannotated view", + testWidgets("statusBarColor isn't set for unannotated view", (WidgetTester tester) async { await tester.pumpWidget(const SizedBox.expand()); await tester.pumpAndSettle(); @@ -47,7 +46,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('statusBarColor is set for annotated view', + testWidgets('statusBarColor is set for annotated view', (WidgetTester tester) async { setupTestDevice(tester); await tester.pumpWidget(const AnnotatedRegion<SystemUiOverlayStyle>( @@ -66,7 +65,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking("statusBarColor isn't set when view covers less than half of the system status bar", + testWidgets("statusBarColor isn't set when view covers less than half of the system status bar", (WidgetTester tester) async { setupTestDevice(tester); const double lessThanHalfOfTheStatusBarHeight = @@ -90,7 +89,7 @@ void main() { variant: TargetPlatformVariant.mobile(), ); - testWidgetsWithLeakTracking('statusBarColor is set when view covers more than half of tye system status bar', + testWidgets('statusBarColor is set when view covers more than half of tye system status bar', (WidgetTester tester) async { setupTestDevice(tester); const double moreThanHalfOfTheStatusBarHeight = @@ -119,7 +118,7 @@ void main() { }); group('navigation color (Android only)', () { - testWidgetsWithLeakTracking("systemNavigationBarColor isn't set for non Android device", + testWidgets("systemNavigationBarColor isn't set for non Android device", (WidgetTester tester) async { setupTestDevice(tester); await tester.pumpWidget(const AnnotatedRegion<SystemUiOverlayStyle>( @@ -138,7 +137,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.iOS), ); - testWidgetsWithLeakTracking("systemNavigationBarColor isn't set for unannotated view", + testWidgets("systemNavigationBarColor isn't set for unannotated view", (WidgetTester tester) async { await tester.pumpWidget(const SizedBox.expand()); await tester.pumpAndSettle(); @@ -148,7 +147,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.android), ); - testWidgetsWithLeakTracking('systemNavigationBarColor is set for annotated view', + testWidgets('systemNavigationBarColor is set for annotated view', (WidgetTester tester) async { setupTestDevice(tester); await tester.pumpWidget(const AnnotatedRegion<SystemUiOverlayStyle>( @@ -167,7 +166,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.android), ); - testWidgetsWithLeakTracking("systemNavigationBarColor isn't set when view covers less than half of navigation bar", + testWidgets("systemNavigationBarColor isn't set when view covers less than half of navigation bar", (WidgetTester tester) async { setupTestDevice(tester); const double lessThanHalfOfTheNavigationBarHeight = @@ -191,7 +190,7 @@ void main() { variant: TargetPlatformVariant.only(TargetPlatform.android), ); - testWidgetsWithLeakTracking('systemNavigationBarColor is set when view covers more than half of navigation bar', + testWidgets('systemNavigationBarColor is set when view covers more than half of navigation bar', (WidgetTester tester) async { setupTestDevice(tester); const double moreThanHalfOfTheNavigationBarHeight = @@ -219,7 +218,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Top AnnotatedRegion provides status bar overlay style and bottom AnnotatedRegion provides navigation bar overlay style', (WidgetTester tester) async { + testWidgets('Top AnnotatedRegion provides status bar overlay style and bottom AnnotatedRegion provides navigation bar overlay style', (WidgetTester tester) async { setupTestDevice(tester); await tester.pumpWidget( const Column(children: <Widget>[ @@ -245,7 +244,7 @@ void main() { expect(SystemChrome.latestStyle?.systemNavigationBarColor, Colors.green); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Top only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async { + testWidgets('Top only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async { setupTestDevice(tester); await tester.pumpWidget( const Column(children: <Widget>[ @@ -265,7 +264,7 @@ void main() { expect(SystemChrome.latestStyle?.systemNavigationBarColor, Colors.blue); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Bottom only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async { + testWidgets('Bottom only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async { setupTestDevice(tester); await tester.pumpWidget( const Column(children: <Widget>[ diff --git a/packages/flutter/test/rendering/viewport_test.dart b/packages/flutter/test/rendering/viewport_test.dart index b2b844dcb6d..7013d6dcd18 100644 --- a/packages/flutter/test/rendering/viewport_test.dart +++ b/packages/flutter/test/rendering/viewport_test.dart @@ -14,7 +14,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate { _TestSliverPersistentHeaderDelegate({ @@ -47,7 +46,7 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate } void main() { - testWidgetsWithLeakTracking('Scrollable widget scrollDirection update test', (WidgetTester tester) async { + testWidgets('Scrollable widget scrollDirection update test', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); Widget buildFrame(Axis axis) { @@ -92,7 +91,7 @@ void main() { expect(controller.position.pixels, 0.0); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal - down', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal - down', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -138,7 +137,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(40.0, 190.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal - right', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal - right', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -186,7 +185,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(190.0, 40.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal - up', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal - up', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -234,7 +233,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(40.0, 0.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal - left', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal - left', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -283,7 +282,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(0.0, 40.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal Sliver - down', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal Sliver - down', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); final List<Widget> children = <Widget>[]; @@ -331,7 +330,7 @@ void main() { expect(revealed.offset, 5 * (100 + 22 + 23) + 22 - (200 - 4)); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal Sliver - right', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal Sliver - right', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); final List<Widget> children = <Widget>[]; @@ -380,7 +379,7 @@ void main() { expect(revealed.offset, 5 * (100 + 22 + 23) + 22 - (200 - 3)); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal Sliver - up', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal Sliver - up', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); final List<Widget> children = <Widget>[]; @@ -430,7 +429,7 @@ void main() { expect(revealed.offset, - 200 + 6 * (100 + 22 + 23) - 22 - 2); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal Sliver - up - reverse growth', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal Sliver - up - reverse growth', (WidgetTester tester) async { const Key centerKey = ValueKey<String>('center'); const EdgeInsets padding = EdgeInsets.only(top: 22.0, bottom: 23.0); const Widget centerSliver = SliverPadding( @@ -487,7 +486,7 @@ void main() { expect(revealed.offset, -200 - 22 - 2); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal Sliver - left - reverse growth', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal Sliver - left - reverse growth', (WidgetTester tester) async { const Key centerKey = ValueKey<String>('center'); const EdgeInsets padding = EdgeInsets.only(left: 22.0, right: 23.0); const Widget centerSliver = SliverPadding( @@ -545,7 +544,7 @@ void main() { expect(revealed.offset, - 300 - 22 - 1); }); - testWidgetsWithLeakTracking('Viewport getOffsetToReveal Sliver - left', (WidgetTester tester) async { + testWidgets('Viewport getOffsetToReveal Sliver - left', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); final List<Widget> children = <Widget>[]; @@ -595,7 +594,7 @@ void main() { expect(revealed.offset, -200 + 6 * (100 + 22 + 23) - 22 - 1); }); - testWidgetsWithLeakTracking('Nested Viewports showOnScreen', (WidgetTester tester) async { + testWidgets('Nested Viewports showOnScreen', (WidgetTester tester) async { final List<ScrollController> controllersX = List<ScrollController>.generate(10, (int i) => ScrollController(initialScrollOffset: 400.0)); final ScrollController controllerY = ScrollController(initialScrollOffset: 400.0); @@ -806,7 +805,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Reverse List showOnScreen', (WidgetTester tester) async { + testWidgets('Reverse List showOnScreen', (WidgetTester tester) async { addTearDown(tester.view.reset); const double screenHeight = 400.0; const double screenWidth = 400.0; @@ -872,7 +871,7 @@ void main() { expect(find.text('Item -1'), findsOneWidget); }); - testWidgetsWithLeakTracking('in view in inner, but not in outer', (WidgetTester tester) async { + testWidgets('in view in inner, but not in outer', (WidgetTester tester) async { final ScrollController inner = ScrollController(); final ScrollController outer = ScrollController(); addTearDown(inner.dispose); @@ -892,7 +891,7 @@ void main() { expect(outer.offset, 100.0); }); - testWidgetsWithLeakTracking('not in view of neither inner nor outer', (WidgetTester tester) async { + testWidgets('not in view of neither inner nor outer', (WidgetTester tester) async { final ScrollController inner = ScrollController(); final ScrollController outer = ScrollController(); addTearDown(inner.dispose); @@ -912,7 +911,7 @@ void main() { expect(outer.offset, 200.0); }); - testWidgetsWithLeakTracking('in view in inner and outer', (WidgetTester tester) async { + testWidgets('in view in inner and outer', (WidgetTester tester) async { final ScrollController inner = ScrollController(initialScrollOffset: 200.0); final ScrollController outer = ScrollController(initialScrollOffset: 200.0); addTearDown(inner.dispose); @@ -932,7 +931,7 @@ void main() { expect(inner.offset, 200.0); }); - testWidgetsWithLeakTracking('inner shown in outer, but item not visible', (WidgetTester tester) async { + testWidgets('inner shown in outer, but item not visible', (WidgetTester tester) async { final ScrollController inner = ScrollController(initialScrollOffset: 200.0); final ScrollController outer = ScrollController(initialScrollOffset: 200.0); addTearDown(inner.dispose); @@ -952,7 +951,7 @@ void main() { expect(inner.offset, 400.0); }); - testWidgetsWithLeakTracking('inner half shown in outer, item only visible in inner', (WidgetTester tester) async { + testWidgets('inner half shown in outer, item only visible in inner', (WidgetTester tester) async { final ScrollController inner = ScrollController(); final ScrollController outer = ScrollController(initialScrollOffset: 100.0); addTearDown(inner.dispose); @@ -973,7 +972,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Nested Viewports showOnScreen with allowImplicitScrolling=false for inner viewport', (WidgetTester tester) async { + testWidgets('Nested Viewports showOnScreen with allowImplicitScrolling=false for inner viewport', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/20893. List<Widget> slivers; @@ -1027,7 +1026,7 @@ void main() { expect(controllerY.offset, 50.0); }); - testWidgetsWithLeakTracking('Nested Viewports showOnScreen on Sliver with allowImplicitScrolling=false for inner viewport', (WidgetTester tester) async { + testWidgets('Nested Viewports showOnScreen on Sliver with allowImplicitScrolling=false for inner viewport', (WidgetTester tester) async { Widget sliver; final ScrollController controllerX = ScrollController(); final ScrollController controllerY = ScrollController(); @@ -1089,7 +1088,7 @@ void main() { expect(controllerY.offset, 25.0); }); - testWidgetsWithLeakTracking('Viewport showOnScreen with objects larger than viewport', (WidgetTester tester) async { + testWidgets('Viewport showOnScreen with objects larger than viewport', (WidgetTester tester) async { List<Widget> children; final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); @@ -1150,7 +1149,7 @@ void main() { expect(controller.offset, 300.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'Viewport showOnScreen should not scroll if the rect is already visible, even if it does not scroll linearly', (WidgetTester tester) async { List<Widget> children; @@ -1269,7 +1268,7 @@ void main() { } group('animated: $animated, scrollDirection: $axis', () { - testWidgetsWithLeakTracking( + testWidgets( 'RenderViewportBase.showOnScreen', (WidgetTester tester) async { await tester.pumpWidget( @@ -1314,7 +1313,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('RenderViewportBase.showOnScreen twice almost instantly', (WidgetTester tester) async{ + testWidgets('RenderViewportBase.showOnScreen twice almost instantly', (WidgetTester tester) async{ // Regression test for https://github.com/flutter/flutter/issues/137901 await tester.pumpWidget( buildList( @@ -1354,7 +1353,7 @@ void main() { expect(mainAxisExtent(tester, pinnedHeaderContent), 150); }); - testWidgetsWithLeakTracking( + testWidgets( 'RenderViewportBase.showOnScreen but no child', (WidgetTester tester) async { await tester.pumpWidget( @@ -1398,7 +1397,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'RenderViewportBase.showOnScreen with maxShowOnScreenExtent ', (WidgetTester tester) async { await tester.pumpWidget( @@ -1459,7 +1458,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'RenderViewportBase.showOnScreen with minShowOnScreenExtent ', (WidgetTester tester) async { await tester.pumpWidget( @@ -1520,7 +1519,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'RenderViewportBase.showOnScreen should not scroll if the rect is already visible, ' 'even if it does not scroll linearly (reversed order version)', (WidgetTester tester) async { @@ -1603,7 +1602,7 @@ void main() { ); } - testWidgetsWithLeakTracking('up, forward growth', (WidgetTester tester) async { + testWidgets('up, forward growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1612,7 +1611,7 @@ void main() { expect(revealOffset, (300.0 + padding.horizontal) * 5 + 34.0 * 2); }); - testWidgetsWithLeakTracking('up, reverse growth', (WidgetTester tester) async { + testWidgets('up, reverse growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: true, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1621,7 +1620,7 @@ void main() { expect(revealOffset, -(300.0 + padding.horizontal) * 5 + 34.0 * 2); }); - testWidgetsWithLeakTracking('right, forward growth', (WidgetTester tester) async { + testWidgets('right, forward growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.horizontal)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1630,7 +1629,7 @@ void main() { expect(revealOffset, (300.0 + padding.horizontal) * 5 + 22.0 * 2); }); - testWidgetsWithLeakTracking('right, reverse growth', (WidgetTester tester) async { + testWidgets('right, reverse growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.horizontal, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1639,7 +1638,7 @@ void main() { expect(revealOffset, -(300.0 + padding.horizontal) * 5 + 22.0 * 2); }); - testWidgetsWithLeakTracking('down, forward growth', (WidgetTester tester) async { + testWidgets('down, forward growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.vertical)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1648,7 +1647,7 @@ void main() { expect(revealOffset, (300.0 + padding.horizontal) * 5 + 22.0 * 2); }); - testWidgetsWithLeakTracking('down, reverse growth', (WidgetTester tester) async { + testWidgets('down, reverse growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.vertical, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1657,7 +1656,7 @@ void main() { expect(revealOffset, -(300.0 + padding.horizontal) * 5 + 22.0 * 2); }); - testWidgetsWithLeakTracking('left, forward growth', (WidgetTester tester) async { + testWidgets('left, forward growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.horizontal, reverse: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1666,7 +1665,7 @@ void main() { expect(revealOffset, (300.0 + padding.horizontal) * 5 + 34.0 * 2); }); - testWidgetsWithLeakTracking('left, reverse growth', (WidgetTester tester) async { + testWidgets('left, reverse growth', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.horizontal, reverse: true, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1675,7 +1674,7 @@ void main() { expect(revealOffset, -(300.0 + padding.horizontal) * 5 + 34.0 * 2); }); - testWidgetsWithLeakTracking('will not assert on mismatched axis', (WidgetTester tester) async { + testWidgets('will not assert on mismatched axis', (WidgetTester tester) async { await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: true, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType<RenderAbstractViewport>().first; @@ -1684,7 +1683,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('RenderViewportBase.showOnScreen reports the correct targetRect', (WidgetTester tester) async { + testWidgets('RenderViewportBase.showOnScreen reports the correct targetRect', (WidgetTester tester) async { final ScrollController innerController = ScrollController(); final ScrollController outerController = ScrollController(); addTearDown(innerController.dispose); @@ -1771,7 +1770,7 @@ void main() { expect((errors.first.exception as FlutterError).toStringDeep(), message); } - testWidgetsWithLeakTracking('Horizontal viewport was given unbounded height', (WidgetTester tester) async { + testWidgets('Horizontal viewport was given unbounded height', (WidgetTester tester) async { await expectFlutterError( widget: buildNestedWidget(), tester: tester, @@ -1785,7 +1784,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Horizontal viewport was given unbounded width', (WidgetTester tester) async { + testWidgets('Horizontal viewport was given unbounded width', (WidgetTester tester) async { await expectFlutterError( widget: buildNestedWidget(Axis.horizontal), tester: tester, @@ -1805,7 +1804,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Vertical viewport was given unbounded width', (WidgetTester tester) async { + testWidgets('Vertical viewport was given unbounded width', (WidgetTester tester) async { await expectFlutterError( widget: buildNestedWidget(Axis.horizontal, Axis.vertical), tester: tester, @@ -1819,7 +1818,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Vertical viewport was given unbounded height', (WidgetTester tester) async { + testWidgets('Vertical viewport was given unbounded height', (WidgetTester tester) async { await expectFlutterError( widget: buildNestedWidget(Axis.vertical, Axis.vertical), tester: tester, @@ -1999,7 +1998,7 @@ void main() { ); } - testWidgetsWithLeakTracking('constrained viewport correctly clips overflow', (WidgetTester tester) async { + testWidgets('constrained viewport correctly clips overflow', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/89717 final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -2028,7 +2027,7 @@ void main() { expect(tester.getTopLeft(find.text('Item 9')).dy, 226.0); }); - testWidgetsWithLeakTracking('correctly clips overflow without constraints', (WidgetTester tester) async { + testWidgets('correctly clips overflow without constraints', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/89717 final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -2057,7 +2056,7 @@ void main() { expect(tester.getTopLeft(find.text('Item 9')).dy, 226.0); }); - testWidgetsWithLeakTracking('allows overscrolling on default platforms - vertical', (WidgetTester tester) async { + testWidgets('allows overscrolling on default platforms - vertical', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/10949 // Scrollables should overscroll by default on iOS and macOS final ScrollController controller = ScrollController(); @@ -2098,7 +2097,7 @@ void main() { expect(tester.getBottomLeft(find.text('Item 19')).dy, 600.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('allows overscrolling on default platforms - horizontal', (WidgetTester tester) async { + testWidgets('allows overscrolling on default platforms - horizontal', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/10949 // Scrollables should overscroll by default on iOS and macOS final ScrollController controller = ScrollController(); @@ -2139,7 +2138,7 @@ void main() { expect(tester.getTopRight(find.text('Item 19')).dx, 800.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('allows overscrolling per physics - vertical', (WidgetTester tester) async { + testWidgets('allows overscrolling per physics - vertical', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/10949 // Scrollables should overscroll when the scroll physics allow final ScrollController controller = ScrollController(); @@ -2180,7 +2179,7 @@ void main() { expect(tester.getBottomLeft(find.text('Item 19')).dy, 600.0); }); - testWidgetsWithLeakTracking('allows overscrolling per physics - horizontal', (WidgetTester tester) async { + testWidgets('allows overscrolling per physics - horizontal', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/10949 // Scrollables should overscroll when the scroll physics allow final ScrollController controller = ScrollController(); @@ -2226,7 +2225,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Handles infinite constraints when TargetPlatform is iOS or macOS', (WidgetTester tester) async { + testWidgets('Handles infinite constraints when TargetPlatform is iOS or macOS', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/45866 await tester.pumpWidget( Directionality( @@ -2262,7 +2261,7 @@ void main() { await tester.pumpAndSettle(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Viewport describeApproximateClip respects clipBehavior', (WidgetTester tester) async { + testWidgets('Viewport describeApproximateClip respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( @@ -2299,7 +2298,7 @@ void main() { expect(visited, true); }); - testWidgetsWithLeakTracking( + testWidgets( 'Shrinkwrapping viewport asserts bounded cross axis', (WidgetTester tester) async { final List<FlutterErrorDetails> errors = <FlutterErrorDetails>[]; FlutterError.onError = (FlutterErrorDetails error) => errors.add(error); diff --git a/packages/flutter/test/scheduler/ticker_test.dart b/packages/flutter/test/scheduler/ticker_test.dart index 4b87a64caba..723b924adcb 100644 --- a/packages/flutter/test/scheduler/ticker_test.dart +++ b/packages/flutter/test/scheduler/ticker_test.dart @@ -16,7 +16,7 @@ void main() { .handlePlatformMessage('flutter/lifecycle', message, (_) {}); } - testWidgetsWithLeakTracking('Ticker mute control test', (WidgetTester tester) async { + testWidgets('Ticker mute control test', (WidgetTester tester) async { int tickCount = 0; void handleTick(Duration duration) { tickCount += 1; @@ -99,7 +99,7 @@ void main() { expect(ticker.isActive, isFalse); }); - testWidgetsWithLeakTracking('Ticker control test', (WidgetTester tester) async { + testWidgets('Ticker control test', (WidgetTester tester) async { late Ticker ticker; addTearDown(() => ticker.dispose()); @@ -113,7 +113,7 @@ void main() { expect(ticker.toString(debugIncludeStack: true), contains('testFunction')); }); - testWidgetsWithLeakTracking('Ticker can be sped up with time dilation', (WidgetTester tester) async { + testWidgets('Ticker can be sped up with time dilation', (WidgetTester tester) async { timeDilation = 0.5; // Move twice as fast. late Duration lastDuration; void handleTick(Duration duration) { @@ -131,7 +131,7 @@ void main() { timeDilation = 1.0; // restore time dilation, or it will affect other tests }); - testWidgetsWithLeakTracking('Ticker can be slowed down with time dilation', (WidgetTester tester) async { + testWidgets('Ticker can be slowed down with time dilation', (WidgetTester tester) async { timeDilation = 2.0; // Move half as fast. late Duration lastDuration; void handleTick(Duration duration) { @@ -149,7 +149,7 @@ void main() { timeDilation = 1.0; // restore time dilation, or it will affect other tests }); - testWidgetsWithLeakTracking('Ticker stops ticking when application is paused', (WidgetTester tester) async { + testWidgets('Ticker stops ticking when application is paused', (WidgetTester tester) async { int tickCount = 0; void handleTick(Duration duration) { tickCount += 1; @@ -173,7 +173,7 @@ void main() { setAppLifeCycleState(AppLifecycleState.resumed); }); - testWidgetsWithLeakTracking('Ticker can be created before application unpauses', (WidgetTester tester) async { + testWidgets('Ticker can be created before application unpauses', (WidgetTester tester) async { setAppLifeCycleState(AppLifecycleState.paused); int tickCount = 0; diff --git a/packages/flutter/test/semantics/semantics_binding_test.dart b/packages/flutter/test/semantics/semantics_binding_test.dart index 3e24cb78a90..1ea4c318793 100644 --- a/packages/flutter/test/semantics/semantics_binding_test.dart +++ b/packages/flutter/test/semantics/semantics_binding_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Listeners are called when semantics are turned on with ensureSemantics', (WidgetTester tester) async { + testWidgets('Listeners are called when semantics are turned on with ensureSemantics', (WidgetTester tester) async { expect(SemanticsBinding.instance.semanticsEnabled, isFalse); final List<bool> status = <bool>[]; @@ -44,7 +44,7 @@ void main() { expect(SemanticsBinding.instance.semanticsEnabled, isFalse); }, semanticsEnabled: false); - testWidgetsWithLeakTracking('Listeners are called when semantics are turned on by platform', (WidgetTester tester) async { + testWidgets('Listeners are called when semantics are turned on by platform', (WidgetTester tester) async { expect(SemanticsBinding.instance.semanticsEnabled, isFalse); final List<bool> status = <bool>[]; @@ -70,7 +70,7 @@ void main() { expect(SemanticsBinding.instance.semanticsEnabled, isFalse); }, semanticsEnabled: false); - testWidgetsWithLeakTracking('SemanticsBinding.ensureSemantics triggers creation of semantics owner.', (WidgetTester tester) async { + testWidgets('SemanticsBinding.ensureSemantics triggers creation of semantics owner.', (WidgetTester tester) async { expect(SemanticsBinding.instance.semanticsEnabled, isFalse); expect(tester.binding.pipelineOwner.semanticsOwner, isNull); diff --git a/packages/flutter/test/semantics/semantics_elevation_test.dart b/packages/flutter/test/semantics/semantics_elevation_test.dart index 149101db2a8..24c6918af2b 100644 --- a/packages/flutter/test/semantics/semantics_elevation_test.dart +++ b/packages/flutter/test/semantics/semantics_elevation_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('SemanticsNodes overlapping in z', (WidgetTester tester) async { + testWidgets('SemanticsNodes overlapping in z', (WidgetTester tester) async { // Cards are semantic boundaries that always own their own SemanticNode, // PhysicalModels merge their semantics information into parent. // @@ -98,7 +97,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SemanticsNodes overlapping in z with switched children', (WidgetTester tester) async { + testWidgets('SemanticsNodes overlapping in z with switched children', (WidgetTester tester) async { // Same as 'SemanticsNodes overlapping in z', but the order of children // is reversed @@ -174,7 +173,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('single node thickness', (WidgetTester tester) async { + testWidgets('single node thickness', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const MaterialApp( @@ -194,7 +193,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('force-merge', (WidgetTester tester) async { + testWidgets('force-merge', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -248,7 +247,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('force-merge with inversed children', (WidgetTester tester) async { + testWidgets('force-merge with inversed children', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( diff --git a/packages/flutter/test/semantics/semantics_owner_test.dart b/packages/flutter/test/semantics/semantics_owner_test.dart index c8f59f19df4..18c93f5eb62 100644 --- a/packages/flutter/test/semantics/semantics_owner_test.dart +++ b/packages/flutter/test/semantics/semantics_owner_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Performing SemanticsAction.showOnScreen does not crash if node no longer exist', (WidgetTester tester) async { + testWidgets('Performing SemanticsAction.showOnScreen does not crash if node no longer exist', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/100358. final SemanticsTester semantics = SemanticsTester(tester); diff --git a/packages/flutter/test/semantics/semantics_update_test.dart b/packages/flutter/test/semantics/semantics_update_test.dart index 57bf081e035..e67cadef426 100644 --- a/packages/flutter/test/semantics/semantics_update_test.dart +++ b/packages/flutter/test/semantics/semantics_update_test.dart @@ -8,12 +8,11 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { SemanticsUpdateTestBinding(); - testWidgetsWithLeakTracking('Semantics update does not send update for merged nodes.', (WidgetTester tester) async { + testWidgets('Semantics update does not send update for merged nodes.', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); // Pumps a placeholder to trigger the warm up frame. await tester.pumpWidget( @@ -86,7 +85,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Semantics update receives attributed text', (WidgetTester tester) async { + testWidgets('Semantics update receives attributed text', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); // Pumps a placeholder to trigger the warm up frame. await tester.pumpWidget( diff --git a/packages/flutter/test/semantics/traversal_order_test.dart b/packages/flutter/test/semantics/traversal_order_test.dart index 5bc8981463a..2b469bb1139 100644 --- a/packages/flutter/test/semantics/traversal_order_test.dart +++ b/packages/flutter/test/semantics/traversal_order_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Traversal order handles touching elements', (WidgetTester tester) async { + testWidgets('Traversal order handles touching elements', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/services/asset_bundle_test.dart b/packages/flutter/test/services/asset_bundle_test.dart index 7641adaf1a8..361bea64b09 100644 --- a/packages/flutter/test/services/asset_bundle_test.dart +++ b/packages/flutter/test/services/asset_bundle_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/painting.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestAssetBundle extends CachingAssetBundle { Map<String, int> loadCallCount = <String, int>{}; @@ -152,7 +151,7 @@ void main() { expect(await data, 1); }); - testWidgetsWithLeakTracking('loadStructuredData handles exceptions correctly', (WidgetTester tester) async { + testWidgets('loadStructuredData handles exceptions correctly', (WidgetTester tester) async { final TestAssetBundle bundle = TestAssetBundle(); try { await bundle.loadStructuredData('AssetManifest.json', (String value) => Future<String>.error('what do they say?')); @@ -162,7 +161,7 @@ void main() { } }); - testWidgetsWithLeakTracking('loadStructuredBinaryData handles exceptions correctly', (WidgetTester tester) async { + testWidgets('loadStructuredBinaryData handles exceptions correctly', (WidgetTester tester) async { final TestAssetBundle bundle = TestAssetBundle(); try { await bundle.loadStructuredBinaryData('AssetManifest.bin', (ByteData value) => Future<String>.error('buy more crystals')); diff --git a/packages/flutter/test/services/hardware_keyboard_test.dart b/packages/flutter/test/services/hardware_keyboard_test.dart index 2eda48b1e80..8b2a3be96e1 100644 --- a/packages/flutter/test/services/hardware_keyboard_test.dart +++ b/packages/flutter/test/services/hardware_keyboard_test.dart @@ -8,10 +8,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('HardwareKeyboard records pressed keys and enabled locks', (WidgetTester tester) async { + testWidgets('HardwareKeyboard records pressed keys and enabled locks', (WidgetTester tester) async { await simulateKeyDownEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numLock})); @@ -70,7 +69,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); - testWidgetsWithLeakTracking('KeyEvent can tell which keys are pressed', (WidgetTester tester) async { + testWidgets('KeyEvent can tell which keys are pressed', (WidgetTester tester) async { await tester.pumpWidget(const Focus(autofocus: true, child: SizedBox())); await tester.pump(); @@ -105,7 +104,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); - testWidgetsWithLeakTracking('KeyboardManager synthesizes modifier keys in rawKeyData mode', (WidgetTester tester) async { + testWidgets('KeyboardManager synthesizes modifier keys in rawKeyData mode', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; HardwareKeyboard.instance.addHandler((KeyEvent event) { events.add(event); @@ -133,7 +132,7 @@ void main() { expect(events[1].synthesized, false); }); - testWidgetsWithLeakTracking('Dispatch events to all handlers', (WidgetTester tester) async { + testWidgets('Dispatch events to all handlers', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<int> logs = <int>[]; @@ -240,7 +239,7 @@ void main() { // _CastError on _hardwareKeyboard.lookUpLayout(key). The original scenario // that this is triggered on Android is unknown. Here we make up a scenario // where a ShiftLeft key down is dispatched but the modifier bit is not set. - testWidgetsWithLeakTracking('Correctly convert down events that are synthesized released', (WidgetTester tester) async { + testWidgets('Correctly convert down events that are synthesized released', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<KeyEvent> events = <KeyEvent>[]; @@ -285,7 +284,7 @@ void main() { KeyDataTransitMode.rawKeyData, })); - testWidgetsWithLeakTracking('Instantly dispatch synthesized key events when the queue is empty', (WidgetTester tester) async { + testWidgets('Instantly dispatch synthesized key events when the queue is empty', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<int> logs = <int>[]; @@ -319,7 +318,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); - testWidgetsWithLeakTracking('Postpone synthesized key events when the queue is not empty', (WidgetTester tester) async { + testWidgets('Postpone synthesized key events when the queue is not empty', (WidgetTester tester) async { final FocusNode keyboardListenerFocusNode = FocusNode(); addTearDown(keyboardListenerFocusNode.dispose); final FocusNode rawKeyboardListenerFocusNode = FocusNode(); @@ -378,7 +377,7 @@ void main() { // In that case, the key data should not be converted to any [KeyEvent]s, // but is only used so that *a* key data comes before the raw key message // and makes [KeyEventManager] infer [KeyDataTransitMode.keyDataThenRawKeyData]. - testWidgetsWithLeakTracking('Empty keyData yields no event but triggers inference', (WidgetTester tester) async { + testWidgets('Empty keyData yields no event but triggers inference', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; final List<RawKeyEvent> rawEvents = <RawKeyEvent>[]; tester.binding.keyboard.addHandler((KeyEvent event) { @@ -430,7 +429,7 @@ void main() { expect(rawEvents.length, 2); }); - testWidgetsWithLeakTracking('Exceptions from keyMessageHandler are caught and reported', (WidgetTester tester) async { + testWidgets('Exceptions from keyMessageHandler are caught and reported', (WidgetTester tester) async { final KeyMessageHandler? oldKeyMessageHandler = tester.binding.keyEventManager.keyMessageHandler; addTearDown(() { tester.binding.keyEventManager.keyMessageHandler = oldKeyMessageHandler; @@ -473,7 +472,7 @@ void main() { expect(record, isNull); }); - testWidgetsWithLeakTracking('Exceptions from HardwareKeyboard handlers are caught and reported', (WidgetTester tester) async { + testWidgets('Exceptions from HardwareKeyboard handlers are caught and reported', (WidgetTester tester) async { bool throwingCallback(KeyEvent event) { throw 1; } @@ -514,7 +513,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('debugPrintKeyboardEvents causes logging of key events', (WidgetTester tester) async { + testWidgets('debugPrintKeyboardEvents causes logging of key events', (WidgetTester tester) async { final bool oldDebugPrintKeyboardEvents = debugPrintKeyboardEvents; final DebugPrintCallback oldDebugPrint = debugPrint; final StringBuffer messages = StringBuffer(); diff --git a/packages/flutter/test/services/lifecycle_test.dart b/packages/flutter/test/services/lifecycle_test.dart index 6737ce15fa1..c275691b3cd 100644 --- a/packages/flutter/test/services/lifecycle_test.dart +++ b/packages/flutter/test/services/lifecycle_test.dart @@ -6,10 +6,9 @@ import 'dart:ui'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('initialLifecycleState is used to init state paused', (WidgetTester tester) async { + testWidgets('initialLifecycleState is used to init state paused', (WidgetTester tester) async { expect(ServicesBinding.instance.lifecycleState, isNull); final TestWidgetsFlutterBinding binding = tester.binding; binding.resetLifecycleState(); @@ -21,7 +20,7 @@ void main() { // even though no lifecycle event was fired from the platform. expect(binding.lifecycleState.toString(), equals('AppLifecycleState.paused')); }); - testWidgetsWithLeakTracking('Handles all of the allowed states of AppLifecycleState', (WidgetTester tester) async { + testWidgets('Handles all of the allowed states of AppLifecycleState', (WidgetTester tester) async { final TestWidgetsFlutterBinding binding = tester.binding; for (final AppLifecycleState state in AppLifecycleState.values) { binding.resetLifecycleState(); diff --git a/packages/flutter/test/services/raw_keyboard_test.dart b/packages/flutter/test/services/raw_keyboard_test.dart index 547619717b0..7d0dace2218 100644 --- a/packages/flutter/test/services/raw_keyboard_test.dart +++ b/packages/flutter/test/services/raw_keyboard_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class _ModifierCheck { const _ModifierCheck(this.key, this.side); @@ -18,7 +17,7 @@ class _ModifierCheck { void main() { group('RawKeyboard', () { - testWidgetsWithLeakTracking('The correct character is produced', (WidgetTester tester) async { + testWidgets('The correct character is produced', (WidgetTester tester) async { for (final String platform in <String>['linux', 'android', 'macos', 'fuchsia', 'windows', 'ios']) { String character = ''; void handleKey(RawKeyEvent event) { @@ -33,7 +32,7 @@ void main() { } }); - testWidgetsWithLeakTracking('No character is produced for non-printables', (WidgetTester tester) async { + testWidgets('No character is produced for non-printables', (WidgetTester tester) async { for (final String platform in <String>['linux', 'android', 'macos', 'fuchsia', 'windows', 'web', 'ios']) { void handleKey(RawKeyEvent event) { expect(event.character, isNull, reason: 'on $platform'); @@ -44,7 +43,7 @@ void main() { } }); - testWidgetsWithLeakTracking('keysPressed is maintained', (WidgetTester tester) async { + testWidgets('keysPressed is maintained', (WidgetTester tester) async { for (final String platform in <String>['linux', 'android', 'macos', 'fuchsia', 'windows', 'ios']) { RawKeyboard.instance.clearKeysPressed(); expect(RawKeyboard.instance.keysPressed, isEmpty, reason: 'on $platform'); @@ -150,7 +149,7 @@ void main() { } }, skip: isBrowser); // https://github.com/flutter/flutter/issues/61021 - testWidgetsWithLeakTracking('keysPressed is correct when modifier is released before key', (WidgetTester tester) async { + testWidgets('keysPressed is correct when modifier is released before key', (WidgetTester tester) async { for (final String platform in <String>['linux', 'android', 'macos', 'fuchsia', 'windows', 'ios']) { RawKeyboard.instance.clearKeysPressed(); expect(RawKeyboard.instance.keysPressed, isEmpty, reason: 'on $platform'); @@ -201,7 +200,7 @@ void main() { } }, skip: isBrowser); // https://github.com/flutter/flutter/issues/76741 - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on macOS', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on macOS', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -225,7 +224,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is a macOS-specific test. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on iOS', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on iOS', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -249,7 +248,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is an iOS-specific test. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on Windows', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on Windows', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -273,7 +272,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is a Windows-specific test. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on android', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on android', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -297,7 +296,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is an Android-specific test. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on fuchsia', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on fuchsia', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -321,7 +320,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is a Fuchsia-specific test. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on Linux GLFW', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on Linux GLFW', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -383,7 +382,7 @@ void main() { // // GTK has some weird behavior where the tested key event sequence will // result in a AltRight down event without Alt bitmask. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on Linux GTK (down events)', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on Linux GTK (down events)', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); await simulateGTKKeyEvent(true, 0x6c/*AltRight*/, 0xffea/*AltRight*/, 0x2000000); @@ -403,7 +402,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/114591 . // // On Linux, CapsLock can be remapped to a non-modifier key. - testWidgetsWithLeakTracking('CapsLock should not be release when remapped on Linux', (WidgetTester tester) async { + testWidgets('CapsLock should not be release when remapped on Linux', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); await simulateGTKKeyEvent(true, 0x42/*CapsLock*/, 0xff08/*Backspace*/, 0x2000000); @@ -420,7 +419,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/114591 . // // On Web, CapsLock can be remapped to a non-modifier key. - testWidgetsWithLeakTracking('CapsLock should not be release when remapped on Web', (WidgetTester _) async { + testWidgets('CapsLock should not be release when remapped on Web', (WidgetTester _) async { final List<RawKeyEvent> events = <RawKeyEvent>[]; RawKeyboard.instance.addListener(events.add); addTearDown(() { @@ -450,7 +449,7 @@ void main() { ); }, skip: !isBrowser); // [intended] This is a Browser-specific test. - testWidgetsWithLeakTracking('keysPressed modifiers are synchronized with key events on web', (WidgetTester tester) async { + testWidgets('keysPressed modifiers are synchronized with key events on web', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. Change the modifiers so // that they show the shift key as already down when this event is @@ -538,7 +537,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('sided modifiers without a side set return all sides on Android', (WidgetTester tester) async { + testWidgets('sided modifiers without a side set return all sides on Android', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -575,7 +574,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is an Android-specific test. - testWidgetsWithLeakTracking('sided modifiers without a side set return all sides on macOS', (WidgetTester tester) async { + testWidgets('sided modifiers without a side set return all sides on macOS', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -612,7 +611,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is a macOS-specific test. - testWidgetsWithLeakTracking('sided modifiers without a side set return all sides on iOS', (WidgetTester tester) async { + testWidgets('sided modifiers without a side set return all sides on iOS', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -649,7 +648,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is an iOS-specific test. - testWidgetsWithLeakTracking('repeat events', (WidgetTester tester) async { + testWidgets('repeat events', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); late RawKeyEvent receivedEvent; RawKeyboard.instance.keyEventHandler = (RawKeyEvent event) { @@ -692,7 +691,7 @@ void main() { RawKeyboard.instance.keyEventHandler = null; }, skip: isBrowser); // [intended] This is a Windows-specific test. - testWidgetsWithLeakTracking('sided modifiers without a side set return all sides on Windows', (WidgetTester tester) async { + testWidgets('sided modifiers without a side set return all sides on Windows', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -727,7 +726,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is a Windows-specific test. - testWidgetsWithLeakTracking('sided modifiers without a side set return all sides on Linux GLFW', (WidgetTester tester) async { + testWidgets('sided modifiers without a side set return all sides on Linux GLFW', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -765,7 +764,7 @@ void main() { ); }, skip: isBrowser); // [intended] This is a GLFW-specific test. - testWidgetsWithLeakTracking('sided modifiers without a side set return left sides on web', (WidgetTester tester) async { + testWidgets('sided modifiers without a side set return left sides on web', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -798,7 +797,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RawKeyboard asserts if no keys are in keysPressed after receiving a key down event', (WidgetTester tester) async { + testWidgets('RawKeyboard asserts if no keys are in keysPressed after receiving a key down event', (WidgetTester tester) async { final Map<String, dynamic> keyEventMessage; if (kIsWeb) { keyEventMessage = const <String, dynamic>{ @@ -834,7 +833,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Allows inconsistent modifier for iOS', (WidgetTester _) async { + testWidgets('Allows inconsistent modifier for iOS', (WidgetTester _) async { // Use `testWidgets` for clean-ups. final List<RawKeyEvent> events = <RawKeyEvent>[]; RawKeyboard.instance.addListener(events.add); @@ -862,7 +861,7 @@ void main() { expect(RawKeyboard.instance.keysPressed, contains(LogicalKeyboardKey.capsLock)); }, skip: isBrowser); // [intended] This is an iOS-specific group. - testWidgetsWithLeakTracking('Allows inconsistent modifier for Android', (WidgetTester _) async { + testWidgets('Allows inconsistent modifier for Android', (WidgetTester _) async { // Use `testWidgets` for clean-ups. final List<RawKeyEvent> events = <RawKeyEvent>[]; RawKeyboard.instance.addListener(events.add); @@ -893,7 +892,7 @@ void main() { expect(RawKeyboard.instance.keysPressed, contains(LogicalKeyboardKey.capsLock)); }, skip: isBrowser); // [intended] This is an Android-specific group. - testWidgetsWithLeakTracking('Allows inconsistent modifier for Web - Alt graph', (WidgetTester _) async { + testWidgets('Allows inconsistent modifier for Web - Alt graph', (WidgetTester _) async { // Regression test for https://github.com/flutter/flutter/issues/113836 final List<RawKeyEvent> events = <RawKeyEvent>[]; RawKeyboard.instance.addListener(events.add); @@ -922,7 +921,7 @@ void main() { expect(RawKeyboard.instance.keysPressed, contains(LogicalKeyboardKey.altGraph)); }, skip: !isBrowser); // [intended] This is a Browser-specific test. - testWidgetsWithLeakTracking('Allows inconsistent modifier for Web - Alt right', (WidgetTester _) async { + testWidgets('Allows inconsistent modifier for Web - Alt right', (WidgetTester _) async { // Regression test for https://github.com/flutter/flutter/issues/113836 final List<RawKeyEvent> events = <RawKeyEvent>[]; RawKeyboard.instance.addListener(events.add); @@ -951,7 +950,7 @@ void main() { expect(RawKeyboard.instance.keysPressed, contains(LogicalKeyboardKey.altRight)); }, skip: !isBrowser); // [intended] This is a Browser-specific test. - testWidgetsWithLeakTracking('Dispatch events to all handlers', (WidgetTester tester) async { + testWidgets('Dispatch events to all handlers', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<int> logs = <int>[]; @@ -1017,7 +1016,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Exceptions from RawKeyboard listeners are caught and reported', (WidgetTester tester) async { + testWidgets('Exceptions from RawKeyboard listeners are caught and reported', (WidgetTester tester) async { void throwingListener(RawKeyEvent event) { throw 1; } @@ -1291,7 +1290,7 @@ void main() { expect(data.repeatCount, equals(42)); }); - testWidgetsWithLeakTracking('Key events are responded to correctly.', (WidgetTester tester) async { + testWidgets('Key events are responded to correctly.', (WidgetTester tester) async { expect(RawKeyboard.instance.keysPressed, isEmpty); // Generate the data for a regular key down event. final Map<String, dynamic> data = KeyEventSimulator.getKeyData( @@ -2102,7 +2101,7 @@ void main() { expect(data.logicalKey, equals(LogicalKeyboardKey.arrowLeft)); }); - testWidgetsWithLeakTracking('Win32 VK_PROCESSKEY events are skipped', (WidgetTester tester) async { + testWidgets('Win32 VK_PROCESSKEY events are skipped', (WidgetTester tester) async { const String platform = 'windows'; bool lastHandled = true; final List<RawKeyEvent> events = <RawKeyEvent>[]; diff --git a/packages/flutter/test/services/restoration_test.dart b/packages/flutter/test/services/restoration_test.dart index 413917b5a7e..7e264e75137 100644 --- a/packages/flutter/test/services/restoration_test.dart +++ b/packages/flutter/test/services/restoration_test.dart @@ -13,7 +13,7 @@ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'restoration.dart'; void main() { - testWidgetsWithLeakTracking('$RestorationManager dispatches memory events', (WidgetTester tester) async { + testWidgets('$RestorationManager dispatches memory events', (WidgetTester tester) async { await expectLater( await memoryEvents(() => RestorationManager().dispose(), RestorationManager), areCreateAndDispose, @@ -21,7 +21,7 @@ void main() { }); group('RestorationManager', () { - testWidgetsWithLeakTracking('root bucket retrieval', (WidgetTester tester) async { + testWidgets('root bucket retrieval', (WidgetTester tester) async { final List<MethodCall> callsToEngine = <MethodCall>[]; final Completer<Map<dynamic, dynamic>> result = Completer<Map<dynamic, dynamic>>(); tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.restoration, (MethodCall call) { @@ -69,7 +69,7 @@ void main() { expect(synchronousBucket, same(rootBucket)); }); - testWidgetsWithLeakTracking('root bucket received from engine before retrieval', (WidgetTester tester) async { + testWidgets('root bucket received from engine before retrieval', (WidgetTester tester) async { SystemChannels.restoration.setMethodCallHandler(null); final List<MethodCall> callsToEngine = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.restoration, (MethodCall call) async { @@ -89,7 +89,7 @@ void main() { expect(callsToEngine, isEmpty); }); - testWidgetsWithLeakTracking('root bucket received while engine retrieval is pending', (WidgetTester tester) async { + testWidgets('root bucket received while engine retrieval is pending', (WidgetTester tester) async { SystemChannels.restoration.setMethodCallHandler(null); final List<MethodCall> callsToEngine = <MethodCall>[]; final Completer<Map<dynamic, dynamic>> result = Completer<Map<dynamic, dynamic>>(); @@ -120,7 +120,7 @@ void main() { expect(rootBucket2!.contains('foo'), isFalse); }); - testWidgetsWithLeakTracking('root bucket is properly replaced when new data is available', (WidgetTester tester) async { + testWidgets('root bucket is properly replaced when new data is available', (WidgetTester tester) async { tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.restoration, (MethodCall call) async { return _createEncodedRestorationData1(); }); @@ -162,7 +162,7 @@ void main() { expect(newChild.read<String>('bar'), 'Hello'); }); - testWidgetsWithLeakTracking('returns null as root bucket when restoration is disabled', (WidgetTester tester) async { + testWidgets('returns null as root bucket when restoration is disabled', (WidgetTester tester) async { final List<MethodCall> callsToEngine = <MethodCall>[]; final Completer<Map<dynamic, dynamic>> result = Completer<Map<dynamic, dynamic>>(); tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.restoration, (MethodCall call) { @@ -206,7 +206,7 @@ void main() { expect(rootBucket, isNull); }); - testWidgetsWithLeakTracking('flushData', (WidgetTester tester) async { + testWidgets('flushData', (WidgetTester tester) async { final List<MethodCall> callsToEngine = <MethodCall>[]; final Completer<Map<dynamic, dynamic>> result = Completer<Map<dynamic, dynamic>>(); tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.restoration, (MethodCall call) { @@ -243,7 +243,7 @@ void main() { expect(callsToEngine, hasLength(1)); }); - testWidgetsWithLeakTracking('isReplacing', (WidgetTester tester) async { + testWidgets('isReplacing', (WidgetTester tester) async { final Completer<Map<dynamic, dynamic>> result = Completer<Map<dynamic, dynamic>>(); tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.restoration, (MethodCall call) { return result.future; diff --git a/packages/flutter/test/services/system_chrome_test.dart b/packages/flutter/test/services/system_chrome_test.dart index c4aa7fe3373..555d9e21979 100644 --- a/packages/flutter/test/services/system_chrome_test.dart +++ b/packages/flutter/test/services/system_chrome_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - testWidgetsWithLeakTracking('SystemChrome overlay style test', (WidgetTester tester) async { + testWidgets('SystemChrome overlay style test', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { diff --git a/packages/flutter/test/widgets/absorb_pointer_test.dart b/packages/flutter/test/widgets/absorb_pointer_test.dart index afe8198a29a..6c2a88f58ca 100644 --- a/packages/flutter/test/widgets/absorb_pointer_test.dart +++ b/packages/flutter/test/widgets/absorb_pointer_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('AbsorbPointers do not block siblings', (WidgetTester tester) async { + testWidgets('AbsorbPointers do not block siblings', (WidgetTester tester) async { bool tapped = false; await tester.pumpWidget( Column( @@ -30,7 +29,7 @@ void main() { }); group('AbsorbPointer semantics', () { - testWidgetsWithLeakTracking('does not change semantics when not absorbing', (WidgetTester tester) async { + testWidgets('does not change semantics when not absorbing', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -57,7 +56,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('drops semantics when its ignoreSemantics is true', (WidgetTester tester) async { + testWidgets('drops semantics when its ignoreSemantics is true', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final UniqueKey key = UniqueKey(); await tester.pumpWidget( @@ -76,7 +75,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ignores user interactions', (WidgetTester tester) async { + testWidgets('ignores user interactions', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/widgets/actions_test.dart b/packages/flutter/test/widgets/actions_test.dart index 38f548ee210..87d2f2b0e11 100644 --- a/packages/flutter/test/widgets/actions_test.dart +++ b/packages/flutter/test/widgets/actions_test.dart @@ -8,11 +8,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group(ActionDispatcher, () { - testWidgetsWithLeakTracking('ActionDispatcher invokes actions when asked.', (WidgetTester tester) async { + testWidgets('ActionDispatcher invokes actions when asked.', (WidgetTester tester) async { await tester.pumpWidget(Container()); bool invoked = false; const ActionDispatcher dispatcher = ActionDispatcher(); @@ -49,7 +48,7 @@ void main() { setUp(clear); - testWidgetsWithLeakTracking('Actions widget can invoke actions with default dispatcher', (WidgetTester tester) async { + testWidgets('Actions widget can invoke actions with default dispatcher', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; @@ -76,7 +75,7 @@ void main() { expect(invoked, isTrue); }); - testWidgetsWithLeakTracking('Actions widget can invoke actions with default dispatcher and maybeInvoke', (WidgetTester tester) async { + testWidgets('Actions widget can invoke actions with default dispatcher and maybeInvoke', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; @@ -103,7 +102,7 @@ void main() { expect(invoked, isTrue); }); - testWidgetsWithLeakTracking('maybeInvoke returns null when no action is found', (WidgetTester tester) async { + testWidgets('maybeInvoke returns null when no action is found', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; @@ -130,7 +129,7 @@ void main() { expect(invoked, isFalse); }); - testWidgetsWithLeakTracking('invoke throws when no action is found', (WidgetTester tester) async { + testWidgets('invoke throws when no action is found', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; @@ -157,7 +156,7 @@ void main() { expect(invoked, isFalse); }); - testWidgetsWithLeakTracking('Actions widget can invoke actions with custom dispatcher', (WidgetTester tester) async { + testWidgets('Actions widget can invoke actions with custom dispatcher', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; const TestIntent intent = TestIntent(); @@ -188,7 +187,7 @@ void main() { expect(invokedIntent, equals(intent)); }); - testWidgetsWithLeakTracking('Actions can invoke actions in ancestor dispatcher', (WidgetTester tester) async { + testWidgets('Actions can invoke actions in ancestor dispatcher', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; const TestIntent intent = TestIntent(); @@ -225,7 +224,7 @@ void main() { expect(invokedDispatcher.runtimeType, equals(TestDispatcher1)); }); - testWidgetsWithLeakTracking("Actions can invoke actions in ancestor dispatcher if a lower one isn't specified", (WidgetTester tester) async { + testWidgets("Actions can invoke actions in ancestor dispatcher if a lower one isn't specified", (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; const TestIntent intent = TestIntent(); @@ -261,7 +260,7 @@ void main() { expect(invokedDispatcher.runtimeType, equals(TestDispatcher1)); }); - testWidgetsWithLeakTracking('Actions widget can be found with of', (WidgetTester tester) async { + testWidgets('Actions widget can be found with of', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final ActionDispatcher testDispatcher = TestDispatcher1(postInvoke: collect); @@ -278,7 +277,7 @@ void main() { expect(dispatcher, equals(testDispatcher)); }); - testWidgetsWithLeakTracking('Action can be found with find', (WidgetTester tester) async { + testWidgets('Action can be found with find', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final ActionDispatcher testDispatcher = TestDispatcher1(postInvoke: collect); bool invoked = false; @@ -325,7 +324,7 @@ void main() { expect(Actions.maybeFind<DoNothingIntent>(containerKey.currentContext!), isNull); }); - testWidgetsWithLeakTracking('FocusableActionDetector keeps track of focus and hover even when disabled.', (WidgetTester tester) async { + testWidgets('FocusableActionDetector keeps track of focus and hover even when disabled.', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); bool invoked = false; @@ -397,7 +396,7 @@ void main() { expect(focusing, isFalse); }); - testWidgetsWithLeakTracking('FocusableActionDetector changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('FocusableActionDetector changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( MouseRegion( cursor: SystemMouseCursors.forbidden, @@ -430,7 +429,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.forbidden); }); - testWidgetsWithLeakTracking('Actions.invoke returns the value of Action.invoke', (WidgetTester tester) async { + testWidgets('Actions.invoke returns the value of Action.invoke', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final Object sentinel = Object(); bool invoked = false; @@ -461,7 +460,7 @@ void main() { expect(invoked, isTrue); }); - testWidgetsWithLeakTracking('ContextAction can return null', (WidgetTester tester) async { + testWidgets('ContextAction can return null', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); const TestIntent intent = TestIntent(); final TestContextAction testAction = TestContextAction(); @@ -488,7 +487,7 @@ void main() { expect(testAction.capturedContexts.single, containerKey.currentContext); }); - testWidgetsWithLeakTracking('Disabled actions stop propagation to an ancestor', (WidgetTester tester) async { + testWidgets('Disabled actions stop propagation to an ancestor', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked = false; const TestIntent intent = TestIntent(); @@ -537,7 +536,7 @@ void main() { }); group('Listening', () { - testWidgetsWithLeakTracking('can listen to enabled state of Actions', (WidgetTester tester) async { + testWidgets('can listen to enabled state of Actions', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); bool invoked1 = false; bool invoked2 = false; @@ -763,7 +762,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('FocusableActionDetector keeps track of focus and hover even when disabled.', (WidgetTester tester) async { + testWidgets('FocusableActionDetector keeps track of focus and hover even when disabled.', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); @@ -797,7 +796,7 @@ void main() { expect(focusing, isFalse); }); - testWidgetsWithLeakTracking('FocusableActionDetector shows focus highlight appropriately when focused and disabled', (WidgetTester tester) async { + testWidgets('FocusableActionDetector shows focus highlight appropriately when focused and disabled', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); @@ -828,7 +827,7 @@ void main() { expect(focusing, isTrue); }); - testWidgetsWithLeakTracking('FocusableActionDetector can be used without callbacks', (WidgetTester tester) async { + testWidgets('FocusableActionDetector can be used without callbacks', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); @@ -862,7 +861,7 @@ void main() { expect(focusing, isFalse); }); - testWidgetsWithLeakTracking( + testWidgets( 'FocusableActionDetector can prevent its descendants from being focusable', (WidgetTester tester) async { final FocusNode buttonNode = FocusNode(debugLabel: 'Test'); @@ -908,7 +907,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'FocusableActionDetector can prevent its descendants from being traversable', (WidgetTester tester) async { final FocusNode buttonNode1 = FocusNode(debugLabel: 'Button Node 1'); @@ -986,7 +985,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('FocusableActionDetector can exclude Focus semantics', (WidgetTester tester) async { + testWidgets('FocusableActionDetector can exclude Focus semantics', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: FocusableActionDetector( @@ -1092,7 +1091,7 @@ void main() { }); group('Action subclasses', () { - testWidgetsWithLeakTracking('CallbackAction passes correct intent when invoked.', (WidgetTester tester) async { + testWidgets('CallbackAction passes correct intent when invoked.', (WidgetTester tester) async { late Intent passedIntent; final TestAction action = TestAction(onInvoke: (Intent intent) { passedIntent = intent; @@ -1103,7 +1102,7 @@ void main() { expect(passedIntent, equals(intent)); }); - testWidgetsWithLeakTracking('VoidCallbackAction', (WidgetTester tester) async { + testWidgets('VoidCallbackAction', (WidgetTester tester) async { bool called = false; void testCallback() { called = true; @@ -1113,7 +1112,7 @@ void main() { action.invoke(intent); expect(called, isTrue); }); - testWidgetsWithLeakTracking('Base Action class default toKeyEventResult delegates to consumesKey', (WidgetTester tester) async { + testWidgets('Base Action class default toKeyEventResult delegates to consumesKey', (WidgetTester tester) async { expect( DefaultToKeyEventResultAction(consumesKey: false).toKeyEventResult(const DefaultToKeyEventResultIntent(), null), KeyEventResult.skipRemainingHandlers, @@ -1126,7 +1125,7 @@ void main() { }); group('Diagnostics', () { - testWidgetsWithLeakTracking('default Intent debugFillProperties', (WidgetTester tester) async { + testWidgets('default Intent debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); // ignore: invalid_use_of_protected_member @@ -1142,7 +1141,7 @@ void main() { expect(description, isEmpty); }); - testWidgetsWithLeakTracking('default Actions debugFillProperties', (WidgetTester tester) async { + testWidgets('default Actions debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); Actions( @@ -1168,7 +1167,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Actions implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Actions implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); Actions( @@ -1207,7 +1206,7 @@ void main() { invokingContext = null; }); - testWidgetsWithLeakTracking('Basic usage', (WidgetTester tester) async { + testWidgets('Basic usage', (WidgetTester tester) async { late BuildContext invokingContext2; late BuildContext invokingContext3; await tester.pumpWidget( @@ -1272,7 +1271,7 @@ void main() { expect(invocations, <String>['action1.invoke']); }); - testWidgetsWithLeakTracking('Does not break after use', (WidgetTester tester) async { + testWidgets('Does not break after use', (WidgetTester tester) async { late BuildContext invokingContext2; late BuildContext invokingContext3; await tester.pumpWidget( @@ -1339,7 +1338,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Does not override if not overridable', (WidgetTester tester) async { + testWidgets('Does not override if not overridable', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context1) { @@ -1382,7 +1381,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('The final override controls isEnabled', (WidgetTester tester) async { + testWidgets('The final override controls isEnabled', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context1) { @@ -1469,7 +1468,7 @@ void main() { expect(invocations, <String>[]); }); - testWidgetsWithLeakTracking('The override can choose to defer isActionEnabled to the overridable', (WidgetTester tester) async { + testWidgets('The override can choose to defer isActionEnabled to the overridable', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context1) { @@ -1559,7 +1558,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Throws on infinite recursions', (WidgetTester tester) async { + testWidgets('Throws on infinite recursions', (WidgetTester tester) async { late StateSetter setState; BuildContext? action2LookupContext; await tester.pumpWidget( @@ -1618,7 +1617,7 @@ void main() { expect(exception?.toString(), contains('debugAssertIsEnabledMutuallyRecursive')); }); - testWidgetsWithLeakTracking('Throws on invoking invalid override', (WidgetTester tester) async { + testWidgets('Throws on invoking invalid override', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context) { @@ -1656,7 +1655,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Make an overridable action overridable', (WidgetTester tester) async { + testWidgets('Make an overridable action overridable', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context1) { @@ -1712,7 +1711,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Overriding Actions can change the intent', (WidgetTester tester) async { + testWidgets('Overriding Actions can change the intent', (WidgetTester tester) async { final List<String> newLogChannel = <String>[]; await tester.pumpWidget( Builder( @@ -1762,7 +1761,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Override non-context overridable Actions with a ContextAction', (WidgetTester tester) async { + testWidgets('Override non-context overridable Actions with a ContextAction', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context1) { @@ -1815,7 +1814,7 @@ void main() { expect(LogInvocationContextAction.invokeContext, invokingContext); }); - testWidgetsWithLeakTracking('Override a ContextAction with a regular Action', (WidgetTester tester) async { + testWidgets('Override a ContextAction with a regular Action', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context1) { diff --git a/packages/flutter/test/widgets/align_test.dart b/packages/flutter/test/widgets/align_test.dart index 1a6e89f73f1..aa44e27bce1 100644 --- a/packages/flutter/test/widgets/align_test.dart +++ b/packages/flutter/test/widgets/align_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Align smoke test', (WidgetTester tester) async { + testWidgets('Align smoke test', (WidgetTester tester) async { await tester.pumpWidget( Align( alignment: const Alignment(0.50, 0.50), @@ -39,7 +38,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Align control test (LTR)', (WidgetTester tester) async { + testWidgets('Align control test (LTR)', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: Align( @@ -63,7 +62,7 @@ void main() { expect(tester.getBottomRight(find.byType(SizedBox)).dx, 100.0); }); - testWidgetsWithLeakTracking('Align control test (RTL)', (WidgetTester tester) async { + testWidgets('Align control test (RTL)', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.rtl, child: Align( @@ -87,7 +86,7 @@ void main() { expect(tester.getBottomRight(find.byType(SizedBox)).dx, 100.0); }); - testWidgetsWithLeakTracking('Shrink wraps in finite space', (WidgetTester tester) async { + testWidgets('Shrink wraps in finite space', (WidgetTester tester) async { final GlobalKey alignKey = GlobalKey(); await tester.pumpWidget( SingleChildScrollView( @@ -106,7 +105,7 @@ void main() { expect(size.height, equals(10.0)); }); - testWidgetsWithLeakTracking('Align widthFactor', (WidgetTester tester) async { + testWidgets('Align widthFactor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -129,7 +128,7 @@ void main() { expect(box.size.width, equals(50.0)); }); - testWidgetsWithLeakTracking('Align heightFactor', (WidgetTester tester) async { + testWidgets('Align heightFactor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/animated_align_test.dart b/packages/flutter/test/widgets/animated_align_test.dart index 0d0331505ab..032f2678654 100644 --- a/packages/flutter/test/widgets/animated_align_test.dart +++ b/packages/flutter/test/widgets/animated_align_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('AnimatedAlign.debugFillProperties', (WidgetTester tester) async { + testWidgets('AnimatedAlign.debugFillProperties', (WidgetTester tester) async { const AnimatedAlign box = AnimatedAlign( alignment: Alignment.topCenter, curve: Curves.ease, @@ -16,7 +15,7 @@ void main() { expect(box, hasOneLineDescription); }); - testWidgetsWithLeakTracking('AnimatedAlign alignment visual-to-directional animation', (WidgetTester tester) async { + testWidgets('AnimatedAlign alignment visual-to-directional animation', (WidgetTester tester) async { final Key target = UniqueKey(); await tester.pumpWidget( @@ -58,7 +57,7 @@ void main() { expect(tester.getTopRight(find.byKey(target)), const Offset(800.0, 400.0)); }); - testWidgetsWithLeakTracking('AnimatedAlign widthFactor', (WidgetTester tester) async { + testWidgets('AnimatedAlign widthFactor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -83,7 +82,7 @@ void main() { expect(box.size.width, equals(50.0)); }); - testWidgetsWithLeakTracking('AnimatedAlign heightFactor', (WidgetTester tester) async { + testWidgets('AnimatedAlign heightFactor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -107,7 +106,7 @@ void main() { expect(box.size.height, equals( 50.0)); }); - testWidgetsWithLeakTracking('AnimatedAlign null height factor', (WidgetTester tester) async { + testWidgets('AnimatedAlign null height factor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -131,7 +130,7 @@ void main() { expect(box.size, equals(const Size(100.0, 100))); }); - testWidgetsWithLeakTracking('AnimatedAlign null widthFactor', (WidgetTester tester) async { + testWidgets('AnimatedAlign null widthFactor', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/animated_container_test.dart b/packages/flutter/test/widgets/animated_container_test.dart index d25156a5957..6d40f450cd5 100644 --- a/packages/flutter/test/widgets/animated_container_test.dart +++ b/packages/flutter/test/widgets/animated_container_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('AnimatedContainer.debugFillProperties', (WidgetTester tester) async { + testWidgets('AnimatedContainer.debugFillProperties', (WidgetTester tester) async { final AnimatedContainer container = AnimatedContainer( constraints: const BoxConstraints.tightFor(width: 17.0, height: 23.0), decoration: const BoxDecoration(color: Color(0xFF00FF00)), @@ -25,7 +24,7 @@ void main() { expect(container, hasOneLineDescription); }); - testWidgetsWithLeakTracking('AnimatedContainer control test', (WidgetTester tester) async { + testWidgets('AnimatedContainer control test', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); const BoxDecoration decorationA = BoxDecoration( @@ -103,7 +102,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AnimatedContainer overanimate test', (WidgetTester tester) async { + testWidgets('AnimatedContainer overanimate test', (WidgetTester tester) async { await tester.pumpWidget( AnimatedContainer( duration: const Duration(milliseconds: 200), @@ -140,7 +139,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('AnimatedContainer padding visual-to-directional animation', (WidgetTester tester) async { + testWidgets('AnimatedContainer padding visual-to-directional animation', (WidgetTester tester) async { final Key target = UniqueKey(); await tester.pumpWidget( @@ -182,7 +181,7 @@ void main() { expect(tester.getTopRight(find.byKey(target)), const Offset(700.0, 0.0)); }); - testWidgetsWithLeakTracking('AnimatedContainer alignment visual-to-directional animation', (WidgetTester tester) async { + testWidgets('AnimatedContainer alignment visual-to-directional animation', (WidgetTester tester) async { final Key target = UniqueKey(); await tester.pumpWidget( @@ -224,7 +223,7 @@ void main() { expect(tester.getTopRight(find.byKey(target)), const Offset(800.0, 400.0)); }); - testWidgetsWithLeakTracking('Animation rerun', (WidgetTester tester) async { + testWidgets('Animation rerun', (WidgetTester tester) async { await tester.pumpWidget( Center( child: AnimatedContainer( @@ -292,7 +291,7 @@ void main() { expect(text.size.height, equals(100.0)); }); - testWidgetsWithLeakTracking('AnimatedContainer sets transformAlignment', (WidgetTester tester) async { + testWidgets('AnimatedContainer sets transformAlignment', (WidgetTester tester) async { final Key target = UniqueKey(); await tester.pumpWidget( @@ -340,7 +339,7 @@ void main() { expect(tester.getTopLeft(find.byKey(target)), const Offset(400.0, 300.0)); }); - testWidgetsWithLeakTracking('AnimatedContainer sets clipBehavior', (WidgetTester tester) async { + testWidgets('AnimatedContainer sets clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( AnimatedContainer( decoration: const BoxDecoration( diff --git a/packages/flutter/test/widgets/animated_cross_fade_test.dart b/packages/flutter/test/widgets/animated_cross_fade_test.dart index ee3f88b132b..7a4ac09b49b 100644 --- a/packages/flutter/test/widgets/animated_cross_fade_test.dart +++ b/packages/flutter/test/widgets/animated_cross_fade_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('AnimatedCrossFade test', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade test', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -62,7 +61,7 @@ void main() { expect(box.size.height, equals(150.0)); }); - testWidgetsWithLeakTracking('AnimatedCrossFade test showSecond', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade test showSecond', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -89,7 +88,7 @@ void main() { expect(box.size.height, equals(200.0)); }); - testWidgetsWithLeakTracking('AnimatedCrossFade alignment (VISUAL)', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade alignment (VISUAL)', (WidgetTester tester) async { final Key firstKey = UniqueKey(); final Key secondKey = UniqueKey(); @@ -147,7 +146,7 @@ void main() { expect(box2.localToGlobal(Offset.zero), const Offset(275.0, 175.0)); }); - testWidgetsWithLeakTracking('AnimatedCrossFade alignment (LTR)', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade alignment (LTR)', (WidgetTester tester) async { final Key firstKey = UniqueKey(); final Key secondKey = UniqueKey(); @@ -205,7 +204,7 @@ void main() { expect(box2.localToGlobal(Offset.zero), const Offset(275.0, 175.0)); }); - testWidgetsWithLeakTracking('AnimatedCrossFade alignment (RTL)', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade alignment (RTL)', (WidgetTester tester) async { final Key firstKey = UniqueKey(); final Key secondKey = UniqueKey(); @@ -275,7 +274,7 @@ void main() { ); } - testWidgetsWithLeakTracking('AnimatedCrossFade preserves widget state', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade preserves widget state', (WidgetTester tester) async { await tester.pumpWidget(crossFadeWithWatcher()); _TickerWatchingWidgetState findState() => tester.state(find.byType(_TickerWatchingWidget)); @@ -288,7 +287,7 @@ void main() { } }); - testWidgetsWithLeakTracking('AnimatedCrossFade switches off TickerMode and semantics on faded out widget', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade switches off TickerMode and semantics on faded out widget', (WidgetTester tester) async { ExcludeSemantics findSemantics() { return tester.widget(find.descendant( of: find.byKey(const ValueKey<CrossFadeState>(CrossFadeState.showFirst)), @@ -318,7 +317,7 @@ void main() { expect(findSemantics().excluding, true); }); - testWidgetsWithLeakTracking('AnimatedCrossFade.layoutBuilder', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade.layoutBuilder', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -362,7 +361,7 @@ void main() { expect(find.text('AAA'), findsNothing); }); - testWidgetsWithLeakTracking('AnimatedCrossFade test focus', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade test focus', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -386,7 +385,7 @@ void main() { expect(hiddenNode.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('AnimatedCrossFade bottom child can have focus', (WidgetTester tester) async { + testWidgets('AnimatedCrossFade bottom child can have focus', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -411,7 +410,7 @@ void main() { expect(hiddenNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('AnimatedCrossFade second child do not receive touch events', + testWidgets('AnimatedCrossFade second child do not receive touch events', (WidgetTester tester) async { int numberOfTouchEventNoticed = 0; diff --git a/packages/flutter/test/widgets/animated_grid_test.dart b/packages/flutter/test/widgets/animated_grid_test.dart index c03c7143feb..dcec143a9e7 100644 --- a/packages/flutter/test/widgets/animated_grid_test.dart +++ b/packages/flutter/test/widgets/animated_grid_test.dart @@ -5,11 +5,10 @@ import 'package:flutter/src/foundation/diagnostics.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('SliverAnimatedGrid.builder respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('SliverAnimatedGrid.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -51,7 +50,7 @@ void main() { expect(finderCalled, true); }); - testWidgetsWithLeakTracking('AnimatedGrid', (WidgetTester tester) async { + testWidgets('AnimatedGrid', (WidgetTester tester) async { Widget builder(BuildContext context, int index, Animation<double> animation) { return SizedBox( height: 100.0, @@ -133,7 +132,7 @@ void main() { }); group('SliverAnimatedGrid', () { - testWidgetsWithLeakTracking('initialItemCount', (WidgetTester tester) async { + testWidgets('initialItemCount', (WidgetTester tester) async { final Map<int, Animation<double>> animations = <int, Animation<double>>{}; await tester.pumpWidget( @@ -171,7 +170,7 @@ void main() { expect(animations[1]!.value, 1.0); }); - testWidgetsWithLeakTracking('insert', (WidgetTester tester) async { + testWidgets('insert', (WidgetTester tester) async { final GlobalKey<SliverAnimatedGridState> listKey = GlobalKey<SliverAnimatedGridState>(); await tester.pumpWidget( @@ -251,7 +250,7 @@ void main() { expect(itemRight(2), 300.0); }); - testWidgetsWithLeakTracking('insertAll', (WidgetTester tester) async { + testWidgets('insertAll', (WidgetTester tester) async { final GlobalKey<SliverAnimatedGridState> listKey = GlobalKey<SliverAnimatedGridState>(); await tester.pumpWidget( @@ -307,7 +306,7 @@ void main() { expect(itemRight(1), 200.0); }); - testWidgetsWithLeakTracking('remove', (WidgetTester tester) async { + testWidgets('remove', (WidgetTester tester) async { final GlobalKey<SliverAnimatedGridState> listKey = GlobalKey<SliverAnimatedGridState>(); final List<int> items = <int>[0, 1, 2]; @@ -385,7 +384,7 @@ void main() { expect(itemRight(2), 200.0); }); - testWidgetsWithLeakTracking('removeAll', (WidgetTester tester) async { + testWidgets('removeAll', (WidgetTester tester) async { final GlobalKey<SliverAnimatedGridState> listKey = GlobalKey<SliverAnimatedGridState>(); final List<int> items = <int>[0, 1, 2]; @@ -437,7 +436,7 @@ void main() { expect(find.text('item 2'), findsNothing); }); - testWidgetsWithLeakTracking('works in combination with other slivers', (WidgetTester tester) async { + testWidgets('works in combination with other slivers', (WidgetTester tester) async { final GlobalKey<SliverAnimatedGridState> listKey = GlobalKey<SliverAnimatedGridState>(); await tester.pumpWidget( @@ -506,7 +505,7 @@ void main() { expect(tester.getTopLeft(find.text('item 0')).dx, 0); }); - testWidgetsWithLeakTracking('passes correctly derived index of findChildIndexCallback to the inner SliverChildBuilderDelegate', + testWidgets('passes correctly derived index of findChildIndexCallback to the inner SliverChildBuilderDelegate', (WidgetTester tester) async { final List<int> items = <int>[0, 1, 2, 3]; final GlobalKey<SliverAnimatedGridState> listKey = GlobalKey<SliverAnimatedGridState>(); @@ -574,7 +573,7 @@ void main() { }); }); - testWidgetsWithLeakTracking( + testWidgets( 'AnimatedGrid.of() and maybeOf called with a context that does not contain AnimatedGrid', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); @@ -619,7 +618,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('AnimatedGrid.clipBehavior is forwarded to its inner CustomScrollView', (WidgetTester tester) async { + testWidgets('AnimatedGrid.clipBehavior is forwarded to its inner CustomScrollView', (WidgetTester tester) async { const Clip clipBehavior = Clip.none; await tester.pumpWidget( @@ -648,7 +647,7 @@ void main() { expect(tester.widget<CustomScrollView>(find.byType(CustomScrollView)).clipBehavior, clipBehavior); }); - testWidgetsWithLeakTracking('AnimatedGrid applies MediaQuery padding', (WidgetTester tester) async { + testWidgets('AnimatedGrid applies MediaQuery padding', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.all(30.0); EdgeInsets? innerMediaQueryPadding; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/animated_image_filtered_repaint_test.dart b/packages/flutter/test/widgets/animated_image_filtered_repaint_test.dart index 75de31aea77..0ccd2510743 100644 --- a/packages/flutter/test/widgets/animated_image_filtered_repaint_test.dart +++ b/packages/flutter/test/widgets/animated_image_filtered_repaint_test.dart @@ -7,10 +7,9 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ImageFiltered avoids repainting child as it animates', (WidgetTester tester) async { + testWidgets('ImageFiltered avoids repainting child as it animates', (WidgetTester tester) async { RenderTestObject.paintCount = 0; await tester.pumpWidget( ColoredBox( diff --git a/packages/flutter/test/widgets/animated_list_test.dart b/packages/flutter/test/widgets/animated_list_test.dart index d8d637bb430..0c169161050 100644 --- a/packages/flutter/test/widgets/animated_list_test.dart +++ b/packages/flutter/test/widgets/animated_list_test.dart @@ -5,11 +5,10 @@ import 'package:flutter/src/foundation/diagnostics.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('SliverAnimatedList.builder respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('SliverAnimatedList.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -48,7 +47,7 @@ void main() { expect(finderCalled, true); }); - testWidgetsWithLeakTracking('AnimatedList', (WidgetTester tester) async { + testWidgets('AnimatedList', (WidgetTester tester) async { Widget builder(BuildContext context, int index, Animation<double> animation) { return SizedBox( height: 100.0, @@ -127,7 +126,7 @@ void main() { }); group('SliverAnimatedList', () { - testWidgetsWithLeakTracking('initialItemCount', (WidgetTester tester) async { + testWidgets('initialItemCount', (WidgetTester tester) async { final Map<int, Animation<double>> animations = <int, Animation<double>>{}; await tester.pumpWidget( @@ -160,7 +159,7 @@ void main() { expect(animations[1]!.value, 1.0); }); - testWidgetsWithLeakTracking('insert', (WidgetTester tester) async { + testWidgets('insert', (WidgetTester tester) async { final GlobalKey<SliverAnimatedListState> listKey = GlobalKey<SliverAnimatedListState>(); await tester.pumpWidget( @@ -246,7 +245,7 @@ void main() { }); // Test for insertAllItems with SliverAnimatedList - testWidgetsWithLeakTracking('insertAll', (WidgetTester tester) async { + testWidgets('insertAll', (WidgetTester tester) async { final GlobalKey<SliverAnimatedListState> listKey = GlobalKey<SliverAnimatedListState>(); await tester.pumpWidget( @@ -303,7 +302,7 @@ void main() { }); // Test for removeAllItems with SliverAnimatedList - testWidgetsWithLeakTracking('remove', (WidgetTester tester) async { + testWidgets('remove', (WidgetTester tester) async { final GlobalKey<SliverAnimatedListState> listKey = GlobalKey<SliverAnimatedListState>(); final List<int> items = <int>[0, 1, 2]; @@ -380,7 +379,7 @@ void main() { }); // Test for removeAllItems with SliverAnimatedList - testWidgetsWithLeakTracking('removeAll', (WidgetTester tester) async { + testWidgets('removeAll', (WidgetTester tester) async { final GlobalKey<SliverAnimatedListState> listKey = GlobalKey<SliverAnimatedListState>(); final List<int> items = <int>[0, 1, 2]; @@ -430,7 +429,7 @@ void main() { expect(find.text('item 2'), findsNothing); }); - testWidgetsWithLeakTracking('works in combination with other slivers', (WidgetTester tester) async { + testWidgets('works in combination with other slivers', (WidgetTester tester) async { final GlobalKey<SliverAnimatedListState> listKey = GlobalKey<SliverAnimatedListState>(); await tester.pumpWidget( @@ -495,7 +494,7 @@ void main() { expect(tester.getTopLeft(find.text('item 0')).dy, 200); }); - testWidgetsWithLeakTracking('passes correctly derived index of findChildIndexCallback to the inner SliverChildBuilderDelegate', (WidgetTester tester) async { + testWidgets('passes correctly derived index of findChildIndexCallback to the inner SliverChildBuilderDelegate', (WidgetTester tester) async { final List<int> items = <int>[0, 1, 2, 3]; final GlobalKey<SliverAnimatedListState> listKey = GlobalKey<SliverAnimatedListState>(); @@ -557,7 +556,7 @@ void main() { }); }); - testWidgetsWithLeakTracking( + testWidgets( 'AnimatedList.of() and maybeOf called with a context that does not contain AnimatedList', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); @@ -602,7 +601,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('AnimatedList.clipBehavior is forwarded to its inner CustomScrollView', (WidgetTester tester) async { + testWidgets('AnimatedList.clipBehavior is forwarded to its inner CustomScrollView', (WidgetTester tester) async { const Clip clipBehavior = Clip.none; await tester.pumpWidget( @@ -626,7 +625,7 @@ void main() { expect(tester.widget<CustomScrollView>(find.byType(CustomScrollView)).clipBehavior, clipBehavior); }); - testWidgetsWithLeakTracking('AnimatedList.shrinkwrap is forwarded to its inner CustomScrollView', (WidgetTester tester) async { + testWidgets('AnimatedList.shrinkwrap is forwarded to its inner CustomScrollView', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/115040 final ScrollController controller = ScrollController(); @@ -654,7 +653,7 @@ void main() { expect(tester.widget<CustomScrollView>(find.byType(CustomScrollView)).shrinkWrap, true); }); - testWidgetsWithLeakTracking('AnimatedList applies MediaQuery padding', (WidgetTester tester) async { + testWidgets('AnimatedList applies MediaQuery padding', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.all(30.0); EdgeInsets? innerMediaQueryPadding; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/animated_opacity_repaint_test.dart b/packages/flutter/test/widgets/animated_opacity_repaint_test.dart index 24704cdab2b..da024281dcf 100644 --- a/packages/flutter/test/widgets/animated_opacity_repaint_test.dart +++ b/packages/flutter/test/widgets/animated_opacity_repaint_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('RenderAnimatedOpacityMixin does not drop layer when animating to 1', (WidgetTester tester) async { + testWidgets('RenderAnimatedOpacityMixin does not drop layer when animating to 1', (WidgetTester tester) async { RenderTestObject.paintCount = 0; final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1)); addTearDown(controller.dispose); @@ -42,7 +41,7 @@ void main() { expect(RenderTestObject.paintCount, 1); }); - testWidgetsWithLeakTracking('RenderAnimatedOpacityMixin avoids repainting child as it animates', (WidgetTester tester) async { + testWidgets('RenderAnimatedOpacityMixin avoids repainting child as it animates', (WidgetTester tester) async { RenderTestObject.paintCount = 0; final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1)); addTearDown(controller.dispose); @@ -76,7 +75,7 @@ void main() { expect(RenderTestObject.paintCount, 1); }); - testWidgetsWithLeakTracking('RenderAnimatedOpacityMixin allows opacity layer to be disposed when animating to 0 opacity', (WidgetTester tester) async { + testWidgets('RenderAnimatedOpacityMixin allows opacity layer to be disposed when animating to 0 opacity', (WidgetTester tester) async { RenderTestObject.paintCount = 0; final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1)); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/animated_padding_test.dart b/packages/flutter/test/widgets/animated_padding_test.dart index 8542efdfd61..e8cd37f1073 100644 --- a/packages/flutter/test/widgets/animated_padding_test.dart +++ b/packages/flutter/test/widgets/animated_padding_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('AnimatedPadding.debugFillProperties', (WidgetTester tester) async { + testWidgets('AnimatedPadding.debugFillProperties', (WidgetTester tester) async { final AnimatedPadding padding = AnimatedPadding( padding: const EdgeInsets.all(7.0), curve: Curves.ease, @@ -17,7 +16,7 @@ void main() { expect(padding, hasOneLineDescription); }); - testWidgetsWithLeakTracking('AnimatedPadding padding visual-to-directional animation', (WidgetTester tester) async { + testWidgets('AnimatedPadding padding visual-to-directional animation', (WidgetTester tester) async { final Key target = UniqueKey(); await tester.pumpWidget( @@ -59,7 +58,7 @@ void main() { expect(tester.getTopRight(find.byKey(target)), const Offset(700.0, 0.0)); }); - testWidgetsWithLeakTracking('AnimatedPadding animated padding clamped to positive values', (WidgetTester tester) async { + testWidgets('AnimatedPadding animated padding clamped to positive values', (WidgetTester tester) async { final Key target = UniqueKey(); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/animated_positioned_test.dart b/packages/flutter/test/widgets/animated_positioned_test.dart index 8d3b5efe73f..f1a794069a4 100644 --- a/packages/flutter/test/widgets/animated_positioned_test.dart +++ b/packages/flutter/test/widgets/animated_positioned_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('AnimatedPositioned.fromRect control test', (WidgetTester tester) async { + testWidgets('AnimatedPositioned.fromRect control test', (WidgetTester tester) async { final AnimatedPositioned positioned = AnimatedPositioned.fromRect( rect: const Rect.fromLTWH(7.0, 5.0, 12.0, 16.0), duration: const Duration(milliseconds: 200), @@ -21,7 +20,7 @@ void main() { expect(positioned, hasOneLineDescription); }); - testWidgetsWithLeakTracking('AnimatedPositioned - basics (VISUAL)', (WidgetTester tester) async { + testWidgets('AnimatedPositioned - basics (VISUAL)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -103,7 +102,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional - basics (LTR)', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional - basics (LTR)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -189,7 +188,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional - basics (RTL)', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional - basics (RTL)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -275,7 +274,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AnimatedPositioned - interrupted animation (VISUAL)', (WidgetTester tester) async { + testWidgets('AnimatedPositioned - interrupted animation (VISUAL)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -358,7 +357,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(200.0, 200.0))); }); - testWidgetsWithLeakTracking('AnimatedPositioned - switching variables (VISUAL)', (WidgetTester tester) async { + testWidgets('AnimatedPositioned - switching variables (VISUAL)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -417,7 +416,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(350.0, 150.0))); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional - interrupted animation (LTR)', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional - interrupted animation (LTR)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -506,7 +505,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(200.0, 200.0))); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional - switching variables (LTR)', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional - switching variables (LTR)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -569,7 +568,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(350.0, 150.0))); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional - interrupted animation (RTL)', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional - interrupted animation (RTL)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; @@ -658,7 +657,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(600.0, 200.0))); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional - switching variables (RTL)', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional - switching variables (RTL)', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); RenderBox box; diff --git a/packages/flutter/test/widgets/animated_size_test.dart b/packages/flutter/test/widgets/animated_size_test.dart index c48729e48e6..d6b851475c1 100644 --- a/packages/flutter/test/widgets/animated_size_test.dart +++ b/packages/flutter/test/widgets/animated_size_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestPaintingContext implements PaintingContext { final List<Invocation> invocations = <Invocation>[]; @@ -18,7 +17,7 @@ class TestPaintingContext implements PaintingContext { void main() { group('AnimatedSize', () { - testWidgetsWithLeakTracking('animates forwards then backwards with stable-sized children', (WidgetTester tester) async { + testWidgets('animates forwards then backwards with stable-sized children', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: AnimatedSize( @@ -88,7 +87,7 @@ void main() { expect(box.size.height, equals(100.0)); }); - testWidgetsWithLeakTracking('clamps animated size to constraints', (WidgetTester tester) async { + testWidgets('clamps animated size to constraints', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox ( @@ -133,7 +132,7 @@ void main() { expect(box.size.height, equals(100.0)); }); - testWidgetsWithLeakTracking('tracks unstable child, then resumes animation when child stabilizes', (WidgetTester tester) async { + testWidgets('tracks unstable child, then resumes animation when child stabilizes', (WidgetTester tester) async { Future<void> pumpMillis(int millis) async { await tester.pump(Duration(milliseconds: millis)); } @@ -216,7 +215,7 @@ void main() { verify(size: 100.0, state: RenderAnimatedSizeState.stable); }); - testWidgetsWithLeakTracking('resyncs its animation controller', (WidgetTester tester) async { + testWidgets('resyncs its animation controller', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: AnimatedSize( @@ -247,7 +246,7 @@ void main() { expect(box.size.width, equals(150.0)); }); - testWidgetsWithLeakTracking('does not run animation unnecessarily', (WidgetTester tester) async { + testWidgets('does not run animation unnecessarily', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: AnimatedSize( @@ -270,7 +269,7 @@ void main() { } }); - testWidgetsWithLeakTracking('can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: AnimatedSize( @@ -304,7 +303,7 @@ void main() { } }); - testWidgetsWithLeakTracking('works wrapped in IntrinsicHeight and Wrap', (WidgetTester tester) async { + testWidgets('works wrapped in IntrinsicHeight and Wrap', (WidgetTester tester) async { Future<void> pumpWidget(Size size, [Duration? duration]) async { return tester.pumpWidget( Center( @@ -351,7 +350,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(IntrinsicHeight)).size, const Size(222, 222)); }); - testWidgetsWithLeakTracking('re-attach with interrupted animation', (WidgetTester tester) async { + testWidgets('re-attach with interrupted animation', (WidgetTester tester) async { const Key key1 = ValueKey<String>('key1'); const Key key2 = ValueKey<String>('key2'); late StateSetter setState; @@ -435,7 +434,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('disposes animation and controller', (WidgetTester tester) async { + testWidgets('disposes animation and controller', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: AnimatedSize( diff --git a/packages/flutter/test/widgets/animated_switcher_test.dart b/packages/flutter/test/widgets/animated_switcher_test.dart index 70de6e294d3..0d914cb73ed 100644 --- a/packages/flutter/test/widgets/animated_switcher_test.dart +++ b/packages/flutter/test/widgets/animated_switcher_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('AnimatedSwitcher fades in a new child.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher fades in a new child.', (WidgetTester tester) async { final UniqueKey containerOne = UniqueKey(); final UniqueKey containerTwo = UniqueKey(); final UniqueKey containerThree = UniqueKey(); @@ -51,7 +50,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('AnimatedSwitcher can handle back-to-back changes.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher can handle back-to-back changes.', (WidgetTester tester) async { final UniqueKey container1 = UniqueKey(); final UniqueKey container2 = UniqueKey(); final UniqueKey container3 = UniqueKey(); @@ -86,7 +85,7 @@ void main() { expect(find.byKey(container3), findsOneWidget); }); - testWidgetsWithLeakTracking("AnimatedSwitcher doesn't transition in a new child of the same type.", (WidgetTester tester) async { + testWidgets("AnimatedSwitcher doesn't transition in a new child of the same type.", (WidgetTester tester) async { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), @@ -112,7 +111,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('AnimatedSwitcher handles null children.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher handles null children.', (WidgetTester tester) async { await tester.pumpWidget( const AnimatedSwitcher( duration: Duration(milliseconds: 100), @@ -167,7 +166,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking("AnimatedSwitcher doesn't start any animations after dispose.", (WidgetTester tester) async { + testWidgets("AnimatedSwitcher doesn't start any animations after dispose.", (WidgetTester tester) async { await tester.pumpWidget(AnimatedSwitcher( duration: const Duration(milliseconds: 100), child: Container(color: const Color(0xff000000)), @@ -179,7 +178,7 @@ void main() { expect(await tester.pumpAndSettle(), equals(1)); }); - testWidgetsWithLeakTracking('AnimatedSwitcher uses custom layout.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher uses custom layout.', (WidgetTester tester) async { Widget newLayoutBuilder(Widget? currentChild, List<Widget> previousChildren) { return Column( children: <Widget>[ @@ -200,7 +199,7 @@ void main() { expect(find.byType(Column), findsOneWidget); }); - testWidgetsWithLeakTracking('AnimatedSwitcher uses custom transitions.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher uses custom transitions.', (WidgetTester tester) async { late List<Widget> foundChildren; Widget newLayoutBuilder(Widget? currentChild, List<Widget> previousChildren) { foundChildren = <Widget>[ @@ -255,7 +254,7 @@ void main() { } }); - testWidgetsWithLeakTracking("AnimatedSwitcher doesn't reset state of the children in transitions.", (WidgetTester tester) async { + testWidgets("AnimatedSwitcher doesn't reset state of the children in transitions.", (WidgetTester tester) async { final UniqueKey statefulOne = UniqueKey(); final UniqueKey statefulTwo = UniqueKey(); final UniqueKey statefulThree = UniqueKey(); @@ -306,7 +305,7 @@ void main() { expect(StatefulTestState.generation, equals(3)); }); - testWidgetsWithLeakTracking('AnimatedSwitcher updates widgets without animating if they are isomorphic.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher updates widgets without animating if they are isomorphic.', (WidgetTester tester) async { Future<void> pumpChild(Widget child) async { return tester.pumpWidget( Directionality( @@ -333,7 +332,7 @@ void main() { expect(find.text('2'), findsOneWidget); }); - testWidgetsWithLeakTracking('AnimatedSwitcher updates previous child transitions if the transitionBuilder changes.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher updates previous child transitions if the transitionBuilder changes.', (WidgetTester tester) async { final UniqueKey containerOne = UniqueKey(); final UniqueKey containerTwo = UniqueKey(); final UniqueKey containerThree = UniqueKey(); @@ -417,7 +416,7 @@ void main() { } }); - testWidgetsWithLeakTracking('AnimatedSwitcher does not duplicate animations if the same child is entered twice.', (WidgetTester tester) async { + testWidgets('AnimatedSwitcher does not duplicate animations if the same child is entered twice.', (WidgetTester tester) async { Future<void> pumpChild(Widget child) async { return tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/widgets/annotated_region_test.dart b/packages/flutter/test/widgets/annotated_region_test.dart index 66ab89b6303..4d08085bf7e 100644 --- a/packages/flutter/test/widgets/annotated_region_test.dart +++ b/packages/flutter/test/widgets/annotated_region_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('provides a value to the layer tree', (WidgetTester tester) async { + testWidgets('provides a value to the layer tree', (WidgetTester tester) async { await tester.pumpWidget( const AnnotatedRegion<int>( value: 1, @@ -20,7 +19,7 @@ void main() { expect(layer.value, 1); }); - testWidgetsWithLeakTracking('provides a value to the layer tree in a particular region', (WidgetTester tester) async { + testWidgets('provides a value to the layer tree in a particular region', (WidgetTester tester) async { await tester.pumpWidget( Transform.translate( offset: const Offset(25.0, 25.0), diff --git a/packages/flutter/test/widgets/app_lifecycle_listener_test.dart b/packages/flutter/test/widgets/app_lifecycle_listener_test.dart index ee001556dda..b9dfc798299 100644 --- a/packages/flutter/test/widgets/app_lifecycle_listener_test.dart +++ b/packages/flutter/test/widgets/app_lifecycle_listener_test.dart @@ -49,13 +49,13 @@ void main() { 'There were ${TestAppLifecycleListener.registerCount} listeners that were not disposed of in tests.'); }); - testWidgetsWithLeakTracking('Default Diagnostics', (WidgetTester tester) async { + testWidgets('Default Diagnostics', (WidgetTester tester) async { listener = TestAppLifecycleListener(binding: tester.binding); expect(listener.toString(), equalsIgnoringHashCodes('TestAppLifecycleListener#00000(binding: <AutomatedTestWidgetsFlutterBinding>)')); }); - testWidgetsWithLeakTracking('Diagnostics', (WidgetTester tester) async { + testWidgets('Diagnostics', (WidgetTester tester) async { Future<AppExitResponse> handleExitRequested() async { return AppExitResponse.cancel; } @@ -71,7 +71,7 @@ void main() { 'TestAppLifecycleListener#00000(binding: <AutomatedTestWidgetsFlutterBinding>, onStateChange, onExitRequested)')); }); - testWidgetsWithLeakTracking('listens to AppLifecycleState', (WidgetTester tester) async { + testWidgets('listens to AppLifecycleState', (WidgetTester tester) async { final List<AppLifecycleState> states = <AppLifecycleState>[tester.binding.lifecycleState!]; void stateChange(AppLifecycleState state) { states.add(state); @@ -97,7 +97,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('Triggers correct state transition callbacks', (WidgetTester tester) async { + testWidgets('Triggers correct state transition callbacks', (WidgetTester tester) async { final List<String> transitions = <String>[]; listener = TestAppLifecycleListener( binding: WidgetsBinding.instance, @@ -150,7 +150,7 @@ void main() { await setAppLifeCycleState(AppLifecycleState.detached); }); - testWidgetsWithLeakTracking('Receives exit requests', (WidgetTester tester) async { + testWidgets('Receives exit requests', (WidgetTester tester) async { bool exitRequested = false; Future<AppExitResponse> handleExitRequested() async { exitRequested = true; diff --git a/packages/flutter/test/widgets/app_navigator_key_test.dart b/packages/flutter/test/widgets/app_navigator_key_test.dart index 57c95932903..a989516e143 100644 --- a/packages/flutter/test/widgets/app_navigator_key_test.dart +++ b/packages/flutter/test/widgets/app_navigator_key_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Route<void> generateRoute(RouteSettings settings) => PageRouteBuilder<void>( settings: settings, @@ -14,7 +13,7 @@ Route<void> generateRoute(RouteSettings settings) => PageRouteBuilder<void>( ); void main() { - testWidgetsWithLeakTracking('WidgetsApp.navigatorKey', (WidgetTester tester) async { + testWidgets('WidgetsApp.navigatorKey', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); await tester.pumpWidget(WidgetsApp( navigatorKey: key, diff --git a/packages/flutter/test/widgets/app_overrides_test.dart b/packages/flutter/test/widgets/app_overrides_test.dart index 601db0b84c3..66a7a1c6c0c 100644 --- a/packages/flutter/test/widgets/app_overrides_test.dart +++ b/packages/flutter/test/widgets/app_overrides_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestRoute<T> extends PageRoute<T> { TestRoute({ required this.child, super.settings }); @@ -41,7 +40,7 @@ Future<void> pumpApp(WidgetTester tester) async { } void main() { - testWidgetsWithLeakTracking('WidgetsApp control test', (WidgetTester tester) async { + testWidgets('WidgetsApp control test', (WidgetTester tester) async { await pumpApp(tester); expect(find.byType(WidgetsApp), findsOneWidget); expect(find.byType(Navigator), findsOneWidget); @@ -49,7 +48,7 @@ void main() { expect(find.byType(CheckedModeBanner), findsOneWidget); }); - testWidgetsWithLeakTracking('showPerformanceOverlayOverride true', (WidgetTester tester) async { + testWidgets('showPerformanceOverlayOverride true', (WidgetTester tester) async { expect(WidgetsApp.showPerformanceOverlayOverride, false); WidgetsApp.showPerformanceOverlayOverride = true; await pumpApp(tester); @@ -60,7 +59,7 @@ void main() { WidgetsApp.showPerformanceOverlayOverride = false; }); - testWidgetsWithLeakTracking('showPerformanceOverlayOverride false', (WidgetTester tester) async { + testWidgets('showPerformanceOverlayOverride false', (WidgetTester tester) async { WidgetsApp.showPerformanceOverlayOverride = true; expect(WidgetsApp.showPerformanceOverlayOverride, true); WidgetsApp.showPerformanceOverlayOverride = false; @@ -71,7 +70,7 @@ void main() { expect(find.byType(CheckedModeBanner), findsOneWidget); }); - testWidgetsWithLeakTracking('debugAllowBannerOverride false', (WidgetTester tester) async { + testWidgets('debugAllowBannerOverride false', (WidgetTester tester) async { expect(WidgetsApp.showPerformanceOverlayOverride, false); expect(WidgetsApp.debugAllowBannerOverride, true); WidgetsApp.debugAllowBannerOverride = false; @@ -83,7 +82,7 @@ void main() { WidgetsApp.debugAllowBannerOverride = true; // restore to default value }); - testWidgetsWithLeakTracking('debugAllowBannerOverride true', (WidgetTester tester) async { + testWidgets('debugAllowBannerOverride true', (WidgetTester tester) async { WidgetsApp.debugAllowBannerOverride = false; expect(WidgetsApp.showPerformanceOverlayOverride, false); expect(WidgetsApp.debugAllowBannerOverride, false); diff --git a/packages/flutter/test/widgets/app_test.dart b/packages/flutter/test/widgets/app_test.dart index 0ef2f87e0b4..bbde4361729 100644 --- a/packages/flutter/test/widgets/app_test.dart +++ b/packages/flutter/test/widgets/app_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestIntent extends Intent { const TestIntent(); @@ -24,7 +23,7 @@ class TestAction extends Action<Intent> { } void main() { - testWidgetsWithLeakTracking('WidgetsApp with builder only', (WidgetTester tester) async { + testWidgets('WidgetsApp with builder only', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( WidgetsApp( @@ -38,7 +37,7 @@ void main() { expect(find.byKey(key), findsOneWidget); }); - testWidgetsWithLeakTracking('WidgetsApp default key bindings', (WidgetTester tester) async { + testWidgets('WidgetsApp default key bindings', (WidgetTester tester) async { bool? checked = false; final GlobalKey key = GlobalKey(); await tester.pumpWidget( @@ -65,7 +64,7 @@ void main() { expect(checked, isTrue); }); - testWidgetsWithLeakTracking('WidgetsApp can override default key bindings', (WidgetTester tester) async { + testWidgets('WidgetsApp can override default key bindings', (WidgetTester tester) async { final TestAction action = TestAction(); bool? checked = false; final GlobalKey key = GlobalKey(); @@ -102,7 +101,7 @@ void main() { expect(action.calls, equals(1)); }); - testWidgetsWithLeakTracking('WidgetsApp default activation key mappings work', (WidgetTester tester) async { + testWidgets('WidgetsApp default activation key mappings work', (WidgetTester tester) async { bool? checked = false; await tester.pumpWidget( @@ -170,7 +169,7 @@ void main() { } } - testWidgetsWithLeakTracking('push unknown route when onUnknownRoute is null', (WidgetTester tester) async { + testWidgets('push unknown route when onUnknownRoute is null', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); expectFlutterError( key: key, @@ -198,7 +197,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('push unknown route when onUnknownRoute returns null', (WidgetTester tester) async { + testWidgets('push unknown route when onUnknownRoute returns null', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); expectFlutterError( key: key, @@ -220,7 +219,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('WidgetsApp can customize initial routes', (WidgetTester tester) async { + testWidgets('WidgetsApp can customize initial routes', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( WidgetsApp( @@ -273,7 +272,7 @@ void main() { expect(find.text('regular page'), findsNothing); }); - testWidgetsWithLeakTracking('WidgetsApp.router works', (WidgetTester tester) async { + testWidgets('WidgetsApp.router works', (WidgetTester tester) async { final PlatformRouteInformationProvider provider = PlatformRouteInformationProvider( initialRouteInformation: RouteInformation( uri: Uri.parse('initial'), @@ -307,7 +306,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('WidgetsApp.router route information parser is optional', (WidgetTester tester) async { + testWidgets('WidgetsApp.router route information parser is optional', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -334,7 +333,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('WidgetsApp.router throw if route information provider is provided but no route information parser', (WidgetTester tester) async { + testWidgets('WidgetsApp.router throw if route information provider is provided but no route information parser', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -363,7 +362,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking('WidgetsApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async { + testWidgets('WidgetsApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -387,7 +386,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking('WidgetsApp.router router config works', (WidgetTester tester) async { + testWidgets('WidgetsApp.router router config works', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -425,7 +424,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('WidgetsApp.router has correct default', (WidgetTester tester) async { + testWidgets('WidgetsApp.router has correct default', (WidgetTester tester) async { final SimpleNavigatorRouterDelegate delegate = SimpleNavigatorRouterDelegate( builder: (BuildContext context, RouteInformation information) { return Text(information.uri.toString()); @@ -441,7 +440,7 @@ void main() { expect(find.text('/'), findsOneWidget); }); - testWidgetsWithLeakTracking('WidgetsApp has correct default ScrollBehavior', (WidgetTester tester) async { + testWidgets('WidgetsApp has correct default ScrollBehavior', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget( WidgetsApp( @@ -582,7 +581,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("WidgetsApp reports an exception if the selected locale isn't supported", (WidgetTester tester) async { + testWidgets("WidgetsApp reports an exception if the selected locale isn't supported", (WidgetTester tester) async { late final List<Locale>? localesArg; late final Iterable<Locale> supportedLocalesArg; await tester.pumpWidget( @@ -606,7 +605,7 @@ void main() { expect(tester.takeException(), "Warning: This application's locale, C_UTF-8, is not supported by all of its localization delegates."); }); - testWidgetsWithLeakTracking("WidgetsApp doesn't have dependency on MediaQuery", (WidgetTester tester) async { + testWidgets("WidgetsApp doesn't have dependency on MediaQuery", (WidgetTester tester) async { int routeBuildCount = 0; final Widget widget = WidgetsApp( @@ -632,7 +631,7 @@ void main() { expect(routeBuildCount, equals(1)); }); - testWidgetsWithLeakTracking('WidgetsApp provides meta based shortcuts for iOS and macOS', (WidgetTester tester) async { + testWidgets('WidgetsApp provides meta based shortcuts for iOS and macOS', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -725,7 +724,7 @@ void main() { await setAppLifeCycleState(AppLifecycleState.resumed); }); - testWidgetsWithLeakTracking('WidgetsApp calls setFrameworkHandlesBack only when app is ready', (WidgetTester tester) async { + testWidgets('WidgetsApp calls setFrameworkHandlesBack only when app is ready', (WidgetTester tester) async { // Start in the `resumed` state, where setFrameworkHandlesBack should be // called like normal. await setAppLifeCycleState(AppLifecycleState.resumed); diff --git a/packages/flutter/test/widgets/app_title_test.dart b/packages/flutter/test/widgets/app_title_test.dart index 1528c3c6c12..7cddafb6d56 100644 --- a/packages/flutter/test/widgets/app_title_test.dart +++ b/packages/flutter/test/widgets/app_title_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Color kTitleColor = Color(0xFF333333); const String kTitleString = 'Hello World'; @@ -31,13 +30,13 @@ Future<void> pumpApp(WidgetTester tester, { GenerateAppTitle? onGenerateTitle, C } void main() { - testWidgetsWithLeakTracking('Specified title and color are used to build a Title', (WidgetTester tester) async { + testWidgets('Specified title and color are used to build a Title', (WidgetTester tester) async { await pumpApp(tester); expect(tester.widget<Title>(find.byType(Title)).title, kTitleString); expect(tester.widget<Title>(find.byType(Title)).color, kTitleColor); }); - testWidgetsWithLeakTracking('Specified color is made opaque for Title', (WidgetTester tester) async { + testWidgets('Specified color is made opaque for Title', (WidgetTester tester) async { // The Title widget can only handle fully opaque colors, the WidgetApp should // ensure it only uses a fully opaque version of its color for the title. const Color transparentBlue = Color(0xDD0000ff); @@ -46,7 +45,7 @@ void main() { expect(tester.widget<Title>(find.byType(Title)).color, opaqueBlue); }); - testWidgetsWithLeakTracking('onGenerateTitle handles changing locales', (WidgetTester tester) async { + testWidgets('onGenerateTitle handles changing locales', (WidgetTester tester) async { String generateTitle(BuildContext context) { return Localizations.localeOf(context).toString(); } diff --git a/packages/flutter/test/widgets/aspect_ratio_test.dart b/packages/flutter/test/widgets/aspect_ratio_test.dart index f480fa37cee..b103f381cf9 100644 --- a/packages/flutter/test/widgets/aspect_ratio_test.dart +++ b/packages/flutter/test/widgets/aspect_ratio_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Future<Size> _getSize(WidgetTester tester, BoxConstraints constraints, double aspectRatio) async { final Key childKey = UniqueKey(); @@ -26,12 +25,12 @@ Future<Size> _getSize(WidgetTester tester, BoxConstraints constraints, double as } void main() { - testWidgetsWithLeakTracking('Aspect ratio control test', (WidgetTester tester) async { + testWidgets('Aspect ratio control test', (WidgetTester tester) async { expect(await _getSize(tester, BoxConstraints.loose(const Size(500.0, 500.0)), 2.0), equals(const Size(500.0, 250.0))); expect(await _getSize(tester, BoxConstraints.loose(const Size(500.0, 500.0)), 0.5), equals(const Size(250.0, 500.0))); }); - testWidgetsWithLeakTracking('Aspect ratio infinite width', (WidgetTester tester) async { + testWidgets('Aspect ratio infinite width', (WidgetTester tester) async { final Key childKey = UniqueKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/async_test.dart b/packages/flutter/test/widgets/async_test.dart index c3eb815cc00..9c685412061 100644 --- a/packages/flutter/test/widgets/async_test.dart +++ b/packages/flutter/test/widgets/async_test.dart @@ -7,7 +7,6 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { Widget snapshotText(BuildContext context, AsyncSnapshot<String> snapshot) { @@ -67,21 +66,21 @@ void main() { }); }); group('Async smoke tests', () { - testWidgetsWithLeakTracking('FutureBuilder', (WidgetTester tester) async { + testWidgets('FutureBuilder', (WidgetTester tester) async { await tester.pumpWidget(FutureBuilder<String>( future: Future<String>.value('hello'), builder: snapshotText, )); await eventFiring(tester); }); - testWidgetsWithLeakTracking('StreamBuilder', (WidgetTester tester) async { + testWidgets('StreamBuilder', (WidgetTester tester) async { await tester.pumpWidget(StreamBuilder<String>( stream: Stream<String>.fromIterable(<String>['hello', 'world']), builder: snapshotText, )); await eventFiring(tester); }); - testWidgetsWithLeakTracking('StreamFold', (WidgetTester tester) async { + testWidgets('StreamFold', (WidgetTester tester) async { await tester.pumpWidget(StringCollector( stream: Stream<String>.fromIterable(<String>['hello', 'world']), )); @@ -89,7 +88,7 @@ void main() { }); }); group('FutureBuilder', () { - testWidgetsWithLeakTracking('gives expected snapshot with SynchronousFuture', (WidgetTester tester) async { + testWidgets('gives expected snapshot with SynchronousFuture', (WidgetTester tester) async { final SynchronousFuture<String> future = SynchronousFuture<String>('flutter'); await tester.pumpWidget(FutureBuilder<String>( future: future, @@ -103,7 +102,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('gracefully handles transition from null future', (WidgetTester tester) async { + testWidgets('gracefully handles transition from null future', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(FutureBuilder<String>( key: key, builder: snapshotText, future: null, @@ -115,7 +114,7 @@ void main() { )); expect(find.text('AsyncSnapshot<String>(ConnectionState.waiting, null, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('gracefully handles transition to null future', (WidgetTester tester) async { + testWidgets('gracefully handles transition to null future', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final Completer<String> completer = Completer<String>(); await tester.pumpWidget(FutureBuilder<String>( @@ -130,7 +129,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.none, null, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('gracefully handles transition to other future', (WidgetTester tester) async { + testWidgets('gracefully handles transition to other future', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final Completer<String> completerA = Completer<String>(); final Completer<String> completerB = Completer<String>(); @@ -147,7 +146,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, B, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('tracks life-cycle of Future to success', (WidgetTester tester) async { + testWidgets('tracks life-cycle of Future to success', (WidgetTester tester) async { final Completer<String> completer = Completer<String>(); await tester.pumpWidget(FutureBuilder<String>( future: completer.future, builder: snapshotText, @@ -157,7 +156,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, hello, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('tracks life-cycle of Future to error', (WidgetTester tester) async { + testWidgets('tracks life-cycle of Future to error', (WidgetTester tester) async { final Completer<String> completer = Completer<String>(); await tester.pumpWidget(FutureBuilder<String>( future: completer.future, builder: snapshotText, @@ -167,7 +166,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, null, bad, trace)'), findsOneWidget); }); - testWidgetsWithLeakTracking('runs the builder using given initial data', (WidgetTester tester) async { + testWidgets('runs the builder using given initial data', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(FutureBuilder<String>( key: key, @@ -177,7 +176,7 @@ void main() { )); expect(find.text('AsyncSnapshot<String>(ConnectionState.none, I, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('ignores initialData when reconfiguring', (WidgetTester tester) async { + testWidgets('ignores initialData when reconfiguring', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(FutureBuilder<String>( key: key, @@ -195,7 +194,7 @@ void main() { )); expect(find.text('AsyncSnapshot<String>(ConnectionState.waiting, I, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('debugRethrowError rethrows caught error', (WidgetTester tester) async { + testWidgets('debugRethrowError rethrows caught error', (WidgetTester tester) async { FutureBuilder.debugRethrowError = true; final Completer<void> caughtError = Completer<void>(); await runZonedGuarded(() async { @@ -215,7 +214,7 @@ void main() { }); }); group('StreamBuilder', () { - testWidgetsWithLeakTracking('gracefully handles transition from null stream', (WidgetTester tester) async { + testWidgets('gracefully handles transition from null stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(StreamBuilder<String>( key: key, builder: snapshotText, stream: null, @@ -227,7 +226,7 @@ void main() { )); expect(find.text('AsyncSnapshot<String>(ConnectionState.waiting, null, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('gracefully handles transition to null stream', (WidgetTester tester) async { + testWidgets('gracefully handles transition to null stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final StreamController<String> controller = StreamController<String>(); await tester.pumpWidget(StreamBuilder<String>( @@ -239,7 +238,7 @@ void main() { )); expect(find.text('AsyncSnapshot<String>(ConnectionState.none, null, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('gracefully handles transition to other stream', (WidgetTester tester) async { + testWidgets('gracefully handles transition to other stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final StreamController<String> controllerA = StreamController<String>(); final StreamController<String> controllerB = StreamController<String>(); @@ -255,7 +254,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.active, B, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('tracks events and errors of stream until completion', (WidgetTester tester) async { + testWidgets('tracks events and errors of stream until completion', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final StreamController<String> controller = StreamController<String>(); await tester.pumpWidget(StreamBuilder<String>( @@ -275,7 +274,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, 4, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('runs the builder using given initial data', (WidgetTester tester) async { + testWidgets('runs the builder using given initial data', (WidgetTester tester) async { final StreamController<String> controller = StreamController<String>(); await tester.pumpWidget(StreamBuilder<String>( stream: controller.stream, @@ -284,7 +283,7 @@ void main() { )); expect(find.text('AsyncSnapshot<String>(ConnectionState.waiting, I, null, null)'), findsOneWidget); }); - testWidgetsWithLeakTracking('ignores initialData when reconfiguring', (WidgetTester tester) async { + testWidgets('ignores initialData when reconfiguring', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(StreamBuilder<String>( key: key, @@ -304,7 +303,7 @@ void main() { }); }); group('FutureBuilder and StreamBuilder behave identically on Stream from Future', () { - testWidgetsWithLeakTracking('when completing with data', (WidgetTester tester) async { + testWidgets('when completing with data', (WidgetTester tester) async { final Completer<String> completer = Completer<String>(); await tester.pumpWidget(Column(children: <Widget>[ FutureBuilder<String>(future: completer.future, builder: snapshotText), @@ -315,7 +314,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, hello, null, null)'), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('when completing with error and with empty stack trace', (WidgetTester tester) async { + testWidgets('when completing with error and with empty stack trace', (WidgetTester tester) async { final Completer<String> completer = Completer<String>(); await tester.pumpWidget(Column(children: <Widget>[ FutureBuilder<String>(future: completer.future, builder: snapshotText), @@ -326,7 +325,7 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, null, bad, )'), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('when completing with error and with stack trace', (WidgetTester tester) async { + testWidgets('when completing with error and with stack trace', (WidgetTester tester) async { final Completer<String> completer = Completer<String>(); await tester.pumpWidget(Column(children: <Widget>[ FutureBuilder<String>(future: completer.future, builder: snapshotText), @@ -337,21 +336,21 @@ void main() { await eventFiring(tester); expect(find.text('AsyncSnapshot<String>(ConnectionState.done, null, bad, trace)'), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('when Future is null', (WidgetTester tester) async { + testWidgets('when Future is null', (WidgetTester tester) async { await tester.pumpWidget(Column(children: <Widget>[ FutureBuilder<String>(builder: snapshotText, future: null), StreamBuilder<String>(builder: snapshotText, stream: null,), ])); expect(find.text('AsyncSnapshot<String>(ConnectionState.none, null, null, null)'), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('when initialData is used with null Future and Stream', (WidgetTester tester) async { + testWidgets('when initialData is used with null Future and Stream', (WidgetTester tester) async { await tester.pumpWidget(Column(children: <Widget>[ FutureBuilder<String>(builder: snapshotText, initialData: 'I', future: null), StreamBuilder<String>(builder: snapshotText, initialData: 'I', stream: null), ])); expect(find.text('AsyncSnapshot<String>(ConnectionState.none, I, null, null)'), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('when using initialData and completing with data', (WidgetTester tester) async { + testWidgets('when using initialData and completing with data', (WidgetTester tester) async { final Completer<String> completer = Completer<String>(); await tester.pumpWidget(Column(children: <Widget>[ FutureBuilder<String>(future: completer.future, builder: snapshotText, initialData: 'I'), @@ -364,7 +363,7 @@ void main() { }); }); group('StreamBuilderBase', () { - testWidgetsWithLeakTracking('gracefully handles transition from null stream', (WidgetTester tester) async { + testWidgets('gracefully handles transition from null stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(StringCollector(key: key)); expect(find.text(''), findsOneWidget); @@ -372,7 +371,7 @@ void main() { await tester.pumpWidget(StringCollector(key: key, stream: controller.stream)); expect(find.text('conn'), findsOneWidget); }); - testWidgetsWithLeakTracking('gracefully handles transition to null stream', (WidgetTester tester) async { + testWidgets('gracefully handles transition to null stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final StreamController<String> controller = StreamController<String>(); await tester.pumpWidget(StringCollector(key: key, stream: controller.stream)); @@ -380,7 +379,7 @@ void main() { await tester.pumpWidget(StringCollector(key: key)); expect(find.text('conn, disc'), findsOneWidget); }); - testWidgetsWithLeakTracking('gracefully handles transition to other stream', (WidgetTester tester) async { + testWidgets('gracefully handles transition to other stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final StreamController<String> controllerA = StreamController<String>(); final StreamController<String> controllerB = StreamController<String>(); @@ -391,7 +390,7 @@ void main() { await eventFiring(tester); expect(find.text('conn, disc, conn, data:B'), findsOneWidget); }); - testWidgetsWithLeakTracking('tracks events and errors until completion', (WidgetTester tester) async { + testWidgets('tracks events and errors until completion', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final StreamController<String> controller = StreamController<String>(); await tester.pumpWidget(StringCollector(key: key, stream: controller.stream)); diff --git a/packages/flutter/test/widgets/autocomplete_test.dart b/packages/flutter/test/widgets/autocomplete_test.dart index adcac083052..cf83d5abc4a 100644 --- a/packages/flutter/test/widgets/autocomplete_test.dart +++ b/packages/flutter/test/widgets/autocomplete_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class User { const User({ @@ -46,7 +45,7 @@ void main() { User(name: 'Charlie', email: 'charlie123@gmail.com'), ]; - testWidgetsWithLeakTracking('can filter and select a list of string options', (WidgetTester tester) async { + testWidgets('can filter and select a list of string options', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -130,7 +129,7 @@ void main() { expect(lastOptions.elementAt(5), 'northern white rhinoceros'); }); - testWidgetsWithLeakTracking('tapping on an option selects it', (WidgetTester tester) async { + testWidgets('tapping on an option selects it', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -200,7 +199,7 @@ void main() { expect(textEditingController.text, equals(kOptions[2])); }); - testWidgetsWithLeakTracking('can filter and select a list of custom User options', (WidgetTester tester) async { + testWidgets('can filter and select a list of custom User options', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<User> lastOptions; @@ -278,7 +277,7 @@ void main() { expect(lastOptions.elementAt(0), kOptionsUsers[1]); }); - testWidgetsWithLeakTracking('can specify a custom display string for a list of custom User options', (WidgetTester tester) async { + testWidgets('can specify a custom display string for a list of custom User options', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<User> lastOptions; @@ -361,7 +360,7 @@ void main() { expect(lastOptions.elementAt(0), kOptionsUsers[1]); }); - testWidgetsWithLeakTracking('onFieldSubmitted selects the first option', (WidgetTester tester) async { + testWidgets('onFieldSubmitted selects the first option', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -423,7 +422,7 @@ void main() { }); group('optionsViewOpenDirection', () { - testWidgetsWithLeakTracking('unset (default behavior): open downward', (WidgetTester tester) async { + testWidgets('unset (default behavior): open downward', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -446,7 +445,7 @@ void main() { offsetMoreOrLessEquals(tester.getTopLeft(find.text('a')))); }); - testWidgetsWithLeakTracking('down: open downward', (WidgetTester tester) async { + testWidgets('down: open downward', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -470,7 +469,7 @@ void main() { offsetMoreOrLessEquals(tester.getTopLeft(find.text('a')))); }); - testWidgetsWithLeakTracking('up: open upward', (WidgetTester tester) async { + testWidgets('up: open upward', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -495,7 +494,7 @@ void main() { }); group('fieldViewBuilder not passed', () { - testWidgetsWithLeakTracking('down', (WidgetTester tester) async { + testWidgets('down', (WidgetTester tester) async { final GlobalKey autocompleteKey = GlobalKey(); final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -528,7 +527,7 @@ void main() { offsetMoreOrLessEquals(tester.getTopLeft(find.text('a')))); }); - testWidgetsWithLeakTracking('up', (WidgetTester tester) async { + testWidgets('up', (WidgetTester tester) async { final GlobalKey autocompleteKey = GlobalKey(); final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -564,7 +563,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('options follow field when it moves', (WidgetTester tester) async { + testWidgets('options follow field when it moves', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late StateSetter setState; @@ -638,7 +637,7 @@ void main() { expect(optionsOffsetOpen.dy, fieldOffset.dy + fieldSize.height); }); - testWidgetsWithLeakTracking('can prevent options from showing by returning an empty iterable', (WidgetTester tester) async { + testWidgets('can prevent options from showing by returning an empty iterable', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -701,7 +700,7 @@ void main() { expect(lastOptions.elementAt(1), 'elephant'); }); - testWidgetsWithLeakTracking('can create a field outside of fieldViewBuilder', (WidgetTester tester) async { + testWidgets('can create a field outside of fieldViewBuilder', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); final GlobalKey autocompleteKey = GlobalKey(); @@ -769,7 +768,7 @@ void main() { expect(textEditingController.text, lastOptions.elementAt(0)); }); - testWidgetsWithLeakTracking('initialValue sets initial text field value', (WidgetTester tester) async { + testWidgets('initialValue sets initial text field value', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -829,7 +828,7 @@ void main() { expect(textEditingController.text, selection); }); - testWidgetsWithLeakTracking('initialValue cannot be defined if TextEditingController is defined', (WidgetTester tester) async { + testWidgets('initialValue cannot be defined if TextEditingController is defined', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final TextEditingController textEditingController = TextEditingController(); @@ -863,7 +862,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('support asynchronous options builder', (WidgetTester tester) async { + testWidgets('support asynchronous options builder', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late FocusNode focusNode; @@ -924,7 +923,7 @@ void main() { expect(lastOptions, <String>['dingo', 'flamingo']); }); - testWidgetsWithLeakTracking('can navigate options with the keyboard', (WidgetTester tester) async { + testWidgets('can navigate options with the keyboard', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -1010,7 +1009,7 @@ void main() { expect(textEditingController.text, 'goose'); }); - testWidgetsWithLeakTracking('can hide and show options with the keyboard', (WidgetTester tester) async { + testWidgets('can hide and show options with the keyboard', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -1100,7 +1099,7 @@ void main() { expect(find.byKey(optionsKey), findsNothing); }); - testWidgetsWithLeakTracking('re-invokes DismissIntent if options not shown', (WidgetTester tester) async { + testWidgets('re-invokes DismissIntent if options not shown', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late FocusNode focusNode; @@ -1159,7 +1158,7 @@ void main() { expect(wrappingActionInvoked, true); }); - testWidgetsWithLeakTracking('optionsViewBuilders can use AutocompleteHighlightedOption to highlight selected option', (WidgetTester tester) async { + testWidgets('optionsViewBuilders can use AutocompleteHighlightedOption to highlight selected option', (WidgetTester tester) async { final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); late Iterable<String> lastOptions; @@ -1240,7 +1239,7 @@ void main() { expect(lastHighlighted, 5); }); - testWidgetsWithLeakTracking('floating menu goes away on select', (WidgetTester tester) async { + testWidgets('floating menu goes away on select', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/99749. final GlobalKey fieldKey = GlobalKey(); final GlobalKey optionsKey = GlobalKey(); diff --git a/packages/flutter/test/widgets/autofill_group_test.dart b/packages/flutter/test/widgets/autofill_group_test.dart index 3ac6b860744..9721fca8a58 100644 --- a/packages/flutter/test/widgets/autofill_group_test.dart +++ b/packages/flutter/test/widgets/autofill_group_test.dart @@ -4,13 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; final Matcher _matchesCommit = isMethodCall('TextInput.finishAutofillContext', arguments: true); final Matcher _matchesCancel = isMethodCall('TextInput.finishAutofillContext', arguments: false); void main() { - testWidgetsWithLeakTracking('AutofillGroup has the right clients', (WidgetTester tester) async { + testWidgets('AutofillGroup has the right clients', (WidgetTester tester) async { const Key outerKey = Key('outer'); const Key innerKey = Key('inner'); @@ -45,7 +44,7 @@ void main() { expect(innerState.autofillClients.toList(), <State<TextField>>[clientState2]); }); - testWidgetsWithLeakTracking('new clients can be added & removed to a scope', (WidgetTester tester) async { + testWidgets('new clients can be added & removed to a scope', (WidgetTester tester) async { const Key scopeKey = Key('scope'); const TextField client1 = TextField(autofillHints: <String>['1']); @@ -93,7 +92,7 @@ void main() { expect(scopeState.autofillClients, <State<TextField>>[clientState1]); }); - testWidgetsWithLeakTracking('AutofillGroup has the right clients after reparenting', (WidgetTester tester) async { + testWidgets('AutofillGroup has the right clients after reparenting', (WidgetTester tester) async { const Key outerKey = Key('outer'); const Key innerKey = Key('inner'); final GlobalKey keyClient3 = GlobalKey(); @@ -152,7 +151,7 @@ void main() { expect(innerState.autofillClients, <State<TextField>>[clientState2]); }); - testWidgetsWithLeakTracking('disposing AutofillGroups', (WidgetTester tester) async { + testWidgets('disposing AutofillGroups', (WidgetTester tester) async { late StateSetter setState; const Key group1 = Key('group1'); const Key group2 = Key('group2'); diff --git a/packages/flutter/test/widgets/automatic_keep_alive_test.dart b/packages/flutter/test/widgets/automatic_keep_alive_test.dart index 089a827d02d..35b9375f279 100644 --- a/packages/flutter/test/widgets/automatic_keep_alive_test.dart +++ b/packages/flutter/test/widgets/automatic_keep_alive_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Leaf extends StatefulWidget { const Leaf({ required Key key, required this.child }) : super(key: key); @@ -68,7 +67,7 @@ List<Widget> generateList(Widget child, { required bool impliedMode }) { } void tests({ required bool impliedMode }) { - testWidgetsWithLeakTracking('AutomaticKeepAlive with ListView with itemExtent', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive with ListView with itemExtent', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -116,7 +115,7 @@ void tests({ required bool impliedMode }) { expect(find.byKey(const GlobalObjectKey<_LeafState>(90), skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive with ListView without itemExtent', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive with ListView without itemExtent', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -166,7 +165,7 @@ void tests({ required bool impliedMode }) { expect(find.byKey(const GlobalObjectKey<_LeafState>(90), skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive with GridView', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive with GridView', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -223,7 +222,7 @@ void main() { group('Explicit automatic keep-alive', () { tests(impliedMode: false); }); group('Implied automatic keep-alive', () { tests(impliedMode: true); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive double', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive double', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -307,7 +306,7 @@ void main() { expect(find.byKey(const GlobalObjectKey<_LeafState>(3)), findsOneWidget); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive double 2', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive double 2', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -475,7 +474,7 @@ void main() { expect(find.byKey(const GlobalObjectKey<_LeafState>(0), skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive with keepAlive set to true before initState', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive with keepAlive set to true before initState', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: ListView.builder( @@ -510,7 +509,7 @@ void main() { expect(find.text('FooBar 2'), findsNothing); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive with keepAlive set to true before initState and widget goes out of scope', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive with keepAlive set to true before initState and widget goes out of scope', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: ListView.builder( @@ -549,7 +548,7 @@ void main() { expect(find.text('FooBar 73'), findsOneWidget); }); - testWidgetsWithLeakTracking('AutomaticKeepAlive with SliverKeepAliveWidget', (WidgetTester tester) async { + testWidgets('AutomaticKeepAlive with SliverKeepAliveWidget', (WidgetTester tester) async { // We're just doing a basic test here to make sure that the functionality of // RenderSliverWithKeepAliveMixin doesn't get regressed or deleted. As testing // the full functionality would be cumbersome. @@ -562,7 +561,7 @@ void main() { expect(alternate.children.length, 1); }); - testWidgetsWithLeakTracking('Keep alive Listenable has its listener removed once called', (WidgetTester tester) async { + testWidgets('Keep alive Listenable has its listener removed once called', (WidgetTester tester) async { final LeakCheckerHandle handle = LeakCheckerHandle(); addTearDown(handle.dispose); await tester.pumpWidget(Directionality( diff --git a/packages/flutter/test/widgets/backdrop_filter_test.dart b/packages/flutter/test/widgets/backdrop_filter_test.dart index 9fc7e9cb4f3..a112fe9e666 100644 --- a/packages/flutter/test/widgets/backdrop_filter_test.dart +++ b/packages/flutter/test/widgets/backdrop_filter_test.dart @@ -11,10 +11,9 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking("Material2 - BackdropFilter's cull rect does not shrink", (WidgetTester tester) async { + testWidgets("Material2 - BackdropFilter's cull rect does not shrink", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -52,7 +51,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("Material3 - BackdropFilter's cull rect does not shrink", (WidgetTester tester) async { + testWidgets("Material3 - BackdropFilter's cull rect does not shrink", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), @@ -90,7 +89,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material2 - BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { + testWidgets('Material2 - BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -149,7 +148,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { + testWidgets('Material3 - BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: true), diff --git a/packages/flutter/test/widgets/banner_test.dart b/packages/flutter/test/widgets/banner_test.dart index c1a75656a31..405c7b96424 100644 --- a/packages/flutter/test/widgets/banner_test.dart +++ b/packages/flutter/test/widgets/banner_test.dart @@ -246,7 +246,7 @@ void main() { expect(rotateCommand.positionalArguments[0], equals(math.pi / 4.0)); }); - testWidgetsWithLeakTracking('Banner widget', (WidgetTester tester) async { + testWidgets('Banner widget', (WidgetTester tester) async { debugDisableShadows = false; await tester.pumpWidget( const Directionality( @@ -266,7 +266,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('Banner widget in MaterialApp', (WidgetTester tester) async { + testWidgets('Banner widget in MaterialApp', (WidgetTester tester) async { debugDisableShadows = false; await tester.pumpWidget(const MaterialApp(home: Placeholder())); expect(find.byType(CheckedModeBanner), paints diff --git a/packages/flutter/test/widgets/baseline_test.dart b/packages/flutter/test/widgets/baseline_test.dart index 912f6391633..707707fdc8f 100644 --- a/packages/flutter/test/widgets/baseline_test.dart +++ b/packages/flutter/test/widgets/baseline_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Baseline - control test', (WidgetTester tester) async { + testWidgets('Baseline - control test', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: DefaultTextStyle( @@ -21,7 +20,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.text('X')).size, const Size(100.0, 100.0)); }); - testWidgetsWithLeakTracking('Baseline - position test', (WidgetTester tester) async { + testWidgets('Baseline - position test', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: Baseline( @@ -44,7 +43,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Chip caches baseline', (WidgetTester tester) async { + testWidgets('Chip caches baseline', (WidgetTester tester) async { int calls = 0; await tester.pumpWidget( MaterialApp( @@ -69,7 +68,7 @@ void main() { expect(calls, 2); }); - testWidgetsWithLeakTracking('ListTile caches baseline', (WidgetTester tester) async { + testWidgets('ListTile caches baseline', (WidgetTester tester) async { int calls = 0; await tester.pumpWidget( MaterialApp( @@ -94,7 +93,7 @@ void main() { expect(calls, 2); }); - testWidgetsWithLeakTracking("LayoutBuilder returns child's baseline", (WidgetTester tester) async { + testWidgets("LayoutBuilder returns child's baseline", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart index b3d97f690a7..86782c7700f 100644 --- a/packages/flutter/test/widgets/basic_test.dart +++ b/packages/flutter/test/widgets/basic_test.dart @@ -15,13 +15,12 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { group('RawImage', () { - testWidgetsWithLeakTracking('properties', (WidgetTester tester) async { + testWidgets('properties', (WidgetTester tester) async { final ui.Image image1 = (await tester.runAsync<ui.Image>(() => createTestImage()))!; await tester.pumpWidget( @@ -111,7 +110,7 @@ void main() { }); group('PhysicalShape', () { - testWidgetsWithLeakTracking('properties', (WidgetTester tester) async { + testWidgets('properties', (WidgetTester tester) async { await tester.pumpWidget( const PhysicalShape( clipper: ShapeBorderClipper(shape: CircleBorder()), @@ -127,7 +126,7 @@ void main() { expect(renderObject.elevation, 2.0); }); - testWidgetsWithLeakTracking('hit test', (WidgetTester tester) async { + testWidgets('hit test', (WidgetTester tester) async { await tester.pumpWidget( PhysicalShape( clipper: const ShapeBorderClipper(shape: CircleBorder()), @@ -157,7 +156,7 @@ void main() { }); group('FractionalTranslation', () { - testWidgetsWithLeakTracking('hit test - entirely inside the bounding box', (WidgetTester tester) async { + testWidgets('hit test - entirely inside the bounding box', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); bool pointerDown = false; @@ -186,7 +185,7 @@ void main() { expect(pointerDown, isTrue); }); - testWidgetsWithLeakTracking('hit test - partially inside the bounding box', (WidgetTester tester) async { + testWidgets('hit test - partially inside the bounding box', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); bool pointerDown = false; @@ -215,7 +214,7 @@ void main() { expect(pointerDown, isTrue); }); - testWidgetsWithLeakTracking('hit test - completely outside the bounding box', (WidgetTester tester) async { + testWidgets('hit test - completely outside the bounding box', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); bool pointerDown = false; @@ -244,7 +243,7 @@ void main() { expect(pointerDown, isTrue); }); - testWidgetsWithLeakTracking('semantics bounds are updated', (WidgetTester tester) async { + testWidgets('semantics bounds are updated', (WidgetTester tester) async { final GlobalKey fractionalTranslationKey = GlobalKey(); final GlobalKey textKey = GlobalKey(); Offset offset = const Offset(0.4, 0.4); @@ -308,7 +307,7 @@ void main() { }); group('Semantics', () { - testWidgetsWithLeakTracking('Semantics can set attributed Text', (WidgetTester tester) async { + testWidgets('Semantics can set attributed Text', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -359,7 +358,7 @@ void main() { expect(attributedHint.attributes[0].range, const TextRange(start:1, end: 2)); }); - testWidgetsWithLeakTracking('Semantics can merge attributed strings', (WidgetTester tester) async { + testWidgets('Semantics can merge attributed strings', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -414,7 +413,7 @@ void main() { expect(attributedHint.attributes[1].range, const TextRange(start:6, end: 7)); }); - testWidgetsWithLeakTracking('Semantics can merge attributed strings with non attributed string', (WidgetTester tester) async { + testWidgets('Semantics can merge attributed strings with non attributed string', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -454,7 +453,7 @@ void main() { }); group('Row', () { - testWidgetsWithLeakTracking('multiple baseline aligned children', (WidgetTester tester) async { + testWidgets('multiple baseline aligned children', (WidgetTester tester) async { final UniqueKey key1 = UniqueKey(); final UniqueKey key2 = UniqueKey(); // The point size of the font must be a multiple of 4 until @@ -508,7 +507,7 @@ void main() { expect(tester.getTopLeft(find.byKey(key2)).dy, aboveBaseline1 - aboveBaseline2); }); - testWidgetsWithLeakTracking('baseline aligned children account for a larger, no-baseline child size', (WidgetTester tester) async { + testWidgets('baseline aligned children account for a larger, no-baseline child size', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/58898 final UniqueKey key1 = UniqueKey(); final UniqueKey key2 = UniqueKey(); @@ -576,7 +575,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('UnconstrainedBox can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('UnconstrainedBox can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(const UnconstrainedBox()); final RenderConstraintsTransformBox renderObject = tester.allRenderObjects.whereType<RenderConstraintsTransformBox>().first; expect(renderObject.clipBehavior, equals(Clip.none)); @@ -585,7 +584,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('UnconstrainedBox warns only when clipBehavior is Clip.none', (WidgetTester tester) async { + testWidgets('UnconstrainedBox warns only when clipBehavior is Clip.none', (WidgetTester tester) async { for (final Clip? clip in <Clip?>[null, ...Clip.values]) { // Clear any render objects that were there before so that we can see more // than one error. Otherwise, it just throws the first one and skips the @@ -661,7 +660,7 @@ void main() { mockCanvas = mockContext.canvas; }); - testWidgetsWithLeakTracking('ColoredBox - no size, no child', (WidgetTester tester) async { + testWidgets('ColoredBox - no size, no child', (WidgetTester tester) async { await tester.pumpWidget(const Flex( direction: Axis.horizontal, textDirection: TextDirection.ltr, @@ -682,7 +681,7 @@ void main() { expect(mockContext.offsets, isEmpty); }); - testWidgetsWithLeakTracking('ColoredBox - no size, child', (WidgetTester tester) async { + testWidgets('ColoredBox - no size, child', (WidgetTester tester) async { const ValueKey<int> key = ValueKey<int>(0); const Widget child = SizedBox.expand(key: key); await tester.pumpWidget(const Flex( @@ -706,7 +705,7 @@ void main() { expect(mockContext.offsets.single, Offset.zero); }); - testWidgetsWithLeakTracking('ColoredBox - size, no child', (WidgetTester tester) async { + testWidgets('ColoredBox - size, no child', (WidgetTester tester) async { await tester.pumpWidget(const ColoredBox(color: colorToPaint)); expect(find.byType(ColoredBox), findsOneWidget); final RenderObject renderColoredBox = tester.renderObject(find.byType(ColoredBox)); @@ -719,7 +718,7 @@ void main() { expect(mockContext.offsets, isEmpty); }); - testWidgetsWithLeakTracking('ColoredBox - size, child', (WidgetTester tester) async { + testWidgets('ColoredBox - size, child', (WidgetTester tester) async { const ValueKey<int> key = ValueKey<int>(0); const Widget child = SizedBox.expand(key: key); await tester.pumpWidget(const ColoredBox(color: colorToPaint, child: child)); @@ -735,7 +734,7 @@ void main() { expect(mockContext.offsets.single, Offset.zero); }); - testWidgetsWithLeakTracking('ColoredBox - debugFillProperties', (WidgetTester tester) async { + testWidgets('ColoredBox - debugFillProperties', (WidgetTester tester) async { const ColoredBox box = ColoredBox(color: colorToPaint); final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder(); box.debugFillProperties(properties); @@ -743,7 +742,7 @@ void main() { expect(properties.properties.first.value, colorToPaint); }); }); - testWidgetsWithLeakTracking('Inconsequential golden test', (WidgetTester tester) async { + testWidgets('Inconsequential golden test', (WidgetTester tester) async { // The test validates the Flutter Gold integration. Any changes to the // golden file can be approved at any time. await tester.pumpWidget(RepaintBoundary( @@ -759,7 +758,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('IgnorePointer ignores pointers', (WidgetTester tester) async { + testWidgets('IgnorePointer ignores pointers', (WidgetTester tester) async { final List<String> logs = <String>[]; Widget target({required bool ignoring}) => Align( alignment: Alignment.topLeft, @@ -837,7 +836,7 @@ void main() { }); group('IgnorePointer semantics', () { - testWidgetsWithLeakTracking('does not change semantics when not ignoring', (WidgetTester tester) async { + testWidgets('does not change semantics when not ignoring', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -864,7 +863,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('can toggle the ignoring.', (WidgetTester tester) async { + testWidgets('can toggle the ignoring.', (WidgetTester tester) async { final UniqueKey key1 = UniqueKey(); final UniqueKey key2 = UniqueKey(); final UniqueKey key3 = UniqueKey(); @@ -983,7 +982,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('drops semantics when its ignoringSemantics is true', (WidgetTester tester) async { + testWidgets('drops semantics when its ignoringSemantics is true', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final UniqueKey key = UniqueKey(); await tester.pumpWidget( @@ -1002,7 +1001,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ignores user interactions', (WidgetTester tester) async { + testWidgets('ignores user interactions', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1029,7 +1028,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('AbsorbPointer absorbs pointers', (WidgetTester tester) async { + testWidgets('AbsorbPointer absorbs pointers', (WidgetTester tester) async { final List<String> logs = <String>[]; Widget target({required bool absorbing}) => Align( alignment: Alignment.topLeft, @@ -1106,7 +1105,7 @@ void main() { logs.clear(); }); - testWidgetsWithLeakTracking('Wrap implements debugFillProperties', (WidgetTester tester) async { + testWidgets('Wrap implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Wrap( spacing: 8.0, // gap between adjacent Text widget @@ -1137,7 +1136,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('Row and IgnoreBaseline (control -- with baseline)', (WidgetTester tester) async { + testWidgets('Row and IgnoreBaseline (control -- with baseline)', (WidgetTester tester) async { await tester.pumpWidget( const Row( crossAxisAlignment: CrossAxisAlignment.baseline, @@ -1164,7 +1163,7 @@ void main() { expect(bPos.dy, 96.0 - 24.0); }); - testWidgetsWithLeakTracking('Row and IgnoreBaseline (with ignored baseline)', (WidgetTester tester) async { + testWidgets('Row and IgnoreBaseline (with ignored baseline)', (WidgetTester tester) async { await tester.pumpWidget( const Row( crossAxisAlignment: CrossAxisAlignment.baseline, diff --git a/packages/flutter/test/widgets/binding_deferred_first_frame_test.dart b/packages/flutter/test/widgets/binding_deferred_first_frame_test.dart index afac6ff2a48..dc7208c5dd1 100644 --- a/packages/flutter/test/widgets/binding_deferred_first_frame_test.dart +++ b/packages/flutter/test/widgets/binding_deferred_first_frame_test.dart @@ -8,13 +8,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const String _actualContent = 'Actual Content'; const String _loading = 'Loading...'; void main() { - testWidgetsWithLeakTracking('deferFirstFrame/allowFirstFrame stops sending frames to engine', (WidgetTester tester) async { + testWidgets('deferFirstFrame/allowFirstFrame stops sending frames to engine', (WidgetTester tester) async { expect(RendererBinding.instance.sendFramesToEngine, isTrue); final Completer<void> completer = Completer<void>(); @@ -51,7 +50,7 @@ void main() { expect(RendererBinding.instance.sendFramesToEngine, isTrue); }); - testWidgetsWithLeakTracking('Two widgets can defer frames', (WidgetTester tester) async { + testWidgets('Two widgets can defer frames', (WidgetTester tester) async { expect(RendererBinding.instance.sendFramesToEngine, isTrue); final Completer<void> completer1 = Completer<void>(); diff --git a/packages/flutter/test/widgets/binding_test.dart b/packages/flutter/test/widgets/binding_test.dart index d0ded5fb100..b42df5fe094 100644 --- a/packages/flutter/test/widgets/binding_test.dart +++ b/packages/flutter/test/widgets/binding_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class MemoryPressureObserver with WidgetsBindingObserver { bool sawMemoryPressure = false; @@ -144,7 +143,7 @@ void main() { .handlePlatformMessage('flutter/lifecycle', message, (_) { }); } - testWidgetsWithLeakTracking('Rentrant observer callbacks do not result in exceptions', (WidgetTester tester) async { + testWidgets('Rentrant observer callbacks do not result in exceptions', (WidgetTester tester) async { final RentrantObserver observer = RentrantObserver(); WidgetsBinding.instance.handleAccessibilityFeaturesChanged(); WidgetsBinding.instance.handleAppLifecycleStateChanged(AppLifecycleState.resumed); @@ -161,7 +160,7 @@ void main() { expect(observer.removeSelf(), 0); }); - testWidgetsWithLeakTracking('didHaveMemoryPressure callback', (WidgetTester tester) async { + testWidgets('didHaveMemoryPressure callback', (WidgetTester tester) async { final MemoryPressureObserver observer = MemoryPressureObserver(); WidgetsBinding.instance.addObserver(observer); final ByteData message = const JSONMessageCodec().encodeMessage(<String, dynamic>{'type': 'memoryPressure'})!; @@ -170,7 +169,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('handleLifecycleStateChanged callback', (WidgetTester tester) async { + testWidgets('handleLifecycleStateChanged callback', (WidgetTester tester) async { final AppLifecycleStateObserver observer = AppLifecycleStateObserver(); WidgetsBinding.instance.addObserver(observer); @@ -229,7 +228,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('didPushRoute callback', (WidgetTester tester) async { + testWidgets('didPushRoute callback', (WidgetTester tester) async { final PushRouteObserver observer = PushRouteObserver(); WidgetsBinding.instance.addObserver(observer); @@ -241,7 +240,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('didPushRouteInformation calls didPushRoute by default', (WidgetTester tester) async { + testWidgets('didPushRouteInformation calls didPushRoute by default', (WidgetTester tester) async { final PushRouteObserver observer = PushRouteObserver(); WidgetsBinding.instance.addObserver(observer); @@ -259,7 +258,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('didPushRouteInformation calls didPushRoute correctly when handling url', (WidgetTester tester) async { + testWidgets('didPushRouteInformation calls didPushRoute correctly when handling url', (WidgetTester tester) async { final PushRouteObserver observer = PushRouteObserver(); WidgetsBinding.instance.addObserver(observer); @@ -291,7 +290,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('didPushRouteInformation callback', (WidgetTester tester) async { + testWidgets('didPushRouteInformation callback', (WidgetTester tester) async { final PushRouteInformationObserver observer = PushRouteInformationObserver(); WidgetsBinding.instance.addObserver(observer); @@ -308,7 +307,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('didPushRouteInformation callback can handle url', (WidgetTester tester) async { + testWidgets('didPushRouteInformation callback can handle url', (WidgetTester tester) async { final PushRouteInformationObserver observer = PushRouteInformationObserver(); WidgetsBinding.instance.addObserver(observer); @@ -326,7 +325,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('didPushRouteInformation callback with null state', (WidgetTester tester) async { + testWidgets('didPushRouteInformation callback with null state', (WidgetTester tester) async { final PushRouteInformationObserver observer = PushRouteInformationObserver(); WidgetsBinding.instance.addObserver(observer); @@ -344,7 +343,7 @@ void main() { WidgetsBinding.instance.removeObserver(observer); }); - testWidgetsWithLeakTracking('Application lifecycle affects frame scheduling', (WidgetTester tester) async { + testWidgets('Application lifecycle affects frame scheduling', (WidgetTester tester) async { expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.paused); @@ -398,7 +397,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('scheduleFrameCallback error control test', (WidgetTester tester) async { + testWidgets('scheduleFrameCallback error control test', (WidgetTester tester) async { late FlutterError error; try { tester.binding.scheduleFrameCallback((Duration _) { }, rescheduling: true); @@ -430,7 +429,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('defaultStackFilter elides framework Element mounting stacks', (WidgetTester tester) async { + testWidgets('defaultStackFilter elides framework Element mounting stacks', (WidgetTester tester) async { final FlutterExceptionHandler? oldHandler = FlutterError.onError; late FlutterErrorDetails errorDetails; FlutterError.onError = (FlutterErrorDetails details) { diff --git a/packages/flutter/test/widgets/box_decoration_test.dart b/packages/flutter/test/widgets/box_decoration_test.dart index f21a9b33118..031006439d7 100644 --- a/packages/flutter/test/widgets/box_decoration_test.dart +++ b/packages/flutter/test/widgets/box_decoration_test.dart @@ -9,7 +9,6 @@ import 'dart:ui' as ui show Image; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; @@ -37,7 +36,7 @@ Future<void> main() async { AutomatedTestWidgetsFlutterBinding(); TestImageProvider.image = await decodeImageFromList(Uint8List.fromList(kTransparentImage)); - testWidgetsWithLeakTracking('DecoratedBox handles loading images', (WidgetTester tester) async { + testWidgets('DecoratedBox handles loading images', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final Completer<void> completer = Completer<void>(); await tester.pumpWidget( @@ -60,7 +59,7 @@ Future<void> main() async { expect(tester.binding.hasScheduledFrame, isFalse); }); - testWidgetsWithLeakTracking('Moving a DecoratedBox', (WidgetTester tester) async { + testWidgets('Moving a DecoratedBox', (WidgetTester tester) async { final Completer<void> completer = Completer<void>(); final Widget subtree = KeyedSubtree( key: GlobalKey(), @@ -89,7 +88,7 @@ Future<void> main() async { expect(tester.binding.hasScheduledFrame, isFalse); }); - testWidgetsWithLeakTracking('Circles can have uniform borders', (WidgetTester tester) async { + testWidgets('Circles can have uniform borders', (WidgetTester tester) async { await tester.pumpWidget( Container( padding: const EdgeInsets.all(50.0), @@ -102,7 +101,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('Bordered Container insets its child', (WidgetTester tester) async { + testWidgets('Bordered Container insets its child', (WidgetTester tester) async { const Key key = Key('outerContainer'); await tester.pumpWidget( Center( @@ -119,7 +118,7 @@ Future<void> main() async { expect(tester.getSize(find.byKey(key)), equals(const Size(45.0, 45.0))); }); - testWidgetsWithLeakTracking('BoxDecoration paints its border correctly', (WidgetTester tester) async { + testWidgets('BoxDecoration paints its border correctly', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/7672 const Key key = Key('Container with BoxDecoration'); @@ -170,7 +169,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('BoxDecoration paints its border correctly', (WidgetTester tester) async { + testWidgets('BoxDecoration paints its border correctly', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/12165 await tester.pumpWidget( Column( @@ -255,7 +254,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('Can hit test on BoxDecoration', (WidgetTester tester) async { + testWidgets('Can hit test on BoxDecoration', (WidgetTester tester) async { late List<int> itemsTapped; @@ -292,7 +291,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('Can hit test on BoxDecoration circle', (WidgetTester tester) async { + testWidgets('Can hit test on BoxDecoration circle', (WidgetTester tester) async { late List<int> itemsTapped; @@ -332,7 +331,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('Can hit test on BoxDecoration border', (WidgetTester tester) async { + testWidgets('Can hit test on BoxDecoration border', (WidgetTester tester) async { late List<int> itemsTapped; const Key key = Key('Container with BoxDecoration'); Widget buildFrame(Border border) { @@ -370,7 +369,7 @@ Future<void> main() async { expect(itemsTapped, <int>[1,1]); }); - testWidgetsWithLeakTracking('BoxDecoration not tap outside rounded angles - Top Left', (WidgetTester tester) async { + testWidgets('BoxDecoration not tap outside rounded angles - Top Left', (WidgetTester tester) async { const double height = 50.0; const double width = 50.0; const double radius = 12.3; @@ -430,7 +429,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('BoxDecoration tap inside rounded angles - Top Left', (WidgetTester tester) async { + testWidgets('BoxDecoration tap inside rounded angles - Top Left', (WidgetTester tester) async { const double height = 50.0; const double width = 50.0; const double radius = 12.3; @@ -478,7 +477,7 @@ Future<void> main() async { expect(itemsTapped, <int>[1,1,1,1]); }); - testWidgetsWithLeakTracking('BoxDecoration rounded angles other corner works', (WidgetTester tester) async { + testWidgets('BoxDecoration rounded angles other corner works', (WidgetTester tester) async { const double height = 50.0; const double width = 50.0; const double radius = 20; @@ -546,7 +545,7 @@ Future<void> main() async { expect(itemsTapped, <int>[1,1,1,1,1], reason: 'top left tapped'); }); - testWidgetsWithLeakTracking("BoxDecoration doesn't crash with BorderRadiusDirectional", (WidgetTester tester) async { + testWidgets("BoxDecoration doesn't crash with BorderRadiusDirectional", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/88039 await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/build_context_test.dart b/packages/flutter/test/widgets/build_context_test.dart index b24833f5c9f..fd52b941fa7 100644 --- a/packages/flutter/test/widgets/build_context_test.dart +++ b/packages/flutter/test/widgets/build_context_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('StatefulWidget BuildContext.mounted', (WidgetTester tester) async { + testWidgets('StatefulWidget BuildContext.mounted', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget(TestStatefulWidget( onBuild: (BuildContext context) { @@ -19,7 +18,7 @@ void main() { expect(capturedContext.mounted, isFalse); }); - testWidgetsWithLeakTracking('StatelessWidget BuildContext.mounted', (WidgetTester tester) async { + testWidgets('StatelessWidget BuildContext.mounted', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget(TestStatelessWidget( onBuild: (BuildContext context) { diff --git a/packages/flutter/test/widgets/build_scope_test.dart b/packages/flutter/test/widgets/build_scope_test.dart index 8cb0802da9d..8fb7a786c31 100644 --- a/packages/flutter/test/widgets/build_scope_test.dart +++ b/packages/flutter/test/widgets/build_scope_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; @@ -134,7 +133,7 @@ class Wrapper extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('Legal times for setState', (WidgetTester tester) async { + testWidgets('Legal times for setState', (WidgetTester tester) async { final GlobalKey flipKey = GlobalKey(); expect(ProbeWidgetState.buildCount, equals(0)); await tester.pumpWidget(const ProbeWidget(key: Key('a'))); @@ -172,7 +171,7 @@ void main() { expect(tester.takeException(), isNotNull); }); - testWidgetsWithLeakTracking('Dirty element list sort order', (WidgetTester tester) async { + testWidgets('Dirty element list sort order', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: 'key1'); final GlobalKey key2 = GlobalKey(debugLabel: 'key2'); diff --git a/packages/flutter/test/widgets/center_test.dart b/packages/flutter/test/widgets/center_test.dart index 6cdb8d504ee..5d32e3deb46 100644 --- a/packages/flutter/test/widgets/center_test.dart +++ b/packages/flutter/test/widgets/center_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can be placed in an infinite box', (WidgetTester tester) async { + testWidgets('Can be placed in an infinite box', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/clamp_overscrolls_test.dart b/packages/flutter/test/widgets/clamp_overscrolls_test.dart index f12862be852..f322eb0ab48 100644 --- a/packages/flutter/test/widgets/clamp_overscrolls_test.dart +++ b/packages/flutter/test/widgets/clamp_overscrolls_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // Assuming that the test container is 800x600. The height of the // viewport's contents is 650.0, the top and bottom text children @@ -33,7 +32,7 @@ Widget buildFrame(ScrollPhysics physics, { ScrollController? scrollController }) } void main() { - testWidgetsWithLeakTracking('ClampingScrollPhysics', (WidgetTester tester) async { + testWidgets('ClampingScrollPhysics', (WidgetTester tester) async { // Scroll the target text widget by offset and then return its origin // in global coordinates. @@ -60,7 +59,7 @@ void main() { expect(origin.dy, equals(500.0)); }); - testWidgetsWithLeakTracking('ClampingScrollPhysics affects ScrollPosition', (WidgetTester tester) async { + testWidgets('ClampingScrollPhysics affects ScrollPosition', (WidgetTester tester) async { // BouncingScrollPhysics @@ -92,7 +91,7 @@ void main() { expect(scrollable.position.pixels, equals(50.0)); }); - testWidgetsWithLeakTracking('ClampingScrollPhysics handles out of bounds ScrollPosition - initialScrollOffset', (WidgetTester tester) async { + testWidgets('ClampingScrollPhysics handles out of bounds ScrollPosition - initialScrollOffset', (WidgetTester tester) async { Future<void> testOutOfBounds(ScrollPhysics physics, double initialOffset, double expectedOffset) async { final ScrollController scrollController = ScrollController(initialScrollOffset: initialOffset); addTearDown(scrollController.dispose); @@ -107,7 +106,7 @@ void main() { await testOutOfBounds(const ClampingScrollPhysics(), 800.0, 50.0); }); - testWidgetsWithLeakTracking('ClampingScrollPhysics handles out of bounds ScrollPosition - jumpTo', (WidgetTester tester) async { + testWidgets('ClampingScrollPhysics handles out of bounds ScrollPosition - jumpTo', (WidgetTester tester) async { Future<void> testOutOfBounds(ScrollPhysics physics, double targetOffset, double endingOffset) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); diff --git a/packages/flutter/test/widgets/clip_test.dart b/packages/flutter/test/widgets/clip_test.dart index b9e3e64b90f..7dd3bdbc6c8 100644 --- a/packages/flutter/test/widgets/clip_test.dart +++ b/packages/flutter/test/widgets/clip_test.dart @@ -11,7 +11,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_border.dart' show TestBorder; @@ -59,7 +58,7 @@ class NotifyClipper<T> extends CustomClipper<T> { } void main() { - testWidgetsWithLeakTracking('ClipRect with a FittedBox child sized to zero works with semantics', (WidgetTester tester) async { + testWidgets('ClipRect with a FittedBox child sized to zero works with semantics', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: ClipRect( @@ -78,7 +77,7 @@ void main() { expect(find.byType(FittedBox), findsOneWidget); }); - testWidgetsWithLeakTracking('ClipRect updates clipBehavior in updateRenderObject', (WidgetTester tester) async { + testWidgets('ClipRect updates clipBehavior in updateRenderObject', (WidgetTester tester) async { await tester.pumpWidget(const ClipRect()); final RenderClipRect renderClip = tester.allRenderObjects.whereType<RenderClipRect>().first; @@ -100,7 +99,7 @@ void main() { expect(clipRRect.borderRadius, equals(BorderRadius.zero)); }); - testWidgetsWithLeakTracking('ClipRRect updates clipBehavior in updateRenderObject', (WidgetTester tester) async { + testWidgets('ClipRRect updates clipBehavior in updateRenderObject', (WidgetTester tester) async { await tester.pumpWidget(const ClipRRect()); final RenderClipRRect renderClip = tester.allRenderObjects.whereType<RenderClipRRect>().first; @@ -116,7 +115,7 @@ void main() { expect(renderClip.clipBehavior, equals(Clip.none)); }); - testWidgetsWithLeakTracking('ClipOval updates clipBehavior in updateRenderObject', (WidgetTester tester) async { + testWidgets('ClipOval updates clipBehavior in updateRenderObject', (WidgetTester tester) async { await tester.pumpWidget(const ClipOval()); final RenderClipOval renderClip = tester.allRenderObjects.whereType<RenderClipOval>().first; @@ -132,7 +131,7 @@ void main() { expect(renderClip.clipBehavior, equals(Clip.none)); }); - testWidgetsWithLeakTracking('ClipPath updates clipBehavior in updateRenderObject', (WidgetTester tester) async { + testWidgets('ClipPath updates clipBehavior in updateRenderObject', (WidgetTester tester) async { await tester.pumpWidget(const ClipPath()); final RenderClipPath renderClip = tester.allRenderObjects.whereType<RenderClipPath>().first; @@ -148,7 +147,7 @@ void main() { expect(renderClip.clipBehavior, equals(Clip.none)); }); - testWidgetsWithLeakTracking('ClipPath', (WidgetTester tester) async { + testWidgets('ClipPath', (WidgetTester tester) async { await tester.pumpWidget( ClipPath( clipper: PathClipper(), @@ -169,7 +168,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('ClipOval', (WidgetTester tester) async { + testWidgets('ClipOval', (WidgetTester tester) async { await tester.pumpWidget( ClipOval( child: GestureDetector( @@ -189,7 +188,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('Transparent ClipOval hit test', (WidgetTester tester) async { + testWidgets('Transparent ClipOval hit test', (WidgetTester tester) async { await tester.pumpWidget( Opacity( opacity: 0.0, @@ -212,7 +211,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('ClipRect', (WidgetTester tester) async { + testWidgets('ClipRect', (WidgetTester tester) async { await tester.pumpWidget( Align( alignment: Alignment.topLeft, @@ -335,7 +334,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('debugPaintSizeEnabled', (WidgetTester tester) async { + testWidgets('debugPaintSizeEnabled', (WidgetTester tester) async { await tester.pumpWidget( const ClipRect( child: Placeholder(), @@ -357,7 +356,7 @@ void main() { debugPaintSizeEnabled = false; }); - testWidgetsWithLeakTracking('ClipRect painting', (WidgetTester tester) async { + testWidgets('ClipRect painting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -400,7 +399,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ClipRect save, overlay, and antialiasing', (WidgetTester tester) async { + testWidgets('ClipRect save, overlay, and antialiasing', (WidgetTester tester) async { await tester.pumpWidget( RepaintBoundary( child: Stack( @@ -439,7 +438,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ClipRRect painting', (WidgetTester tester) async { + testWidgets('ClipRRect painting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -488,7 +487,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ClipOval painting', (WidgetTester tester) async { + testWidgets('ClipOval painting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -531,7 +530,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ClipPath painting', (WidgetTester tester) async { + testWidgets('ClipPath painting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -616,7 +615,7 @@ void main() { ); } - testWidgetsWithLeakTracking('PhysicalModel painting with Clip.antiAlias', (WidgetTester tester) async { + testWidgets('PhysicalModel painting with Clip.antiAlias', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalModel(Clip.antiAlias)); await expectLater( find.byType(RepaintBoundary).first, @@ -624,7 +623,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PhysicalModel painting with Clip.hardEdge', (WidgetTester tester) async { + testWidgets('PhysicalModel painting with Clip.hardEdge', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalModel(Clip.hardEdge)); await expectLater( find.byType(RepaintBoundary).first, @@ -634,7 +633,7 @@ void main() { // There will be bleeding edges on the rect edges, but there shouldn't be any bleeding edges on the // round corners. - testWidgetsWithLeakTracking('PhysicalModel painting with Clip.antiAliasWithSaveLayer', (WidgetTester tester) async { + testWidgets('PhysicalModel painting with Clip.antiAliasWithSaveLayer', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalModel(Clip.antiAliasWithSaveLayer)); await expectLater( find.byType(RepaintBoundary).first, @@ -642,7 +641,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default PhysicalModel painting', (WidgetTester tester) async { + testWidgets('Default PhysicalModel painting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -725,7 +724,7 @@ void main() { ); } - testWidgetsWithLeakTracking('PhysicalShape painting with Clip.antiAlias', (WidgetTester tester) async { + testWidgets('PhysicalShape painting with Clip.antiAlias', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalShape(Clip.antiAlias)); await expectLater( find.byType(RepaintBoundary).first, @@ -733,7 +732,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PhysicalShape painting with Clip.hardEdge', (WidgetTester tester) async { + testWidgets('PhysicalShape painting with Clip.hardEdge', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalShape(Clip.hardEdge)); await expectLater( find.byType(RepaintBoundary).first, @@ -741,7 +740,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PhysicalShape painting with Clip.antiAliasWithSaveLayer', (WidgetTester tester) async { + testWidgets('PhysicalShape painting with Clip.antiAliasWithSaveLayer', (WidgetTester tester) async { await tester.pumpWidget(genPhysicalShape(Clip.antiAliasWithSaveLayer)); await expectLater( find.byType(RepaintBoundary).first, @@ -749,7 +748,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PhysicalShape painting', (WidgetTester tester) async { + testWidgets('PhysicalShape painting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -795,7 +794,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ClipPath.shape', (WidgetTester tester) async { + testWidgets('ClipPath.shape', (WidgetTester tester) async { final List<String> logs = <String>[]; final ShapeBorder shape = TestBorder((String message) { logs.add(message); }); Widget buildClipPath() { @@ -852,7 +851,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('CustomClipper reclips when notified', (WidgetTester tester) async { + testWidgets('CustomClipper reclips when notified', (WidgetTester tester) async { final ValueNotifier<Rect> clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0)); addTearDown(clip.dispose); @@ -886,7 +885,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ClipRRect supports BorderRadiusDirectional', (WidgetTester tester) async { + testWidgets('ClipRRect supports BorderRadiusDirectional', (WidgetTester tester) async { const Radius startRadius = Radius.circular(15.0); const Radius endRadius = Radius.circular(30.0); @@ -913,7 +912,7 @@ void main() { } }); - testWidgetsWithLeakTracking('ClipRRect is direction-aware', (WidgetTester tester) async { + testWidgets('ClipRRect is direction-aware', (WidgetTester tester) async { const Radius startRadius = Radius.circular(15.0); const Radius endRadius = Radius.circular(30.0); TextDirection textDirection = TextDirection.ltr; diff --git a/packages/flutter/test/widgets/color_filter_test.dart b/packages/flutter/test/widgets/color_filter_test.dart index fa512f682b6..3135844c03d 100644 --- a/packages/flutter/test/widgets/color_filter_test.dart +++ b/packages/flutter/test/widgets/color_filter_test.dart @@ -11,10 +11,9 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Color filter - red', (WidgetTester tester) async { + testWidgets('Color filter - red', (WidgetTester tester) async { await tester.pumpWidget( const RepaintBoundary( child: ColorFiltered( @@ -29,7 +28,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Color filter - sepia', (WidgetTester tester) async { + testWidgets('Color filter - sepia', (WidgetTester tester) async { const ColorFilter sepia = ColorFilter.matrix(<double>[ 0.39, 0.769, 0.189, 0, 0, // 0.349, 0.686, 0.168, 0, 0, // @@ -66,7 +65,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Color filter - reuses its layer', (WidgetTester tester) async { + testWidgets('Color filter - reuses its layer', (WidgetTester tester) async { Future<void> pumpWithColor(Color color) async { await tester.pumpWidget( RepaintBoundary( diff --git a/packages/flutter/test/widgets/column_test.dart b/packages/flutter/test/widgets/column_test.dart index 1b45f093d14..7f86f285e9f 100644 --- a/packages/flutter/test/widgets/column_test.dart +++ b/packages/flutter/test/widgets/column_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // DOWN (default) - testWidgetsWithLeakTracking('Column with one flexible child', (WidgetTester tester) async { + testWidgets('Column with one flexible child', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -56,7 +55,7 @@ void main() { expect(boxParentData.offset.dy, equals(500.0)); }); - testWidgetsWithLeakTracking('Column with default main axis parameters', (WidgetTester tester) async { + testWidgets('Column with default main axis parameters', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -102,7 +101,7 @@ void main() { expect(boxParentData.offset.dy, equals(200.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.center', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.center', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -140,7 +139,7 @@ void main() { expect(boxParentData.offset.dy, equals(300.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.end', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.end', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -186,7 +185,7 @@ void main() { expect(boxParentData.offset.dy, equals(500.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.spaceBetween', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.spaceBetween', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -232,7 +231,7 @@ void main() { expect(boxParentData.offset.dy, equals(500.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.spaceAround', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.spaceAround', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -286,7 +285,7 @@ void main() { expect(boxParentData.offset.dy, equals(475.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.spaceEvenly', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.spaceEvenly', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -332,7 +331,7 @@ void main() { expect(boxParentData.offset.dy, equals(445.0)); }); - testWidgetsWithLeakTracking('Column and MainAxisSize.min', (WidgetTester tester) async { + testWidgets('Column and MainAxisSize.min', (WidgetTester tester) async { const Key flexKey = Key('flexKey'); // Default is MainAxisSize.max so the Column should be as high as the test: 600. @@ -365,7 +364,7 @@ void main() { expect(renderBox.size.height, equals(250.0)); }); - testWidgetsWithLeakTracking('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async { + testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async { const Key childKey = Key('childKey'); await tester.pumpWidget(const Center( @@ -391,7 +390,7 @@ void main() { // UP - testWidgetsWithLeakTracking('Column with one flexible child', (WidgetTester tester) async { + testWidgets('Column with one flexible child', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -438,7 +437,7 @@ void main() { expect(boxParentData.offset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('Column with default main axis parameters', (WidgetTester tester) async { + testWidgets('Column with default main axis parameters', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -485,7 +484,7 @@ void main() { expect(boxParentData.offset.dy, equals(300.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.center', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.center', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -524,7 +523,7 @@ void main() { expect(boxParentData.offset.dy, equals(200.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.end', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.end', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -571,7 +570,7 @@ void main() { expect(boxParentData.offset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.spaceBetween', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.spaceBetween', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -618,7 +617,7 @@ void main() { expect(boxParentData.offset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.spaceAround', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.spaceAround', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -673,7 +672,7 @@ void main() { expect(boxParentData.offset.dy, equals(500.0 - 475.0)); }); - testWidgetsWithLeakTracking('Column with MainAxisAlignment.spaceEvenly', (WidgetTester tester) async { + testWidgets('Column with MainAxisAlignment.spaceEvenly', (WidgetTester tester) async { const Key columnKey = Key('column'); const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -720,7 +719,7 @@ void main() { expect(boxParentData.offset.dy, equals(600.0 - 445.0 - 20.0)); }); - testWidgetsWithLeakTracking('Column and MainAxisSize.min', (WidgetTester tester) async { + testWidgets('Column and MainAxisSize.min', (WidgetTester tester) async { const Key flexKey = Key('flexKey'); // Default is MainAxisSize.max so the Column should be as high as the test: 600. @@ -755,7 +754,7 @@ void main() { expect(renderBox.size.height, equals(250.0)); }); - testWidgetsWithLeakTracking('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async { + testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async { const Key childKey = Key('childKey'); await tester.pumpWidget(const Center( diff --git a/packages/flutter/test/widgets/composited_transform_test.dart b/packages/flutter/test/widgets/composited_transform_test.dart index 319702c277c..f46294f3046 100644 --- a/packages/flutter/test/widgets/composited_transform_test.dart +++ b/packages/flutter/test/widgets/composited_transform_test.dart @@ -7,12 +7,11 @@ import 'dart:ui' as ui; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { final LayerLink link = LayerLink(); - testWidgetsWithLeakTracking('Change link during layout', (WidgetTester tester) async { + testWidgets('Change link during layout', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); Widget build({ LayerLink? linkToUse }) { return Directionality( @@ -57,7 +56,7 @@ void main() { expect(box.localToGlobal(Offset.zero), const Offset(118.0, 451.0)); }); - testWidgetsWithLeakTracking('LeaderLayer should not cause error', (WidgetTester tester) async { + testWidgets('LeaderLayer should not cause error', (WidgetTester tester) async { final LayerLink link = LayerLink(); Widget buildWidget({ @@ -117,19 +116,19 @@ void main() { ); } - testWidgetsWithLeakTracking('topLeft', (WidgetTester tester) async { + testWidgets('topLeft', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.topLeft, followerAlignment: Alignment.topLeft)); final RenderBox box = key.currentContext!.findRenderObject()! as RenderBox; expect(box.localToGlobal(Offset.zero), const Offset(123.0, 456.0)); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.center, followerAlignment: Alignment.center)); final RenderBox box = key.currentContext!.findRenderObject()! as RenderBox; expect(box.localToGlobal(Offset.zero), const Offset(118.0, 451.0)); }); - testWidgetsWithLeakTracking('bottomRight - topRight', (WidgetTester tester) async { + testWidgets('bottomRight - topRight', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.bottomRight, followerAlignment: Alignment.topRight)); final RenderBox box = key.currentContext!.findRenderObject()! as RenderBox; expect(box.localToGlobal(Offset.zero), const Offset(113.0, 466.0)); @@ -173,7 +172,7 @@ void main() { ), ); } - testWidgetsWithLeakTracking('topLeft', (WidgetTester tester) async { + testWidgets('topLeft', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.topLeft, followerAlignment: Alignment.topLeft)); final RenderBox box1 = key1.currentContext!.findRenderObject()! as RenderBox; final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; @@ -182,7 +181,7 @@ void main() { expect(position1, offsetMoreOrLessEquals(position2)); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.center, followerAlignment: Alignment.center)); final RenderBox box1 = key1.currentContext!.findRenderObject()! as RenderBox; final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; @@ -191,7 +190,7 @@ void main() { expect(position1, offsetMoreOrLessEquals(position2)); }); - testWidgetsWithLeakTracking('bottomRight - topRight', (WidgetTester tester) async { + testWidgets('bottomRight - topRight', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.bottomRight, followerAlignment: Alignment.topRight)); final RenderBox box1 = key1.currentContext!.findRenderObject()! as RenderBox; final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; @@ -250,7 +249,7 @@ void main() { ), ); } - testWidgetsWithLeakTracking('topLeft', (WidgetTester tester) async { + testWidgets('topLeft', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.topLeft, followerAlignment: Alignment.topLeft)); final RenderBox box1 = key1.currentContext!.findRenderObject()! as RenderBox; final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; @@ -259,7 +258,7 @@ void main() { expect(position1, offsetMoreOrLessEquals(position2)); }); - testWidgetsWithLeakTracking('center', (WidgetTester tester) async { + testWidgets('center', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.center, followerAlignment: Alignment.center)); final RenderBox box1 = key1.currentContext!.findRenderObject()! as RenderBox; final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; @@ -268,7 +267,7 @@ void main() { expect(position1, offsetMoreOrLessEquals(position2)); }); - testWidgetsWithLeakTracking('bottomRight - topRight', (WidgetTester tester) async { + testWidgets('bottomRight - topRight', (WidgetTester tester) async { await tester.pumpWidget(build(targetAlignment: Alignment.bottomRight, followerAlignment: Alignment.topRight)); final RenderBox box1 = key1.currentContext!.findRenderObject()! as RenderBox; final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; @@ -322,7 +321,7 @@ void main() { for (final Alignment targetAlignment in alignments) { for (final Alignment followerAlignment in alignments) { - testWidgetsWithLeakTracking('$targetAlignment - $followerAlignment', (WidgetTester tester) async{ + testWidgets('$targetAlignment - $followerAlignment', (WidgetTester tester) async{ await tester.pumpWidget(build(targetAlignment: targetAlignment, followerAlignment: followerAlignment)); final RenderBox box2 = key2.currentContext!.findRenderObject()! as RenderBox; expect(box2.size, const Size(2.0, 2.0)); @@ -334,7 +333,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Leader after Follower asserts', (WidgetTester tester) async { + testWidgets('Leader after Follower asserts', (WidgetTester tester) async { final LayerLink link = LayerLink(); await tester.pumpWidget( CompositedTransformFollower( @@ -352,7 +351,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( '`FollowerLayer` (`CompositedTransformFollower`) has null pointer error when using with some kinds of `Layer`s', (WidgetTester tester) async { final LayerLink link = LayerLink(); diff --git a/packages/flutter/test/widgets/constrained_box_test.dart b/packages/flutter/test/widgets/constrained_box_test.dart index b09d9e9a934..26d7e51df9f 100644 --- a/packages/flutter/test/widgets/constrained_box_test.dart +++ b/packages/flutter/test/widgets/constrained_box_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Placeholder intrinsics', (WidgetTester tester) async { + testWidgets('Placeholder intrinsics', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).getMinIntrinsicWidth(double.infinity), 0.0); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).getMaxIntrinsicWidth(double.infinity), 0.0); @@ -15,7 +14,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).getMaxIntrinsicHeight(double.infinity), 0.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - minHeight', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - minHeight', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints( @@ -30,7 +29,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(ConstrainedBox)).getMaxIntrinsicHeight(double.infinity), 20.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - minWidth', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - minWidth', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints( @@ -45,7 +44,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(ConstrainedBox)).getMaxIntrinsicHeight(double.infinity), 0.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - maxHeight', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - maxHeight', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints( @@ -60,7 +59,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(ConstrainedBox)).getMaxIntrinsicHeight(double.infinity), 0.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - maxWidth', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - maxWidth', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints( @@ -75,7 +74,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(ConstrainedBox)).getMaxIntrinsicHeight(double.infinity), 0.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - tight', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - tight', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints.tightFor(width: 10.0, height: 30.0), @@ -89,7 +88,7 @@ void main() { }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - minHeight - with infinite width', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - minHeight - with infinite width', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints( @@ -105,7 +104,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(ConstrainedBox)).getMaxIntrinsicHeight(double.infinity), 20.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - minWidth - with infinite height', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - minWidth - with infinite height', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints( @@ -121,7 +120,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(ConstrainedBox)).getMaxIntrinsicHeight(double.infinity), 0.0); }); - testWidgetsWithLeakTracking('ConstrainedBox intrinsics - infinite', (WidgetTester tester) async { + testWidgets('ConstrainedBox intrinsics - infinite', (WidgetTester tester) async { await tester.pumpWidget( ConstrainedBox( constraints: const BoxConstraints.tightFor(width: double.infinity, height: double.infinity), diff --git a/packages/flutter/test/widgets/container_test.dart b/packages/flutter/test/widgets/container_test.dart index 19492ee7518..fd5cc476f0b 100644 --- a/packages/flutter/test/widgets/container_test.dart +++ b/packages/flutter/test/widgets/container_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('Container control tests:', () { @@ -38,7 +37,7 @@ void main() { ), ); - testWidgetsWithLeakTracking('paints as expected', (WidgetTester tester) async { + testWidgets('paints as expected', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -55,7 +54,7 @@ void main() { }); group('diagnostics', () { - testWidgetsWithLeakTracking('has reasonable default diagnostics', (WidgetTester tester) async { + testWidgets('has reasonable default diagnostics', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -67,7 +66,7 @@ void main() { expect(box, hasAGoodToStringDeep); }); - testWidgetsWithLeakTracking('has expected info diagnostics', (WidgetTester tester) async { + testWidgets('has expected info diagnostics', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -139,7 +138,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('has expected debug diagnostics', (WidgetTester tester) async { + testWidgets('has expected debug diagnostics', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -244,7 +243,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('has expected fine diagnostics', (WidgetTester tester) async { + testWidgets('has expected fine diagnostics', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -377,7 +376,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('has expected hidden diagnostics', (WidgetTester tester) async { + testWidgets('has expected hidden diagnostics', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -534,7 +533,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('painting error has expected diagnostics', (WidgetTester tester) async { + testWidgets('painting error has expected diagnostics', (WidgetTester tester) async { await tester.pumpWidget(Align( alignment: Alignment.topLeft, child: container, @@ -565,7 +564,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can be placed in an infinite box', (WidgetTester tester) async { + testWidgets('Can be placed in an infinite box', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -574,7 +573,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Container transformAlignment', (WidgetTester tester) async { + testWidgets('Container transformAlignment', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( @@ -621,7 +620,7 @@ void main() { expect(tester.getBottomRight(finder), equals(const Offset(200, 200))); }); - testWidgetsWithLeakTracking('giving clipBehaviour Clip.None, will not add a ClipPath to the tree', (WidgetTester tester) async { + testWidgets('giving clipBehaviour Clip.None, will not add a ClipPath to the tree', (WidgetTester tester) async { await tester.pumpWidget( Container( decoration: const BoxDecoration( @@ -636,7 +635,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('giving clipBehaviour not a Clip.None, will add a ClipPath to the tree', (WidgetTester tester) async { + testWidgets('giving clipBehaviour not a Clip.None, will add a ClipPath to the tree', (WidgetTester tester) async { final Container container = Container( clipBehavior: Clip.hardEdge, decoration: const BoxDecoration( @@ -653,7 +652,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('getClipPath() works for lots of kinds of decorations', (WidgetTester tester) async { + testWidgets('getClipPath() works for lots of kinds of decorations', (WidgetTester tester) async { Future<void> test(Decoration decoration) async { await tester.pumpWidget( Directionality( @@ -683,7 +682,7 @@ void main() { await test(const FlutterLogoDecoration()); }); - testWidgetsWithLeakTracking('Container is hittable only when having decorations', (WidgetTester tester) async { + testWidgets('Container is hittable only when having decorations', (WidgetTester tester) async { bool tapped = false; await tester.pumpWidget(GestureDetector( onTap: () { tapped = true; }, @@ -737,7 +736,7 @@ void main() { expect(tapped, false); }); - testWidgetsWithLeakTracking('Container discards alignment when the child parameter is null and constraints is not Tight', (WidgetTester tester) async { + testWidgets('Container discards alignment when the child parameter is null and constraints is not Tight', (WidgetTester tester) async { await tester.pumpWidget( Container( decoration: const BoxDecoration( @@ -752,7 +751,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('using clipBehaviour and shadow, should not clip the shadow', (WidgetTester tester) async { + testWidgets('using clipBehaviour and shadow, should not clip the shadow', (WidgetTester tester) async { final Container container = Container( clipBehavior: Clip.hardEdge, decoration: const BoxDecoration( diff --git a/packages/flutter/test/widgets/context_menu_controller_test.dart b/packages/flutter/test/widgets/context_menu_controller_test.dart index 2328238dcf8..1a6155881e2 100644 --- a/packages/flutter/test/widgets/context_menu_controller_test.dart +++ b/packages/flutter/test/widgets/context_menu_controller_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'clipboard_utils.dart'; import 'editable_text_utils.dart'; @@ -21,7 +20,7 @@ void main() { await Clipboard.setData(const ClipboardData(text: 'Clipboard data')); }); - testWidgetsWithLeakTracking('Hides and shows only a single menu', (WidgetTester tester) async { + testWidgets('Hides and shows only a single menu', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); late final BuildContext context; @@ -91,7 +90,7 @@ void main() { expect(find.byKey(key2), findsNothing); }); - testWidgetsWithLeakTracking('A menu can be hidden and then reshown', (WidgetTester tester) async { + testWidgets('A menu can be hidden and then reshown', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); late final BuildContext context; @@ -142,7 +141,7 @@ void main() { expect(find.byKey(key1), findsOneWidget); }); - testWidgetsWithLeakTracking('markNeedsBuild causes the builder to update', (WidgetTester tester) async { + testWidgets('markNeedsBuild causes the builder to update', (WidgetTester tester) async { int buildCount = 0; late final BuildContext context; @@ -179,7 +178,7 @@ void main() { controller.remove(); }); - testWidgetsWithLeakTracking('Calling show when a built-in widget is already showing its context menu hides the built-in menu', (WidgetTester tester) async { + testWidgets('Calling show when a built-in widget is already showing its context menu hides the built-in menu', (WidgetTester tester) async { final GlobalKey builtInKey = GlobalKey(); final GlobalKey directKey = GlobalKey(); late final BuildContext context; diff --git a/packages/flutter/test/widgets/coordinates_test.dart b/packages/flutter/test/widgets/coordinates_test.dart index f2668521cab..847f7482f26 100644 --- a/packages/flutter/test/widgets/coordinates_test.dart +++ b/packages/flutter/test/widgets/coordinates_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Comparing coordinates', (WidgetTester tester) async { + testWidgets('Comparing coordinates', (WidgetTester tester) async { final Key keyA = GlobalKey(); final Key keyB = GlobalKey(); diff --git a/packages/flutter/test/widgets/custom_multi_child_layout_test.dart b/packages/flutter/test/widgets/custom_multi_child_layout_test.dart index 8a31b287754..b691c0d6561 100644 --- a/packages/flutter/test/widgets/custom_multi_child_layout_test.dart +++ b/packages/flutter/test/widgets/custom_multi_child_layout_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestMultiChildLayoutDelegate extends MultiChildLayoutDelegate { late BoxConstraints getSizeConstraints; @@ -164,7 +163,7 @@ class LayoutWithMissingId extends ParentDataWidget<MultiChildLayoutParentData> { } void main() { - testWidgetsWithLeakTracking('Control test for CustomMultiChildLayout', (WidgetTester tester) async { + testWidgets('Control test for CustomMultiChildLayout', (WidgetTester tester) async { final TestMultiChildLayoutDelegate delegate = TestMultiChildLayoutDelegate(); await tester.pumpWidget(buildFrame(delegate)); @@ -182,7 +181,7 @@ void main() { expect(delegate.performLayoutIsChild, false); }); - testWidgetsWithLeakTracking('Test MultiChildDelegate shouldRelayout method', (WidgetTester tester) async { + testWidgets('Test MultiChildDelegate shouldRelayout method', (WidgetTester tester) async { TestMultiChildLayoutDelegate delegate = TestMultiChildLayoutDelegate(); await tester.pumpWidget(buildFrame(delegate)); @@ -205,7 +204,7 @@ void main() { expect(delegate.performLayoutSize, isNotNull); }); - testWidgetsWithLeakTracking('Nested CustomMultiChildLayouts', (WidgetTester tester) async { + testWidgets('Nested CustomMultiChildLayouts', (WidgetTester tester) async { final TestMultiChildLayoutDelegate delegate = TestMultiChildLayoutDelegate(); await tester.pumpWidget(Center( child: CustomMultiChildLayout( @@ -228,7 +227,7 @@ void main() { }); - testWidgetsWithLeakTracking('Loose constraints', (WidgetTester tester) async { + testWidgets('Loose constraints', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget(Center( child: CustomMultiChildLayout( @@ -252,7 +251,7 @@ void main() { expect(box.size.height, equals(250.0)); }); - testWidgetsWithLeakTracking('Can use listener for relayout', (WidgetTester tester) async { + testWidgets('Can use listener for relayout', (WidgetTester tester) async { final ValueNotifier<Size> size = ValueNotifier<Size>(const Size(100.0, 200.0)); addTearDown(size.dispose); @@ -304,7 +303,7 @@ void main() { expect((errors.first.exception as FlutterError).toStringDeep(), equalsIgnoringHashCodes(message)); } - testWidgetsWithLeakTracking('layoutChild on non existent child', (WidgetTester tester) async { + testWidgets('layoutChild on non existent child', (WidgetTester tester) async { await expectFlutterErrorMessage( tester: tester, delegate: ZeroAndOneIdLayoutDelegate(), @@ -316,7 +315,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('layoutChild more than once', (WidgetTester tester) async { + testWidgets('layoutChild more than once', (WidgetTester tester) async { await expectFlutterErrorMessage( tester: tester, delegate: DuplicateLayoutDelegate(), @@ -328,7 +327,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('layoutChild on invalid size constraint', (WidgetTester tester) async { + testWidgets('layoutChild on invalid size constraint', (WidgetTester tester) async { await expectFlutterErrorMessage( tester: tester, delegate: InvalidConstraintsChildLayoutDelegate(), @@ -347,7 +346,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('positionChild on non existent child', (WidgetTester tester) async { + testWidgets('positionChild on non existent child', (WidgetTester tester) async { await expectFlutterErrorMessage( tester: tester, delegate: NonExistentPositionDelegate(), @@ -359,7 +358,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("_callPerformLayout on child that doesn't have id", (WidgetTester tester) async { + testWidgets("_callPerformLayout on child that doesn't have id", (WidgetTester tester) async { await expectFlutterErrorMessage( widget: Center( child: CustomMultiChildLayout( @@ -385,7 +384,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('performLayout did not layout a child', (WidgetTester tester) async { + testWidgets('performLayout did not layout a child', (WidgetTester tester) async { await expectFlutterErrorMessage( widget: Center( child: CustomMultiChildLayout( @@ -407,7 +406,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('performLayout did not layout multiple child', (WidgetTester tester) async { + testWidgets('performLayout did not layout multiple child', (WidgetTester tester) async { await expectFlutterErrorMessage( widget: Center( child: CustomMultiChildLayout( diff --git a/packages/flutter/test/widgets/custom_paint_test.dart b/packages/flutter/test/widgets/custom_paint_test.dart index 70071f62dae..933b5b6b4f7 100644 --- a/packages/flutter/test/widgets/custom_paint_test.dart +++ b/packages/flutter/test/widgets/custom_paint_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestCustomPainter extends CustomPainter { TestCustomPainter({ required this.log, this.name }); @@ -41,7 +40,7 @@ class MockPaintingContext extends Fake implements PaintingContext { } void main() { - testWidgetsWithLeakTracking('Control test for custom painting', (WidgetTester tester) async { + testWidgets('Control test for custom painting', (WidgetTester tester) async { final List<String?> log = <String?>[]; await tester.pumpWidget(CustomPaint( painter: TestCustomPainter( @@ -63,7 +62,7 @@ void main() { expect(log, equals(<String>['background', 'child', 'foreground'])); }); - testWidgetsWithLeakTracking('Throws FlutterError on custom painter incorrect restore/save calls', (WidgetTester tester) async { + testWidgets('Throws FlutterError on custom painter incorrect restore/save calls', (WidgetTester tester) async { final GlobalKey target = GlobalKey(); final List<String?> log = <String?>[]; await tester.pumpWidget(CustomPaint( @@ -119,7 +118,7 @@ void main() { expect(error.toStringDeep(), contains('2 more times')); }); - testWidgetsWithLeakTracking('CustomPaint sizing', (WidgetTester tester) async { + testWidgets('CustomPaint sizing', (WidgetTester tester) async { final GlobalKey target = GlobalKey(); await tester.pumpWidget(Center( @@ -154,7 +153,7 @@ void main() { }); - testWidgetsWithLeakTracking('Raster cache hints', (WidgetTester tester) async { + testWidgets('Raster cache hints', (WidgetTester tester) async { final GlobalKey target = GlobalKey(); final List<String?> log = <String?>[]; diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index 322e974c947..e9320e21df1 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -23,7 +22,7 @@ void main() { } void _defineTests() { - testWidgetsWithLeakTracking('builds no semantics by default', (WidgetTester tester) async { + testWidgets('builds no semantics by default', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(CustomPaint( @@ -37,7 +36,7 @@ void _defineTests() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('provides foreground semantics', (WidgetTester tester) async { + testWidgets('provides foreground semantics', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(CustomPaint( @@ -73,7 +72,7 @@ void _defineTests() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('provides background semantics', (WidgetTester tester) async { + testWidgets('provides background semantics', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(CustomPaint( @@ -109,7 +108,7 @@ void _defineTests() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('combines background, child and foreground semantics', (WidgetTester tester) async { + testWidgets('combines background, child and foreground semantics', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(CustomPaint( @@ -168,7 +167,7 @@ void _defineTests() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('applies $SemanticsProperties', (WidgetTester tester) async { + testWidgets('applies $SemanticsProperties', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(CustomPaint( @@ -271,7 +270,7 @@ void _defineTests() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('Can toggle semantics on, off, on without crash', (WidgetTester tester) async { + testWidgets('Can toggle semantics on, off, on without crash', (WidgetTester tester) async { await tester.pumpWidget(CustomPaint( painter: _PainterWithSemantics( semantics: const CustomPainterSemantics( @@ -313,7 +312,7 @@ void _defineTests() { semantics.dispose(); }, semanticsEnabled: false); - testWidgetsWithLeakTracking('Supports all actions', (WidgetTester tester) async { + testWidgets('Supports all actions', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<SemanticsAction> performedActions = <SemanticsAction>[]; @@ -411,7 +410,7 @@ void _defineTests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Supports all flags', (WidgetTester tester) async { + testWidgets('Supports all flags', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // checked state and toggled state are mutually exclusive. await tester.pumpWidget(CustomPaint( @@ -526,7 +525,7 @@ void _defineTests() { }); group('diffing', () { - testWidgetsWithLeakTracking('complains about duplicate keys', (WidgetTester tester) async { + testWidgets('complains about duplicate keys', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); await tester.pumpWidget(CustomPaint( painter: _SemanticsDiffTest(<String>[ @@ -623,7 +622,7 @@ void _defineTests() { }); }); - testWidgetsWithLeakTracking('rebuilds semantics upon resize', (WidgetTester tester) async { + testWidgets('rebuilds semantics upon resize', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); final _PainterWithSemantics painter = _PainterWithSemantics( @@ -668,7 +667,7 @@ void _defineTests() { semanticsTester.dispose(); }); - testWidgetsWithLeakTracking('does not rebuild when shouldRebuildSemantics is false', (WidgetTester tester) async { + testWidgets('does not rebuild when shouldRebuildSemantics is false', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester); const CustomPainterSemantics testSemantics = CustomPainterSemantics( @@ -713,7 +712,7 @@ void _defineTests() { } void _testDiff(String description, Future<void> Function(_DiffTester tester) testFunction) { - testWidgetsWithLeakTracking(description, (WidgetTester tester) async { + testWidgets(description, (WidgetTester tester) async { await testFunction(_DiffTester(tester)); }); } diff --git a/packages/flutter/test/widgets/custom_scroll_view_test.dart b/packages/flutter/test/widgets/custom_scroll_view_test.dart index 20f5f475f38..02c32813323 100644 --- a/packages/flutter/test/widgets/custom_scroll_view_test.dart +++ b/packages/flutter/test/widgets/custom_scroll_view_test.dart @@ -4,11 +4,10 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/96024 - testWidgetsWithLeakTracking('CustomScrollView.center update test 1', (WidgetTester tester) async { + testWidgets('CustomScrollView.center update test 1', (WidgetTester tester) async { final Key centerKey = UniqueKey(); late StateSetter setState; bool hasKey = false; @@ -50,7 +49,7 @@ void main() { // Pass without throw. }); - testWidgetsWithLeakTracking('CustomScrollView.center update test 2', (WidgetTester tester) async { + testWidgets('CustomScrollView.center update test 2', (WidgetTester tester) async { const List<Widget> slivers1 = <Widget>[ SliverToBoxAdapter(key: Key('a'), child: SizedBox(height: 100.0)), SliverToBoxAdapter(key: Key('b'), child: SizedBox(height: 100.0)), @@ -82,7 +81,7 @@ void main() { // Pass without throw. }); - testWidgetsWithLeakTracking('CustomScrollView.center', (WidgetTester tester) async { + testWidgets('CustomScrollView.center', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( @@ -104,7 +103,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CustomScrollView.center', (WidgetTester tester) async { + testWidgets('CustomScrollView.center', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( @@ -136,7 +135,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('CustomScrollView.anchor', (WidgetTester tester) async { + testWidgets('CustomScrollView.anchor', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( diff --git a/packages/flutter/test/widgets/custom_single_child_layout_test.dart b/packages/flutter/test/widgets/custom_single_child_layout_test.dart index 724f71bde79..a276a32e83b 100644 --- a/packages/flutter/test/widgets/custom_single_child_layout_test.dart +++ b/packages/flutter/test/widgets/custom_single_child_layout_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestSingleChildLayoutDelegate extends SingleChildLayoutDelegate { late BoxConstraints constraintsFromGetSize; @@ -94,7 +93,7 @@ Widget buildFrame(SingleChildLayoutDelegate delegate) { } void main() { - testWidgetsWithLeakTracking('Control test for CustomSingleChildLayout', (WidgetTester tester) async { + testWidgets('Control test for CustomSingleChildLayout', (WidgetTester tester) async { final TestSingleChildLayoutDelegate delegate = TestSingleChildLayoutDelegate(); await tester.pumpWidget(buildFrame(delegate)); @@ -115,7 +114,7 @@ void main() { expect(delegate.childSizeFromGetPositionForChild.height, 400.0); }); - testWidgetsWithLeakTracking('Test SingleChildDelegate shouldRelayout method', (WidgetTester tester) async { + testWidgets('Test SingleChildDelegate shouldRelayout method', (WidgetTester tester) async { TestSingleChildLayoutDelegate delegate = TestSingleChildLayoutDelegate(); await tester.pumpWidget(buildFrame(delegate)); @@ -139,7 +138,7 @@ void main() { expect(delegate.constraintsFromGetConstraintsForChild, isNotNull); }); - testWidgetsWithLeakTracking('Delegate can change size', (WidgetTester tester) async { + testWidgets('Delegate can change size', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(FixedSizeLayoutDelegate(const Size(100.0, 200.0)))); RenderBox box = tester.renderObject(find.byType(CustomSingleChildLayout)); @@ -151,7 +150,7 @@ void main() { expect(box.size, equals(const Size(150.0, 240.0))); }); - testWidgetsWithLeakTracking('Can use listener for relayout', (WidgetTester tester) async { + testWidgets('Can use listener for relayout', (WidgetTester tester) async { final ValueNotifier<Size> size = ValueNotifier<Size>(const Size(100.0, 200.0)); addTearDown(size.dispose); diff --git a/packages/flutter/test/widgets/debug_test.dart b/packages/flutter/test/widgets/debug_test.dart index fd362bc06a4..8ae59d0aa05 100644 --- a/packages/flutter/test/widgets/debug_test.dart +++ b/packages/flutter/test/widgets/debug_test.dart @@ -7,7 +7,6 @@ import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('debugChildrenHaveDuplicateKeys control test', () { @@ -65,7 +64,7 @@ void main() { } }); - testWidgetsWithLeakTracking('debugCheckHasTable control test', (WidgetTester tester) async { + testWidgets('debugCheckHasTable control test', (WidgetTester tester) async { await tester.pumpWidget( Builder( builder: (BuildContext context) { @@ -96,7 +95,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('debugCheckHasMediaQuery control test', (WidgetTester tester) async { + testWidgets('debugCheckHasMediaQuery control test', (WidgetTester tester) async { // Cannot use tester.pumpWidget here because it wraps the widget in a View, // which introduces a MediaQuery ancestor. await pumpWidgetWithoutViewWrapper( @@ -232,7 +231,7 @@ void main() { } }); - testWidgetsWithLeakTracking('debugCheckHasWidgetsLocalizations throws', (WidgetTester tester) async { + testWidgets('debugCheckHasWidgetsLocalizations throws', (WidgetTester tester) async { final GlobalKey noLocalizationsAvailable = GlobalKey(); final GlobalKey localizationsAvailable = GlobalKey(); @@ -281,7 +280,7 @@ void main() { debugHighlightDeprecatedWidgets = false; }); - testWidgetsWithLeakTracking('debugCreator of layers should not be null', (WidgetTester tester) async { + testWidgets('debugCreator of layers should not be null', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Directionality( diff --git a/packages/flutter/test/widgets/decorated_sliver_test.dart b/packages/flutter/test/widgets/decorated_sliver_test.dart index 5800d8db161..f5539344f28 100644 --- a/packages/flutter/test/widgets/decorated_sliver_test.dart +++ b/packages/flutter/test/widgets/decorated_sliver_test.dart @@ -9,10 +9,9 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('DecoratedSliver creates, paints, and disposes BoxPainter', (WidgetTester tester) async { + testWidgets('DecoratedSliver creates, paints, and disposes BoxPainter', (WidgetTester tester) async { final TestDecoration decoration = TestDecoration(); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -40,7 +39,7 @@ void main() { expect(decoration.painters.last.disposed, true); }); - testWidgetsWithLeakTracking('DecoratedSliver can update box painter', (WidgetTester tester) async { + testWidgets('DecoratedSliver can update box painter', (WidgetTester tester) async { final TestDecoration decorationA = TestDecoration(); final TestDecoration decorationB = TestDecoration(); @@ -80,7 +79,7 @@ void main() { expect(decorationB.painters.last.paintCount, 1); }); - testWidgetsWithLeakTracking('DecoratedSliver can update DecorationPosition', (WidgetTester tester) async { + testWidgets('DecoratedSliver can update DecorationPosition', (WidgetTester tester) async { final TestDecoration decoration = TestDecoration(); DecorationPosition activePosition = DecorationPosition.foreground; @@ -118,7 +117,7 @@ void main() { expect(decoration.painters.last.paintCount, 2); }); - testWidgetsWithLeakTracking('DecoratedSliver golden test', (WidgetTester tester) async { + testWidgets('DecoratedSliver golden test', (WidgetTester tester) async { const BoxDecoration decoration = BoxDecoration( color: Colors.blue, ); @@ -199,7 +198,7 @@ void main() { await expectLater(find.byKey(foregroundKey), matchesGoldenFile('decorated_sliver.moon.foreground.png')); }); - testWidgetsWithLeakTracking('DecoratedSliver paints its border correctly vertically', (WidgetTester tester) async { + testWidgets('DecoratedSliver paints its border correctly vertically', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); @@ -236,7 +235,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('DecoratedSliver paints its border correctly vertically reverse', (WidgetTester tester) async { + testWidgets('DecoratedSliver paints its border correctly vertically reverse', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); @@ -276,7 +275,7 @@ void main() { - testWidgetsWithLeakTracking('DecoratedSliver paints its border correctly horizontally', (WidgetTester tester) async { + testWidgets('DecoratedSliver paints its border correctly horizontally', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); @@ -314,7 +313,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('DecoratedSliver paints its border correctly horizontally reverse', (WidgetTester tester) async { + testWidgets('DecoratedSliver paints its border correctly horizontally reverse', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); @@ -354,7 +353,7 @@ void main() { }); - testWidgetsWithLeakTracking('DecoratedSliver works with SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('DecoratedSliver works with SliverMainAxisGroup', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); @@ -393,7 +392,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('DecoratedSliver works with SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('DecoratedSliver works with SliverCrossAxisGroup', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); @@ -432,7 +431,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('DecoratedSliver draws only up to the bottom cache when sliver has infinite scroll extent', (WidgetTester tester) async { + testWidgets('DecoratedSliver draws only up to the bottom cache when sliver has infinite scroll extent', (WidgetTester tester) async { const Key key = Key('DecoratedSliver with border'); const Color black = Color(0xFF000000); final ScrollController controller = ScrollController(); diff --git a/packages/flutter/test/widgets/default_colors_test.dart b/packages/flutter/test/widgets/default_colors_test.dart index 90b89bfedea..1a410f572b3 100644 --- a/packages/flutter/test/widgets/default_colors_test.dart +++ b/packages/flutter/test/widgets/default_colors_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const double _crispText = 100.0; // this font size is selected to avoid needing any antialiasing. const String _expText = 'Éxp'; // renders in the test font as: @@ -20,7 +19,7 @@ const String _expText = 'Éxp'; // renders in the test font as: // ÉÉÉÉxxxxpppp void main() { - testWidgetsWithLeakTracking('Default background', (WidgetTester tester) async { + testWidgets('Default background', (WidgetTester tester) async { await tester.pumpWidget(const Align( alignment: Alignment.topLeft, child: Text(_expText, textDirection: TextDirection.ltr, style: TextStyle(color: Color(0xFF345678), fontSize: _crispText))), @@ -41,7 +40,7 @@ void main() { ); }, skip: !canCaptureImage); // [intended] Test relies on captureImage, which is not supported on web currently. - testWidgetsWithLeakTracking('Default text color', (WidgetTester tester) async { + testWidgets('Default text color', (WidgetTester tester) async { await tester.pumpWidget(const ColoredBox( color: Color(0xFFABCDEF), child: Align( @@ -66,7 +65,7 @@ void main() { ); }, skip: !canCaptureImage); // [intended] Test relies on captureImage, which is not supported on web currently. - testWidgetsWithLeakTracking('Default text selection color', (WidgetTester tester) async { + testWidgets('Default text selection color', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); diff --git a/packages/flutter/test/widgets/default_text_editing_shortcuts_test.dart b/packages/flutter/test/widgets/default_text_editing_shortcuts_test.dart index c3d8a71aa31..a68002c933d 100644 --- a/packages/flutter/test/widgets/default_text_editing_shortcuts_test.dart +++ b/packages/flutter/test/widgets/default_text_editing_shortcuts_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'keyboard_utils.dart'; @@ -54,7 +53,7 @@ void main() { final FocusNode editable = FocusNode(); final FocusNode spy = FocusNode(); - testWidgetsWithLeakTracking('backspace with and without word modifier', (WidgetTester tester) async { + testWidgets('backspace with and without word modifier', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown(tester.binding.testTextInput.register); @@ -78,7 +77,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: iOS); - testWidgetsWithLeakTracking('delete with and without word modifier', (WidgetTester tester) async { + testWidgets('delete with and without word modifier', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown(tester.binding.testTextInput.register); @@ -102,7 +101,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: iOS); - testWidgetsWithLeakTracking('Exception: deleting to line boundary is handled by the framework', (WidgetTester tester) async { + testWidgets('Exception: deleting to line boundary is handled by the framework', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown(tester.binding.testTextInput.register); @@ -132,7 +131,7 @@ void main() { group('macOS does not accept shortcuts if focus under EditableText', () { final TargetPlatformVariant macOSOnly = TargetPlatformVariant.only(TargetPlatform.macOS); - testWidgetsWithLeakTracking('word modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('word modifier + arrowLeft', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -157,7 +156,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: macOSOnly); - testWidgetsWithLeakTracking('word modifier + arrowRight', (WidgetTester tester) async { + testWidgets('word modifier + arrowRight', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -182,7 +181,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('line modifier + arrowLeft', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -207,7 +206,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrowRight', (WidgetTester tester) async { + testWidgets('line modifier + arrowRight', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -232,7 +231,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: macOSOnly); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -269,7 +268,7 @@ void main() { expect(state.lastIntent, isNull); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -309,7 +308,7 @@ void main() { group('macOS does accept shortcuts if focus above EditableText', () { final TargetPlatformVariant macOSOnly = TargetPlatformVariant.only(TargetPlatform.macOS); - testWidgetsWithLeakTracking('word modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('word modifier + arrowLeft', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -334,7 +333,7 @@ void main() { expect(state.lastIntent, isA<ExtendSelectionToNextWordBoundaryIntent>()); }, variant: macOSOnly); - testWidgetsWithLeakTracking('word modifier + arrowRight', (WidgetTester tester) async { + testWidgets('word modifier + arrowRight', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -359,7 +358,7 @@ void main() { expect(state.lastIntent, isA<ExtendSelectionToNextWordBoundaryIntent>()); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('line modifier + arrowLeft', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -384,7 +383,7 @@ void main() { expect(state.lastIntent, isA<ExtendSelectionToLineBreakIntent>()); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrowRight', (WidgetTester tester) async { + testWidgets('line modifier + arrowRight', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -409,7 +408,7 @@ void main() { expect(state.lastIntent, isA<ExtendSelectionToLineBreakIntent>()); }, variant: macOSOnly); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); @@ -448,7 +447,7 @@ void main() { expect(state.lastIntent, isA<ExtendSelectionToNextWordBoundaryIntent>()); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { tester.binding.testTextInput.unregister(); addTearDown((){ tester.binding.testTextInput.register(); diff --git a/packages/flutter/test/widgets/default_text_height_behavior_test.dart b/packages/flutter/test/widgets/default_text_height_behavior_test.dart index 5649d75a2c6..a3974dffb09 100644 --- a/packages/flutter/test/widgets/default_text_height_behavior_test.dart +++ b/packages/flutter/test/widgets/default_text_height_behavior_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Text widget parameter takes precedence over DefaultTextHeightBehavior', (WidgetTester tester) async { + testWidgets('Text widget parameter takes precedence over DefaultTextHeightBehavior', (WidgetTester tester) async { const TextHeightBehavior behavior1 = TextHeightBehavior( applyHeightToLastDescent: false, applyHeightToFirstAscent: false, @@ -32,7 +31,7 @@ void main() { expect(text.textHeightBehavior, behavior1); }); - testWidgetsWithLeakTracking('DefaultTextStyle.textHeightBehavior takes precedence over DefaultTextHeightBehavior ', (WidgetTester tester) async { + testWidgets('DefaultTextStyle.textHeightBehavior takes precedence over DefaultTextHeightBehavior ', (WidgetTester tester) async { const TextHeightBehavior behavior1 = TextHeightBehavior( applyHeightToLastDescent: false, applyHeightToFirstAscent: false, @@ -78,7 +77,7 @@ void main() { expect(text.textHeightBehavior, behavior1); }); - testWidgetsWithLeakTracking('DefaultTextHeightBehavior changes propagate to Text', (WidgetTester tester) async { + testWidgets('DefaultTextHeightBehavior changes propagate to Text', (WidgetTester tester) async { const Text textWidget = Text('Hello', textDirection: TextDirection.ltr); const TextHeightBehavior behavior1 = TextHeightBehavior( applyHeightToLastDescent: false, @@ -108,7 +107,7 @@ void main() { expect(text.textHeightBehavior, behavior2); }); - testWidgetsWithLeakTracking( + testWidgets( 'DefaultTextHeightBehavior.of(context) returns null if no ' 'DefaultTextHeightBehavior widget in tree', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/default_text_style_test.dart b/packages/flutter/test/widgets/default_text_style_test.dart index 9b26768b91b..ddd9c6a986d 100644 --- a/packages/flutter/test/widgets/default_text_style_test.dart +++ b/packages/flutter/test/widgets/default_text_style_test.dart @@ -6,10 +6,9 @@ import 'dart:ui' as ui show TextHeightBehavior; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('DefaultTextStyle changes propagate to Text', (WidgetTester tester) async { + testWidgets('DefaultTextStyle changes propagate to Text', (WidgetTester tester) async { const Text textWidget = Text('Hello', textDirection: TextDirection.ltr); const TextStyle s1 = TextStyle( fontSize: 10.0, @@ -44,7 +43,7 @@ void main() { expect(text.maxLines, 3); }); - testWidgetsWithLeakTracking('AnimatedDefaultTextStyle changes propagate to Text', (WidgetTester tester) async { + testWidgets('AnimatedDefaultTextStyle changes propagate to Text', (WidgetTester tester) async { const Text textWidget = Text('Hello', textDirection: TextDirection.ltr); const TextStyle s1 = TextStyle( fontSize: 10.0, diff --git a/packages/flutter/test/widgets/did_update_widget_test.dart b/packages/flutter/test/widgets/did_update_widget_test.dart index d697cdbebd2..afe802a5df8 100644 --- a/packages/flutter/test/widgets/did_update_widget_test.dart +++ b/packages/flutter/test/widgets/did_update_widget_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can call setState from didUpdateWidget', (WidgetTester tester) async { + testWidgets('Can call setState from didUpdateWidget', (WidgetTester tester) async { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: WidgetUnderTest(text: 'hello'), diff --git a/packages/flutter/test/widgets/directionality_test.dart b/packages/flutter/test/widgets/directionality_test.dart index 4f83dc35fb3..8472eb46ad9 100644 --- a/packages/flutter/test/widgets/directionality_test.dart +++ b/packages/flutter/test/widgets/directionality_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Directionality', (WidgetTester tester) async { + testWidgets('Directionality', (WidgetTester tester) async { final List<TextDirection> log = <TextDirection>[]; final Widget inner = Builder( builder: (BuildContext context) { @@ -52,7 +51,7 @@ void main() { expect(log, <TextDirection>[TextDirection.ltr, TextDirection.rtl, TextDirection.ltr]); }); - testWidgetsWithLeakTracking('Directionality default', (WidgetTester tester) async { + testWidgets('Directionality default', (WidgetTester tester) async { bool good = false; await tester.pumpWidget(Builder( builder: (BuildContext context) { @@ -64,7 +63,7 @@ void main() { expect(good, isTrue); }); - testWidgetsWithLeakTracking('Directionality.maybeOf', (WidgetTester tester) async { + testWidgets('Directionality.maybeOf', (WidgetTester tester) async { final GlobalKey hasDirectionality = GlobalKey(); final GlobalKey noDirectionality = GlobalKey(); await tester.pumpWidget( @@ -82,7 +81,7 @@ void main() { expect(Directionality.maybeOf(hasDirectionality.currentContext!), TextDirection.rtl); }); - testWidgetsWithLeakTracking('Directionality.of', (WidgetTester tester) async { + testWidgets('Directionality.of', (WidgetTester tester) async { final GlobalKey hasDirectionality = GlobalKey(); final GlobalKey noDirectionality = GlobalKey(); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart index 878ea08bd0c..b948dc1331f 100644 --- a/packages/flutter/test/widgets/dismissible_test.dart +++ b/packages/flutter/test/widgets/dismissible_test.dart @@ -7,7 +7,6 @@ import 'dart:async'; import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const DismissDirection defaultDismissDirection = DismissDirection.horizontal; const double crossAxisEndOffset = 0.5; @@ -253,7 +252,7 @@ void main() { dismissedItems = <int>[]; }); - testWidgetsWithLeakTracking('Horizontal drag triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { + testWidgets('Horizontal drag triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { await tester.pumpWidget( buildTest(), ); @@ -270,7 +269,7 @@ void main() { expect(reportedDismissDirection, DismissDirection.endToStart); }); - testWidgetsWithLeakTracking('Horizontal fling triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { + testWidgets('Horizontal fling triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { await tester.pumpWidget( buildTest(), ); @@ -287,7 +286,7 @@ void main() { expect(reportedDismissDirection, DismissDirection.endToStart); }); - testWidgetsWithLeakTracking('Horizontal fling does not trigger at zero offset, but does otherwise', (WidgetTester tester) async { + testWidgets('Horizontal fling does not trigger at zero offset, but does otherwise', (WidgetTester tester) async { await tester.pumpWidget( buildTest( startToEndThreshold: 0.95, @@ -314,7 +313,7 @@ void main() { expect(reportedDismissDirection, DismissDirection.endToStart); }); - testWidgetsWithLeakTracking('Vertical drag triggers dismiss scrollDirection=horizontal', (WidgetTester tester) async { + testWidgets('Vertical drag triggers dismiss scrollDirection=horizontal', (WidgetTester tester) async { await tester.pumpWidget( buildTest( scrollDirection: Axis.horizontal, @@ -334,7 +333,7 @@ void main() { expect(reportedDismissDirection, DismissDirection.down); }); - testWidgetsWithLeakTracking('drag-left with DismissDirection.endToStart triggers dismiss (LTR)', (WidgetTester tester) async { + testWidgets('drag-left with DismissDirection.endToStart triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( dismissDirection: DismissDirection.endToStart, @@ -353,7 +352,7 @@ void main() { await dismissItem(tester, 1, gestureDirection: AxisDirection.left); }); - testWidgetsWithLeakTracking('drag-right with DismissDirection.startToEnd triggers dismiss (LTR)', (WidgetTester tester) async { + testWidgets('drag-right with DismissDirection.startToEnd triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( dismissDirection: DismissDirection.startToEnd, @@ -370,7 +369,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('drag-right with DismissDirection.endToStart triggers dismiss (RTL)', (WidgetTester tester) async { + testWidgets('drag-right with DismissDirection.endToStart triggers dismiss (RTL)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, @@ -389,7 +388,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('drag-left with DismissDirection.startToEnd triggers dismiss (RTL)', (WidgetTester tester) async { + testWidgets('drag-left with DismissDirection.startToEnd triggers dismiss (RTL)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, @@ -409,7 +408,7 @@ void main() { await dismissItem(tester, 1, gestureDirection: AxisDirection.left); }); - testWidgetsWithLeakTracking('fling-left with DismissDirection.endToStart triggers dismiss (LTR)', (WidgetTester tester) async { + testWidgets('fling-left with DismissDirection.endToStart triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( dismissDirection: DismissDirection.endToStart, @@ -428,7 +427,7 @@ void main() { await dismissItem(tester, 1, gestureDirection: AxisDirection.left); }); - testWidgetsWithLeakTracking('fling-right with DismissDirection.startToEnd triggers dismiss (LTR)', (WidgetTester tester) async { + testWidgets('fling-right with DismissDirection.startToEnd triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( dismissDirection: DismissDirection.startToEnd, @@ -446,7 +445,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('fling-right with DismissDirection.endToStart triggers dismiss (RTL)', (WidgetTester tester) async { + testWidgets('fling-right with DismissDirection.endToStart triggers dismiss (RTL)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, @@ -464,7 +463,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('fling-left with DismissDirection.startToEnd triggers dismiss (RTL)', (WidgetTester tester) async { + testWidgets('fling-left with DismissDirection.startToEnd triggers dismiss (RTL)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, @@ -484,7 +483,7 @@ void main() { await dismissItem(tester, 1, mechanism: flingElement, gestureDirection: AxisDirection.left); }); - testWidgetsWithLeakTracking('drag-up with DismissDirection.up triggers dismiss', (WidgetTester tester) async { + testWidgets('drag-up with DismissDirection.up triggers dismiss', (WidgetTester tester) async { await tester.pumpWidget( buildTest( scrollDirection: Axis.horizontal, @@ -502,7 +501,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('drag-down with DismissDirection.down triggers dismiss', (WidgetTester tester) async { + testWidgets('drag-down with DismissDirection.down triggers dismiss', (WidgetTester tester) async { await tester.pumpWidget( buildTest( scrollDirection: Axis.horizontal, @@ -520,7 +519,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('fling-up with DismissDirection.up triggers dismiss', (WidgetTester tester) async { + testWidgets('fling-up with DismissDirection.up triggers dismiss', (WidgetTester tester) async { await tester.pumpWidget( buildTest( scrollDirection: Axis.horizontal, @@ -538,7 +537,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('fling-down with DismissDirection.down triggers dismiss', (WidgetTester tester) async { + testWidgets('fling-down with DismissDirection.down triggers dismiss', (WidgetTester tester) async { await tester.pumpWidget( buildTest( scrollDirection: Axis.horizontal, @@ -556,7 +555,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('drag-left has no effect on dismissible with a high dismiss threshold', (WidgetTester tester) async { + testWidgets('drag-left has no effect on dismissible with a high dismiss threshold', (WidgetTester tester) async { await tester.pumpWidget( buildTest( startToEndThreshold: 1.0, @@ -573,7 +572,7 @@ void main() { expect(dismissedItems, equals(<int>[0])); }); - testWidgetsWithLeakTracking('fling-left has no effect on dismissible with a high dismiss threshold', (WidgetTester tester) async { + testWidgets('fling-left has no effect on dismissible with a high dismiss threshold', (WidgetTester tester) async { await tester.pumpWidget( buildTest( startToEndThreshold: 1.0, @@ -596,7 +595,7 @@ void main() { // now since we migrated to the new repo. The bug was fixed by // https://github.com/flutter/engine/pull/1134 at the time, and later made // irrelevant by fn3, but just in case... - testWidgetsWithLeakTracking('Verify that drag-move events do not assert', (WidgetTester tester) async { + testWidgets('Verify that drag-move events do not assert', (WidgetTester tester) async { await tester.pumpWidget( buildTest( scrollDirection: Axis.horizontal, @@ -623,7 +622,7 @@ void main() { // died in the migration to the new repo). Don't copy this test; it doesn't // actually remove the dismissed widget, which is a violation of the // Dismissible contract. This is not an example of good practice. - testWidgetsWithLeakTracking('dismissing bottom then top (smoketest)', (WidgetTester tester) async { + testWidgets('dismissing bottom then top (smoketest)', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -655,7 +654,7 @@ void main() { expect(find.text('2'), findsNothing); }); - testWidgetsWithLeakTracking('Dismissible starts from the full size when collapsing', (WidgetTester tester) async { + testWidgets('Dismissible starts from the full size when collapsing', (WidgetTester tester) async { await tester.pumpWidget( buildTest( background: const Text('background'), @@ -673,7 +672,7 @@ void main() { expect(backgroundBox.size.height, equals(100.0)); }); - testWidgetsWithLeakTracking('Checking fling item before movementDuration completes', (WidgetTester tester) async { + testWidgets('Checking fling item before movementDuration completes', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(dismissedItems, isEmpty); @@ -684,7 +683,7 @@ void main() { expect(find.text('1'), findsOneWidget); }); - testWidgetsWithLeakTracking('Checking fling item after movementDuration', (WidgetTester tester) async { + testWidgets('Checking fling item after movementDuration', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(dismissedItems, isEmpty); @@ -695,7 +694,7 @@ void main() { expect(find.text('0'), findsNothing); }); - testWidgetsWithLeakTracking('Horizontal fling less than threshold', (WidgetTester tester) async { + testWidgets('Horizontal fling less than threshold', (WidgetTester tester) async { await tester.pumpWidget(buildTest(scrollDirection: Axis.horizontal)); expect(dismissedItems, isEmpty); @@ -708,7 +707,7 @@ void main() { expect(dismissedItems, isEmpty); }); - testWidgetsWithLeakTracking('Vertical fling less than threshold', (WidgetTester tester) async { + testWidgets('Vertical fling less than threshold', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(dismissedItems, isEmpty); @@ -721,7 +720,7 @@ void main() { expect(dismissedItems, isEmpty); }); - testWidgetsWithLeakTracking('confirmDismiss returns values: true, false, null', (WidgetTester tester) async { + testWidgets('confirmDismiss returns values: true, false, null', (WidgetTester tester) async { late DismissDirection confirmDismissDirection; Widget buildFrame(bool? confirmDismissValue) { @@ -778,7 +777,7 @@ void main() { expect(confirmDismissDirection, DismissDirection.endToStart); }); - testWidgetsWithLeakTracking('Pending confirmDismiss does not cause errors', (WidgetTester tester) async { + testWidgets('Pending confirmDismiss does not cause errors', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/54990 late Completer<bool?> completer; @@ -840,7 +839,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('Dismissible cannot be dragged with pending confirmDismiss', (WidgetTester tester) async { + testWidgets('Dismissible cannot be dragged with pending confirmDismiss', (WidgetTester tester) async { final Completer<bool?> completer = Completer<bool?>(); await tester.pumpWidget( buildTest( @@ -864,7 +863,7 @@ void main() { expect(tester.getTopLeft(find.text('0')), position); }); - testWidgetsWithLeakTracking('Drag to end and release - items does not get stuck if confirmDismiss returns false', (WidgetTester tester) async { + testWidgets('Drag to end and release - items does not get stuck if confirmDismiss returns false', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/87556 final Completer<bool?> completer = Completer<bool?>(); @@ -883,7 +882,7 @@ void main() { expect(tester.getTopLeft(find.text('0')), position); }); - testWidgetsWithLeakTracking('Dismissible with null resizeDuration calls onDismissed immediately', (WidgetTester tester) async { + testWidgets('Dismissible with null resizeDuration calls onDismissed immediately', (WidgetTester tester) async { bool resized = false; bool dismissed = false; @@ -915,7 +914,7 @@ void main() { expect(resized, false); }); - testWidgetsWithLeakTracking('setState that does not remove the Dismissible from tree should throw Error', (WidgetTester tester) async { + testWidgets('setState that does not remove the Dismissible from tree should throw Error', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: StatefulBuilder( @@ -972,7 +971,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dismissible.behavior should behave correctly during hit testing', (WidgetTester tester) async { + testWidgets('Dismissible.behavior should behave correctly during hit testing', (WidgetTester tester) async { bool didReceivePointerDown = false; Widget buildStack({required Widget child}) { @@ -1041,7 +1040,7 @@ void main() { expect(didReceivePointerDown, isTrue); }); - testWidgetsWithLeakTracking('DismissDirection.none does not trigger dismiss', (WidgetTester tester) async { + testWidgets('DismissDirection.none does not trigger dismiss', (WidgetTester tester) async { await tester.pumpWidget(buildTest( dismissDirection: DismissDirection.none, scrollPhysics: const NeverScrollableScrollPhysics(), @@ -1055,7 +1054,7 @@ void main() { expect(find.text('0'), findsOneWidget); }); - testWidgetsWithLeakTracking('DismissDirection.none does not prevent scrolling', (WidgetTester tester) async { + testWidgets('DismissDirection.none does not prevent scrolling', (WidgetTester tester) async { final ScrollController controller = ScrollController(); await tester.pumpWidget( @@ -1078,7 +1077,7 @@ void main() { controller.dispose(); }); - testWidgetsWithLeakTracking('onUpdate', (WidgetTester tester) async { + testWidgets('onUpdate', (WidgetTester tester) async { await tester.pumpWidget(buildTest( scrollDirection: Axis.horizontal, )); @@ -1132,7 +1131,7 @@ void main() { expect(reportedDismissUpdateProgress, 0.0); }); - testWidgetsWithLeakTracking('Change direction does not lose child state', (WidgetTester tester) async { + testWidgets('Change direction does not lose child state', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/108961 Widget buildFrame(DismissDirection direction) { return Directionality( diff --git a/packages/flutter/test/widgets/display_feature_sub_screen_test.dart b/packages/flutter/test/widgets/display_feature_sub_screen_test.dart index e61042887f0..926a459a81d 100644 --- a/packages/flutter/test/widgets/display_feature_sub_screen_test.dart +++ b/packages/flutter/test/widgets/display_feature_sub_screen_test.dart @@ -6,11 +6,10 @@ import 'dart:ui'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('DisplayFeatureSubScreen', () { - testWidgetsWithLeakTracking('without Directionality or anchor', (WidgetTester tester) async { + testWidgets('without Directionality or anchor', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ @@ -38,7 +37,7 @@ void main() { expect(message, contains('Directionality')); }); - testWidgetsWithLeakTracking('with anchorPoint', (WidgetTester tester) async { + testWidgets('with anchorPoint', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ @@ -69,7 +68,7 @@ void main() { expect(renderBox.localToGlobal(Offset.zero), equals(const Offset(410,0))); }); - testWidgetsWithLeakTracking('with infinity anchorpoint', (WidgetTester tester) async { + testWidgets('with infinity anchorpoint', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ @@ -100,7 +99,7 @@ void main() { expect(renderBox.localToGlobal(Offset.zero), equals(const Offset(410,0))); }); - testWidgetsWithLeakTracking('with horizontal hinge and anchorPoint', (WidgetTester tester) async { + testWidgets('with horizontal hinge and anchorPoint', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ @@ -130,7 +129,7 @@ void main() { expect(renderBox.localToGlobal(Offset.zero), equals(const Offset(0,310))); }); - testWidgetsWithLeakTracking('with multiple display features and anchorPoint', (WidgetTester tester) async { + testWidgets('with multiple display features and anchorPoint', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ @@ -165,7 +164,7 @@ void main() { expect(renderBox.localToGlobal(Offset.zero), equals(const Offset(410,310))); }); - testWidgetsWithLeakTracking('with non-splitting display features and anchorPoint', (WidgetTester tester) async { + testWidgets('with non-splitting display features and anchorPoint', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ @@ -210,7 +209,7 @@ void main() { expect(renderBox.localToGlobal(Offset.zero), equals(Offset.zero)); }); - testWidgetsWithLeakTracking('with size 0 display feature in half-opened posture and anchorPoint', (WidgetTester tester) async { + testWidgets('with size 0 display feature in half-opened posture and anchorPoint', (WidgetTester tester) async { const Key childKey = Key('childKey'); final MediaQueryData mediaQuery = MediaQueryData.fromView(tester.view).copyWith( displayFeatures: <DisplayFeature>[ diff --git a/packages/flutter/test/widgets/disposable_build_context_test.dart b/packages/flutter/test/widgets/disposable_build_context_test.dart index 463de7d7871..ec89d80b436 100644 --- a/packages/flutter/test/widgets/disposable_build_context_test.dart +++ b/packages/flutter/test/widgets/disposable_build_context_test.dart @@ -8,7 +8,7 @@ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('DisposableBuildContext asserts on disposed state', (WidgetTester tester) async { + testWidgets('DisposableBuildContext asserts on disposed state', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); await tester.pumpWidget(TestWidget(key)); @@ -31,7 +31,7 @@ void main() { expect(() => DisposableBuildContext(state), throwsAssertionError); }); - testWidgetsWithLeakTracking('DisposableBuildContext dispatches memory events', (WidgetTester tester) async { + testWidgets('DisposableBuildContext dispatches memory events', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); await tester.pumpWidget(TestWidget(key)); diff --git a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart index bf7e87fd320..52e8dd1b4ac 100644 --- a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart +++ b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart @@ -72,7 +72,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Do not crash when replacing scroll position during the drag', (WidgetTester tester) async { + testWidgets('Do not crash when replacing scroll position during the drag', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/89681 bool showScrollbars = false; await tester.pumpWidget( @@ -120,7 +120,7 @@ void main() { // Go without throw. }); - testWidgetsWithLeakTracking('Scrolls correct amount when maxChildSize < 1.0', (WidgetTester tester) async { + testWidgets('Scrolls correct amount when maxChildSize < 1.0', (WidgetTester tester) async { const Key key = ValueKey<String>('container'); await tester.pumpWidget(boilerplateWidget( null, @@ -136,7 +136,7 @@ void main() { expect(tester.getRect(find.byKey(key)), const Rect.fromLTRB(0.0, 325.0, 800.0, 600.0)); }); - testWidgetsWithLeakTracking('Scrolls correct amount when maxChildSize == 1.0', (WidgetTester tester) async { + testWidgets('Scrolls correct amount when maxChildSize == 1.0', (WidgetTester tester) async { const Key key = ValueKey<String>('container'); await tester.pumpWidget(boilerplateWidget( null, @@ -173,7 +173,7 @@ void main() { }); group('Scroll Physics', () { - testWidgetsWithLeakTracking('Can be dragged up without covering its container', (WidgetTester tester) async { + testWidgets('Can be dragged up without covering its container', (WidgetTester tester) async { int taps = 0; await tester.pumpWidget(boilerplateWidget(() => taps++)); @@ -194,7 +194,7 @@ void main() { expect(find.text('Item 31'), findsOneWidget); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be dragged down when not full height', (WidgetTester tester) async { + testWidgets('Can be dragged down when not full height', (WidgetTester tester) async { await tester.pumpWidget(boilerplateWidget(null)); expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 21'), findsOneWidget); @@ -207,7 +207,7 @@ void main() { expect(find.text('Item 36'), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be dragged down when list is shorter than full height', (WidgetTester tester) async { + testWidgets('Can be dragged down when list is shorter than full height', (WidgetTester tester) async { await tester.pumpWidget(boilerplateWidget(null, itemCount: 30, initialChildSize: .25)); expect(find.text('Item 1').hitTestable(), findsOneWidget); @@ -224,7 +224,7 @@ void main() { expect(find.text('Item 29').hitTestable(), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be dragged up and cover its container and scroll in single motion, and then dragged back down', (WidgetTester tester) async { + testWidgets('Can be dragged up and cover its container and scroll in single motion, and then dragged back down', (WidgetTester tester) async { int taps = 0; await tester.pumpWidget(boilerplateWidget(() => taps++)); @@ -253,7 +253,7 @@ void main() { expect(find.text('Item 36'), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be flung up gently', (WidgetTester tester) async { + testWidgets('Can be flung up gently', (WidgetTester tester) async { int taps = 0; await tester.pumpWidget(boilerplateWidget(() => taps++)); @@ -276,7 +276,7 @@ void main() { expect(find.text('Item 70'), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be flung up', (WidgetTester tester) async { + testWidgets('Can be flung up', (WidgetTester tester) async { int taps = 0; await tester.pumpWidget(boilerplateWidget(() => taps++)); @@ -302,7 +302,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be flung down when not full height', (WidgetTester tester) async { + testWidgets('Can be flung down when not full height', (WidgetTester tester) async { await tester.pumpWidget(boilerplateWidget(null)); expect(find.text('Item 1'), findsOneWidget); expect(find.text('Item 21'), findsOneWidget); @@ -315,7 +315,7 @@ void main() { expect(find.text('Item 36'), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Can be flung up and then back down', (WidgetTester tester) async { + testWidgets('Can be flung up and then back down', (WidgetTester tester) async { int taps = 0; await tester.pumpWidget(boilerplateWidget(() => taps++)); @@ -359,7 +359,7 @@ void main() { expect(find.text('Item 70'), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Ballistic animation on fling can be interrupted', (WidgetTester tester) async { + testWidgets('Ballistic animation on fling can be interrupted', (WidgetTester tester) async { int taps = 0; await tester.pumpWidget(boilerplateWidget(() => taps++)); @@ -393,7 +393,7 @@ void main() { expect(find.text('Item 70'), findsNothing); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Ballistic animation on fling should not leak Ticker', (WidgetTester tester) async { + testWidgets('Ballistic animation on fling should not leak Ticker', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/101061 await tester.pumpWidget( Directionality( @@ -448,7 +448,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Does not snap away from initial child on build', (WidgetTester tester) async { + testWidgets('Does not snap away from initial child on build', (WidgetTester tester) async { const Key containerKey = ValueKey<String>('container'); const Key stackKey = ValueKey<String>('stack'); await tester.pumpWidget(boilerplateWidget(null, @@ -468,7 +468,7 @@ void main() { }, variant: TargetPlatformVariant.all()); for (final bool useActuator in <bool>[false, true]) { - testWidgetsWithLeakTracking('Does not snap away from initial child on ${useActuator ? 'actuator' : 'controller'}.reset()', (WidgetTester tester) async { + testWidgets('Does not snap away from initial child on ${useActuator ? 'actuator' : 'controller'}.reset()', (WidgetTester tester) async { const Key containerKey = ValueKey<String>('container'); const Key stackKey = ValueKey<String>('stack'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -506,7 +506,7 @@ void main() { } for (final Duration? snapAnimationDuration in <Duration?>[null, const Duration(seconds: 2)]) { - testWidgetsWithLeakTracking( + testWidgets( 'Zero velocity drag snaps to nearest snap target with ' 'snapAnimationDuration: $snapAnimationDuration', (WidgetTester tester) async { @@ -565,7 +565,7 @@ void main() { } for (final List<double>? snapSizes in <List<double>?>[null, <double>[]]) { - testWidgetsWithLeakTracking('Setting snapSizes to $snapSizes resolves to min and max', (WidgetTester tester) async { + testWidgets('Setting snapSizes to $snapSizes resolves to min and max', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); await tester.pumpWidget(boilerplateWidget(null, @@ -593,7 +593,7 @@ void main() { }, variant: TargetPlatformVariant.all()); } - testWidgetsWithLeakTracking('Min and max are implicitly added to snapSizes', (WidgetTester tester) async { + testWidgets('Min and max are implicitly added to snapSizes', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); await tester.pumpWidget(boilerplateWidget(null, @@ -620,7 +620,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Changes to widget parameters are propagated', (WidgetTester tester) async { + testWidgets('Changes to widget parameters are propagated', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); await tester.pumpWidget(boilerplateWidget( @@ -728,7 +728,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Fling snaps in direction of momentum', (WidgetTester tester) async { + testWidgets('Fling snaps in direction of momentum', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); await tester.pumpWidget(boilerplateWidget(null, @@ -756,7 +756,7 @@ void main() { }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking("Changing parameters with an un-listened controller doesn't throw", (WidgetTester tester) async { + testWidgets("Changing parameters with an un-listened controller doesn't throw", (WidgetTester tester) async { await tester.pumpWidget(boilerplateWidget( null, snap: true, @@ -771,7 +771,7 @@ void main() { await tester.pumpAndSettle(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Transitioning between scrollable children sharing a scroll controller will not throw', (WidgetTester tester) async { + testWidgets('Transitioning between scrollable children sharing a scroll controller will not throw', (WidgetTester tester) async { int s = 0; await tester.pumpWidget(MaterialApp( home: StatefulBuilder( @@ -828,7 +828,7 @@ void main() { // Completes without throwing }); - testWidgetsWithLeakTracking('ScrollNotification correctly dispatched when flung without covering its container', (WidgetTester tester) async { + testWidgets('ScrollNotification correctly dispatched when flung without covering its container', (WidgetTester tester) async { final List<Type> notificationTypes = <Type>[]; await tester.pumpWidget(boilerplateWidget( null, @@ -849,7 +849,7 @@ void main() { expect(notificationTypes, equals(types)); }); - testWidgetsWithLeakTracking('ScrollNotification correctly dispatched when flung with contents scroll', (WidgetTester tester) async { + testWidgets('ScrollNotification correctly dispatched when flung with contents scroll', (WidgetTester tester) async { final List<Type> notificationTypes = <Type>[]; await tester.pumpWidget(boilerplateWidget( null, @@ -872,7 +872,7 @@ void main() { expect(notificationTypes, types); }); - testWidgetsWithLeakTracking('Emits DraggableScrollableNotification with shouldCloseOnMinExtent set to non-default value', (WidgetTester tester) async { + testWidgets('Emits DraggableScrollableNotification with shouldCloseOnMinExtent set to non-default value', (WidgetTester tester) async { DraggableScrollableNotification? receivedNotification; await tester.pumpWidget(boilerplateWidget( null, @@ -888,7 +888,7 @@ void main() { expect(receivedNotification!.shouldCloseOnMinExtent, isFalse); }); - testWidgetsWithLeakTracking('Do not crash when remove the tree during animation.', (WidgetTester tester) async { + testWidgets('Do not crash when remove the tree during animation.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/89214 await tester.pumpWidget(boilerplateWidget( null, @@ -907,7 +907,7 @@ void main() { }); for (final bool shouldAnimate in <bool>[true, false]) { - testWidgetsWithLeakTracking('Can ${shouldAnimate ? 'animate' : 'jump'} to arbitrary positions', (WidgetTester tester) async { + testWidgets('Can ${shouldAnimate ? 'animate' : 'jump'} to arbitrary positions', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -983,7 +983,7 @@ void main() { }); } - testWidgetsWithLeakTracking('Can animateTo with a nonlinear curve', (WidgetTester tester) async { + testWidgets('Can animateTo with a nonlinear curve', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1031,7 +1031,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can animateTo with a Curves.easeInOutBack curve begin min-size', (WidgetTester tester) async { + testWidgets('Can animateTo with a Curves.easeInOutBack curve begin min-size', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1055,7 +1055,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can reuse a controller after the old controller is disposed', (WidgetTester tester) async { + testWidgets('Can reuse a controller after the old controller is disposed', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1086,7 +1086,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('animateTo interrupts other animations', (WidgetTester tester) async { + testWidgets('animateTo interrupts other animations', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1123,7 +1123,7 @@ void main() { expect(find.text('Item 1'), findsOneWidget); }); - testWidgetsWithLeakTracking('Other animations interrupt animateTo', (WidgetTester tester) async { + testWidgets('Other animations interrupt animateTo', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1157,7 +1157,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('animateTo can be interrupted by other animateTo or jumpTo', (WidgetTester tester) async { + testWidgets('animateTo can be interrupted by other animateTo or jumpTo', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1200,7 +1200,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can get size and pixels', (WidgetTester tester) async { + testWidgets('Can get size and pixels', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final DraggableScrollableController controller = DraggableScrollableController(); @@ -1252,7 +1252,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Can listen for changes in sheet size', (WidgetTester tester) async { + testWidgets('Can listen for changes in sheet size', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final List<double> loggedSizes = <double>[]; @@ -1301,7 +1301,7 @@ void main() { loggedSizes.clear(); }); - testWidgetsWithLeakTracking('Listener does not fire on parameter change and persists after change', (WidgetTester tester) async { + testWidgets('Listener does not fire on parameter change and persists after change', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final List<double> loggedSizes = <double>[]; @@ -1344,7 +1344,7 @@ void main() { loggedSizes.clear(); }); - testWidgetsWithLeakTracking('Listener fires if a parameter change forces a change in size', (WidgetTester tester) async { + testWidgets('Listener fires if a parameter change forces a change in size', (WidgetTester tester) async { const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); final List<double> loggedSizes = <double>[]; @@ -1396,7 +1396,7 @@ void main() { loggedSizes.clear(); }); - testWidgetsWithLeakTracking('Invalid controller interactions throw assertion errors', (WidgetTester tester) async { + testWidgets('Invalid controller interactions throw assertion errors', (WidgetTester tester) async { final DraggableScrollableController controller = DraggableScrollableController(); addTearDown(controller.dispose); // Can't use a controller before attaching it. @@ -1429,7 +1429,7 @@ void main() { expect(() => controller.animateTo(.5, duration: Duration.zero, curve: Curves.linear), throwsAssertionError); }); - testWidgetsWithLeakTracking('DraggableScrollableController must be attached before using any of its parameters', (WidgetTester tester) async { + testWidgets('DraggableScrollableController must be attached before using any of its parameters', (WidgetTester tester) async { final DraggableScrollableController controller = DraggableScrollableController(); addTearDown(controller.dispose); expect(controller.isAttached, false); @@ -1444,7 +1444,7 @@ void main() { expect(controller.size, isNotNull); }); - testWidgetsWithLeakTracking('DraggableScrollableController.animateTo after detach', (WidgetTester tester) async { + testWidgets('DraggableScrollableController.animateTo after detach', (WidgetTester tester) async { final DraggableScrollableController controller = DraggableScrollableController(); addTearDown(controller.dispose); await tester.pumpWidget(boilerplateWidget(() {}, controller: controller)); @@ -1459,7 +1459,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('DraggableScrollableSheet should not reset programmatic drag on rebuild', (WidgetTester tester) async { + testWidgets('DraggableScrollableSheet should not reset programmatic drag on rebuild', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/101114 const Key stackKey = ValueKey<String>('stack'); const Key containerKey = ValueKey<String>('container'); @@ -1526,7 +1526,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('DraggableScrollableSheet should respect NeverScrollableScrollPhysics', (WidgetTester tester) async { + testWidgets('DraggableScrollableSheet should respect NeverScrollableScrollPhysics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/121021 final DraggableScrollableController controller = DraggableScrollableController(); addTearDown(controller.dispose); @@ -1572,7 +1572,7 @@ void main() { expect(controller.pixels, initPixels + 300.0); }); - testWidgetsWithLeakTracking('DraggableScrollableSheet should not rebuild every frame while dragging', (WidgetTester tester) async { + testWidgets('DraggableScrollableSheet should not rebuild every frame while dragging', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/67219 int buildCount = 0; await tester.pumpWidget(MaterialApp( @@ -1619,7 +1619,7 @@ void main() { expect(buildCount, 2); }); - testWidgetsWithLeakTracking('DraggableScrollableSheet controller can be changed', (WidgetTester tester) async { + testWidgets('DraggableScrollableSheet controller can be changed', (WidgetTester tester) async { final DraggableScrollableController controller1 = DraggableScrollableController(); addTearDown(controller1.dispose); final DraggableScrollableController controller2 = DraggableScrollableController(); @@ -1679,7 +1679,7 @@ void main() { expect(loggedSizes, <double>[1.0].map((double v) => closeTo(v, precisionErrorTolerance))); }); - testWidgetsWithLeakTracking('DraggableScrollableSheet controller can be changed while animating', (WidgetTester tester) async { + testWidgets('DraggableScrollableSheet controller can be changed while animating', (WidgetTester tester) async { final DraggableScrollableController controller1 = DraggableScrollableController(); addTearDown(controller1.dispose); final DraggableScrollableController controller2 = DraggableScrollableController(); @@ -1736,7 +1736,7 @@ void main() { expect(controller2.isAttached, false); }); - testWidgetsWithLeakTracking('$DraggableScrollableController dispatches creation in constructor.', (WidgetTester widgetTester) async { + testWidgets('$DraggableScrollableController dispatches creation in constructor.', (WidgetTester widgetTester) async { await expectLater( await memoryEvents(() async => DraggableScrollableController().dispose(), DraggableScrollableController), areCreateAndDispose, diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 6ad69e21fae..56257b6978a 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -14,12 +14,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Drag and drop - control test', (WidgetTester tester) async { + testWidgets('Drag and drop - control test', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; int dragStartedCount = 0; @@ -94,7 +93,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/76825 - testWidgetsWithLeakTracking('Drag and drop - onLeave callback fires correctly with generic parameter', (WidgetTester tester) async { + testWidgets('Drag and drop - onLeave callback fires correctly with generic parameter', (WidgetTester tester) async { final Map<String,int> leftBehind = <String,int>{ 'Target 1': 0, 'Target 2': 0, @@ -169,7 +168,7 @@ void main() { expect(leftBehind['Target 2'], equals(1)); }); - testWidgetsWithLeakTracking('Drag and drop - onLeave callback fires correctly', (WidgetTester tester) async { + testWidgets('Drag and drop - onLeave callback fires correctly', (WidgetTester tester) async { final Map<String,int> leftBehind = <String,int>{ 'Target 1': 0, 'Target 2': 0, @@ -245,7 +244,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/76825 - testWidgetsWithLeakTracking('Drag and drop - onMove callback fires correctly with generic parameter', (WidgetTester tester) async { + testWidgets('Drag and drop - onMove callback fires correctly with generic parameter', (WidgetTester tester) async { final Map<String,int> targetMoveCount = <String,int>{ 'Target 1': 0, 'Target 2': 0, @@ -318,7 +317,7 @@ void main() { expect(targetMoveCount['Target 2'], equals(1)); }); - testWidgetsWithLeakTracking('Drag and drop - onMove callback fires correctly', (WidgetTester tester) async { + testWidgets('Drag and drop - onMove callback fires correctly', (WidgetTester tester) async { final Map<String,int> targetMoveCount = <String,int>{ 'Target 1': 0, 'Target 2': 0, @@ -395,7 +394,7 @@ void main() { expect(targetMoveCount['Target 2'], equals(1)); }); - testWidgetsWithLeakTracking('Drag and drop - onMove is not called if moved with null data', (WidgetTester tester) async { + testWidgets('Drag and drop - onMove is not called if moved with null data', (WidgetTester tester) async { bool onMoveCalled = false; await tester.pumpWidget(MaterialApp( @@ -436,7 +435,7 @@ void main() { expect(onMoveCalled, isFalse); }); - testWidgetsWithLeakTracking('Drag and drop - dragging over button', (WidgetTester tester) async { + testWidgets('Drag and drop - dragging over button', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation; @@ -529,7 +528,7 @@ void main() { events.clear(); }); - testWidgetsWithLeakTracking('Drag and drop - tapping button', (WidgetTester tester) async { + testWidgets('Drag and drop - tapping button', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation; @@ -586,7 +585,7 @@ void main() { events.clear(); }); - testWidgetsWithLeakTracking('Drag and drop - long press draggable, short press', (WidgetTester tester) async { + testWidgets('Drag and drop - long press draggable, short press', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation; @@ -635,7 +634,7 @@ void main() { expect(events, isEmpty); }); - testWidgetsWithLeakTracking('Drag and drop - long press draggable, long press', (WidgetTester tester) async { + testWidgets('Drag and drop - long press draggable, long press', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation; @@ -686,7 +685,7 @@ void main() { expect(events, equals(<String>['drop', 'details'])); }); - testWidgetsWithLeakTracking('Drag and drop - horizontal and vertical draggables in vertical block', (WidgetTester tester) async { + testWidgets('Drag and drop - horizontal and vertical draggables in vertical block', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation, thirdLocation; @@ -796,7 +795,7 @@ void main() { events.clear(); }); - testWidgetsWithLeakTracking('Drag and drop - horizontal and vertical draggables in horizontal block', (WidgetTester tester) async { + testWidgets('Drag and drop - horizontal and vertical draggables in horizontal block', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation, thirdLocation; @@ -955,7 +954,7 @@ void main() { ), ); } - testWidgetsWithLeakTracking('Null axis draggable moves along all axes', (WidgetTester tester) async { + testWidgets('Null axis draggable moves along all axes', (WidgetTester tester) async { await tester.pumpWidget(build()); final Offset firstLocation = tester.getTopLeft(find.text('N')); final Offset secondLocation = firstLocation + const Offset(300.0, 300.0); @@ -970,7 +969,7 @@ void main() { expect(tester.getTopLeft(find.text('N')), thirdLocation); }); - testWidgetsWithLeakTracking('Horizontal axis draggable moves horizontally', (WidgetTester tester) async { + testWidgets('Horizontal axis draggable moves horizontally', (WidgetTester tester) async { await tester.pumpWidget(build()); final Offset firstLocation = tester.getTopLeft(find.text('H')); final Offset secondLocation = firstLocation + const Offset(300.0, 0.0); @@ -985,7 +984,7 @@ void main() { expect(tester.getTopLeft(find.text('H')), thirdLocation); }); - testWidgetsWithLeakTracking('Horizontal axis draggable does not move vertically', (WidgetTester tester) async { + testWidgets('Horizontal axis draggable does not move vertically', (WidgetTester tester) async { await tester.pumpWidget(build()); final Offset firstLocation = tester.getTopLeft(find.text('H')); final Offset secondDragLocation = firstLocation + const Offset(300.0, 200.0); @@ -1003,7 +1002,7 @@ void main() { expect(tester.getTopLeft(find.text('H')), thirdWidgetLocation); }); - testWidgetsWithLeakTracking('Vertical axis draggable moves vertically', (WidgetTester tester) async { + testWidgets('Vertical axis draggable moves vertically', (WidgetTester tester) async { await tester.pumpWidget(build()); final Offset firstLocation = tester.getTopLeft(find.text('V')); final Offset secondLocation = firstLocation + const Offset(0.0, 300.0); @@ -1018,7 +1017,7 @@ void main() { expect(tester.getTopLeft(find.text('V')), thirdLocation); }); - testWidgetsWithLeakTracking('Vertical axis draggable does not move horizontally', (WidgetTester tester) async { + testWidgets('Vertical axis draggable does not move horizontally', (WidgetTester tester) async { await tester.pumpWidget(build()); final Offset firstLocation = tester.getTopLeft(find.text('V')); final Offset secondDragLocation = firstLocation + const Offset(200.0, 300.0); @@ -1084,7 +1083,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Null axis onDragUpdate called only if draggable moves in any direction', (WidgetTester tester) async { + testWidgets('Null axis onDragUpdate called only if draggable moves in any direction', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(updated, 0); @@ -1119,7 +1118,7 @@ void main() { expect(dragDelta.dy, 10); }); - testWidgetsWithLeakTracking('Vertical axis onDragUpdate only called if draggable moves vertical', (WidgetTester tester) async { + testWidgets('Vertical axis onDragUpdate only called if draggable moves vertical', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(updated, 0); @@ -1154,7 +1153,7 @@ void main() { expect(dragDelta.dy, 10); }); - testWidgetsWithLeakTracking('Horizontal axis onDragUpdate only called if draggable moves horizontal', (WidgetTester tester) async { + testWidgets('Horizontal axis onDragUpdate only called if draggable moves horizontal', (WidgetTester tester) async { await tester.pumpWidget(build()); expect(updated, 0); @@ -1190,7 +1189,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Drag and drop - onDraggableCanceled not called if dropped on accepting target', (WidgetTester tester) async { + testWidgets('Drag and drop - onDraggableCanceled not called if dropped on accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDraggableCanceledCalled = false; @@ -1258,7 +1257,7 @@ void main() { expect(onDraggableCanceledCalled, isFalse); }); - testWidgetsWithLeakTracking('Drag and drop - onDraggableCanceled called if dropped on non-accepting target', (WidgetTester tester) async { + testWidgets('Drag and drop - onDraggableCanceled called if dropped on non-accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDraggableCanceledCalled = false; @@ -1335,7 +1334,7 @@ void main() { expect(onDraggableCanceledOffset, equals(Offset(secondLocation.dx, secondLocation.dy))); }); - testWidgetsWithLeakTracking('Drag and drop - onDraggableCanceled called if dropped on non-accepting target with details', (WidgetTester tester) async { + testWidgets('Drag and drop - onDraggableCanceled called if dropped on non-accepting target with details', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDraggableCanceledCalled = false; @@ -1412,7 +1411,7 @@ void main() { expect(onDraggableCanceledOffset, equals(Offset(secondLocation.dx, secondLocation.dy))); }); - testWidgetsWithLeakTracking('Drag and drop - onDraggableCanceled called if dropped on non-accepting target with correct velocity', (WidgetTester tester) async { + testWidgets('Drag and drop - onDraggableCanceled called if dropped on non-accepting target with correct velocity', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDraggableCanceledCalled = false; @@ -1464,7 +1463,7 @@ void main() { expect(onDraggableCanceledOffset, equals(Offset(flingStart.dx, flingStart.dy) + const Offset(0.0, 100.0))); }); - testWidgetsWithLeakTracking('Drag and drop - onDragEnd not called if dropped on non-accepting target', (WidgetTester tester) async { + testWidgets('Drag and drop - onDragEnd not called if dropped on non-accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragEndCalled = false; @@ -1540,7 +1539,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Drag and drop - onDragEnd not called if dropped on non-accepting target with details', (WidgetTester tester) async { + testWidgets('Drag and drop - onDragEnd not called if dropped on non-accepting target with details', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragEndCalled = false; @@ -1616,7 +1615,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Drag and drop - DragTarget rebuilds with and without rejected data when a rejected draggable enters and leaves', (WidgetTester tester) async { + testWidgets('Drag and drop - DragTarget rebuilds with and without rejected data when a rejected draggable enters and leaves', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Column( children: <Widget>[ @@ -1670,7 +1669,7 @@ void main() { }); - testWidgetsWithLeakTracking('Drag and drop - Can drag and drop over a non-accepting target multiple times', (WidgetTester tester) async { + testWidgets('Drag and drop - Can drag and drop over a non-accepting target multiple times', (WidgetTester tester) async { int numberOfTimesOnDraggableCanceledCalled = 0; await tester.pumpWidget(MaterialApp( home: Column( @@ -1752,7 +1751,7 @@ void main() { expect(find.text('Rejected'), findsNothing); }); - testWidgetsWithLeakTracking('Drag and drop - onDragCompleted not called if dropped on non-accepting target', (WidgetTester tester) async { + testWidgets('Drag and drop - onDragCompleted not called if dropped on non-accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragCompletedCalled = false; @@ -1823,7 +1822,7 @@ void main() { expect(onDragCompletedCalled, isFalse); }); - testWidgetsWithLeakTracking('Drag and drop - onDragCompleted not called if dropped on non-accepting target with details', (WidgetTester tester) async { + testWidgets('Drag and drop - onDragCompleted not called if dropped on non-accepting target with details', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragCompletedCalled = false; @@ -1894,7 +1893,7 @@ void main() { expect(onDragCompletedCalled, isFalse); }); - testWidgetsWithLeakTracking('Drag and drop - onDragEnd called if dropped on accepting target', (WidgetTester tester) async { + testWidgets('Drag and drop - onDragEnd called if dropped on accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragEndCalled = false; @@ -1970,7 +1969,7 @@ void main() { expect(onDragEndDraggableDetails.offset, equals(expectedDropOffset)); }); - testWidgetsWithLeakTracking('DragTarget does not call onDragEnd when remove from the tree', (WidgetTester tester) async { + testWidgets('DragTarget does not call onDragEnd when remove from the tree', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation; int timesOnDragEndCalled = 0; @@ -2036,7 +2035,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('Drag and drop - onDragCompleted called if dropped on accepting target', (WidgetTester tester) async { + testWidgets('Drag and drop - onDragCompleted called if dropped on accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragCompletedCalled = false; @@ -2104,7 +2103,7 @@ void main() { expect(onDragCompletedCalled, isTrue); }); - testWidgetsWithLeakTracking('Drag and drop - allow pass through of unaccepted data test', (WidgetTester tester) async { + testWidgets('Drag and drop - allow pass through of unaccepted data test', (WidgetTester tester) async { final List<int> acceptedInts = <int>[]; final List<DragTargetDetails<int>> acceptedIntsDetails = <DragTargetDetails<int>>[]; final List<double> acceptedDoubles = <double>[]; @@ -2238,7 +2237,7 @@ void main() { expect(find.text('DoubleDragging'), findsNothing); }); - testWidgetsWithLeakTracking('Drag and drop - allow pass through of unaccepted data twice test', (WidgetTester tester) async { + testWidgets('Drag and drop - allow pass through of unaccepted data twice test', (WidgetTester tester) async { final List<DragTargetData> acceptedDragTargetDatas = <DragTargetData>[]; final List<DragTargetDetails<DragTargetData>> acceptedDragTargetDataDetails = <DragTargetDetails<DragTargetData>>[]; final List<ExtendedDragTargetData> acceptedExtendedDragTargetDatas = <ExtendedDragTargetData>[]; @@ -2306,7 +2305,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Drag and drop - maxSimultaneousDrags', (WidgetTester tester) async { + testWidgets('Drag and drop - maxSimultaneousDrags', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; @@ -2433,7 +2432,7 @@ void main() { expect(find.text('Target'), findsOneWidget); }); - testWidgetsWithLeakTracking('Drag and drop - onAccept is not called if dropped with null data', (WidgetTester tester) async { + testWidgets('Drag and drop - onAccept is not called if dropped with null data', (WidgetTester tester) async { bool onAcceptCalled = false; bool onAcceptWithDetailsCalled = false; @@ -2495,7 +2494,7 @@ void main() { expect(find.text('Target'), findsOneWidget); }); - testWidgetsWithLeakTracking('Draggable disposes recognizer', (WidgetTester tester) async { + testWidgets('Draggable disposes recognizer', (WidgetTester tester) async { late final OverlayEntry entry; addTearDown(() => entry..remove()..dispose()); @@ -2541,7 +2540,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/6128. - testWidgetsWithLeakTracking('Draggable plays nice with onTap', (WidgetTester tester) async { + testWidgets('Draggable plays nice with onTap', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -2574,7 +2573,7 @@ void main() { await secondGesture.up(); }); - testWidgetsWithLeakTracking('DragTarget does not set state when remove from the tree', (WidgetTester tester) async { + testWidgets('DragTarget does not set state when remove from the tree', (WidgetTester tester) async { final List<String> events = <String>[]; Offset firstLocation, secondLocation; @@ -2636,7 +2635,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('Drag and drop - remove draggable', (WidgetTester tester) async { + testWidgets('Drag and drop - remove draggable', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; @@ -2716,7 +2715,7 @@ void main() { expect(find.text('Target'), findsOneWidget); }); - testWidgetsWithLeakTracking('Tap above long-press draggable works', (WidgetTester tester) async { + testWidgets('Tap above long-press draggable works', (WidgetTester tester) async { final List<String> events = <String>[]; await tester.pumpWidget(MaterialApp( @@ -2740,7 +2739,7 @@ void main() { expect(events, equals(<String>['tap'])); }); - testWidgetsWithLeakTracking('long-press draggable calls onDragEnd called if dropped on accepting target', (WidgetTester tester) async { + testWidgets('long-press draggable calls onDragEnd called if dropped on accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragEndCalled = false; @@ -2827,7 +2826,7 @@ void main() { expect(onDragEndDraggableDetails.offset, equals(expectedDropOffset)); }); - testWidgetsWithLeakTracking('long-press draggable calls onDragCompleted called if dropped on accepting target', (WidgetTester tester) async { + testWidgets('long-press draggable calls onDragCompleted called if dropped on accepting target', (WidgetTester tester) async { final List<int> accepted = <int>[]; final List<DragTargetDetails<int>> acceptedDetails = <DragTargetDetails<int>>[]; bool onDragCompletedCalled = false; @@ -2903,7 +2902,7 @@ void main() { expect(onDragCompletedCalled, isTrue); }); - testWidgetsWithLeakTracking('long-press draggable calls onDragStartedCalled after long press', (WidgetTester tester) async { + testWidgets('long-press draggable calls onDragStartedCalled after long press', (WidgetTester tester) async { bool onDragStartedCalled = false; await tester.pumpWidget(MaterialApp( @@ -2940,7 +2939,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Custom long press delay for LongPressDraggable', (WidgetTester tester) async { + testWidgets('Custom long press delay for LongPressDraggable', (WidgetTester tester) async { bool onDragStartedCalled = false; await tester.pumpWidget(MaterialApp( home: LongPressDraggable<int>( @@ -2978,7 +2977,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Default long press delay for LongPressDraggable', (WidgetTester tester) async { + testWidgets('Default long press delay for LongPressDraggable', (WidgetTester tester) async { bool onDragStartedCalled = false; await tester.pumpWidget(MaterialApp( home: LongPressDraggable<int>( @@ -3015,23 +3014,23 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('long-press draggable calls Haptic Feedback onStart', (WidgetTester tester) async { + testWidgets('long-press draggable calls Haptic Feedback onStart', (WidgetTester tester) async { await _testLongPressDraggableHapticFeedback(tester: tester, hapticFeedbackOnStart: true, expectedHapticFeedbackCount: 1); }); - testWidgetsWithLeakTracking('long-press draggable can disable Haptic Feedback', (WidgetTester tester) async { + testWidgets('long-press draggable can disable Haptic Feedback', (WidgetTester tester) async { await _testLongPressDraggableHapticFeedback(tester: tester, hapticFeedbackOnStart: false, expectedHapticFeedbackCount: 0); }); - testWidgetsWithLeakTracking('Drag feedback with child anchor positions correctly', (WidgetTester tester) async { + testWidgets('Drag feedback with child anchor positions correctly', (WidgetTester tester) async { await _testChildAnchorFeedbackPosition(tester: tester); }); - testWidgetsWithLeakTracking('Drag feedback with child anchor within a non-global Overlay positions correctly', (WidgetTester tester) async { + testWidgets('Drag feedback with child anchor within a non-global Overlay positions correctly', (WidgetTester tester) async { await _testChildAnchorFeedbackPosition(tester: tester, left: 100.0, top: 100.0); }); - testWidgetsWithLeakTracking('Drag feedback is put on root overlay with [rootOverlay] flag', (WidgetTester tester) async { + testWidgets('Drag feedback is put on root overlay with [rootOverlay] flag', (WidgetTester tester) async { final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> childNavigatorKey = GlobalKey<NavigatorState>(); // Create a [MaterialApp], with a nested [Navigator], which has the @@ -3099,7 +3098,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/72483 - testWidgetsWithLeakTracking('Drag and drop - DragTarget<Object> can accept Draggable<int> data', (WidgetTester tester) async { + testWidgets('Drag and drop - DragTarget<Object> can accept Draggable<int> data', (WidgetTester tester) async { final List<Object> accepted = <Object>[]; await tester.pumpWidget(MaterialApp( home: Column( @@ -3135,7 +3134,7 @@ void main() { expect(accepted, equals(<int>[1])); }); - testWidgetsWithLeakTracking('Drag and drop - DragTarget<int> can accept Draggable<Object> data when runtime type is int', (WidgetTester tester) async { + testWidgets('Drag and drop - DragTarget<int> can accept Draggable<Object> data when runtime type is int', (WidgetTester tester) async { final List<int> accepted = <int>[]; await tester.pumpWidget(MaterialApp( home: Column( @@ -3171,7 +3170,7 @@ void main() { expect(accepted, equals(<int>[1])); }); - testWidgetsWithLeakTracking('Drag and drop - DragTarget<int> should not accept Draggable<Object> data when runtime type null', (WidgetTester tester) async { + testWidgets('Drag and drop - DragTarget<int> should not accept Draggable<Object> data when runtime type null', (WidgetTester tester) async { final List<int> accepted = <int>[]; bool isReceiveNullDataForCheck = false; await tester.pumpWidget(MaterialApp( @@ -3214,7 +3213,7 @@ void main() { expect(isReceiveNullDataForCheck, true); }); - testWidgetsWithLeakTracking('Drag and drop can contribute semantics', (WidgetTester tester) async { + testWidgets('Drag and drop can contribute semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( home: ListView( @@ -3380,7 +3379,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Drag and drop - when a dragAnchorStrategy is provided it gets called', (WidgetTester tester) async { + testWidgets('Drag and drop - when a dragAnchorStrategy is provided it gets called', (WidgetTester tester) async { bool dragAnchorStrategyCalled = false; await tester.pumpWidget(MaterialApp( @@ -3408,7 +3407,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('configurable Draggable hit test behavior', (WidgetTester tester) async { + testWidgets('configurable Draggable hit test behavior', (WidgetTester tester) async { const HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild; await tester.pumpWidget( @@ -3428,7 +3427,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/92083 - testWidgetsWithLeakTracking('feedback respect the MouseRegion cursor configure', (WidgetTester tester) async { + testWidgets('feedback respect the MouseRegion cursor configure', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Column( @@ -3456,7 +3455,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.grabbing); }); - testWidgetsWithLeakTracking('configurable feedback ignore pointer behavior', (WidgetTester tester) async { + testWidgets('configurable feedback ignore pointer behavior', (WidgetTester tester) async { bool onTap = false; await tester.pumpWidget( MaterialApp( @@ -3485,7 +3484,7 @@ void main() { expect(onTap, true); }); - testWidgetsWithLeakTracking('configurable feedback ignore pointer behavior - LongPressDraggable', (WidgetTester tester) async { + testWidgets('configurable feedback ignore pointer behavior - LongPressDraggable', (WidgetTester tester) async { bool onTap = false; await tester.pumpWidget( MaterialApp( @@ -3516,7 +3515,7 @@ void main() { expect(onTap, true); }); - testWidgetsWithLeakTracking('configurable DragTarget hit test behavior', (WidgetTester tester) async { + testWidgets('configurable DragTarget hit test behavior', (WidgetTester tester) async { const HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild; await tester.pumpWidget( @@ -3537,7 +3536,7 @@ void main() { expect(tester.widget<MetaData>(find.byType(MetaData)).behavior, hitTestBehavior); }); - testWidgetsWithLeakTracking('LongPressDraggable.dragAnchorStrategy', (WidgetTester tester) async { + testWidgets('LongPressDraggable.dragAnchorStrategy', (WidgetTester tester) async { const Widget widget1 = Placeholder(key: ValueKey<int>(1)); const Widget widget2 = Placeholder(key: ValueKey<int>(2)); Offset dummyStrategy(Draggable<Object> draggable, BuildContext context, Offset position) => Offset.zero; @@ -3547,7 +3546,7 @@ void main() { expect(LongPressDraggable<int>(feedback: widget2, dragAnchorStrategy: dummyStrategy, child: widget1).dragAnchorStrategy, dummyStrategy); }); - testWidgetsWithLeakTracking('Test allowedButtonsFilter', (WidgetTester tester) async { + testWidgets('Test allowedButtonsFilter', (WidgetTester tester) async { Widget build(bool Function(int buttons)? allowedButtonsFilter) { return MaterialApp( home: Draggable<int>( @@ -3589,7 +3588,7 @@ void main() { await gesture3.up(); }); - testWidgetsWithLeakTracking('throws error when both onWillAccept and onWillAcceptWithDetails are provided', (WidgetTester tester) async { + testWidgets('throws error when both onWillAccept and onWillAcceptWithDetails are provided', (WidgetTester tester) async { expect(() => DragTarget<int>( builder: (BuildContext context, List<int?> data, List<dynamic> rejects) { return const SizedBox(height: 100.0, child: Text('Target')); diff --git a/packages/flutter/test/widgets/drawer_test.dart b/packages/flutter/test/widgets/drawer_test.dart index d1a7ce8f3b2..cb3aba7fd82 100644 --- a/packages/flutter/test/widgets/drawer_test.dart +++ b/packages/flutter/test/widgets/drawer_test.dart @@ -8,13 +8,12 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Drawer control test', (WidgetTester tester) async { + testWidgets('Drawer control test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); late BuildContext savedContext; await tester.pumpWidget( @@ -45,7 +44,7 @@ void main() { expect(find.text('drawer'), findsNothing); }); - testWidgetsWithLeakTracking('Drawer tap test', (WidgetTester tester) async { + testWidgets('Drawer tap test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -77,7 +76,7 @@ void main() { expect(find.text('drawer'), findsNothing); }); - testWidgetsWithLeakTracking('Drawer hover test', (WidgetTester tester) async { + testWidgets('Drawer hover test', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final List<String> logs = <String>[]; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -147,7 +146,7 @@ void main() { logs.clear(); }); - testWidgetsWithLeakTracking('Drawer drag cancel resume (LTR)', (WidgetTester tester) async { + testWidgets('Drawer drag cancel resume (LTR)', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -198,7 +197,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Drawer drag cancel resume (RTL)', (WidgetTester tester) async { + testWidgets('Drawer drag cancel resume (RTL)', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); await tester.pumpWidget( MaterialApp( @@ -252,7 +251,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Drawer navigator back button', (WidgetTester tester) async { + testWidgets('Drawer navigator back button', (WidgetTester tester) async { final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); bool buttonPressed = false; @@ -300,7 +299,7 @@ void main() { expect(buttonPressed, equals(true)); }); - testWidgetsWithLeakTracking('Dismissible ModalBarrier includes button in semantic tree', (WidgetTester tester) async { + testWidgets('Dismissible ModalBarrier includes button in semantic tree', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -327,7 +326,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Dismissible ModalBarrier is hidden on Android (back button is used to dismiss)', (WidgetTester tester) async { + testWidgets('Dismissible ModalBarrier is hidden on Android (back button is used to dismiss)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); @@ -355,7 +354,7 @@ void main() { semantics.dispose(); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('Drawer contains route semantics flags', (WidgetTester tester) async { + testWidgets('Drawer contains route semantics flags', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); diff --git a/packages/flutter/test/widgets/dual_transition_builder_test.dart b/packages/flutter/test/widgets/dual_transition_builder_test.dart index 531aeead57e..21a748bb5eb 100644 --- a/packages/flutter/test/widgets/dual_transition_builder_test.dart +++ b/packages/flutter/test/widgets/dual_transition_builder_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('runs animations', (WidgetTester tester) async { + testWidgets('runs animations', (WidgetTester tester) async { final AnimationController controller = AnimationController( vsync: const TestVSync(), duration: const Duration(milliseconds: 300), @@ -76,7 +75,7 @@ void main() { expect(_getOpacity(tester), 1.0); }); - testWidgetsWithLeakTracking('keeps state', (WidgetTester tester) async { + testWidgets('keeps state', (WidgetTester tester) async { final AnimationController controller = AnimationController( vsync: const TestVSync(), duration: const Duration(milliseconds: 300), @@ -141,7 +140,7 @@ void main() { expect(state, same(tester.state(find.byType(_StatefulTestWidget)))); }); - testWidgetsWithLeakTracking('does not jump when interrupted - forward', (WidgetTester tester) async { + testWidgets('does not jump when interrupted - forward', (WidgetTester tester) async { final AnimationController controller = AnimationController( vsync: const TestVSync(), duration: const Duration(milliseconds: 300), @@ -207,7 +206,7 @@ void main() { expect(_getOpacity(tester), 1.0); }); - testWidgetsWithLeakTracking('does not jump when interrupted - reverse', (WidgetTester tester) async { + testWidgets('does not jump when interrupted - reverse', (WidgetTester tester) async { final AnimationController controller = AnimationController( value: 1.0, vsync: const TestVSync(), diff --git a/packages/flutter/test/widgets/editable_text_cursor_test.dart b/packages/flutter/test/widgets/editable_text_cursor_test.dart index 468e71e3794..883f98f515a 100644 --- a/packages/flutter/test/widgets/editable_text_cursor_test.dart +++ b/packages/flutter/test/widgets/editable_text_cursor_test.dart @@ -15,7 +15,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'editable_text_utils.dart'; @@ -42,7 +41,7 @@ void main() { focusScopeNode.dispose(); }); - testWidgetsWithLeakTracking('cursor has expected width, height, and radius', (WidgetTester tester) async { + testWidgets('cursor has expected width, height, and radius', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -68,7 +67,7 @@ void main() { expect(editableText.cursorRadius!.x, 2.0); }); - testWidgetsWithLeakTracking('cursor layout has correct width', (WidgetTester tester) async { + testWidgets('cursor layout has correct width', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>(); @@ -124,7 +123,7 @@ void main() { EditableText.debugDeterministicCursor = false; }); - testWidgetsWithLeakTracking('cursor layout has correct radius', (WidgetTester tester) async { + testWidgets('cursor layout has correct radius', (WidgetTester tester) async { final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>(); late String changedValue; @@ -179,7 +178,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Cursor animates on iOS', (WidgetTester tester) async { + testWidgets('Cursor animates on iOS', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -230,7 +229,7 @@ void main() { await verifyKeyFrame(opacity: 1.0, at: 1000000); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Cursor does not animate on non-iOS platforms', (WidgetTester tester) async { + testWidgets('Cursor does not animate on non-iOS platforms', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material(child: TextField(maxLines: 3)), @@ -249,7 +248,7 @@ void main() { } }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Cursor does not animate on Android', (WidgetTester tester) async { + testWidgets('Cursor does not animate on Android', (WidgetTester tester) async { final Color defaultCursorColor = Color(ThemeData.fallback().colorScheme.primary.value); const Widget widget = MaterialApp( home: Material( @@ -289,7 +288,7 @@ void main() { expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0)); }); - testWidgetsWithLeakTracking('Cursor does not animates when debugDeterministicCursor is set', (WidgetTester tester) async { + testWidgets('Cursor does not animates when debugDeterministicCursor is set', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; final Color defaultCursorColor = Color(ThemeData.fallback().colorScheme.primary.value); const Widget widget = MaterialApp( @@ -329,7 +328,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('Cursor does not animate on Android when debugDeterministicCursor is set', (WidgetTester tester) async { + testWidgets('Cursor does not animate on Android when debugDeterministicCursor is set', (WidgetTester tester) async { final Color defaultCursorColor = Color(ThemeData.fallback().colorScheme.primary.value); EditableText.debugDeterministicCursor = true; const Widget widget = MaterialApp( @@ -368,7 +367,7 @@ void main() { EditableText.debugDeterministicCursor = false; }); - testWidgetsWithLeakTracking('Cursor animation restarts when it is moved using keys on desktop', (WidgetTester tester) async { + testWidgets('Cursor animation restarts when it is moved using keys on desktop', (WidgetTester tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.macOS; const String testText = 'Some text long enough to move the cursor around'; @@ -449,7 +448,7 @@ void main() { variant: KeySimulatorTransitModeVariant.all(), ); - testWidgetsWithLeakTracking('Cursor does not show when showCursor set to false', (WidgetTester tester) async { + testWidgets('Cursor does not show when showCursor set to false', (WidgetTester tester) async { const Widget widget = MaterialApp( home: Material( child: TextField( @@ -477,7 +476,7 @@ void main() { expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0)); }); - testWidgetsWithLeakTracking('Cursor does not show when not focused', (WidgetTester tester) async { + testWidgets('Cursor does not show when not focused', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/106512 . await tester.pumpWidget( MaterialApp( @@ -507,7 +506,7 @@ void main() { expect(renderEditable, isNot(paintsExactlyCountTimes(#drawRect, 0))); }); - testWidgetsWithLeakTracking('Cursor radius is 2.0', (WidgetTester tester) async { + testWidgets('Cursor radius is 2.0', (WidgetTester tester) async { const Widget widget = MaterialApp( home: Material( child: TextField( @@ -523,7 +522,7 @@ void main() { expect(renderEditable.cursorRadius, const Radius.circular(2.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Cursor gets placed correctly after going out of bounds', (WidgetTester tester) async { + testWidgets('Cursor gets placed correctly after going out of bounds', (WidgetTester tester) async { const String text = 'hello world this is fun and cool and awesome!'; controller.text = text; @@ -617,7 +616,7 @@ void main() { expect(controller.selection.baseOffset, 10); }); - testWidgetsWithLeakTracking('Updating the floating cursor correctly moves the cursor', (WidgetTester tester) async { + testWidgets('Updating the floating cursor correctly moves the cursor', (WidgetTester tester) async { const String text = 'hello world this is fun and cool and awesome!'; controller.text = text; @@ -673,7 +672,7 @@ void main() { expect(controller.selection.baseOffset, 10); }); - testWidgetsWithLeakTracking('Updating the floating cursor can end without update', (WidgetTester tester) async { + testWidgets('Updating the floating cursor can end without update', (WidgetTester tester) async { const String text = 'hello world this is fun and cool and awesome!'; controller.text = text; @@ -716,7 +715,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking("Drag the floating cursor, it won't blink.", (WidgetTester tester) async { + testWidgets("Drag the floating cursor, it won't blink.", (WidgetTester tester) async { const String text = 'hello world this is fun and cool and awesome!'; controller.text = text; @@ -782,7 +781,7 @@ void main() { await checkCursorBlinking(); }); - testWidgetsWithLeakTracking('Turning showCursor off stops the cursor', (WidgetTester tester) async { + testWidgets('Turning showCursor off stops the cursor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/108187. final bool debugDeterministicCursor = EditableText.debugDeterministicCursor; // This doesn't really matter. @@ -831,7 +830,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/pull/30475. - testWidgetsWithLeakTracking('Trying to select with the floating cursor does not crash', (WidgetTester tester) async { + testWidgets('Trying to select with the floating cursor does not crash', (WidgetTester tester) async { const String text = 'hello world this is fun and cool and awesome!'; controller.text = text; @@ -896,7 +895,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('autofocus sets cursor to the end of text', (WidgetTester tester) async { + testWidgets('autofocus sets cursor to the end of text', (WidgetTester tester) async { const String text = 'hello world'; controller.text = text; @@ -926,7 +925,7 @@ void main() { expect(controller.selection.baseOffset, text.length); }); - testWidgetsWithLeakTracking('Floating cursor is painted', (WidgetTester tester) async { + testWidgets('Floating cursor is painted', (WidgetTester tester) async { const TextStyle textStyle = TextStyle(); const String text = 'hello world this is fun and cool and awesome!'; controller.text = text; @@ -1006,7 +1005,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('cursor layout', (WidgetTester tester) async { + testWidgets('cursor layout', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>(); @@ -1067,7 +1066,7 @@ void main() { EditableText.debugDeterministicCursor = false; }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('cursor layout has correct height', (WidgetTester tester) async { + testWidgets('cursor layout has correct height', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>(); @@ -1129,7 +1128,7 @@ void main() { EditableText.debugDeterministicCursor = false; }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('password briefly does not show last character when disabled by system', (WidgetTester tester) async { + testWidgets('password briefly does not show last character when disabled by system', (WidgetTester tester) async { final bool debugDeterministicCursor = EditableText.debugDeterministicCursor; EditableText.debugDeterministicCursor = false; addTearDown(() { @@ -1165,7 +1164,7 @@ void main() { expect((findRenderEditable(tester).text! as TextSpan).text, '•••'); }); - testWidgetsWithLeakTracking('getLocalRectForCaret with empty text', (WidgetTester tester) async { + testWidgets('getLocalRectForCaret with empty text', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; addTearDown(() { EditableText.debugDeterministicCursor = false; }); const String text = '12'; @@ -1210,7 +1209,7 @@ void main() { expect(controller.text, isEmpty); }); - testWidgetsWithLeakTracking('Caret center space test', (WidgetTester tester) async { + testWidgets('Caret center space test', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; addTearDown(() { EditableText.debugDeterministicCursor = false; }); final String text = 'test${' ' * 1000}'; @@ -1258,7 +1257,7 @@ void main() { skip: isBrowser && !isCanvasKit, // https://github.com/flutter/flutter/issues/56308 ); - testWidgetsWithLeakTracking('getLocalRectForCaret reports the real caret Rect', (WidgetTester tester) async { + testWidgets('getLocalRectForCaret reports the real caret Rect', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; addTearDown(() { EditableText.debugDeterministicCursor = false; }); final String text = 'test${' ' * 50}\n' diff --git a/packages/flutter/test/widgets/editable_text_shortcuts_test.dart b/packages/flutter/test/widgets/editable_text_shortcuts_test.dart index da2aaf0961b..9fa1619b75e 100644 --- a/packages/flutter/test/widgets/editable_text_shortcuts_test.dart +++ b/packages/flutter/test/widgets/editable_text_shortcuts_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'clipboard_utils.dart'; import 'keyboard_utils.dart'; @@ -109,7 +108,7 @@ void main() { group('backspace', () { const LogicalKeyboardKey trigger = LogicalKeyboardKey.backspace; - testWidgetsWithLeakTracking('backspace', (WidgetTester tester) async { + testWidgets('backspace', (WidgetTester tester) async { controller.text = testText; // Move the selection to the beginning of the 2nd line (after the newline // character). @@ -134,7 +133,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('backspace readonly', (WidgetTester tester) async { + testWidgets('backspace readonly', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 20, @@ -152,7 +151,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('backspace at start', (WidgetTester tester) async { + testWidgets('backspace at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -175,7 +174,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('backspace at end', (WidgetTester tester) async { + testWidgets('backspace at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -199,7 +198,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('backspace inside of a cluster', (WidgetTester tester) async { + testWidgets('backspace inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 1, @@ -220,7 +219,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('backspace at cluster boundary', (WidgetTester tester) async { + testWidgets('backspace at cluster boundary', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 8, @@ -245,7 +244,7 @@ void main() { group('delete: ', () { const LogicalKeyboardKey trigger = LogicalKeyboardKey.delete; - testWidgetsWithLeakTracking('delete', (WidgetTester tester) async { + testWidgets('delete', (WidgetTester tester) async { controller.text = testText; // Move the selection to the beginning of the 2nd line (after the newline // character). @@ -271,7 +270,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('delete readonly', (WidgetTester tester) async { + testWidgets('delete readonly', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 20, @@ -289,7 +288,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('delete at start', (WidgetTester tester) async { + testWidgets('delete at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -312,7 +311,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('delete at end', (WidgetTester tester) async { + testWidgets('delete at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -336,7 +335,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('delete inside of a cluster', (WidgetTester tester) async { + testWidgets('delete inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 1, @@ -357,7 +356,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('delete at cluster boundary', (WidgetTester tester) async { + testWidgets('delete at cluster boundary', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 8, @@ -383,7 +382,7 @@ void main() { // This shares the same logic as backspace. const LogicalKeyboardKey trigger = LogicalKeyboardKey.delete; - testWidgetsWithLeakTracking('inside of a cluster', (WidgetTester tester) async { + testWidgets('inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection( baseOffset: 9, @@ -404,7 +403,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('at the boundaries of a cluster', (WidgetTester tester) async { + testWidgets('at the boundaries of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection( baseOffset: 8, @@ -425,7 +424,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('cross-cluster', (WidgetTester tester) async { + testWidgets('cross-cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection( baseOffset: 1, @@ -446,7 +445,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('cross-cluster obscured text', (WidgetTester tester) async { + testWidgets('cross-cluster obscured text', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection( baseOffset: 1, @@ -476,7 +475,7 @@ void main() { return SingleActivator(trigger, control: !isApple, alt: isApple); } - testWidgetsWithLeakTracking('WordModifier-backspace', (WidgetTester tester) async { + testWidgets('WordModifier-backspace', (WidgetTester tester) async { controller.text = testText; // Place the caret before "people". controller.selection = const TextSelection.collapsed( @@ -501,7 +500,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('readonly', (WidgetTester tester) async { + testWidgets('readonly', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 29, @@ -519,7 +518,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at start', (WidgetTester tester) async { + testWidgets('at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -542,7 +541,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at end', (WidgetTester tester) async { + testWidgets('at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -566,7 +565,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('inside of a cluster', (WidgetTester tester) async { + testWidgets('inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 1, @@ -587,7 +586,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('at cluster boundary', (WidgetTester tester) async { + testWidgets('at cluster boundary', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 8, @@ -616,7 +615,7 @@ void main() { return SingleActivator(trigger, control: !isApple, alt: isApple); } - testWidgetsWithLeakTracking('WordModifier-delete', (WidgetTester tester) async { + testWidgets('WordModifier-delete', (WidgetTester tester) async { controller.text = testText; // Place the caret after "all". controller.selection = const TextSelection.collapsed( @@ -641,7 +640,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('readonly', (WidgetTester tester) async { + testWidgets('readonly', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 23, @@ -659,7 +658,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at start', (WidgetTester tester) async { + testWidgets('at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -682,7 +681,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('at end', (WidgetTester tester) async { + testWidgets('at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -699,7 +698,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('inside of a cluster', (WidgetTester tester) async { + testWidgets('inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 1, @@ -720,7 +719,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('at cluster boundary', (WidgetTester tester) async { + testWidgets('at cluster boundary', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 8, @@ -749,7 +748,7 @@ void main() { return SingleActivator(trigger, meta: isApple, alt: !isApple); } - testWidgetsWithLeakTracking('alt-backspace', (WidgetTester tester) async { + testWidgets('alt-backspace', (WidgetTester tester) async { controller.text = testText; // Place the caret before "people". controller.selection = const TextSelection.collapsed( @@ -774,7 +773,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('softwrap line boundary, upstream', (WidgetTester tester) async { + testWidgets('softwrap line boundary, upstream', (WidgetTester tester) async { controller.text = testSoftwrapText; // Place the caret at the end of the 2nd line. controller.selection = const TextSelection.collapsed( @@ -798,7 +797,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('softwrap line boundary, downstream', (WidgetTester tester) async { + testWidgets('softwrap line boundary, downstream', (WidgetTester tester) async { controller.text = testSoftwrapText; // Place the caret at the beginning of the 3rd line. controller.selection = const TextSelection.collapsed( @@ -815,7 +814,7 @@ void main() { expect(controller.text, testSoftwrapText); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('readonly', (WidgetTester tester) async { + testWidgets('readonly', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 29, @@ -833,7 +832,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at start', (WidgetTester tester) async { + testWidgets('at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -856,7 +855,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at end', (WidgetTester tester) async { + testWidgets('at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -879,7 +878,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('inside of a cluster', (WidgetTester tester) async { + testWidgets('inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 1, @@ -900,7 +899,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at cluster boundary', (WidgetTester tester) async { + testWidgets('at cluster boundary', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 8, @@ -929,7 +928,7 @@ void main() { return SingleActivator(trigger, meta: isApple, alt: !isApple); } - testWidgetsWithLeakTracking('alt-delete', (WidgetTester tester) async { + testWidgets('alt-delete', (WidgetTester tester) async { controller.text = testText; // Place the caret after "all". controller.selection = const TextSelection.collapsed( @@ -954,7 +953,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('softwrap line boundary, upstream', (WidgetTester tester) async { + testWidgets('softwrap line boundary, upstream', (WidgetTester tester) async { controller.text = testSoftwrapText; // Place the caret at the end of the 2nd line. controller.selection = const TextSelection.collapsed( @@ -973,7 +972,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('softwrap line boundary, downstream', (WidgetTester tester) async { + testWidgets('softwrap line boundary, downstream', (WidgetTester tester) async { controller.text = testSoftwrapText; // Place the caret at the beginning of the 3rd line. controller.selection = const TextSelection.collapsed( @@ -996,7 +995,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('readonly', (WidgetTester tester) async { + testWidgets('readonly', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 23, @@ -1014,7 +1013,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at start', (WidgetTester tester) async { + testWidgets('at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -1037,7 +1036,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at end', (WidgetTester tester) async { + testWidgets('at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -1054,7 +1053,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('inside of a cluster', (WidgetTester tester) async { + testWidgets('inside of a cluster', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 1, @@ -1075,7 +1074,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at cluster boundary', (WidgetTester tester) async { + testWidgets('at cluster boundary', (WidgetTester tester) async { controller.text = testCluster; controller.selection = const TextSelection.collapsed( offset: 8, @@ -1101,7 +1100,7 @@ void main() { group('left', () { const LogicalKeyboardKey trigger = LogicalKeyboardKey.arrowLeft; - testWidgetsWithLeakTracking('at start', (WidgetTester tester) async { + testWidgets('at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -1121,7 +1120,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('base arrow key movement', (WidgetTester tester) async { + testWidgets('base arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 20, @@ -1135,7 +1134,7 @@ void main() { )); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 7, // Before the first "the" @@ -1149,7 +1148,7 @@ void main() { )); }, variant: allExceptApple); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 24, // Before the "good". @@ -1167,7 +1166,7 @@ void main() { group('right', () { const LogicalKeyboardKey trigger = LogicalKeyboardKey.arrowRight; - testWidgetsWithLeakTracking('at end', (WidgetTester tester) async { + testWidgets('at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -1184,7 +1183,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('base arrow key movement', (WidgetTester tester) async { + testWidgets('base arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 20, @@ -1198,7 +1197,7 @@ void main() { )); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 7, // Before the first "the" @@ -1212,7 +1211,7 @@ void main() { )); }, variant: allExceptApple); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 24, // Before the "good". @@ -1229,7 +1228,7 @@ void main() { }); group('With initial non-collapsed selection', () { - testWidgetsWithLeakTracking('base arrow key movement', (WidgetTester tester) async { + testWidgets('base arrow key movement', (WidgetTester tester) async { controller.text = testText; // The word "all" is selected. controller.selection = const TextSelection( @@ -1281,7 +1280,7 @@ void main() { )); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; // "good" to "come" is selected. controller.selection = const TextSelection( @@ -1334,7 +1333,7 @@ void main() { )); }, variant: allExceptApple); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; // "good" to "come" is selected. controller.selection = const TextSelection( @@ -1390,7 +1389,7 @@ void main() { }); group('vertical movement', () { - testWidgetsWithLeakTracking('at start', (WidgetTester tester) async { + testWidgets('at start', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -1423,7 +1422,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('at end', (WidgetTester tester) async { + testWidgets('at end', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 72, @@ -1450,7 +1449,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('run', (WidgetTester tester) async { + testWidgets('run', (WidgetTester tester) async { controller.text = 'aa\n' // 3 'a\n' // 3 + 2 = 5 @@ -1537,7 +1536,7 @@ void main() { )); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('run with page down/up', (WidgetTester tester) async { + testWidgets('run with page down/up', (WidgetTester tester) async { controller.text = 'aa\n' // 3 'a\n' // 3 + 2 = 5 @@ -1572,7 +1571,7 @@ void main() { )); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{TargetPlatform.iOS, TargetPlatform.macOS})); // intended: on macOS Page Up/Down only scrolls - testWidgetsWithLeakTracking('run can be interrupted by layout changes', (WidgetTester tester) async { + testWidgets('run can be interrupted by layout changes', (WidgetTester tester) async { controller.text = 'aa\n' // 3 'a\n' // 3 + 2 = 5 @@ -1601,7 +1600,7 @@ void main() { )); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('run can be interrupted by selection changes', (WidgetTester tester) async { + testWidgets('run can be interrupted by selection changes', (WidgetTester tester) async { controller.text = 'aa\n' // 3 'a\n' // 3 + 2 = 5 @@ -1636,7 +1635,7 @@ void main() { )); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('long run with fractional text height', (WidgetTester tester) async { + testWidgets('long run with fractional text height', (WidgetTester tester) async { controller.text = "${'źdźbło\n' * 49}źdźbło"; controller.selection = const TextSelection.collapsed(offset: 2); await tester.pumpWidget(buildEditableText(style: const TextStyle(fontSize: 13.0, height: 1.17))); @@ -1670,7 +1669,7 @@ void main() { group('macOS shortcuts', () { final TargetPlatformVariant macOSOnly = TargetPlatformVariant.only(TargetPlatform.macOS); - testWidgetsWithLeakTracking('word modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('word modifier + arrowLeft', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 7, // Before the first "the" @@ -1684,7 +1683,7 @@ void main() { )); }, variant: macOSOnly); - testWidgetsWithLeakTracking('word modifier + arrowRight', (WidgetTester tester) async { + testWidgets('word modifier + arrowRight', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 7, // Before the first "the" @@ -1698,7 +1697,7 @@ void main() { )); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('line modifier + arrowLeft', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 24, // Before the "good". @@ -1712,7 +1711,7 @@ void main() { )); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrowRight', (WidgetTester tester) async { + testWidgets('line modifier + arrowRight', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 24, // Before the "good". @@ -1727,7 +1726,7 @@ void main() { )); }, variant: macOSOnly); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; // "good" to "come" is selected. controller.selection = const TextSelection( @@ -1780,7 +1779,7 @@ void main() { )); }, variant: macOSOnly); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; // "good" to "come" is selected. controller.selection = const TextSelection( @@ -1840,7 +1839,7 @@ void main() { const TargetPlatformVariant appleOnly = TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.iOS }); group('macOS shortcuts', () { - testWidgetsWithLeakTracking('word modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('word modifier + arrowLeft', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 7, // Before the first "the" @@ -1852,7 +1851,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 7)); }, variant: appleOnly); - testWidgetsWithLeakTracking('word modifier + arrowRight', (WidgetTester tester) async { + testWidgets('word modifier + arrowRight', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 7, // Before the first "the" @@ -1864,7 +1863,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 7)); }, variant: appleOnly); - testWidgetsWithLeakTracking('line modifier + arrowLeft', (WidgetTester tester) async { + testWidgets('line modifier + arrowLeft', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 24, // Before the "good". @@ -1876,7 +1875,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 24,)); }, variant: appleOnly); - testWidgetsWithLeakTracking('line modifier + arrowRight', (WidgetTester tester) async { + testWidgets('line modifier + arrowRight', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 24, // Before the "good". @@ -1890,7 +1889,7 @@ void main() { )); }, variant: appleOnly); - testWidgetsWithLeakTracking('word modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('word modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 24, @@ -1943,7 +1942,7 @@ void main() { )); }, variant: appleOnly); - testWidgetsWithLeakTracking('line modifier + arrow key movement', (WidgetTester tester) async { + testWidgets('line modifier + arrow key movement', (WidgetTester tester) async { controller.text = testText; // "good" to "come" is selected. controller.selection = const TextSelection( @@ -2000,7 +1999,7 @@ void main() { }, variant: appleOnly); }); - testWidgetsWithLeakTracking('vertical movement outside of selection', + testWidgets('vertical movement outside of selection', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( @@ -2026,7 +2025,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('select all non apple', (WidgetTester tester) async { + testWidgets('select all non apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -2039,7 +2038,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 0)); }, variant: allExceptApple); - testWidgetsWithLeakTracking('select all apple', (WidgetTester tester) async { + testWidgets('select all apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed( offset: 0, @@ -2052,7 +2051,7 @@ void main() { expect(controller.selection, const TextSelection.collapsed(offset: 0)); }, variant: appleOnly); - testWidgetsWithLeakTracking('copy non apple', (WidgetTester tester) async { + testWidgets('copy non apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -2067,7 +2066,7 @@ void main() { expect(clipboardData['text'], 'empty'); }, variant: allExceptApple); - testWidgetsWithLeakTracking('copy apple', (WidgetTester tester) async { + testWidgets('copy apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -2082,7 +2081,7 @@ void main() { expect(clipboardData['text'], 'empty'); }, variant: appleOnly); - testWidgetsWithLeakTracking('cut non apple', (WidgetTester tester) async { + testWidgets('cut non apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -2101,7 +2100,7 @@ void main() { )); }, variant: allExceptApple); - testWidgetsWithLeakTracking('cut apple', (WidgetTester tester) async { + testWidgets('cut apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -2120,7 +2119,7 @@ void main() { )); }, variant: appleOnly); - testWidgetsWithLeakTracking('paste non apple', (WidgetTester tester) async { + testWidgets('paste non apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed(offset: 0); mockClipboard.clipboardData = <String, dynamic>{ @@ -2133,7 +2132,7 @@ void main() { expect(controller.text, testText); }, variant: allExceptApple); - testWidgetsWithLeakTracking('paste apple', (WidgetTester tester) async { + testWidgets('paste apple', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection.collapsed(offset: 0); mockClipboard.clipboardData = <String, dynamic>{ @@ -2155,7 +2154,7 @@ void main() { TargetPlatform.windows, }); - testWidgetsWithLeakTracking('select up', (WidgetTester tester) async { + testWidgets('select up', (WidgetTester tester) async { const SingleActivator selectUp = SingleActivator(LogicalKeyboardKey.arrowUp, shift: true); controller.text = testVerticalText; @@ -2177,7 +2176,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select down', (WidgetTester tester) async { + testWidgets('select down', (WidgetTester tester) async { const SingleActivator selectDown = SingleActivator(LogicalKeyboardKey.arrowDown, shift: true); controller.text = testVerticalText; @@ -2199,7 +2198,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select all up', (WidgetTester tester) async { + testWidgets('select all up', (WidgetTester tester) async { final bool isMacOS = defaultTargetPlatform == TargetPlatform.macOS; final SingleActivator selectAllUp = isMacOS ? const SingleActivator(LogicalKeyboardKey.arrowUp, @@ -2225,7 +2224,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select all down', (WidgetTester tester) async { + testWidgets('select all down', (WidgetTester tester) async { final bool isMacOS = defaultTargetPlatform == TargetPlatform.macOS; final SingleActivator selectAllDown = isMacOS ? const SingleActivator(LogicalKeyboardKey.arrowDown, @@ -2251,7 +2250,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select left', (WidgetTester tester) async { + testWidgets('select left', (WidgetTester tester) async { const SingleActivator selectLeft = SingleActivator(LogicalKeyboardKey.arrowLeft, shift: true); controller.text = 'testing'; @@ -2271,7 +2270,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select right', (WidgetTester tester) async { + testWidgets('select right', (WidgetTester tester) async { const SingleActivator selectRight = SingleActivator(LogicalKeyboardKey.arrowRight, shift: true); controller.text = 'testing'; @@ -2291,7 +2290,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking( + testWidgets( 'select left should not expand selection if selection is disabled', (WidgetTester tester) async { const SingleActivator selectLeft = @@ -2314,7 +2313,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking( + testWidgets( 'select right should not expand selection if selection is disabled', (WidgetTester tester) async { const SingleActivator selectRight = @@ -2335,7 +2334,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select all left', (WidgetTester tester) async { + testWidgets('select all left', (WidgetTester tester) async { final bool isMacOS = defaultTargetPlatform == TargetPlatform.macOS; final SingleActivator selectAllLeft = isMacOS ? const SingleActivator(LogicalKeyboardKey.arrowLeft, @@ -2359,7 +2358,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('select all right', (WidgetTester tester) async { + testWidgets('select all right', (WidgetTester tester) async { final bool isMacOS = defaultTargetPlatform == TargetPlatform.macOS; final SingleActivator selectAllRight = isMacOS ? const SingleActivator(LogicalKeyboardKey.arrowRight, @@ -2383,7 +2382,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); group('macOS only', () { - testWidgetsWithLeakTracking('pageUp scrolls 80% of viewport dimension upwards', (WidgetTester tester) async { + testWidgets('pageUp scrolls 80% of viewport dimension upwards', (WidgetTester tester) async { const SingleActivator pageUp = SingleActivator(LogicalKeyboardKey.pageUp); controller.text = longText; @@ -2411,7 +2410,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: macOSOnly); - testWidgetsWithLeakTracking('pageUp + shift scrolls upwards and modifies selection', (WidgetTester tester) async { + testWidgets('pageUp + shift scrolls upwards and modifies selection', (WidgetTester tester) async { const SingleActivator pageUp = SingleActivator(LogicalKeyboardKey.pageUp, shift: true); controller.text = longText; @@ -2436,7 +2435,7 @@ void main() { expect(scrollController.offset, lessThan(initialScrollOffset)); }, variant: macOSOnly); - testWidgetsWithLeakTracking('pageDown scrolls 80% of viewport dimension downwards', (WidgetTester tester) async { + testWidgets('pageDown scrolls 80% of viewport dimension downwards', (WidgetTester tester) async { const SingleActivator pageDown = SingleActivator(LogicalKeyboardKey.pageDown); controller.text = longText; @@ -2464,7 +2463,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: macOSOnly); - testWidgetsWithLeakTracking('pageDown + shift scrolls downwards and modifies selection', (WidgetTester tester) async { + testWidgets('pageDown + shift scrolls downwards and modifies selection', (WidgetTester tester) async { const SingleActivator pageDown = SingleActivator(LogicalKeyboardKey.pageDown, shift: true); controller.text = longText; @@ -2489,7 +2488,7 @@ void main() { expect(scrollController.offset, greaterThan(initialScrollOffset)); }, variant: macOSOnly); - testWidgetsWithLeakTracking('end scrolls to the end of the text field', (WidgetTester tester) async { + testWidgets('end scrolls to the end of the text field', (WidgetTester tester) async { const SingleActivator end = SingleActivator(LogicalKeyboardKey.end); controller.text = longText; @@ -2517,7 +2516,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: macOSOnly); - testWidgetsWithLeakTracking('end + shift scrolls to the end of the text field and selects everything', (WidgetTester tester) async { + testWidgets('end + shift scrolls to the end of the text field and selects everything', (WidgetTester tester) async { const SingleActivator end = SingleActivator(LogicalKeyboardKey.end, shift: true); controller.text = longText; @@ -2545,7 +2544,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: macOSOnly); - testWidgetsWithLeakTracking('home scrolls to the beginning of the text field', (WidgetTester tester) async { + testWidgets('home scrolls to the beginning of the text field', (WidgetTester tester) async { const SingleActivator home = SingleActivator(LogicalKeyboardKey.home); controller.text = longText; @@ -2573,7 +2572,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: macOSOnly); - testWidgetsWithLeakTracking('home + shift scrolls to the beginning of text field and selects everything', (WidgetTester tester) async { + testWidgets('home + shift scrolls to the beginning of text field and selects everything', (WidgetTester tester) async { const SingleActivator home = SingleActivator(LogicalKeyboardKey.home, shift: true); controller.text = longText; @@ -2603,7 +2602,7 @@ void main() { }); group('non-macOS', () { - testWidgetsWithLeakTracking('pageUp scrolls up and modifies selection', (WidgetTester tester) async { + testWidgets('pageUp scrolls up and modifies selection', (WidgetTester tester) async { const SingleActivator pageUp = SingleActivator(LogicalKeyboardKey.pageUp); final int initialSelectionOffset = controller.text.length; @@ -2626,7 +2625,7 @@ void main() { expect(scrollController.offset, lessThan(initialScrollOffset)); }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('pageUp + shift scrolls up and modifies selection', (WidgetTester tester) async { + testWidgets('pageUp + shift scrolls up and modifies selection', (WidgetTester tester) async { const SingleActivator pageUp = SingleActivator(LogicalKeyboardKey.pageUp, shift: true); final int initialSelectionOffset = controller.text.length; @@ -2650,7 +2649,7 @@ void main() { expect(scrollController.offset, lessThan(initialScrollOffset)); }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('pageDown scrolls down and modifies selection', (WidgetTester tester) async { + testWidgets('pageDown scrolls down and modifies selection', (WidgetTester tester) async { const SingleActivator pageDown = SingleActivator(LogicalKeyboardKey.pageDown); const int initialSelectionOffset = 0; @@ -2673,7 +2672,7 @@ void main() { expect(scrollController.offset, greaterThan(initialScrollOffset)); }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('pageDown + shift scrolls down and modifies selection', (WidgetTester tester) async { + testWidgets('pageDown + shift scrolls down and modifies selection', (WidgetTester tester) async { const SingleActivator pageDown = SingleActivator(LogicalKeyboardKey.pageDown, shift: true); const int initialSelectionOffset = 0; @@ -2697,7 +2696,7 @@ void main() { expect(scrollController.offset, greaterThan(initialScrollOffset)); }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('end moves selection to the end of the line, no scroll', (WidgetTester tester) async { + testWidgets('end moves selection to the end of the line, no scroll', (WidgetTester tester) async { const SingleActivator end = SingleActivator(LogicalKeyboardKey.end); const int initialSelectionOffset = 0; @@ -2719,7 +2718,7 @@ void main() { expect(scrollController.offset, initialScrollOffset); // no scroll. }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('end + shift highlights selection to the end of the line, no scroll', (WidgetTester tester) async { + testWidgets('end + shift highlights selection to the end of the line, no scroll', (WidgetTester tester) async { const SingleActivator end = SingleActivator(LogicalKeyboardKey.end, shift: true); const int initialSelectionOffset = 0; @@ -2742,7 +2741,7 @@ void main() { expect(scrollController.offset, initialScrollOffset); // no scroll. }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('home moves selection to the beginning of the line, no scroll', (WidgetTester tester) async { + testWidgets('home moves selection to the beginning of the line, no scroll', (WidgetTester tester) async { const SingleActivator home = SingleActivator(LogicalKeyboardKey.home); final int initialSelectionOffset = controller.text.length; @@ -2764,7 +2763,7 @@ void main() { expect(scrollController.offset, initialScrollOffset); // no scroll. }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('home + shift highlights selection to the beginning of the line, no scroll', (WidgetTester tester) async { + testWidgets('home + shift highlights selection to the beginning of the line, no scroll', (WidgetTester tester) async { const SingleActivator home = SingleActivator(LogicalKeyboardKey.home, shift: true); final int initialSelectionOffset = controller.text.length; @@ -2787,7 +2786,7 @@ void main() { expect(scrollController.offset, initialScrollOffset); // no scroll. }, variant: desktopExceptMacOS); - testWidgetsWithLeakTracking('end + ctrl scrolls to the end of the text field and changes selection on Windows', (WidgetTester tester) async { + testWidgets('end + ctrl scrolls to the end of the text field and changes selection on Windows', (WidgetTester tester) async { const SingleActivator end = SingleActivator(LogicalKeyboardKey.end, control: true); controller.text = longText; @@ -2815,7 +2814,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: TargetPlatformVariant.only(TargetPlatform.windows)); - testWidgetsWithLeakTracking('end + shift + ctrl scrolls to the end of the text field and highlights everything on Windows', (WidgetTester tester) async { + testWidgets('end + shift + ctrl scrolls to the end of the text field and highlights everything on Windows', (WidgetTester tester) async { const SingleActivator end = SingleActivator(LogicalKeyboardKey.end, control: true, shift: true); controller.text = longText; @@ -2843,7 +2842,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: TargetPlatformVariant.only(TargetPlatform.windows)); - testWidgetsWithLeakTracking('home + ctrl scrolls to the beginning of the text field and changes selection on Windows', (WidgetTester tester) async { + testWidgets('home + ctrl scrolls to the beginning of the text field and changes selection on Windows', (WidgetTester tester) async { const SingleActivator home = SingleActivator(LogicalKeyboardKey.home, control: true); controller.text = longText; @@ -2871,7 +2870,7 @@ void main() { expect(scrollController.offset, newOffset); }, variant: TargetPlatformVariant.only(TargetPlatform.windows)); - testWidgetsWithLeakTracking('home + shift + ctrl scrolls to the beginning of the text field and highlights everything on Windows', (WidgetTester tester) async { + testWidgets('home + shift + ctrl scrolls to the beginning of the text field and highlights everything on Windows', (WidgetTester tester) async { const SingleActivator home = SingleActivator(LogicalKeyboardKey.home, control: true, shift: true); controller.text = longText; diff --git a/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart b/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart index 7e943445123..ce80ec07f70 100644 --- a/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart +++ b/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/src/foundation/constants.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate { _TestSliverPersistentHeaderDelegate({ @@ -55,7 +54,7 @@ void main() { focusNode.dispose(); }); - testWidgetsWithLeakTracking('tapping on a partly visible editable brings it fully on screen', (WidgetTester tester) async { + testWidgets('tapping on a partly visible editable brings it fully on screen', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -93,7 +92,7 @@ void main() { expect(scrollController.offset, 0.0); }); - testWidgetsWithLeakTracking('tapping on a partly visible editable brings it fully on screen with scrollInsets', (WidgetTester tester) async { + testWidgets('tapping on a partly visible editable brings it fully on screen with scrollInsets', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -138,7 +137,7 @@ void main() { expect(scrollController.offset, greaterThan(200.0 - 50.0 - 5.0)); }); - testWidgetsWithLeakTracking('editable comes back on screen when entering text while it is off-screen', (WidgetTester tester) async { + testWidgets('editable comes back on screen when entering text while it is off-screen', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(initialScrollOffset: 100.0); addTearDown(scrollController.dispose); @@ -184,7 +183,7 @@ void main() { expect(find.byType(EditableText), findsOneWidget); }); - testWidgetsWithLeakTracking('entering text does not scroll when scrollPhysics.allowImplicitScrolling = false', (WidgetTester tester) async { + testWidgets('entering text does not scroll when scrollPhysics.allowImplicitScrolling = false', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/19523 final ScrollController scrollController = ScrollController(initialScrollOffset: 100.0); addTearDown(scrollController.dispose); @@ -232,7 +231,7 @@ void main() { expect(find.byType(EditableText), findsNothing); }); - testWidgetsWithLeakTracking('entering text does not scroll a surrounding PageView', (WidgetTester tester) async { + testWidgets('entering text does not scroll a surrounding PageView', (WidgetTester tester) async { // regression test for https://github.com/flutter/flutter/issues/19523 final PageController pageController = PageController(initialPage: 1); addTearDown(pageController.dispose); @@ -280,7 +279,7 @@ void main() { expect(controller.text, 'H'); }); - testWidgetsWithLeakTracking('focused multi-line editable scrolls caret back into view when typing', (WidgetTester tester) async { + testWidgets('focused multi-line editable scrolls caret back into view when typing', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); controller.text = "Start${'\n' * 39}End"; @@ -329,7 +328,7 @@ void main() { expect(scrollController.offset, greaterThan(0.0)); }); - testWidgetsWithLeakTracking('focused multi-line editable does not scroll to old position when non-collapsed selection set', (WidgetTester tester) async { + testWidgets('focused multi-line editable does not scroll to old position when non-collapsed selection set', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); final String text = "Start${'\n' * 39}End"; @@ -380,7 +379,7 @@ void main() { expect(scrollController.offset, 28.0); }); - testWidgetsWithLeakTracking('scrolls into view with scrollInserts after the keyboard pops up', (WidgetTester tester) async { + testWidgets('scrolls into view with scrollInserts after the keyboard pops up', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); const Key container = Key('container'); @@ -422,7 +421,7 @@ void main() { expect(find.byKey(container), findsNothing); }); - testWidgetsWithLeakTracking( + testWidgets( 'A pinned persistent header should not scroll when its descendant EditableText gains focus', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25507. @@ -483,7 +482,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'A pinned persistent header should not scroll when its descendant EditableText gains focus (no animation)', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25507. @@ -589,7 +588,7 @@ void main() { ); } - testWidgetsWithLeakTracking('focus-triggered showCaretOnScreen', (WidgetTester tester) async { + testWidgets('focus-triggered showCaretOnScreen', (WidgetTester tester) async { controller.text = 'a' * 100; controller.selection = const TextSelection.collapsed(offset: 100); final ScrollController scrollController = ScrollController(); @@ -620,7 +619,7 @@ void main() { expect(editableScrollController.offset, readOnly ? 0.0 : greaterThan(0.0)); }); - testWidgetsWithLeakTracking('selection-triggered showCaretOnScreen: virtual keyboard', (WidgetTester tester) async { + testWidgets('selection-triggered showCaretOnScreen: virtual keyboard', (WidgetTester tester) async { controller.text = 'a' * 100; controller.selection = const TextSelection.collapsed(offset: 80); final ScrollController scrollController = ScrollController(); @@ -680,7 +679,7 @@ void main() { expect(editableScrollController.offset, readOnly && !kIsWeb ? 0.0 : greaterThan(0.0)); }); - testWidgetsWithLeakTracking('selection-triggered showCaretOnScreen: text selection delegate', (WidgetTester tester) async { + testWidgets('selection-triggered showCaretOnScreen: text selection delegate', (WidgetTester tester) async { controller.text = 'a' * 100; controller.selection = const TextSelection.collapsed(offset: 80); final ScrollController scrollController = ScrollController(); @@ -746,7 +745,7 @@ void main() { }); // Regression text for https://github.com/flutter/flutter/pull/74722. - testWidgetsWithLeakTracking('does NOT randomly trigger when cursor blinks', (WidgetTester tester) async { + testWidgets('does NOT randomly trigger when cursor blinks', (WidgetTester tester) async { controller.text = 'a' * 100; controller.selection = const TextSelection.collapsed(offset: 0); final ScrollController editableScrollController = ScrollController(); diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 229c353b443..c4f160ee5d3 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import 'editable_text_utils.dart'; @@ -125,7 +124,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals(serializedActionName)); } - testWidgetsWithLeakTracking( + testWidgets( 'Tapping the Live Text button calls onLiveTextInput', (WidgetTester tester) async { bool invokedLiveTextInputSuccessfully = false; @@ -194,7 +193,7 @@ void main() { ); // Regression test for https://github.com/flutter/flutter/issues/126312. - testWidgetsWithLeakTracking('when open input connection in didUpdateWidget, should not throw', (WidgetTester tester) async { + testWidgets('when open input connection in didUpdateWidget, should not throw', (WidgetTester tester) async { final Key key = GlobalKey(); final TextEditingController controller1 = TextEditingController(text: 'blah blah'); @@ -240,7 +239,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text with selection can be shown on the screen when the keyboard shown', (WidgetTester tester) async { + testWidgets('Text with selection can be shown on the screen when the keyboard shown', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/119628 addTearDown(tester.view.reset); @@ -287,7 +286,7 @@ void main() { }); // Related issue: https://github.com/flutter/flutter/issues/98115 - testWidgetsWithLeakTracking('ScheduleShowCaretOnScreen with no animation when the view changes metrics', (WidgetTester tester) async { + testWidgets('ScheduleShowCaretOnScreen with no animation when the view changes metrics', (WidgetTester tester) async { addTearDown(tester.view.reset); final ScrollController scrollController = ScrollController(); @@ -335,7 +334,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/34538. - testWidgetsWithLeakTracking('RTL arabic correct caret placement after trailing whitespace', (WidgetTester tester) async { + testWidgets('RTL arabic correct caret placement after trailing whitespace', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -388,7 +387,7 @@ void main() { expect(state.currentTextEditingValue.text, equals('گیگ ')); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/78550. - testWidgetsWithLeakTracking('has expected defaults', (WidgetTester tester) async { + testWidgets('has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -418,7 +417,7 @@ void main() { expect(editableText.textHeightBehavior, isNull); }); - testWidgetsWithLeakTracking('when backgroundCursorColor is updated, RenderEditable should be updated', (WidgetTester tester) async { + testWidgets('when backgroundCursorColor is updated, RenderEditable should be updated', (WidgetTester tester) async { Widget buildWidget(Color backgroundCursorColor) { return MediaQuery( data: const MediaQueryData(), @@ -442,7 +441,7 @@ void main() { expect(render.backgroundCursorColor, Colors.green); }); - testWidgetsWithLeakTracking('text keyboard is requested when maxLines is default', (WidgetTester tester) async { + testWidgets('text keyboard is requested when maxLines is default', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -474,7 +473,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.done')); }); - testWidgetsWithLeakTracking('Keyboard is configured for "unspecified" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "unspecified" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.unspecified, @@ -482,7 +481,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "none" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "none" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.none, @@ -490,7 +489,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "done" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "done" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.done, @@ -498,7 +497,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "send" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "send" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.send, @@ -506,7 +505,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "go" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "go" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.go, @@ -514,7 +513,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "search" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "search" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.search, @@ -522,7 +521,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "send" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "send" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.send, @@ -530,7 +529,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "next" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "next" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.next, @@ -538,7 +537,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "previous" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "previous" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.previous, @@ -546,7 +545,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "continue" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "continue" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.continueAction, @@ -554,7 +553,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "join" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "join" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.join, @@ -562,7 +561,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "route" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "route" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.route, @@ -570,7 +569,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Keyboard is configured for "emergencyCall" action when explicitly requested', (WidgetTester tester) async { + testWidgets('Keyboard is configured for "emergencyCall" action when explicitly requested', (WidgetTester tester) async { await desiredKeyboardActionIsRequested( tester: tester, action: TextInputAction.emergencyCall, @@ -578,7 +577,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('insertContent does not throw and parses data correctly', (WidgetTester tester) async { + testWidgets('insertContent does not throw and parses data correctly', (WidgetTester tester) async { String? latestUri; await tester.pumpWidget( MediaQuery( @@ -634,7 +633,7 @@ void main() { expect(latestUri, equals(uri)); }); - testWidgetsWithLeakTracking('onAppPrivateCommand does not throw', (WidgetTester tester) async { + testWidgets('onAppPrivateCommand does not throw', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -682,7 +681,7 @@ void main() { }); group('Infer keyboardType from autofillHints', () { - testWidgetsWithLeakTracking( + testWidgets( 'infer keyboard types from autofillHints: ios', (WidgetTester tester) async { await tester.pumpWidget( @@ -721,7 +720,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'infer keyboard types from autofillHints: non-ios', (WidgetTester tester) async { await tester.pumpWidget( @@ -754,7 +753,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'inferred keyboard types can be overridden: ios', (WidgetTester tester) async { await tester.pumpWidget( @@ -789,7 +788,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'inferred keyboard types can be overridden: non-ios', (WidgetTester tester) async { await tester.pumpWidget( @@ -824,7 +823,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('multiline keyboard is requested when set explicitly', (WidgetTester tester) async { + testWidgets('multiline keyboard is requested when set explicitly', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -855,7 +854,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.newline')); }); - testWidgetsWithLeakTracking('EditableText sends enableInteractiveSelection to config', (WidgetTester tester) async { + testWidgets('EditableText sends enableInteractiveSelection to config', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -907,7 +906,7 @@ void main() { expect(state.textInputConfiguration.enableInteractiveSelection, isFalse); }); - testWidgetsWithLeakTracking('selection persists when unfocused', (WidgetTester tester) async { + testWidgets('selection persists when unfocused', (WidgetTester tester) async { const TextEditingValue value = TextEditingValue( text: 'test test', selection: TextSelection(affinity: TextAffinity.upstream, baseOffset: 5, extentOffset: 7), @@ -961,7 +960,7 @@ void main() { expect(focusNode.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('selection rects re-sent when refocused', (WidgetTester tester) async { + testWidgets('selection rects re-sent when refocused', (WidgetTester tester) async { final List<List<SelectionRect>> log = <List<SelectionRect>>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { if (methodCall.method == 'TextInput.setSelectionRects') { @@ -1043,7 +1042,7 @@ void main() { // On web, we should rely on the browser's implementation of Scribble, so we will not send selection rects. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('EditableText does not derive selection color from DefaultSelectionStyle', (WidgetTester tester) async { + testWidgets('EditableText does not derive selection color from DefaultSelectionStyle', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103341. const TextEditingValue value = TextEditingValue( text: 'test test', @@ -1074,7 +1073,7 @@ void main() { expect(state.renderEditable.selectionColor, null); }); - testWidgetsWithLeakTracking('visiblePassword keyboard is requested when set explicitly', (WidgetTester tester) async { + testWidgets('visiblePassword keyboard is requested when set explicitly', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1105,7 +1104,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.done')); }); - testWidgetsWithLeakTracking('enableSuggestions flag is sent to the engine properly', (WidgetTester tester) async { + testWidgets('enableSuggestions flag is sent to the engine properly', (WidgetTester tester) async { const bool enableSuggestions = false; await tester.pumpWidget( MediaQuery( @@ -1134,7 +1133,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['enableSuggestions'], enableSuggestions); }); - testWidgetsWithLeakTracking('enableIMEPersonalizedLearning flag is sent to the engine properly', (WidgetTester tester) async { + testWidgets('enableIMEPersonalizedLearning flag is sent to the engine properly', (WidgetTester tester) async { const bool enableIMEPersonalizedLearning = false; await tester.pumpWidget( MediaQuery( @@ -1164,7 +1163,7 @@ void main() { }); group('smartDashesType and smartQuotesType', () { - testWidgetsWithLeakTracking('sent to the engine properly', (WidgetTester tester) async { + testWidgets('sent to the engine properly', (WidgetTester tester) async { const SmartDashesType smartDashesType = SmartDashesType.disabled; const SmartQuotesType smartQuotesType = SmartQuotesType.disabled; await tester.pumpWidget( @@ -1196,7 +1195,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['smartQuotesType'], smartQuotesType.index.toString()); }); - testWidgetsWithLeakTracking('default to true when obscureText is false', (WidgetTester tester) async { + testWidgets('default to true when obscureText is false', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1224,7 +1223,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['smartQuotesType'], '1'); }); - testWidgetsWithLeakTracking('default to false when obscureText is true', (WidgetTester tester) async { + testWidgets('default to false when obscureText is true', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1254,7 +1253,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('selection overlay will update when text grow bigger', (WidgetTester tester) async { + testWidgets('selection overlay will update when text grow bigger', (WidgetTester tester) async { controller.value = const TextEditingValue(text: 'initial value'); Future<void> pumpEditableTextWithTextStyle(TextStyle style) async { @@ -1311,7 +1310,7 @@ void main() { expect(handles[1].localToGlobal(Offset.zero), const Offset(197.0, 17.0)); }); - testWidgetsWithLeakTracking('can update style of previous activated EditableText', (WidgetTester tester) async { + testWidgets('can update style of previous activated EditableText', (WidgetTester tester) async { final TextEditingController controller1 = TextEditingController(); addTearDown(controller1.dispose); final TextEditingController controller2 = TextEditingController(); @@ -1403,7 +1402,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Multiline keyboard with newline action is requested when maxLines = null', (WidgetTester tester) async { + testWidgets('Multiline keyboard with newline action is requested when maxLines = null', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1434,7 +1433,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.newline')); }); - testWidgetsWithLeakTracking('Text keyboard is requested when explicitly set and maxLines = null', (WidgetTester tester) async { + testWidgets('Text keyboard is requested when explicitly set and maxLines = null', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1466,7 +1465,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.done')); }); - testWidgetsWithLeakTracking('Correct keyboard is requested when set explicitly and maxLines > 1', (WidgetTester tester) async { + testWidgets('Correct keyboard is requested when set explicitly and maxLines > 1', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1498,7 +1497,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.done')); }); - testWidgetsWithLeakTracking('multiline keyboard is requested when set implicitly', (WidgetTester tester) async { + testWidgets('multiline keyboard is requested when set implicitly', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1529,7 +1528,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['inputAction'], equals('TextInputAction.newline')); }); - testWidgetsWithLeakTracking('single line inputs have correct default keyboard', (WidgetTester tester) async { + testWidgets('single line inputs have correct default keyboard', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1562,7 +1561,7 @@ void main() { // Test case for // https://github.com/flutter/flutter/issues/123523 // https://github.com/flutter/flutter/issues/134846 . - testWidgetsWithLeakTracking( + testWidgets( 'The focus and callback behavior are correct when TextInputClient.onConnectionClosed message received', (WidgetTester tester) async { bool onSubmittedInvoked = false; @@ -1604,7 +1603,7 @@ void main() { expect(onSubmittedInvoked, isFalse); }); - testWidgetsWithLeakTracking('connection is closed when TextInputClient.onConnectionClosed message received', (WidgetTester tester) async { + testWidgets('connection is closed when TextInputClient.onConnectionClosed message received', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1647,7 +1646,7 @@ void main() { expect(tester.testTextInput.log, isEmpty); }); - testWidgetsWithLeakTracking('closed connection reopened when user focused', (WidgetTester tester) async { + testWidgets('closed connection reopened when user focused', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -1698,7 +1697,7 @@ void main() { expect(state.wantKeepAlive, true); }); - testWidgetsWithLeakTracking('closed connection reopened when user focused on another field', (WidgetTester tester) async { + testWidgets('closed connection reopened when user focused on another field', (WidgetTester tester) async { final EditableText testNameField = EditableText( backgroundCursorColor: Colors.grey, @@ -1773,7 +1772,7 @@ void main() { expect(state.wantKeepAlive, true); }); - testWidgetsWithLeakTracking( + testWidgets( 'kept-alive EditableText does not crash when layout is skipped', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84896. @@ -1851,7 +1850,7 @@ void main() { // cut. It might also provide additional functionality depending on the // browser (such as translation). Due to this, in browsers, we should not // show a Flutter toolbar for the editable text elements. - testWidgetsWithLeakTracking('can show toolbar when there is text and a selection', (WidgetTester tester) async { + testWidgets('can show toolbar when there is text and a selection', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -1916,7 +1915,7 @@ void main() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.contextMenu, null); }); - testWidgetsWithLeakTracking('web can show flutter context menu when the browser context menu is disabled', (WidgetTester tester) async { + testWidgets('web can show flutter context menu when the browser context menu is disabled', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -1964,7 +1963,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('can hide toolbar with DismissIntent', (WidgetTester tester) async { + testWidgets('can hide toolbar with DismissIntent', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -1999,7 +1998,7 @@ void main() { expect(find.text('Paste'), findsNothing); }); - testWidgetsWithLeakTracking('toolbar hidden on mobile when orientation changes', (WidgetTester tester) async { + testWidgets('toolbar hidden on mobile when orientation changes', (WidgetTester tester) async { addTearDown(tester.view.reset); await tester.pumpWidget( @@ -2047,7 +2046,7 @@ void main() { // toolbar. Until we change that, this test should remain skipped. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android })); // [intended] - testWidgetsWithLeakTracking('Paste is shown only when there is something to paste', (WidgetTester tester) async { + testWidgets('Paste is shown only when there is something to paste', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -2097,7 +2096,7 @@ void main() { expect(find.text('Paste'), findsNothing); }); - testWidgetsWithLeakTracking('Copy selection does not collapse selection on desktop and iOS', (WidgetTester tester) async { + testWidgets('Copy selection does not collapse selection on desktop and iOS', (WidgetTester tester) async { final TextEditingController localController = TextEditingController(text: 'Hello world'); addTearDown(localController.dispose); @@ -2137,7 +2136,7 @@ void main() { expect(find.text('Copy'), findsNothing); }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.linux, TargetPlatform.windows })); // [intended] - testWidgetsWithLeakTracking('Copy selection collapses selection and hides the toolbar on Android and Fuchsia', (WidgetTester tester) async { + testWidgets('Copy selection collapses selection and hides the toolbar on Android and Fuchsia', (WidgetTester tester) async { final TextEditingController localController = TextEditingController(text: 'Hello world'); addTearDown(localController.dispose); @@ -2179,7 +2178,7 @@ void main() { expect(find.text('Copy'), findsNothing); }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia })); // [intended] - testWidgetsWithLeakTracking('can show the toolbar after clearing all text', (WidgetTester tester) async { + testWidgets('can show the toolbar after clearing all text', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/35998. await tester.pumpWidget( MaterialApp( @@ -2218,7 +2217,7 @@ void main() { expect(find.text('Paste'), kIsWeb ? findsNothing : findsOneWidget); }); - testWidgetsWithLeakTracking('can dynamically disable options in toolbar', (WidgetTester tester) async { + testWidgets('can dynamically disable options in toolbar', (WidgetTester tester) async { controller.text = 'blah blah'; await tester.pumpWidget( @@ -2256,7 +2255,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('can dynamically disable select all option in toolbar - cupertino', (WidgetTester tester) async { + testWidgets('can dynamically disable select all option in toolbar - cupertino', (WidgetTester tester) async { // Regression test: https://github.com/flutter/flutter/issues/40711 controller.text = 'blah blah'; @@ -2287,7 +2286,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('can dynamically disable select all option in toolbar - material', (WidgetTester tester) async { + testWidgets('can dynamically disable select all option in toolbar - material', (WidgetTester tester) async { // Regression test: https://github.com/flutter/flutter/issues/40711 controller.text = 'blah blah'; @@ -2325,7 +2324,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('cut and paste are disabled in read only mode even if explicitly set', (WidgetTester tester) async { + testWidgets('cut and paste are disabled in read only mode even if explicitly set', (WidgetTester tester) async { controller.text = 'blah blah'; await tester.pumpWidget( @@ -2366,7 +2365,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('cut and copy are disabled in obscured mode even if explicitly set', (WidgetTester tester) async { + testWidgets('cut and copy are disabled in obscured mode even if explicitly set', (WidgetTester tester) async { controller.text = 'blah blah'; await tester.pumpWidget( @@ -2410,7 +2409,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('cut and copy do nothing in obscured mode even if explicitly called', (WidgetTester tester) async { + testWidgets('cut and copy do nothing in obscured mode even if explicitly called', (WidgetTester tester) async { controller.text = 'blah blah'; await tester.pumpWidget( @@ -2452,7 +2451,7 @@ void main() { expect(data!.text, isEmpty); }); - testWidgetsWithLeakTracking('select all does nothing if obscured and read-only, even if explicitly called', (WidgetTester tester) async { + testWidgets('select all does nothing if obscured and read-only, even if explicitly called', (WidgetTester tester) async { controller.text = 'blah blah'; await tester.pumpWidget( @@ -2480,7 +2479,7 @@ void main() { }); group('buttonItemsForToolbarOptions', () { - testWidgetsWithLeakTracking('returns null when toolbarOptions are empty', (WidgetTester tester) async { + testWidgets('returns null when toolbarOptions are empty', (WidgetTester tester) async { controller.text = 'TEXT'; await tester.pumpWidget( @@ -2503,7 +2502,7 @@ void main() { expect(state.buttonItemsForToolbarOptions(), isNull); }); - testWidgetsWithLeakTracking('returns empty array when only cut is selected in toolbarOptions but cut is not enabled', (WidgetTester tester) async { + testWidgets('returns empty array when only cut is selected in toolbarOptions but cut is not enabled', (WidgetTester tester) async { controller.text = 'TEXT'; await tester.pumpWidget( @@ -2528,7 +2527,7 @@ void main() { expect(state.buttonItemsForToolbarOptions(), isEmpty); }); - testWidgetsWithLeakTracking('returns only cut button when only cut is selected in toolbarOptions and cut is enabled', (WidgetTester tester) async { + testWidgets('returns only cut button when only cut is selected in toolbarOptions and cut is enabled', (WidgetTester tester) async { const String text = 'TEXT'; controller.text = text; @@ -2573,7 +2572,7 @@ void main() { expect(data!.text, equals(text)); }); - testWidgetsWithLeakTracking('returns empty array when only copy is selected in toolbarOptions but copy is not enabled', (WidgetTester tester) async { + testWidgets('returns empty array when only copy is selected in toolbarOptions but copy is not enabled', (WidgetTester tester) async { controller.text = 'TEXT'; await tester.pumpWidget( @@ -2598,7 +2597,7 @@ void main() { expect(state.buttonItemsForToolbarOptions(), isEmpty); }); - testWidgetsWithLeakTracking('returns only copy button when only copy is selected in toolbarOptions and copy is enabled', (WidgetTester tester) async { + testWidgets('returns only copy button when only copy is selected in toolbarOptions and copy is enabled', (WidgetTester tester) async { const String text = 'TEXT'; controller.text = text; @@ -2643,7 +2642,7 @@ void main() { expect(data!.text, equals(text)); }); - testWidgetsWithLeakTracking('returns empty array when only paste is selected in toolbarOptions but paste is not enabled', (WidgetTester tester) async { + testWidgets('returns empty array when only paste is selected in toolbarOptions but paste is not enabled', (WidgetTester tester) async { controller.text = 'TEXT'; await tester.pumpWidget( @@ -2668,7 +2667,7 @@ void main() { expect(state.buttonItemsForToolbarOptions(), isEmpty); }); - testWidgetsWithLeakTracking('returns only paste button when only paste is selected in toolbarOptions and paste is enabled', (WidgetTester tester) async { + testWidgets('returns only paste button when only paste is selected in toolbarOptions and paste is enabled', (WidgetTester tester) async { const String text = 'TEXT'; controller.text = text; @@ -2710,7 +2709,7 @@ void main() { expect(controller.text, equals(text + text)); }); - testWidgetsWithLeakTracking('returns empty array when only selectAll is selected in toolbarOptions but selectAll is not enabled', (WidgetTester tester) async { + testWidgets('returns empty array when only selectAll is selected in toolbarOptions but selectAll is not enabled', (WidgetTester tester) async { controller.text = 'TEXT'; await tester.pumpWidget( @@ -2736,7 +2735,7 @@ void main() { expect(state.buttonItemsForToolbarOptions(), isEmpty); }); - testWidgetsWithLeakTracking('returns only selectAll button when only selectAll is selected in toolbarOptions and selectAll is enabled', (WidgetTester tester) async { + testWidgets('returns only selectAll button when only selectAll is selected in toolbarOptions and selectAll is enabled', (WidgetTester tester) async { const String text = 'TEXT'; controller.text = text; @@ -2773,7 +2772,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Handles the read-only flag correctly', (WidgetTester tester) async { + testWidgets('Handles the read-only flag correctly', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; await tester.pumpWidget( @@ -2815,7 +2814,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Does not accept updates when read-only', (WidgetTester tester) async { + testWidgets('Does not accept updates when read-only', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; await tester.pumpWidget( @@ -2856,7 +2855,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Read-only fields do not format text', (WidgetTester tester) async { + testWidgets('Read-only fields do not format text', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; late SelectionChangedCause selectionCause; @@ -2894,7 +2893,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Selection changes during Scribble interaction should have the scribble cause', (WidgetTester tester) async { + testWidgets('Selection changes during Scribble interaction should have the scribble cause', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; late SelectionChangedCause selectionCause; @@ -2940,7 +2939,7 @@ void main() { await tester.testTextInput.finishScribbleInteraction(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('Requests focus and changes the selection when onScribbleFocus is called', (WidgetTester tester) async { + testWidgets('Requests focus and changes the selection when onScribbleFocus is called', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; late SelectionChangedCause selectionCause; @@ -2971,7 +2970,7 @@ void main() { // will never be SelectionChangedCause.scribble. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('Declares itself for Scribble interaction if the bounds overlap the scribble rect and the widget is touchable', (WidgetTester tester) async { + testWidgets('Declares itself for Scribble interaction if the bounds overlap the scribble rect and the widget is touchable', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; await tester.pumpWidget( @@ -3064,7 +3063,7 @@ void main() { // never request the scribble elements. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('single line Scribble fields can show a horizontal placeholder', (WidgetTester tester) async { + testWidgets('single line Scribble fields can show a horizontal placeholder', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; await tester.pumpWidget( @@ -3138,7 +3137,7 @@ void main() { // will not handle placeholders. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('multiline Scribble fields can show a vertical placeholder', (WidgetTester tester) async { + testWidgets('multiline Scribble fields can show a vertical placeholder', (WidgetTester tester) async { controller.text = 'Lorem ipsum dolor sit amet'; await tester.pumpWidget( @@ -3215,7 +3214,7 @@ void main() { // will not handle placeholders. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('Sends "updateConfig" when read-only flag is flipped', (WidgetTester tester) async { + testWidgets('Sends "updateConfig" when read-only flag is flipped', (WidgetTester tester) async { bool readOnly = true; late StateSetter setState; controller.text = 'Lorem ipsum dolor sit amet'; @@ -3253,7 +3252,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['readOnly'], isFalse); }); - testWidgetsWithLeakTracking('Sends "updateConfig" when obscureText is flipped', (WidgetTester tester) async { + testWidgets('Sends "updateConfig" when obscureText is flipped', (WidgetTester tester) async { bool obscureText = true; late StateSetter setState; controller.text = 'Lorem'; @@ -3289,7 +3288,7 @@ void main() { expect(tester.testTextInput.setClientArgs!['obscureText'], isFalse); }); - testWidgetsWithLeakTracking('Fires onChanged when text changes via TextSelectionOverlay', (WidgetTester tester) async { + testWidgets('Fires onChanged when text changes via TextSelectionOverlay', (WidgetTester tester) async { late String changedValue; final Widget widget = MaterialApp( home: EditableText( @@ -3332,7 +3331,7 @@ void main() { TextInputAction.values.toSet(), ); - testWidgetsWithLeakTracking('Handles focus correctly when action is invoked', (WidgetTester tester) async { + testWidgets('Handles focus correctly when action is invoked', (WidgetTester tester) async { // The expectations for each of the types of TextInputAction. const Map<TextInputAction, bool> actionShouldLoseFocus = <TextInputAction, bool>{ TextInputAction.none: false, @@ -3411,7 +3410,7 @@ void main() { } }, variant: focusVariants); - testWidgetsWithLeakTracking('Does not lose focus by default when "done" action is pressed and onEditingComplete is provided', (WidgetTester tester) async { + testWidgets('Does not lose focus by default when "done" action is pressed and onEditingComplete is provided', (WidgetTester tester) async { final Widget widget = MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, @@ -3443,7 +3442,7 @@ void main() { expect(focusNode.hasFocus, true); }); - testWidgetsWithLeakTracking('When "done" is pressed callbacks are invoked: onEditingComplete > onSubmitted', (WidgetTester tester) async { + testWidgets('When "done" is pressed callbacks are invoked: onEditingComplete > onSubmitted', (WidgetTester tester) async { bool onEditingCompleteCalled = false; bool onSubmittedCalled = false; @@ -3481,7 +3480,7 @@ void main() { // and onSubmission callbacks. }); - testWidgetsWithLeakTracking('When "next" is pressed callbacks are invoked: onEditingComplete > onSubmitted', (WidgetTester tester) async { + testWidgets('When "next" is pressed callbacks are invoked: onEditingComplete > onSubmitted', (WidgetTester tester) async { bool onEditingCompleteCalled = false; bool onSubmittedCalled = false; @@ -3519,7 +3518,7 @@ void main() { // and onSubmission callbacks. }); - testWidgetsWithLeakTracking('When "newline" action is called on a Editable text with maxLines == 1 callbacks are invoked: onEditingComplete > onSubmitted', (WidgetTester tester) async { + testWidgets('When "newline" action is called on a Editable text with maxLines == 1 callbacks are invoked: onEditingComplete > onSubmitted', (WidgetTester tester) async { bool onEditingCompleteCalled = false; bool onSubmittedCalled = false; @@ -3556,7 +3555,7 @@ void main() { // and onSubmission callbacks. }); - testWidgetsWithLeakTracking('When "newline" action is called on a Editable text with maxLines != 1, onEditingComplete and onSubmitted callbacks are not invoked.', (WidgetTester tester) async { + testWidgets('When "newline" action is called on a Editable text with maxLines != 1, onEditingComplete and onSubmitted callbacks are not invoked.', (WidgetTester tester) async { bool onEditingCompleteCalled = false; bool onSubmittedCalled = false; @@ -3594,7 +3593,7 @@ void main() { assert(!onEditingCompleteCalled); }); - testWidgetsWithLeakTracking( + testWidgets( 'finalizeEditing should reset the input connection when shouldUnfocus is true but the unfocus is cancelled', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84240 . @@ -3659,7 +3658,7 @@ void main() { ]))); }); - testWidgetsWithLeakTracking( + testWidgets( 'requesting focus in the onSubmitted callback should keep the onscreen keyboard visible', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/95154 . @@ -3702,7 +3701,7 @@ void main() { ]))); }); - testWidgetsWithLeakTracking( + testWidgets( 'iOS autocorrection rectangle should appear on demand and dismiss when the text changes or when focus is lost', (WidgetTester tester) async { const Color rectColor = Color(0xFFFF0000); @@ -3782,7 +3781,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Changing controller updates EditableText', (WidgetTester tester) async { + testWidgets('Changing controller updates EditableText', (WidgetTester tester) async { final TextEditingController controller1 = TextEditingController(text: 'Wibble'); addTearDown(controller1.dispose); @@ -3870,7 +3869,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('EditableText identifies as text field (w/ focus) in semantics', (WidgetTester tester) async { + testWidgets('EditableText identifies as text field (w/ focus) in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -3910,7 +3909,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('EditableText sets multi-line flag in semantics', (WidgetTester tester) async { + testWidgets('EditableText sets multi-line flag in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -3970,7 +3969,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('EditableText includes text as value in semantics', (WidgetTester tester) async { + testWidgets('EditableText includes text as value in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const String value1 = 'EditableText content'; @@ -4019,7 +4018,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('exposes correct cursor movement semantics', (WidgetTester tester) async { + testWidgets('exposes correct cursor movement semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); controller.text = 'test'; @@ -4102,7 +4101,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can move cursor with a11y means - character', (WidgetTester tester) async { + testWidgets('can move cursor with a11y means - character', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const bool doNotExtendSelection = false; @@ -4207,7 +4206,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can move cursor with a11y means - word', (WidgetTester tester) async { + testWidgets('can move cursor with a11y means - word', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const bool doNotExtendSelection = false; @@ -4320,7 +4319,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can extend selection with a11y means - character', (WidgetTester tester) async { + testWidgets('can extend selection with a11y means - character', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const bool extendSelection = true; const bool doNotExtendSelection = false; @@ -4436,7 +4435,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can extend selection with a11y means - word', (WidgetTester tester) async { + testWidgets('can extend selection with a11y means - word', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const bool extendSelection = true; const bool doNotExtendSelection = false; @@ -4550,7 +4549,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('password fields have correct semantics', (WidgetTester tester) async { + testWidgets('password fields have correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); controller.text = 'super-secret-password!!1'; @@ -4605,7 +4604,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('password fields become obscured with the right semantics when set', (WidgetTester tester) async { + testWidgets('password fields become obscured with the right semantics when set', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const String originalText = 'super-secret-password!!1'; @@ -4720,7 +4719,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('password fields can have their obscuring character customized', (WidgetTester tester) async { + testWidgets('password fields can have their obscuring character customized', (WidgetTester tester) async { const String originalText = 'super-secret-password!!1'; controller.text = originalText; @@ -4741,7 +4740,7 @@ void main() { expect((findRenderEditable(tester).text! as TextSpan).text, expectedValue); }); - testWidgetsWithLeakTracking('password briefly shows last character when entered on mobile', (WidgetTester tester) async { + testWidgets('password briefly shows last character when entered on mobile', (WidgetTester tester) async { final bool debugDeterministicCursor = EditableText.debugDeterministicCursor; EditableText.debugDeterministicCursor = false; addTearDown(() { @@ -4795,7 +4794,7 @@ void main() { controls = MockTextSelectionControls(); }); - testWidgetsWithLeakTracking('are exposed', (WidgetTester tester) async { + testWidgets('are exposed', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); controls.testCanCopy = false; @@ -4892,7 +4891,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('can copy/cut/paste with a11y', (WidgetTester tester) async { + testWidgets('can copy/cut/paste with a11y', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); controls.testCanCopy = true; @@ -4965,7 +4964,7 @@ void main() { }); // Regression test for b/201218542. - testWidgetsWithLeakTracking('copying with a11y works even when toolbar is hidden', (WidgetTester tester) async { + testWidgets('copying with a11y works even when toolbar is hidden', (WidgetTester tester) async { Future<void> testByControls(TextSelectionControls controls) async { final SemanticsTester semantics = SemanticsTester(tester); final TextEditingController controller = TextEditingController(text: 'ABCDEFG'); @@ -5011,7 +5010,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('can set text with a11y', (WidgetTester tester) async { + testWidgets('can set text with a11y', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( home: EditableText( @@ -5076,7 +5075,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('allows customizing text style in subclasses', (WidgetTester tester) async { + testWidgets('allows customizing text style in subclasses', (WidgetTester tester) async { controller.text = 'Hello World'; await tester.pumpWidget(MaterialApp( @@ -5093,7 +5092,7 @@ void main() { expect(render.text!.style!.fontStyle, FontStyle.italic); }); - testWidgetsWithLeakTracking('onChanged callback only invoked on text changes', (WidgetTester tester) async { + testWidgets('onChanged callback only invoked on text changes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/111651 . int onChangedCount = 0; bool preventInput = false; @@ -5138,7 +5137,7 @@ void main() { expect(onChangedCount , 2); }); - testWidgetsWithLeakTracking('Formatters are skipped if text has not changed', (WidgetTester tester) async { + testWidgets('Formatters are skipped if text has not changed', (WidgetTester tester) async { int called = 0; final TextInputFormatter formatter = TextInputFormatter.withFunction((TextEditingValue oldValue, TextEditingValue newValue) { called += 1; @@ -5181,7 +5180,7 @@ void main() { expect(called, 2); }); - testWidgetsWithLeakTracking('default keyboardAppearance is respected', (WidgetTester tester) async { + testWidgets('default keyboardAppearance is respected', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/22212. final List<MethodCall> log = <MethodCall>[]; @@ -5212,7 +5211,7 @@ void main() { expect(((setClient.arguments as Iterable<dynamic>).last as Map<String, dynamic>)['keyboardAppearance'], 'Brightness.light'); }); - testWidgetsWithLeakTracking('location of widget is sent on show keyboard', (WidgetTester tester) async { + testWidgets('location of widget is sent on show keyboard', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -5247,7 +5246,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('transform and size is reset when text connection opens', (WidgetTester tester) async { + testWidgets('transform and size is reset when text connection opens', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -5339,7 +5338,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('size and transform are sent when they change', (WidgetTester tester) async { + testWidgets('size and transform are sent when they change', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -5382,7 +5381,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('selection rects are sent when they change', (WidgetTester tester) async { + testWidgets('selection rects are sent when they change', (WidgetTester tester) async { addTearDown(tester.view.reset); // Ensure selection rects are sent on iPhone (using SE 3rd gen size) tester.view.physicalSize = const Size(750.0, 1334.0); @@ -5522,7 +5521,7 @@ void main() { // On web, we should rely on the browser's implementation of Scribble, so we will not send selection rects. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('selection rects are not sent if scribbleEnabled is false', (WidgetTester tester) async { + testWidgets('selection rects are not sent if scribbleEnabled is false', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -5561,7 +5560,7 @@ void main() { // On web, we should rely on the browser's implementation of Scribble, so we will not send selection rects. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('selection rects sent even when character corners are outside of paintBounds', (WidgetTester tester) async { + testWidgets('selection rects sent even when character corners are outside of paintBounds', (WidgetTester tester) async { final List<List<SelectionRect>> log = <List<SelectionRect>>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) { if (methodCall.method == 'TextInput.setSelectionRects') { @@ -5637,7 +5636,7 @@ void main() { // On web, we should rely on the browser's implementation of Scribble, so we will not send selection rects. }, skip: kIsWeb, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); // [intended] - testWidgetsWithLeakTracking('text styling info is sent on show keyboard', (WidgetTester tester) async { + testWidgets('text styling info is sent on show keyboard', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -5676,7 +5675,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('text styling info is sent on show keyboard (bold override)', (WidgetTester tester) async { + testWidgets('text styling info is sent on show keyboard (bold override)', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { log.add(methodCall); @@ -5715,7 +5714,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('text styling info is sent on style update', (WidgetTester tester) async { + testWidgets('text styling info is sent on style update', (WidgetTester tester) async { final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>(); late StateSetter setState; const TextStyle textStyle1 = TextStyle( @@ -5814,7 +5813,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( 'called with proper coordinates', (WidgetTester tester) async { controller.value = TextEditingValue(text: 'a' * 50); @@ -5856,7 +5855,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'only send updates when necessary', (WidgetTester tester) async { controller.value = TextEditingValue(text: 'a' * 100); @@ -5874,7 +5873,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'set to selection start on forward selection', (WidgetTester tester) async { controller.value = TextEditingValue( @@ -5897,7 +5896,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'set to selection start on reversed selection', (WidgetTester tester) async { controller.value = TextEditingValue( @@ -5947,7 +5946,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( 'called when the composing range changes', (WidgetTester tester) async { controller.value = TextEditingValue(text: 'a' * 100); @@ -5981,7 +5980,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'only send updates when necessary', (WidgetTester tester) async { controller.value = TextEditingValue(text: 'a' * 100, composing: const TextRange(start: 0, end: 10)); @@ -5999,7 +5998,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'zero matrix paint transform', (WidgetTester tester) async { controller.value = TextEditingValue(text: 'a' * 100, composing: const TextRange(start: 0, end: 10)); @@ -6021,7 +6020,7 @@ void main() { }); - testWidgetsWithLeakTracking('custom keyboardAppearance is respected', (WidgetTester tester) async { + testWidgets('custom keyboardAppearance is respected', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/22212. final List<MethodCall> log = <MethodCall>[]; @@ -6053,7 +6052,7 @@ void main() { expect(((setClient.arguments as Iterable<dynamic>).last as Map<String, dynamic>)['keyboardAppearance'], 'Brightness.dark'); }); - testWidgetsWithLeakTracking('Composing text is underlined and underline is cleared when losing focus', (WidgetTester tester) async { + testWidgets('Composing text is underlined and underline is cleared when losing focus', (WidgetTester tester) async { controller.value = const TextEditingValue( text: 'text composing text', selection: TextSelection.collapsed(offset: 14), @@ -6098,7 +6097,7 @@ void main() { expect(renderEditable.text!.style!.decoration, isNull); }); - testWidgetsWithLeakTracking('text selection toolbar visibility', (WidgetTester tester) async { + testWidgets('text selection toolbar visibility', (WidgetTester tester) async { controller.text = 'hello \n world \n this \n is \n text'; await tester.pumpWidget(MaterialApp( @@ -6166,7 +6165,7 @@ void main() { // toolbar. Until we change that, this test should remain skipped. }, skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('text selection handle visibility', (WidgetTester tester) async { + testWidgets('text selection handle visibility', (WidgetTester tester) async { // Text with two separate words to select. controller.text = 'XXXXX XXXXX'; @@ -6337,7 +6336,7 @@ void main() { // toolbar. Until we change that, this test should remain skipped. }, skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('text selection handle visibility RTL', (WidgetTester tester) async { + testWidgets('text selection handle visibility RTL', (WidgetTester tester) async { // Text with two separate words to select. controller.text = 'XXXXX XXXXX'; @@ -7405,7 +7404,7 @@ void main() { } } - testWidgetsWithLeakTracking('keyboard text selection works (RawKeyEvent)', (WidgetTester tester) async { + testWidgets('keyboard text selection works (RawKeyEvent)', (WidgetTester tester) async { debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.rawKeyData; await testTextEditing(tester, targetPlatform: defaultTargetPlatform); @@ -7415,7 +7414,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('keyboard text selection works (ui.KeyData then RawKeyEvent)', (WidgetTester tester) async { + testWidgets('keyboard text selection works (ui.KeyData then RawKeyEvent)', (WidgetTester tester) async { debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.keyDataThenRawKeyData; await testTextEditing(tester, targetPlatform: defaultTargetPlatform); @@ -7425,7 +7424,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking( + testWidgets( 'keyboard shortcuts respect read-only', (WidgetTester tester) async { final String platform = defaultTargetPlatform.name.toLowerCase(); @@ -7604,7 +7603,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('home/end keys', (WidgetTester tester) async { + testWidgets('home/end keys', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); controller.text = testText; @@ -7750,7 +7749,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('home keys and wordwraps', (WidgetTester tester) async { + testWidgets('home keys and wordwraps', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); const String testText = 'Now is the time for all good people to come to the aid of their country. Now is the time for all good people to come to the aid of their country.'; @@ -7906,7 +7905,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('end keys and wordwraps', (WidgetTester tester) async { + testWidgets('end keys and wordwraps', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); const String testText = 'Now is the time for all good people to come to the aid of their country. Now is the time for all good people to come to the aid of their country.'; @@ -8064,7 +8063,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('shift + home/end keys', (WidgetTester tester) async { + testWidgets('shift + home/end keys', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); controller.text = testText; @@ -8258,7 +8257,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('shift + home/end keys (Windows only)', (WidgetTester tester) async { + testWidgets('shift + home/end keys (Windows only)', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -8369,7 +8368,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.windows }) ); - testWidgetsWithLeakTracking('home/end keys scrolling (Mac only)', (WidgetTester tester) async { + testWidgets('home/end keys scrolling (Mac only)', (WidgetTester tester) async { const String testText = 'Now is the time for all good people to come to the aid of their country. Now is the time for all good people to come to the aid of their country.'; controller.text = testText; controller.selection = const TextSelection( @@ -8430,7 +8429,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }) ); - testWidgetsWithLeakTracking('shift + home keys and wordwraps', (WidgetTester tester) async { + testWidgets('shift + home keys and wordwraps', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); const String testText = 'Now is the time for all good people to come to the aid of their country. Now is the time for all good people to come to the aid of their country.'; @@ -8615,7 +8614,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('shift + end keys and wordwraps', (WidgetTester tester) async { + testWidgets('shift + end keys and wordwraps', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); const String testText = 'Now is the time for all good people to come to the aid of their country. Now is the time for all good people to come to the aid of their country.'; @@ -8802,7 +8801,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('shift + home/end keys to document boundary (Mac only)', (WidgetTester tester) async { + testWidgets('shift + home/end keys to document boundary (Mac only)', (WidgetTester tester) async { const String testText = 'Now is the time for all good people to come to the aid of their country. Now is the time for all good people to come to the aid of their country.'; controller.text = testText; controller.selection = const TextSelection( @@ -8906,7 +8905,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }) ); - testWidgetsWithLeakTracking('control + home/end keys (Windows only)', (WidgetTester tester) async { + testWidgets('control + home/end keys (Windows only)', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -8971,7 +8970,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.windows }) ); - testWidgetsWithLeakTracking('control + shift + home/end keys (Windows only)', (WidgetTester tester) async { + testWidgets('control + shift + home/end keys (Windows only)', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -9058,7 +9057,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.windows }) ); - testWidgetsWithLeakTracking('pageup/pagedown keys on Apple platforms', (WidgetTester tester) async { + testWidgets('pageup/pagedown keys on Apple platforms', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -9154,7 +9153,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('pageup/pagedown keys in a one line field on Apple platforms', (WidgetTester tester) async { + testWidgets('pageup/pagedown keys in a one line field on Apple platforms', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -9233,7 +9232,7 @@ void main() { ); // Regression test for https://github.com/flutter/flutter/issues/31287 - testWidgetsWithLeakTracking('text selection handle visibility', (WidgetTester tester) async { + testWidgets('text selection handle visibility', (WidgetTester tester) async { // Text with two separate words to select. controller.text = 'XXXXX XXXXX'; @@ -9404,7 +9403,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }) ); - testWidgetsWithLeakTracking("scrolling doesn't bounce", (WidgetTester tester) async { + testWidgets("scrolling doesn't bounce", (WidgetTester tester) async { // 3 lines of text, where the last line overflows and requires scrolling. controller.text = 'XXXXX\nXXXXX\nXXXXX'; @@ -9453,7 +9452,7 @@ void main() { expect(scrollable.controller!.position.pixels, equals(renderEditable.maxScrollExtent)); }); - testWidgetsWithLeakTracking('bringIntoView brings the caret into view when in a viewport', (WidgetTester tester) async { + testWidgets('bringIntoView brings the caret into view when in a viewport', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/55547. controller.text = testText * 20; final ScrollController editableScrollController = ScrollController(); @@ -9497,7 +9496,7 @@ void main() { expect(editableScrollController.offset, 0); }); - testWidgetsWithLeakTracking('bringIntoView does nothing if the physics prohibits implicit scrolling', (WidgetTester tester) async { + testWidgets('bringIntoView does nothing if the physics prohibits implicit scrolling', (WidgetTester tester) async { controller.text = testText * 20; final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -9545,7 +9544,7 @@ void main() { expect(scrollController.offset, 0); }); - testWidgetsWithLeakTracking('can change scroll controller', (WidgetTester tester) async { + testWidgets('can change scroll controller', (WidgetTester tester) async { controller.text = 'A' * 1000; final _TestScrollController scrollController1 = _TestScrollController(); addTearDown(scrollController1.dispose); @@ -9619,7 +9618,7 @@ void main() { expect(scrollController2.attached, isTrue); }); - testWidgetsWithLeakTracking('getLocalRectForCaret does not throw when it sees an infinite point', (WidgetTester tester) async { + testWidgets('getLocalRectForCaret does not throw when it sees an infinite point', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: SkipPainting( @@ -9643,7 +9642,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('obscured multiline fields throw an exception', (WidgetTester tester) async { + testWidgets('obscured multiline fields throw an exception', (WidgetTester tester) async { expect( () { EditableText( @@ -9693,7 +9692,7 @@ void main() { ); } - testWidgetsWithLeakTracking('batch editing works', (WidgetTester tester) async { + testWidgets('batch editing works', (WidgetTester tester) async { await tester.pumpWidget(buildWidget()); // Connect. @@ -9732,7 +9731,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('batch edits need to be nested properly', (WidgetTester tester) async { + testWidgets('batch edits need to be nested properly', (WidgetTester tester) async { await tester.pumpWidget(buildWidget()); // Connect. @@ -9752,7 +9751,7 @@ void main() { expect(errorString, contains('Unbalanced call to endBatchEdit')); }); - testWidgetsWithLeakTracking('catch unfinished batch edits on disposal', (WidgetTester tester) async { + testWidgets('catch unfinished batch edits on disposal', (WidgetTester tester) async { await tester.pumpWidget(buildWidget()); // Connect. @@ -9802,7 +9801,7 @@ void main() { ); } - testWidgetsWithLeakTracking('input from text input plugin', (WidgetTester tester) async { + testWidgets('input from text input plugin', (WidgetTester tester) async { controller.text = testText; await tester.pumpWidget(boilerplate()); @@ -9832,7 +9831,7 @@ void main() { expect(tester.testTextInput.log, isEmpty); }); - testWidgetsWithLeakTracking('input from text selection menu', (WidgetTester tester) async { + testWidgets('input from text selection menu', (WidgetTester tester) async { controller.text = testText; await tester.pumpWidget(boilerplate()); @@ -9857,7 +9856,7 @@ void main() { tester.testTextInput.log.clear(); }); - testWidgetsWithLeakTracking('input from controller', (WidgetTester tester) async { + testWidgets('input from controller', (WidgetTester tester) async { controller.text = testText; await tester.pumpWidget(boilerplate()); @@ -9874,7 +9873,7 @@ void main() { expect(updates, <TextEditingValue>[collapsedAtEnd('remoteremoteremote listener')]); }); - testWidgetsWithLeakTracking('input from changing controller', (WidgetTester tester) async { + testWidgets('input from changing controller', (WidgetTester tester) async { Widget build({ TextEditingController? textEditingController }) { return MediaQuery( data: const MediaQueryData(), @@ -9925,7 +9924,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('input imm channel calls are ordered correctly', (WidgetTester tester) async { + testWidgets('input imm channel calls are ordered correctly', (WidgetTester tester) async { controller.text = 'flutter is the best!'; final EditableText et = EditableText( showSelectionHandles: true, @@ -9972,7 +9971,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'keyboard is requested after setEditingState after switching to a new text field', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/68571. @@ -10042,7 +10041,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Autofill does not request focus', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91354 . @@ -10099,7 +10098,7 @@ void main() { expect(focusNode2.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('setEditingState is not called when text changes', (WidgetTester tester) async { + testWidgets('setEditingState is not called when text changes', (WidgetTester tester) async { // We shouldn't get a message here because this change is owned by the platform side. controller.text = 'flutter is the best!'; final EditableText et = EditableText( @@ -10147,7 +10146,7 @@ void main() { expect(tester.testTextInput.editingState!['text'], 'flutter is the best!'); }); - testWidgetsWithLeakTracking('setEditingState is called when text changes on controller', (WidgetTester tester) async { + testWidgets('setEditingState is called when text changes on controller', (WidgetTester tester) async { // We should get a message here because this change is owned by the framework side. controller.text = 'flutter is the best!'; final EditableText et = EditableText( @@ -10196,7 +10195,7 @@ void main() { expect(tester.testTextInput.editingState!['text'], 'flutter is the best!...'); }); - testWidgetsWithLeakTracking('Synchronous test of local and remote editing values', (WidgetTester tester) async { + testWidgets('Synchronous test of local and remote editing values', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/65059 final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { @@ -10325,7 +10324,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Send text input state to engine when the input formatter rejects user input', (WidgetTester tester) async { + testWidgets('Send text input state to engine when the input formatter rejects user input', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/67828 final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { @@ -10398,7 +10397,7 @@ void main() { ))); }); - testWidgetsWithLeakTracking('Repeatedly receiving [TextEditingValue] will not trigger a keyboard request', (WidgetTester tester) async { + testWidgets('Repeatedly receiving [TextEditingValue] will not trigger a keyboard request', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66036 final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { @@ -10483,7 +10482,7 @@ void main() { }); group('TextEditingController', () { - testWidgetsWithLeakTracking('TextEditingController.text set to empty string clears field', (WidgetTester tester) async { + testWidgets('TextEditingController.text set to empty string clears field', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: MediaQuery( @@ -10517,7 +10516,7 @@ void main() { expect(find.text('...'), findsNothing); }); - testWidgetsWithLeakTracking('TextEditingController.clear() behavior test', (WidgetTester tester) async { + testWidgets('TextEditingController.clear() behavior test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66316 final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall methodCall) async { @@ -10590,7 +10589,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('TextEditingController.buildTextSpan receives build context', (WidgetTester tester) async { + testWidgets('TextEditingController.buildTextSpan receives build context', (WidgetTester tester) async { final _AccentColorTextEditingController controller = _AccentColorTextEditingController('a'); addTearDown(controller.dispose); const Color color = Color.fromARGB(255, 1, 2, 3); @@ -10613,7 +10612,7 @@ void main() { expect(textSpan.style!.color, color); }); - testWidgetsWithLeakTracking('controller listener changes value', (WidgetTester tester) async { + testWidgets('controller listener changes value', (WidgetTester tester) async { const double maxValue = 5.5555; controller.addListener(() { @@ -10648,7 +10647,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('autofocus:true on first frame does not throw', (WidgetTester tester) async { + testWidgets('autofocus:true on first frame does not throw', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -10679,7 +10678,7 @@ void main() { expect(exception, isNull); }); - testWidgetsWithLeakTracking('updateEditingValue filters multiple calls from formatter', (WidgetTester tester) async { + testWidgets('updateEditingValue filters multiple calls from formatter', (WidgetTester tester) async { final MockTextFormatter formatter = MockTextFormatter(); await tester.pumpWidget( MediaQuery( @@ -10751,7 +10750,7 @@ void main() { expect(formatter.log, referenceLog); }); - testWidgetsWithLeakTracking('formatter logic handles repeat filtering', (WidgetTester tester) async { + testWidgets('formatter logic handles repeat filtering', (WidgetTester tester) async { final MockTextFormatter formatter = MockTextFormatter(); await tester.pumpWidget( MediaQuery( @@ -10832,7 +10831,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/53612 - testWidgetsWithLeakTracking('formatter logic handles initial repeat edge case', (WidgetTester tester) async { + testWidgets('formatter logic handles initial repeat edge case', (WidgetTester tester) async { final MockTextFormatter formatter = MockTextFormatter(); await tester.pumpWidget( MediaQuery( @@ -10874,7 +10873,7 @@ void main() { expect(formatter.lastOldValue.text, 'test'); }); - testWidgetsWithLeakTracking('EditableText changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('EditableText changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( data: const MediaQueryData(), @@ -10931,7 +10930,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('Can access characters on editing string', (WidgetTester tester) async { + testWidgets('Can access characters on editing string', (WidgetTester tester) async { late int charactersLength; final Widget widget = MaterialApp( home: EditableText( @@ -10957,7 +10956,7 @@ void main() { expect(charactersLength, 1); }); - testWidgetsWithLeakTracking('EditableText can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('EditableText can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(MediaQuery( data: const MediaQueryData(), child: Directionality( @@ -10999,7 +10998,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('EditableText inherits DefaultTextHeightBehavior', (WidgetTester tester) async { + testWidgets('EditableText inherits DefaultTextHeightBehavior', (WidgetTester tester) async { const TextHeightBehavior customTextHeightBehavior = TextHeightBehavior( applyHeightToFirstAscent: false, ); @@ -11027,7 +11026,7 @@ void main() { expect(renderObject.textHeightBehavior, equals(customTextHeightBehavior)); }); - testWidgetsWithLeakTracking('EditableText defaultTextHeightBehavior is used over inherited widget', (WidgetTester tester) async { + testWidgets('EditableText defaultTextHeightBehavior is used over inherited widget', (WidgetTester tester) async { const TextHeightBehavior inheritedTextHeightBehavior = TextHeightBehavior( applyHeightToFirstAscent: false, ); @@ -11092,7 +11091,7 @@ void main() { expectToAssert(const TextEditingValue(text: 'test', composing: TextRange(start: -1, end: 9)), false); }); - testWidgetsWithLeakTracking('Preserves composing range if cursor moves within that range', (WidgetTester tester) async { + testWidgets('Preserves composing range if cursor moves within that range', (WidgetTester tester) async { final Widget widget = MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, @@ -11114,7 +11113,7 @@ void main() { expect(state.currentTextEditingValue.composing, const TextRange(start: 4, end: 12)); }); - testWidgetsWithLeakTracking('Clears composing range if cursor moves outside that range', (WidgetTester tester) async { + testWidgets('Clears composing range if cursor moves outside that range', (WidgetTester tester) async { final Widget widget = MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, @@ -11155,7 +11154,7 @@ void main() { expect(state.currentTextEditingValue.composing, TextRange.empty); }); - testWidgetsWithLeakTracking('Clears composing range if cursor moves outside that range - case two', (WidgetTester tester) async { + testWidgets('Clears composing range if cursor moves outside that range - case two', (WidgetTester tester) async { final Widget widget = MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, @@ -11237,7 +11236,7 @@ void main() { } // Regression test for https://github.com/flutter/flutter/issues/65374. - testWidgetsWithLeakTracking('will not cause crash while the TextEditingValue is composing', (WidgetTester tester) async { + testWidgets('will not cause crash while the TextEditingValue is composing', (WidgetTester tester) async { await setupWidget( tester, LengthLimitingTextInputFormatter( @@ -11263,7 +11262,7 @@ void main() { expect(state.currentTextEditingValue.composing, TextRange.empty); }); - testWidgetsWithLeakTracking('handles composing text correctly, continued', (WidgetTester tester) async { + testWidgets('handles composing text correctly, continued', (WidgetTester tester) async { await setupWidget( tester, LengthLimitingTextInputFormatter( @@ -11295,7 +11294,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/68086. - testWidgetsWithLeakTracking('enforced composing truncated', (WidgetTester tester) async { + testWidgets('enforced composing truncated', (WidgetTester tester) async { await setupWidget( tester, LengthLimitingTextInputFormatter( @@ -11333,7 +11332,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/68086. - testWidgetsWithLeakTracking('default truncate behaviors with different platforms', (WidgetTester tester) async { + testWidgets('default truncate behaviors with different platforms', (WidgetTester tester) async { await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength)); final EditableTextState state = tester.state<EditableTextState>(find.byType(EditableText)); @@ -11373,7 +11372,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/68086. - testWidgetsWithLeakTracking("composing range removed if it's overflowed the truncated value's length", (WidgetTester tester) async { + testWidgets("composing range removed if it's overflowed the truncated value's length", (WidgetTester tester) async { await setupWidget( tester, LengthLimitingTextInputFormatter( @@ -11402,7 +11401,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/68086. - testWidgetsWithLeakTracking('composing range removed with different platforms', (WidgetTester tester) async { + testWidgets('composing range removed with different platforms', (WidgetTester tester) async { await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength)); final EditableTextState state = tester.state<EditableTextState>(find.byType(EditableText)); @@ -11433,7 +11432,7 @@ void main() { } }); - testWidgetsWithLeakTracking("composing range handled correctly when it's overflowed", (WidgetTester tester) async { + testWidgets("composing range handled correctly when it's overflowed", (WidgetTester tester) async { const String string = '👨‍👩‍👦0123456'; await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength)); @@ -11454,7 +11453,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/68086. - testWidgetsWithLeakTracking('typing in the middle with different platforms.', (WidgetTester tester) async { + testWidgets('typing in the middle with different platforms.', (WidgetTester tester) async { await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength)); final EditableTextState state = tester.state<EditableTextState>(find.byType(EditableText)); @@ -11496,7 +11495,7 @@ void main() { group('callback errors', () { const String errorText = 'Test EditableText callback error'; - testWidgetsWithLeakTracking('onSelectionChanged can throw errors', (WidgetTester tester) async { + testWidgets('onSelectionChanged can throw errors', (WidgetTester tester) async { controller.text = 'flutter is the best!'; await tester.pumpWidget(MaterialApp( @@ -11523,7 +11522,7 @@ void main() { expect(error.toString(), contains(errorText)); }); - testWidgetsWithLeakTracking('onChanged can throw errors', (WidgetTester tester) async { + testWidgets('onChanged can throw errors', (WidgetTester tester) async { controller.text = 'flutter is the best!'; await tester.pumpWidget(MaterialApp( @@ -11549,7 +11548,7 @@ void main() { expect(error.toString(), contains(errorText)); }); - testWidgetsWithLeakTracking('onEditingComplete can throw errors', (WidgetTester tester) async { + testWidgets('onEditingComplete can throw errors', (WidgetTester tester) async { controller.text = 'flutter is the best!'; await tester.pumpWidget(MaterialApp( @@ -11580,7 +11579,7 @@ void main() { expect(error.toString(), contains(errorText)); }); - testWidgetsWithLeakTracking('onSubmitted can throw errors', (WidgetTester tester) async { + testWidgets('onSubmitted can throw errors', (WidgetTester tester) async { controller.text = 'flutter is the best!'; await tester.pumpWidget(MaterialApp( @@ -11611,7 +11610,7 @@ void main() { expect(error.toString(), contains(errorText)); }); - testWidgetsWithLeakTracking('input formatters can throw errors', (WidgetTester tester) async { + testWidgets('input formatters can throw errors', (WidgetTester tester) async { final TextInputFormatter badFormatter = TextInputFormatter.withFunction( (TextEditingValue oldValue, TextEditingValue newValue) => throw FlutterError(errorText), ); @@ -11645,7 +11644,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/72400. - testWidgetsWithLeakTracking("delete doesn't cause crash when selection is -1,-1", (WidgetTester tester) async { + testWidgets("delete doesn't cause crash when selection is -1,-1", (WidgetTester tester) async { final UnsettableController unsettableController = UnsettableController(); addTearDown(unsettableController.dispose); @@ -11680,7 +11679,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('can change behavior by overriding text editing shortcuts', (WidgetTester tester) async { + testWidgets('can change behavior by overriding text editing shortcuts', (WidgetTester tester) async { const Map<SingleActivator, Intent> testShortcuts = <SingleActivator, Intent>{ SingleActivator(LogicalKeyboardKey.arrowLeft): ExtendSelectionByCharacterIntent(forward: true, collapseSelection: true), SingleActivator(LogicalKeyboardKey.keyX, control: true): ExtendSelectionByCharacterIntent(forward: true, collapseSelection: true), @@ -11745,7 +11744,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('navigating by word', (WidgetTester tester) async { + testWidgets('navigating by word', (WidgetTester tester) async { controller.text = 'word word word'; // word wo|rd| word controller.selection = const TextSelection( @@ -11882,7 +11881,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('navigating multiline text', (WidgetTester tester) async { + testWidgets('navigating multiline text', (WidgetTester tester) async { controller.text = 'word word word\nword word\nword'; // 15 + 10 + 4; // wo|rd wo|rd controller.selection = const TextSelection( @@ -12040,7 +12039,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking("Mac's expand by line behavior on multiple lines", (WidgetTester tester) async { + testWidgets("Mac's expand by line behavior on multiple lines", (WidgetTester tester) async { controller.text = 'word word word\nword word\nword'; // 15 + 10 + 4; // word word word // wo|rd word @@ -12141,7 +12140,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }) ); - testWidgetsWithLeakTracking("Mac's expand extent position", (WidgetTester tester) async { + testWidgets("Mac's expand extent position", (WidgetTester tester) async { controller.text = 'Now is the time for all good people to come to the aid of their country'; // Start the selection in the middle somewhere. controller.selection = const TextSelection.collapsed(offset: 10); @@ -12374,7 +12373,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }) ); - testWidgetsWithLeakTracking('expanding selection to start/end single line', (WidgetTester tester) async { + testWidgets('expanding selection to start/end single line', (WidgetTester tester) async { controller.text = 'word word word'; // word wo|rd| word controller.selection = const TextSelection( @@ -12461,7 +12460,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }) ); - testWidgetsWithLeakTracking('can change text editing behavior by overriding actions', (WidgetTester tester) async { + testWidgets('can change text editing behavior by overriding actions', (WidgetTester tester) async { controller.text = testText; controller.selection = const TextSelection( baseOffset: 0, @@ -12507,7 +12506,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('ignore key event from web platform', (WidgetTester tester) async { + testWidgets('ignore key event from web platform', (WidgetTester tester) async { controller.text = 'test\ntest'; controller.selection = const TextSelection( baseOffset: 0, @@ -12562,7 +12561,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('the toolbar is disposed when selection changes and there is no selectionControls', (WidgetTester tester) async { + testWidgets('the toolbar is disposed when selection changes and there is no selectionControls', (WidgetTester tester) async { late StateSetter setState; bool enableInteractiveSelection = true; await tester.pumpWidget( @@ -12628,7 +12627,7 @@ void main() { // On web, using keyboard for selection is handled by the browser. }, skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('EditableText does not leak animation controllers', (WidgetTester tester) async { + testWidgets('EditableText does not leak animation controllers', (WidgetTester tester) async { controller.text = 'A'; await tester.pumpWidget( @@ -12665,7 +12664,7 @@ void main() { expect(tester.hasRunningAnimations, isFalse); }); - testWidgetsWithLeakTracking('Floating cursor affinity', (WidgetTester tester) async { + testWidgets('Floating cursor affinity', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; final GlobalKey key = GlobalKey(); // Set it up so that there will be word-wrap. @@ -12729,7 +12728,7 @@ void main() { EditableText.debugDeterministicCursor = false; }); - testWidgetsWithLeakTracking('Floating cursor ending with selection', (WidgetTester tester) async { + testWidgets('Floating cursor ending with selection', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; final GlobalKey key = GlobalKey(); SelectionChangedCause? lastSelectionChangedCause; @@ -12963,7 +12962,7 @@ void main() { return key.currentState!; } - testWidgetsWithLeakTracking('SelectAll toolbar action will not set max scroll on designated platforms', (WidgetTester tester) async { + testWidgets('SelectAll toolbar action will not set max scroll on designated platforms', (WidgetTester tester) async { final TextSelectionDelegate textSelectionDelegate = await pumpLongScrollableText(tester); await resetSelectionAndScrollOffset(tester, setMaxScrollExtent: false); @@ -12972,7 +12971,7 @@ void main() { expect(scrollController.offset, 0.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Selection will be scrolled into view with SelectionChangedCause', (WidgetTester tester) async { + testWidgets('Selection will be scrolled into view with SelectionChangedCause', (WidgetTester tester) async { final TextSelectionDelegate textSelectionDelegate = await pumpLongScrollableText(tester); // Cut @@ -13021,7 +13020,7 @@ void main() { }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); }); - testWidgetsWithLeakTracking('Should not scroll on paste if caret already visible', (WidgetTester tester) async { + testWidgets('Should not scroll on paste if caret already visible', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/96658. final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -13063,7 +13062,7 @@ void main() { expect(scrollController.offset, 0.0); }); - testWidgetsWithLeakTracking('Autofill enabled by default', (WidgetTester tester) async { + testWidgets('Autofill enabled by default', (WidgetTester tester) async { controller.text = 'A'; await tester.pumpWidget( @@ -13087,7 +13086,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Autofill can be disabled', (WidgetTester tester) async { + testWidgets('Autofill can be disabled', (WidgetTester tester) async { controller.text = 'A'; await tester.pumpWidget( @@ -13179,7 +13178,7 @@ void main() { selection: TextSelection.collapsed(offset: textAC.length), ); - testWidgetsWithLeakTracking('Should have no effect on an empty and non-focused field', (WidgetTester tester) async { + testWidgets('Should have no effect on an empty and non-focused field', (WidgetTester tester) async { await tester.pumpWidget(boilerplate()); expect(controller.value, TextEditingValue.empty); @@ -13194,7 +13193,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('Should have no effect on an empty and focused field', (WidgetTester tester) async { + testWidgets('Should have no effect on an empty and focused field', (WidgetTester tester) async { await tester.pumpWidget(boilerplate()); await waitForThrottling(tester); expect(controller.value, TextEditingValue.empty); @@ -13217,7 +13216,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('Can undo/redo a single insertion', (WidgetTester tester) async { + testWidgets('Can undo/redo a single insertion', (WidgetTester tester) async { await tester.pumpWidget(boilerplate()); // Focus the field and wait for throttling delay to get the initial @@ -13255,7 +13254,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('Can undo/redo multiple insertions', (WidgetTester tester) async { + testWidgets('Can undo/redo multiple insertions', (WidgetTester tester) async { await tester.pumpWidget(boilerplate()); // Focus the field and wait for throttling delay to get the initial @@ -13297,7 +13296,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/120794. // This is only reproducible on Android platform because it is the only // platform where composing changes are saved in the editing history. - testWidgetsWithLeakTracking('Can undo as intented when adding a delay between undos', (WidgetTester tester) async { + testWidgets('Can undo as intented when adding a delay between undos', (WidgetTester tester) async { await tester.pumpWidget(boilerplate()); // Focus the field and wait for throttling delay to get the initial @@ -13351,7 +13350,7 @@ void main() { }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] // Regression test for https://github.com/flutter/flutter/issues/120194. - testWidgetsWithLeakTracking('Cursor does not jump after undo', (WidgetTester tester) async { + testWidgets('Cursor does not jump after undo', (WidgetTester tester) async { // Initialize the controller with a non empty text. controller.text = textA; await tester.pumpWidget(boilerplate()); @@ -13375,7 +13374,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('Initial value is recorded when an undo is received just after getting the focus', (WidgetTester tester) async { + testWidgets('Initial value is recorded when an undo is received just after getting the focus', (WidgetTester tester) async { // Initialize the controller with a non empty text. controller.text = textA; await tester.pumpWidget(boilerplate()); @@ -13400,7 +13399,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('Can make changes in the middle of the history', (WidgetTester tester) async { + testWidgets('Can make changes in the middle of the history', (WidgetTester tester) async { await tester.pumpWidget(boilerplate()); // Focus the field and wait for throttling delay to get the initial @@ -13452,7 +13451,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('inside EditableText, duplicate changes', (WidgetTester tester) async { + testWidgets('inside EditableText, duplicate changes', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -13581,7 +13580,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('inside EditableText, autofocus', (WidgetTester tester) async { + testWidgets('inside EditableText, autofocus', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -13653,7 +13652,7 @@ void main() { ); }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('does not save composing changes (except Android)', (WidgetTester tester) async { + testWidgets('does not save composing changes (except Android)', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -13812,7 +13811,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.android }), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('does save composing changes on Android', (WidgetTester tester) async { + testWidgets('does save composing changes on Android', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -14036,7 +14035,7 @@ void main() { // On web, these keyboard shortcuts are handled by the browser. }, variant: TargetPlatformVariant.only(TargetPlatform.android), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('saves right up to composing change even when throttled', (WidgetTester tester) async { + testWidgets('saves right up to composing change even when throttled', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -14240,7 +14239,7 @@ void main() { }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] }); - testWidgetsWithLeakTracking('pasting with the keyboard collapses the selection and places it after the pasted content', (WidgetTester tester) async { + testWidgets('pasting with the keyboard collapses the selection and places it after the pasted content', (WidgetTester tester) async { Future<void> testPasteSelection(WidgetTester tester, _VoidFutureCallback paste) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -14377,7 +14376,7 @@ void main() { }, skip: kIsWeb); // [intended] // Regression test for https://github.com/flutter/flutter/issues/98322. - testWidgetsWithLeakTracking('EditableText consumes ActivateIntent and ButtonActivateIntent', (WidgetTester tester) async { + testWidgets('EditableText consumes ActivateIntent and ButtonActivateIntent', (WidgetTester tester) async { bool receivedIntent = false; await tester.pumpWidget( MaterialApp( @@ -14419,7 +14418,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/100585. - testWidgetsWithLeakTracking('can paste and remove field', (WidgetTester tester) async { + testWidgets('can paste and remove field', (WidgetTester tester) async { controller.text = 'text'; late StateSetter setState; bool showField = true; @@ -14469,7 +14468,7 @@ void main() { }, skip: kIsWeb); // [intended] // Regression test for https://github.com/flutter/flutter/issues/100585. - testWidgetsWithLeakTracking('can cut and remove field', (WidgetTester tester) async { + testWidgets('can cut and remove field', (WidgetTester tester) async { controller.text = 'text'; late StateSetter setState; bool showField = true; @@ -14520,7 +14519,7 @@ void main() { }, skip: kIsWeb); // [intended] group('Mac document shortcuts', () { - testWidgetsWithLeakTracking('ctrl-A/E', (WidgetTester tester) async { + testWidgets('ctrl-A/E', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); controller.text = testText; @@ -14601,7 +14600,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('ctrl-F/B', (WidgetTester tester) async { + testWidgets('ctrl-F/B', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); controller.text = testText; @@ -14667,7 +14666,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('ctrl-N/P', (WidgetTester tester) async { + testWidgets('ctrl-N/P', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); controller.text = testText; @@ -14746,7 +14745,7 @@ void main() { await tester.pump(); } - testWidgetsWithLeakTracking('with normal characters', (WidgetTester tester) async { + testWidgets('with normal characters', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); @@ -14841,7 +14840,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('with extended grapheme clusters', (WidgetTester tester) async { + testWidgets('with extended grapheme clusters', (WidgetTester tester) async { final String targetPlatformString = defaultTargetPlatform.toString(); final String platform = targetPlatformString.substring(targetPlatformString.indexOf('.') + 1).toLowerCase(); @@ -14923,7 +14922,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('macOS selectors work', (WidgetTester tester) async { + testWidgets('macOS selectors work', (WidgetTester tester) async { controller.text = 'test\nline2'; controller.selection = TextSelection.collapsed(offset: controller.text.length); @@ -14981,7 +14980,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('contextMenuBuilder is used in place of the default text selection toolbar', (WidgetTester tester) async { + testWidgets('contextMenuBuilder is used in place of the default text selection toolbar', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(MaterialApp( home: Align( @@ -15031,7 +15030,7 @@ void main() { ); group('Spell check', () { - testWidgetsWithLeakTracking( + testWidgets( 'Spell check configured properly when spell check disabled by default', (WidgetTester tester) async { controller.text = 'A'; @@ -15055,7 +15054,7 @@ void main() { expect(state.spellCheckEnabled, isFalse); }); - testWidgetsWithLeakTracking( + testWidgets( 'Spell check configured properly when spell check disabled manually', (WidgetTester tester) async { controller.text = 'A'; @@ -15080,7 +15079,7 @@ void main() { expect(state.spellCheckEnabled, isFalse); }); - testWidgetsWithLeakTracking( + testWidgets( 'Error thrown when spell check configuration defined without specifying misspelled text style', (WidgetTester tester) async { controller.text = 'A'; @@ -15102,7 +15101,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Spell check configured properly when spell check enabled without specified spell check service and native spell check service defined', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = @@ -15137,7 +15136,7 @@ void main() { tester.binding.platformDispatcher.clearNativeSpellCheckServiceDefined(); }); - testWidgetsWithLeakTracking( + testWidgets( 'Spell check configured properly with specified spell check service', (WidgetTester tester) async { final FakeSpellCheckService fakeSpellCheckService = FakeSpellCheckService(); @@ -15170,7 +15169,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Spell check disabled when spell check configuration specified but no default spell check service available', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = @@ -15202,7 +15201,7 @@ void main() { tester.binding.platformDispatcher.clearNativeSpellCheckServiceDefined(); }); - testWidgetsWithLeakTracking( + testWidgets( 'findSuggestionSpanAtCursorIndex finds correct span with cursor in middle of a word', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = @@ -15247,7 +15246,7 @@ void main() { expect(suggestionSpan, equals(expectedSpan)); }); - testWidgetsWithLeakTracking( + testWidgets( 'findSuggestionSpanAtCursorIndex finds correct span with cursor on edge of a word', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = @@ -15291,7 +15290,7 @@ void main() { expect(suggestionSpan, equals(expectedSpan)); }); - testWidgetsWithLeakTracking( + testWidgets( 'findSuggestionSpanAtCursorIndex finds no span when cursor out of range of spans', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = @@ -15335,7 +15334,7 @@ void main() { expect(suggestionSpan, isNull); }); - testWidgetsWithLeakTracking( + testWidgets( 'findSuggestionSpanAtCursorIndex finds no span when word correctly spelled', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = @@ -15379,7 +15378,7 @@ void main() { expect(suggestionSpan, isNull); }); - testWidgetsWithLeakTracking('can show spell check suggestions toolbar when there are spell check results', (WidgetTester tester) async { + testWidgets('can show spell check suggestions toolbar when there are spell check results', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; const TextEditingValue value = TextEditingValue( @@ -15440,7 +15439,7 @@ void main() { expect(find.text('DELETE'), matcher); }); - testWidgetsWithLeakTracking('can show spell check suggestions toolbar when there are no spell check results on iOS', (WidgetTester tester) async { + testWidgets('can show spell check suggestions toolbar when there are no spell check results on iOS', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; const TextEditingValue value = TextEditingValue( @@ -15502,7 +15501,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('cupertino spell check suggestions toolbar buttons correctly change the composing region', (WidgetTester tester) async { + testWidgets('cupertino spell check suggestions toolbar buttons correctly change the composing region', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; const TextEditingValue value = TextEditingValue( @@ -15563,7 +15562,7 @@ void main() { } }); - testWidgetsWithLeakTracking('material spell check suggestions toolbar buttons correctly change the composing region', (WidgetTester tester) async { + testWidgets('material spell check suggestions toolbar buttons correctly change the composing region', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; const TextEditingValue value = TextEditingValue( @@ -15628,7 +15627,7 @@ void main() { } }); - testWidgetsWithLeakTracking('replacing puts cursor at the end of the word', (WidgetTester tester) async { + testWidgets('replacing puts cursor at the end of the word', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; controller.value = const TextEditingValue( @@ -15740,7 +15739,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('tapping on a misspelled word hides the handles', (WidgetTester tester) async { + testWidgets('tapping on a misspelled word hides the handles', (WidgetTester tester) async { tester.binding.platformDispatcher.nativeSpellCheckServiceDefinedTestValue = true; controller.value = const TextEditingValue( @@ -15803,7 +15802,7 @@ void main() { }); group('magnifier', () { - testWidgetsWithLeakTracking('should build nothing by default', (WidgetTester tester) async { + testWidgets('should build nothing by default', (WidgetTester tester) async { final EditableText editableText = EditableText( controller: controller, showSelectionHandles: true, @@ -15839,7 +15838,7 @@ void main() { }); // Regression test for: https://github.com/flutter/flutter/issues/117418. - testWidgetsWithLeakTracking('can handle the partial selection of a multi-code-unit glyph', (WidgetTester tester) async { + testWidgets('can handle the partial selection of a multi-code-unit glyph', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -15882,7 +15881,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('does not crash when didChangeMetrics is called after unmounting', (WidgetTester tester) async { + testWidgets('does not crash when didChangeMetrics is called after unmounting', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -15904,7 +15903,7 @@ void main() { state.didChangeMetrics(); }); - testWidgetsWithLeakTracking('_CompositionCallback widget does not skip frames', (WidgetTester tester) async { + testWidgets('_CompositionCallback widget does not skip frames', (WidgetTester tester) async { EditableText.debugDeterministicCursor = true; controller.value = const TextEditingValue(selection: TextSelection.collapsed(offset: 0)); Offset offset = Offset.zero; @@ -15961,7 +15960,7 @@ void main() { }); group('selection behavior when receiving focus', () { - testWidgetsWithLeakTracking('tabbing between fields', (WidgetTester tester) async { + testWidgets('tabbing between fields', (WidgetTester tester) async { final TextEditingController controller1 = TextEditingController(); addTearDown(controller1.dispose); final TextEditingController controller2 = TextEditingController(); @@ -16101,7 +16100,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Selection is updated when the field has focus and the new selection is invalid', (WidgetTester tester) async { + testWidgets('Selection is updated when the field has focus and the new selection is invalid', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/120631. controller.text = 'Text'; @@ -16158,7 +16157,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('when having focus stolen between frames on web', (WidgetTester tester) async { + testWidgets('when having focus stolen between frames on web', (WidgetTester tester) async { controller.text = 'Text1'; final FocusNode focusNode1 = FocusNode(); addTearDown(focusNode1.dispose); @@ -16233,7 +16232,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('EditableText respects MediaQuery.boldText', (WidgetTester tester) async { + testWidgets('EditableText respects MediaQuery.boldText', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: MediaQuery( @@ -16254,7 +16253,7 @@ void main() { expect(state.buildTextSpan().style!.fontWeight, FontWeight.bold); }); - testWidgetsWithLeakTracking('code points are treated as single characters in obscure mode', (WidgetTester tester) async { + testWidgets('code points are treated as single characters in obscure mode', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -16390,7 +16389,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('when manually placing the cursor in the middle of a code point', (WidgetTester tester) async { + testWidgets('when manually placing the cursor in the middle of a code point', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -16474,7 +16473,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('when inserting a malformed string', (WidgetTester tester) async { + testWidgets('when inserting a malformed string', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -16536,7 +16535,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('when inserting a malformed string that is a sequence of dangling high surrogates', (WidgetTester tester) async { + testWidgets('when inserting a malformed string that is a sequence of dangling high surrogates', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -16596,7 +16595,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('when inserting a malformed string that is a sequence of dangling low surrogates', (WidgetTester tester) async { + testWidgets('when inserting a malformed string that is a sequence of dangling low surrogates', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -16673,7 +16672,7 @@ void main() { .defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, null); }); - testWidgetsWithLeakTracking('web avoids the paste permissions prompt by not calling hasStrings', (WidgetTester tester) async { + testWidgets('web avoids the paste permissions prompt by not calling hasStrings', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: EditableText( @@ -16706,7 +16705,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Cursor color with an opacity is respected', (WidgetTester tester) async { + testWidgets('Cursor color with an opacity is respected', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); const double opacity = 0.55; controller.text = 'blah blah'; diff --git a/packages/flutter/test/widgets/ensure_visible_test.dart b/packages/flutter/test/widgets/ensure_visible_test.dart index 97898ca632f..33cdc07eda4 100644 --- a/packages/flutter/test/widgets/ensure_visible_test.dart +++ b/packages/flutter/test/widgets/ensure_visible_test.dart @@ -7,7 +7,6 @@ import 'dart:math' as math; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'two_dimensional_utils.dart'; @@ -71,7 +70,7 @@ Widget buildListView(Axis scrollDirection, { bool reverse = false, bool shrinkWr void main() { group('SingleChildScrollView', () { - testWidgetsWithLeakTracking('SingleChildScrollView ensureVisible Axis.vertical', (WidgetTester tester) async { + testWidgets('SingleChildScrollView ensureVisible Axis.vertical', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); await tester.pumpWidget(buildSingleChildScrollView(Axis.vertical)); @@ -98,7 +97,7 @@ void main() { expect(tester.getTopLeft(findKey(3)).dy, equals(100.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView ensureVisible Axis.horizontal', (WidgetTester tester) async { + testWidgets('SingleChildScrollView ensureVisible Axis.horizontal', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); await tester.pumpWidget(buildSingleChildScrollView(Axis.horizontal)); @@ -125,7 +124,7 @@ void main() { expect(tester.getTopLeft(findKey(3)).dx, equals(100.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView ensureVisible Axis.vertical reverse', (WidgetTester tester) async { + testWidgets('SingleChildScrollView ensureVisible Axis.vertical reverse', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); await tester.pumpWidget(buildSingleChildScrollView(Axis.vertical, reverse: true)); @@ -193,7 +192,7 @@ void main() { expect(tester.getBottomLeft(findKey(6)).dy, equals(500.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView ensureVisible Axis.horizontal reverse', (WidgetTester tester) async { + testWidgets('SingleChildScrollView ensureVisible Axis.horizontal reverse', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); await tester.pumpWidget(buildSingleChildScrollView(Axis.horizontal, reverse: true)); @@ -266,7 +265,7 @@ void main() { expect(tester.getBottomLeft(findKey(6)).dx, equals(500.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView ensureVisible rotated child', (WidgetTester tester) async { + testWidgets('SingleChildScrollView ensureVisible rotated child', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); await tester.pumpWidget( @@ -313,7 +312,7 @@ void main() { expect(tester.getTopLeft(findKey(0)).dy, moreOrLessEquals(500.0, epsilon: 0.1)); }); - testWidgetsWithLeakTracking('Nested SingleChildScrollView ensureVisible behavior test', (WidgetTester tester) async { + testWidgets('Nested SingleChildScrollView ensureVisible behavior test', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/65100 Finder findKey(String coordinate) => find.byKey(ValueKey<String>(coordinate)); BuildContext findContext(String coordinate) => tester.element(findKey(coordinate)); @@ -391,7 +390,7 @@ void main() { }); group('ListView', () { - testWidgetsWithLeakTracking('ListView ensureVisible Axis.vertical', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.vertical', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -427,7 +426,7 @@ void main() { expect(tester.getTopLeft(findKey(3)).dy, equals(100.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible Axis.horizontal', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.horizontal', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -463,7 +462,7 @@ void main() { expect(tester.getTopLeft(findKey(3)).dx, equals(100.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible Axis.vertical reverse', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.vertical reverse', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -539,7 +538,7 @@ void main() { expect(tester.getBottomLeft(findKey(0)).dy, equals(500.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible Axis.horizontal reverse', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.horizontal reverse', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -620,7 +619,7 @@ void main() { expect(tester.getBottomLeft(findKey(0)).dx, equals(500.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible negative child', (WidgetTester tester) async { + testWidgets('ListView ensureVisible negative child', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -678,7 +677,7 @@ void main() { expect(getOffset(), equals(-400.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible rotated child', (WidgetTester tester) async { + testWidgets('ListView ensureVisible rotated child', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -731,7 +730,7 @@ void main() { }); group('ListView shrinkWrap', () { - testWidgetsWithLeakTracking('ListView ensureVisible Axis.vertical', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.vertical', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -767,7 +766,7 @@ void main() { expect(tester.getTopLeft(findKey(3)).dy, equals(100.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible Axis.horizontal', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.horizontal', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -803,7 +802,7 @@ void main() { expect(tester.getTopLeft(findKey(3)).dx, equals(100.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible Axis.vertical reverse', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.vertical reverse', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -879,7 +878,7 @@ void main() { expect(tester.getBottomLeft(findKey(0)).dy, equals(500.0)); }); - testWidgetsWithLeakTracking('ListView ensureVisible Axis.horizontal reverse', (WidgetTester tester) async { + testWidgets('ListView ensureVisible Axis.horizontal reverse', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); @@ -962,7 +961,7 @@ void main() { }); group('Scrollable with center', () { - testWidgetsWithLeakTracking('ensureVisible', (WidgetTester tester) async { + testWidgets('ensureVisible', (WidgetTester tester) async { BuildContext findContext(int i) => tester.element(findKey(i)); Future<void> prepare(double offset) async { tester.state<ScrollableState>(find.byType(Scrollable)).position.jumpTo(offset); diff --git a/packages/flutter/test/widgets/error_widget_builder_test.dart b/packages/flutter/test/widgets/error_widget_builder_test.dart index c5c075897ad..141f522209d 100644 --- a/packages/flutter/test/widgets/error_widget_builder_test.dart +++ b/packages/flutter/test/widgets/error_widget_builder_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ErrorWidget.builder', (WidgetTester tester) async { + testWidgets('ErrorWidget.builder', (WidgetTester tester) async { final ErrorWidgetBuilder oldBuilder = ErrorWidget.builder; ErrorWidget.builder = (FlutterErrorDetails details) { return const Text('oopsie!', textDirection: TextDirection.ltr); @@ -26,7 +25,7 @@ void main() { ErrorWidget.builder = oldBuilder; }); - testWidgetsWithLeakTracking('ErrorWidget.builder', (WidgetTester tester) async { + testWidgets('ErrorWidget.builder', (WidgetTester tester) async { final ErrorWidgetBuilder oldBuilder = ErrorWidget.builder; ErrorWidget.builder = (FlutterErrorDetails details) { return ErrorWidget(''); diff --git a/packages/flutter/test/widgets/fade_in_image_test.dart b/packages/flutter/test/widgets/fade_in_image_test.dart index 1d053fb21a9..b1bed560ba1 100644 --- a/packages/flutter/test/widgets/fade_in_image_test.dart +++ b/packages/flutter/test/widgets/fade_in_image_test.dart @@ -8,7 +8,6 @@ import 'dart:ui' as ui; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import '../painting/image_test_utils.dart'; @@ -112,7 +111,7 @@ void main() { }); group('FadeInImage', () { - testWidgetsWithLeakTracking('animates an uncached image', (WidgetTester tester) async { + testWidgets('animates an uncached image', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -162,7 +161,7 @@ void main() { expect(findFadeInImage(tester).target.opacity, 1); }); - testWidgetsWithLeakTracking("FadeInImage's image obeys gapless playback", (WidgetTester tester) async { + testWidgets("FadeInImage's image obeys gapless playback", (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); final TestImageProvider secondImageProvider = TestImageProvider(replacementImage); @@ -203,7 +202,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/111011 - testWidgetsWithLeakTracking("FadeInImage's image obeys gapless playback when first image is cached but second isn't", + testWidgets("FadeInImage's image obeys gapless playback when first image is cached but second isn't", (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -240,7 +239,7 @@ void main() { expect(parts.target.opacity, 1); }); - testWidgetsWithLeakTracking("FadeInImage's placeholder obeys gapless playback", (WidgetTester tester) async { + testWidgets("FadeInImage's placeholder obeys gapless playback", (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider secondPlaceholderProvider = TestImageProvider(replacementImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -276,7 +275,7 @@ void main() { expect(parts.placeholder!.opacity, 1); }); - testWidgetsWithLeakTracking('shows a cached image immediately when skipFadeOnSynchronousLoad=true', (WidgetTester tester) async { + testWidgets('shows a cached image immediately when skipFadeOnSynchronousLoad=true', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); imageProvider.resolve(ImageConfiguration.empty); @@ -292,7 +291,7 @@ void main() { expect(findFadeInImage(tester).target.opacity, 1); }); - testWidgetsWithLeakTracking('handles updating the placeholder image', (WidgetTester tester) async { + testWidgets('handles updating the placeholder image', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider secondPlaceholderProvider = TestImageProvider(replacementImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -324,7 +323,7 @@ void main() { expect(findFadeInImage(tester).state, same(state)); }); - testWidgetsWithLeakTracking('does not keep the placeholder in the tree if it is invisible', (WidgetTester tester) async { + testWidgets('does not keep the placeholder in the tree if it is invisible', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -346,7 +345,7 @@ void main() { expect(find.byType(Image), findsOneWidget); }); - testWidgetsWithLeakTracking("doesn't interrupt in-progress animation when animation values are updated", (WidgetTester tester) async { + testWidgets("doesn't interrupt in-progress animation when animation values are updated", (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -380,7 +379,7 @@ void main() { expect(findFadeInImage(tester).target.opacity, moreOrLessEquals(1)); }); - testWidgetsWithLeakTracking('Image color and colorBlend parameters', (WidgetTester tester) async { + testWidgets('Image color and colorBlend parameters', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -472,7 +471,7 @@ void main() { }); group('semantics', () { - testWidgetsWithLeakTracking('only one Semantics node appears within FadeInImage', (WidgetTester tester) async { + testWidgets('only one Semantics node appears within FadeInImage', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -484,7 +483,7 @@ void main() { expect(find.byType(Semantics), findsOneWidget); }); - testWidgetsWithLeakTracking('is excluded if excludeFromSemantics is true', (WidgetTester tester) async { + testWidgets('is excluded if excludeFromSemantics is true', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -500,7 +499,7 @@ void main() { group('label', () { const String imageSemanticText = 'Test image semantic label'; - testWidgetsWithLeakTracking('defaults to image label if placeholder label is unspecified', (WidgetTester tester) async { + testWidgets('defaults to image label if placeholder label is unspecified', (WidgetTester tester) async { Semantics semanticsWidget() => tester.widget(find.byType(Semantics)); final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); @@ -527,7 +526,7 @@ void main() { expect(semanticsWidget().properties.label, imageSemanticText); }); - testWidgetsWithLeakTracking('is empty without any specified semantics labels', (WidgetTester tester) async { + testWidgets('is empty without any specified semantics labels', (WidgetTester tester) async { Semantics semanticsWidget() => tester.widget(find.byType(Semantics)); final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); @@ -553,7 +552,7 @@ void main() { }); group("placeholder's BoxFit", () { - testWidgetsWithLeakTracking("should be the image's BoxFit when not set", (WidgetTester tester) async { + testWidgets("should be the image's BoxFit when not set", (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -567,7 +566,7 @@ void main() { expect(findFadeInImage(tester).placeholder!.fit, equals(BoxFit.cover)); }); - testWidgetsWithLeakTracking('should be the given value when set', (WidgetTester tester) async { + testWidgets('should be the given value when set', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -584,7 +583,7 @@ void main() { }); group("placeholder's FilterQuality", () { - testWidgetsWithLeakTracking("should be the image's FilterQuality when not set", (WidgetTester tester) async { + testWidgets("should be the image's FilterQuality when not set", (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); @@ -598,7 +597,7 @@ void main() { expect(findFadeInImage(tester).placeholder!.filterQuality, equals(FilterQuality.medium)); }); - testWidgetsWithLeakTracking('should be the given value when set', (WidgetTester tester) async { + testWidgets('should be the given value when set', (WidgetTester tester) async { final TestImageProvider placeholderProvider = TestImageProvider(placeholderImage); final TestImageProvider imageProvider = TestImageProvider(targetImage); diff --git a/packages/flutter/test/widgets/fade_transition_test.dart b/packages/flutter/test/widgets/fade_transition_test.dart index 2e07c58d3fd..b606c95137c 100644 --- a/packages/flutter/test/widgets/fade_transition_test.dart +++ b/packages/flutter/test/widgets/fade_transition_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('FadeTransition', (WidgetTester tester) async { + testWidgets('FadeTransition', (WidgetTester tester) async { final DebugPrintCallback oldPrint = debugPrint; final List<String> log = <String>[]; debugPrint = (String? message, { int? wrapWidth }) { diff --git a/packages/flutter/test/widgets/fitted_box_test.dart b/packages/flutter/test/widgets/fitted_box_test.dart index bcc8aee897c..bc5d30cb42f 100644 --- a/packages/flutter/test/widgets/fitted_box_test.dart +++ b/packages/flutter/test/widgets/fitted_box_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can size according to aspect ratio', (WidgetTester tester) async { + testWidgets('Can size according to aspect ratio', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); @@ -43,7 +42,7 @@ void main() { expect(insidePoint, equals(outsidePoint)); }); - testWidgetsWithLeakTracking('Can contain child', (WidgetTester tester) async { + testWidgets('Can contain child', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); @@ -78,7 +77,7 @@ void main() { expect(insidePoint, equals(outsidePoint)); }); - testWidgetsWithLeakTracking('Child can cover', (WidgetTester tester) async { + testWidgets('Child can cover', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); @@ -114,7 +113,7 @@ void main() { expect(insidePoint, equals(outsidePoint)); }); - testWidgetsWithLeakTracking('FittedBox with no child', (WidgetTester tester) async { + testWidgets('FittedBox with no child', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( @@ -130,7 +129,7 @@ void main() { expect(box.size.height, 0.0); }); - testWidgetsWithLeakTracking('Child can be aligned multiple ways in a row', (WidgetTester tester) async { + testWidgets('Child can be aligned multiple ways in a row', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); @@ -340,7 +339,7 @@ void main() { } }); - testWidgetsWithLeakTracking('FittedBox layers - contain', (WidgetTester tester) async { + testWidgets('FittedBox layers - contain', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( @@ -361,7 +360,7 @@ void main() { expect(getLayers(), <Type>[TransformLayer, TransformLayer, OffsetLayer]); }); - testWidgetsWithLeakTracking('FittedBox layers - cover - horizontal', (WidgetTester tester) async { + testWidgets('FittedBox layers - cover - horizontal', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( @@ -384,7 +383,7 @@ void main() { expect(getLayers(), <Type>[TransformLayer, ClipRectLayer, TransformLayer, OffsetLayer]); }); - testWidgetsWithLeakTracking('FittedBox layers - cover - vertical', (WidgetTester tester) async { + testWidgets('FittedBox layers - cover - vertical', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( @@ -407,7 +406,7 @@ void main() { expect(getLayers(), <Type>[TransformLayer, ClipRectLayer, TransformLayer, OffsetLayer]); }); - testWidgetsWithLeakTracking('FittedBox layers - none - clip', (WidgetTester tester) async { + testWidgets('FittedBox layers - none - clip', (WidgetTester tester) async { final List<double> values = <double>[10.0, 50.0, 100.0]; for (final double a in values) { for (final double b in values) { @@ -443,7 +442,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Big child into small fitted box - hit testing', (WidgetTester tester) async { + testWidgets('Big child into small fitted box - hit testing', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); bool pointerDown = false; await tester.pumpWidget( @@ -475,7 +474,7 @@ void main() { expect(pointerDown, isTrue); }); - testWidgetsWithLeakTracking('Can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('Can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(FittedBox(fit: BoxFit.none, child: Container())); final RenderFittedBox renderObject = tester.allRenderObjects.whereType<RenderFittedBox>().first; expect(renderObject.clipBehavior, equals(Clip.none)); @@ -484,7 +483,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('BoxFit.scaleDown matches size of child', (WidgetTester tester) async { + testWidgets('BoxFit.scaleDown matches size of child', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); @@ -545,7 +544,7 @@ void main() { expect(insidePoint - outsidePoint, equals(Offset.zero)); }); - testWidgetsWithLeakTracking('Switching to and from BoxFit.scaleDown causes relayout', (WidgetTester tester) async { + testWidgets('Switching to and from BoxFit.scaleDown causes relayout', (WidgetTester tester) async { final Key outside = UniqueKey(); final Widget scaleDownWidget = Center( @@ -589,7 +588,7 @@ void main() { expect(outsideBox.size.height, 50.0); }); - testWidgetsWithLeakTracking('FittedBox without child does not throw', (WidgetTester tester) async { + testWidgets('FittedBox without child does not throw', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( diff --git a/packages/flutter/test/widgets/flex_test.dart b/packages/flutter/test/widgets/flex_test.dart index ea48423f574..1a29b997e29 100644 --- a/packages/flutter/test/widgets/flex_test.dart +++ b/packages/flutter/test/widgets/flex_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can hit test flex children of stacks', (WidgetTester tester) async { + testWidgets('Can hit test flex children of stacks', (WidgetTester tester) async { bool didReceiveTap = false; await tester.pumpWidget( Directionality( @@ -48,7 +47,7 @@ void main() { expect(didReceiveTap, isTrue); }); - testWidgetsWithLeakTracking('Flexible defaults to loose', (WidgetTester tester) async { + testWidgets('Flexible defaults to loose', (WidgetTester tester) async { await tester.pumpWidget( const Row( textDirection: TextDirection.ltr, @@ -62,7 +61,7 @@ void main() { expect(box.size.width, 100.0); }); - testWidgetsWithLeakTracking("Doesn't overflow because of floating point accumulated error", (WidgetTester tester) async { + testWidgets("Doesn't overflow because of floating point accumulated error", (WidgetTester tester) async { // both of these cases have failed in the past due to floating point issues await tester.pumpWidget( const Center( @@ -100,7 +99,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Error information is printed correctly', (WidgetTester tester) async { + testWidgets('Error information is printed correctly', (WidgetTester tester) async { // We run this twice, the first time without an error, so that the second time // we only get a single exception. Otherwise we'd get two, the one we want and // an extra one when we discover we never computed a size. @@ -134,7 +133,7 @@ void main() { expect(message, contains('\nSee also:')); }); - testWidgetsWithLeakTracking('Can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('Can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(const Flex(direction: Axis.vertical)); final RenderFlex renderObject = tester.allRenderObjects.whereType<RenderFlex>().first; expect(renderObject.clipBehavior, equals(Clip.none)); diff --git a/packages/flutter/test/widgets/flow_test.dart b/packages/flutter/test/widgets/flow_test.dart index 2a517963e20..0746896d9f3 100644 --- a/packages/flutter/test/widgets/flow_test.dart +++ b/packages/flutter/test/widgets/flow_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestFlowDelegate extends FlowDelegate { TestFlowDelegate({required this.startOffset}) : super(repaint: startOffset); @@ -62,7 +61,7 @@ class DuplicatePainterOpacityFlowDelegate extends OpacityFlowDelegate { } void main() { - testWidgetsWithLeakTracking('Flow control test', (WidgetTester tester) async { + testWidgets('Flow control test', (WidgetTester tester) async { final AnimationController startOffset = AnimationController.unbounded( vsync: tester, ); @@ -116,7 +115,7 @@ void main() { expect(log, equals(<int>[0])); }); - testWidgetsWithLeakTracking('paintChild gets called twice', (WidgetTester tester) async { + testWidgets('paintChild gets called twice', (WidgetTester tester) async { await tester.pumpWidget( Flow( delegate: DuplicatePainterOpacityFlowDelegate(1.0), @@ -138,7 +137,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Flow opacity layer', (WidgetTester tester) async { + testWidgets('Flow opacity layer', (WidgetTester tester) async { const double opacity = 0.2; await tester.pumpWidget( Flow( @@ -158,7 +157,7 @@ void main() { expect(layer!.firstChild, isA<TransformLayer>()); }); - testWidgetsWithLeakTracking('Flow can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('Flow can set and update clipBehavior', (WidgetTester tester) async { const double opacity = 0.2; await tester.pumpWidget( Flow( @@ -187,7 +186,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Flow.unwrapped can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('Flow.unwrapped can set and update clipBehavior', (WidgetTester tester) async { const double opacity = 0.2; await tester.pumpWidget( Flow.unwrapped( diff --git a/packages/flutter/test/widgets/focus_manager_test.dart b/packages/flutter/test/widgets/focus_manager_test.dart index f34c68a8443..159966d91ce 100644 --- a/packages/flutter/test/widgets/focus_manager_test.dart +++ b/packages/flutter/test/widgets/focus_manager_test.dart @@ -21,7 +21,7 @@ void main() { } group(FocusNode, () { - testWidgetsWithLeakTracking('Can add children.', (WidgetTester tester) async { + testWidgets('Can add children.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusNode parent = FocusNode(); addTearDown(parent.dispose); @@ -44,7 +44,7 @@ void main() { expect(parent.children.last, equals(child2)); }); - testWidgetsWithLeakTracking('Can remove children.', (WidgetTester tester) async { + testWidgets('Can remove children.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusNode parent = FocusNode(); addTearDown(parent.dispose); @@ -73,7 +73,7 @@ void main() { expect(parent.children, isEmpty); }); - testWidgetsWithLeakTracking('Geometry is transformed properly.', (WidgetTester tester) async { + testWidgets('Geometry is transformed properly.', (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'Test Node 1'); addTearDown(focusNode1.dispose); final FocusNode focusNode2 = FocusNode(debugLabel: 'Test Node 2'); @@ -113,7 +113,7 @@ void main() { expect(focusNode2.offset, equals(const Offset(443.0, 194.5))); }); - testWidgetsWithLeakTracking('descendantsAreFocusable disables focus for descendants.', (WidgetTester tester) async { + testWidgets('descendantsAreFocusable disables focus for descendants.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -166,7 +166,7 @@ void main() { expect(scope.traversalDescendants.contains(child2), isFalse); }); - testWidgetsWithLeakTracking('descendantsAreTraversable disables traversal for descendants.', (WidgetTester tester) async { + testWidgets('descendantsAreTraversable disables traversal for descendants.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -204,7 +204,7 @@ void main() { expect(scope.traversalDescendants, equals(<FocusNode>[])); }); - testWidgetsWithLeakTracking("canRequestFocus doesn't affect traversalChildren", (WidgetTester tester) async { + testWidgets("canRequestFocus doesn't affect traversalChildren", (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -240,7 +240,7 @@ void main() { expect(scope.traversalChildren.contains(parent2), isFalse); }); - testWidgetsWithLeakTracking('implements debugFillProperties', (WidgetTester tester) async { + testWidgets('implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final FocusNode focusNode = FocusNode(debugLabel: 'Label'); addTearDown(focusNode.dispose); @@ -256,7 +256,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('onKeyEvent and onKey correctly cooperate', (WidgetTester tester) async { + testWidgets('onKeyEvent and onKey correctly cooperate', (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'Test Node 1'); addTearDown(focusNode1.dispose); final FocusNode focusNode2 = FocusNode(debugLabel: 'Test Node 2'); @@ -358,7 +358,7 @@ void main() { group(FocusScopeNode, () { - testWidgetsWithLeakTracking('Can setFirstFocus on a scope with no manager.', (WidgetTester tester) async { + testWidgets('Can setFirstFocus on a scope with no manager.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -387,7 +387,7 @@ void main() { expect(scope.focusedChild, equals(parent)); }); - testWidgetsWithLeakTracking('Removing a node removes it from scope.', (WidgetTester tester) async { + testWidgets('Removing a node removes it from scope.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(); addTearDown(scope.dispose); @@ -416,7 +416,7 @@ void main() { expect(scope.focusedChild, isNull); }); - testWidgetsWithLeakTracking('Can add children to scope and focus', (WidgetTester tester) async { + testWidgets('Can add children to scope and focus', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(); addTearDown(scope.dispose); @@ -461,7 +461,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/136758 - testWidgetsWithLeakTracking('removing grandchildren from scope updates focusedChild', (WidgetTester tester) async { + testWidgets('removing grandchildren from scope updates focusedChild', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); // Sets up this focus node tree: @@ -500,7 +500,7 @@ void main() { expect(scope1.focusedChild, isNull); }); - testWidgetsWithLeakTracking('Requesting focus before adding to tree results in a request after adding', (WidgetTester tester) async { + testWidgets('Requesting focus before adding to tree results in a request after adding', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(); addTearDown(scope.dispose); @@ -522,7 +522,7 @@ void main() { expect(child.hasPrimaryFocus, isTrue); // now attached and parented, so focus finally happened. }); - testWidgetsWithLeakTracking('Autofocus works.', (WidgetTester tester) async { + testWidgets('Autofocus works.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -563,7 +563,7 @@ void main() { expect(child2.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('Adding a focusedChild to a scope sets scope as focusedChild in parent scope', (WidgetTester tester) async { + testWidgets('Adding a focusedChild to a scope sets scope as focusedChild in parent scope', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(); addTearDown(scope1.dispose); @@ -599,7 +599,7 @@ void main() { expect(child2.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('Can move node with focus without losing focus', (WidgetTester tester) async { + testWidgets('Can move node with focus without losing focus', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -641,7 +641,7 @@ void main() { expect(parent2.children.first, equals(child1)); }); - testWidgetsWithLeakTracking('canRequestFocus affects children.', (WidgetTester tester) async { + testWidgets('canRequestFocus affects children.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -686,7 +686,7 @@ void main() { expect(parent1.traversalChildren.contains(child2), isFalse); }); - testWidgetsWithLeakTracking("skipTraversal doesn't affect children.", (WidgetTester tester) async { + testWidgets("skipTraversal doesn't affect children.", (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); addTearDown(scope.dispose); @@ -726,7 +726,7 @@ void main() { expect(scope.traversalDescendants.contains(child2), isTrue); }); - testWidgetsWithLeakTracking('Can move node between scopes and lose scope focus', (WidgetTester tester) async { + testWidgets('Can move node between scopes and lose scope focus', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1')..attach(context); addTearDown(scope1.dispose); @@ -772,7 +772,7 @@ void main() { expect(parent2.children.contains(child1), isTrue); }); - testWidgetsWithLeakTracking('ancestors and descendants are computed and recomputed properly', (WidgetTester tester) async { + testWidgets('ancestors and descendants are computed and recomputed properly', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1'); addTearDown(scope1.dispose); @@ -816,7 +816,7 @@ void main() { expect(tester.binding.focusManager.rootScope.descendants, equals(<FocusNode>[child1, child3, child4, parent2, scope2, child2, parent1, scope1])); }); - testWidgetsWithLeakTracking('Can move focus between scopes and keep focus', (WidgetTester tester) async { + testWidgets('Can move focus between scopes and keep focus', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(); addTearDown(scope1.dispose); @@ -882,7 +882,7 @@ void main() { expect(scope2.focusedChild, equals(child4)); }); - testWidgetsWithLeakTracking('Unfocus with disposition previouslyFocusedChild works properly', (WidgetTester tester) async { + testWidgets('Unfocus with disposition previouslyFocusedChild works properly', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1')..attach(context); addTearDown(scope1.dispose); @@ -971,7 +971,7 @@ void main() { expect(child3.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Unfocus with disposition scope works properly', (WidgetTester tester) async { + testWidgets('Unfocus with disposition scope works properly', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1')..attach(context); addTearDown(scope1.dispose); @@ -1064,7 +1064,7 @@ void main() { expect(FocusManager.instance.rootScope.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Unfocus works properly when some nodes are unfocusable', (WidgetTester tester) async { + testWidgets('Unfocus works properly when some nodes are unfocusable', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1')..attach(context); addTearDown(scope1.dispose); @@ -1138,7 +1138,7 @@ void main() { expect(child2.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking('Requesting focus on a scope works properly when some focusedChild nodes are unfocusable', (WidgetTester tester) async { + testWidgets('Requesting focus on a scope works properly when some focusedChild nodes are unfocusable', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1')..attach(context); addTearDown(scope1.dispose); @@ -1200,7 +1200,7 @@ void main() { expect(child4.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Key handling bubbles up and terminates when handled.', (WidgetTester tester) async { + testWidgets('Key handling bubbles up and terminates when handled.', (WidgetTester tester) async { final Set<FocusNode> receivedAnEvent = <FocusNode>{}; final Set<FocusNode> shouldHandle = <FocusNode>{}; KeyEventResult handleEvent(FocusNode node, RawKeyEvent event) { @@ -1273,7 +1273,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Initial highlight mode guesses correctly.', (WidgetTester tester) async { + testWidgets('Initial highlight mode guesses correctly.', (WidgetTester tester) async { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.automatic; switch (defaultTargetPlatform) { case TargetPlatform.fuchsia: @@ -1287,7 +1287,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Mouse events change initial focus highlight mode on mobile.', (WidgetTester tester) async { + testWidgets('Mouse events change initial focus highlight mode on mobile.', (WidgetTester tester) async { expect(FocusManager.instance.highlightMode, equals(FocusHighlightMode.touch)); RendererBinding.instance.initMouseTracker(); // Clear out the mouse state. final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse, pointer: 0); @@ -1295,7 +1295,7 @@ void main() { expect(FocusManager.instance.highlightMode, equals(FocusHighlightMode.traditional)); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('Mouse events change initial focus highlight mode on desktop.', (WidgetTester tester) async { + testWidgets('Mouse events change initial focus highlight mode on desktop.', (WidgetTester tester) async { expect(FocusManager.instance.highlightMode, equals(FocusHighlightMode.traditional)); RendererBinding.instance.initMouseTracker(); // Clear out the mouse state. final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse, pointer: 0); @@ -1303,12 +1303,12 @@ void main() { expect(FocusManager.instance.highlightMode, equals(FocusHighlightMode.traditional)); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Keyboard events change initial focus highlight mode.', (WidgetTester tester) async { + testWidgets('Keyboard events change initial focus highlight mode.', (WidgetTester tester) async { await tester.sendKeyEvent(LogicalKeyboardKey.enter); expect(FocusManager.instance.highlightMode, equals(FocusHighlightMode.traditional)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Events change focus highlight mode.', (WidgetTester tester) async { + testWidgets('Events change focus highlight mode.', (WidgetTester tester) async { await setupWidget(tester); int callCount = 0; FocusHighlightMode? lastMode; @@ -1349,7 +1349,7 @@ void main() { expect(FocusManager.instance.highlightMode, equals(FocusHighlightMode.touch)); }); - testWidgetsWithLeakTracking('implements debugFillProperties', (WidgetTester tester) async { + testWidgets('implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope Label'); addTearDown(scope.dispose); @@ -1365,7 +1365,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('debugDescribeFocusTree produces correct output', (WidgetTester tester) async { + testWidgets('debugDescribeFocusTree produces correct output', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'Scope 1'); addTearDown(scope1.dispose); @@ -1449,7 +1449,7 @@ void main() { }); group('Autofocus', () { - testWidgetsWithLeakTracking( + testWidgets( 'works when the previous focused node is detached', (WidgetTester tester) async { final FocusNode node1 = FocusNode(); @@ -1476,7 +1476,7 @@ void main() { expect(node2.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'node detached before autofocus is applied', (WidgetTester tester) async { final FocusScopeNode scopeNode = FocusScopeNode(); @@ -1506,7 +1506,7 @@ void main() { expect(scopeNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('autofocus the first candidate', (WidgetTester tester) async { + testWidgets('autofocus the first candidate', (WidgetTester tester) async { final FocusNode node1 = FocusNode(); addTearDown(node1.dispose); final FocusNode node2 = FocusNode(); @@ -1542,7 +1542,7 @@ void main() { expect(node1.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Autofocus works with global key reparenting', (WidgetTester tester) async { + testWidgets('Autofocus works with global key reparenting', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1'); @@ -1599,7 +1599,7 @@ void main() { }); }); - testWidgetsWithLeakTracking("Doesn't lose focused child when reparenting if the nearestScope doesn't change.", (WidgetTester tester) async { + testWidgets("Doesn't lose focused child when reparenting if the nearestScope doesn't change.", (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode parent1 = FocusScopeNode(debugLabel: 'parent1'); addTearDown(parent1.dispose); @@ -1629,7 +1629,7 @@ void main() { expect(parent1.focusedChild, equals(child2)); }); - testWidgetsWithLeakTracking('Ancestors get notified exactly as often as needed if focused child changes focus.', (WidgetTester tester) async { + testWidgets('Ancestors get notified exactly as often as needed if focused child changes focus.', (WidgetTester tester) async { bool topFocus = false; bool parent1Focus = false; bool parent2Focus = false; @@ -1765,7 +1765,7 @@ void main() { expect(child2Notify, equals(0)); }); - testWidgetsWithLeakTracking('Focus changes notify listeners.', (WidgetTester tester) async { + testWidgets('Focus changes notify listeners.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); final FocusScopeNode parent1 = FocusScopeNode(debugLabel: 'parent1'); addTearDown(parent1.dispose); @@ -1826,7 +1826,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('FocusManager.addEarlyKeyEventHandler works', (WidgetTester tester) async { + testWidgets('FocusManager.addEarlyKeyEventHandler works', (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'Test Node 1'); addTearDown(focusNode1.dispose); final List<int> logs = <int>[]; @@ -1906,7 +1906,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('FocusManager.addLateKeyEventHandler works', (WidgetTester tester) async { + testWidgets('FocusManager.addLateKeyEventHandler works', (WidgetTester tester) async { final FocusNode focusNode1 = FocusNode(debugLabel: 'Test Node 1'); addTearDown(focusNode1.dispose); final List<int> logs = <int>[]; @@ -1986,7 +1986,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('FocusManager notifies listeners when a widget loses focus because it was removed.', (WidgetTester tester) async { + testWidgets('FocusManager notifies listeners when a widget loses focus because it was removed.', (WidgetTester tester) async { final FocusNode nodeA = FocusNode(debugLabel: 'a'); addTearDown(nodeA.dispose); final FocusNode nodeB = FocusNode(debugLabel: 'b'); @@ -2035,7 +2035,7 @@ void main() { tester.binding.focusManager.removeListener(handleFocusChange); }); - testWidgetsWithLeakTracking('debugFocusChanges causes logging of focus changes', (WidgetTester tester) async { + testWidgets('debugFocusChanges causes logging of focus changes', (WidgetTester tester) async { final bool oldDebugFocusChanges = debugFocusChanges; final DebugPrintCallback oldDebugPrint = debugPrint; final StringBuffer messages = StringBuffer(); @@ -2082,7 +2082,7 @@ void main() { expect(messagesStr, contains(RegExp(r'FOCUS: Scheduling update, current focus is null, next focus will be FocusScopeNode#.*parent1'))); }); - testWidgetsWithLeakTracking("doesn't call toString on a focus node when debugFocusChanges is false", (WidgetTester tester) async { + testWidgets("doesn't call toString on a focus node when debugFocusChanges is false", (WidgetTester tester) async { final bool oldDebugFocusChanges = debugFocusChanges; final DebugPrintCallback oldDebugPrint = debugPrint; final StringBuffer messages = StringBuffer(); diff --git a/packages/flutter/test/widgets/focus_scope_test.dart b/packages/flutter/test/widgets/focus_scope_test.dart index 2f09b957bad..78e2c94785c 100644 --- a/packages/flutter/test/widgets/focus_scope_test.dart +++ b/packages/flutter/test/widgets/focus_scope_test.dart @@ -6,13 +6,12 @@ import 'package:flutter/semantics.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { group('FocusScope', () { - testWidgetsWithLeakTracking('Can focus', (WidgetTester tester) async { + testWidgets('Can focus', (WidgetTester tester) async { final GlobalKey<TestFocusState> key = GlobalKey(); await tester.pumpWidget( @@ -28,7 +27,7 @@ void main() { expect(find.text('A FOCUSED'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can unfocus', (WidgetTester tester) async { + testWidgets('Can unfocus', (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); await tester.pumpWidget( @@ -63,7 +62,7 @@ void main() { expect(find.text('B FOCUSED'), findsOneWidget); }); - testWidgetsWithLeakTracking('Autofocus works', (WidgetTester tester) async { + testWidgets('Autofocus works', (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); await tester.pumpWidget( @@ -83,7 +82,7 @@ void main() { expect(find.text('B FOCUSED'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can have multiple focused children and they update accordingly', (WidgetTester tester) async { + testWidgets('Can have multiple focused children and they update accordingly', (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); @@ -130,7 +129,7 @@ void main() { // This moves a focus node first into a focus scope that is added to its // parent, and then out of that focus scope again. - testWidgetsWithLeakTracking('Can move focus in and out of FocusScope', (WidgetTester tester) async { + testWidgets('Can move focus in and out of FocusScope', (WidgetTester tester) async { final FocusScopeNode parentFocusScope = FocusScopeNode(debugLabel: 'Parent Scope Node'); addTearDown(parentFocusScope.dispose); final FocusScopeNode childFocusScope = FocusScopeNode(debugLabel: 'Child Scope Node'); @@ -277,7 +276,7 @@ void main() { childAttachment.detach(); }); - testWidgetsWithLeakTracking('Setting first focus requests focus for the scope properly.', (WidgetTester tester) async { + testWidgets('Setting first focus requests focus for the scope properly.', (WidgetTester tester) async { final FocusScopeNode parentFocusScope = FocusScopeNode(debugLabel: 'Parent Scope Node'); addTearDown(parentFocusScope.dispose); final FocusScopeNode childFocusScope1 = FocusScopeNode(debugLabel: 'Child Scope Node 1'); @@ -382,7 +381,7 @@ void main() { expect(childFocusScope2.isFirstFocus, isFalse); }); - testWidgetsWithLeakTracking('Removing focused widget moves focus to next widget', (WidgetTester tester) async { + testWidgets('Removing focused widget moves focus to next widget', (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); @@ -426,7 +425,7 @@ void main() { expect(find.text('b'), findsOneWidget); }); - testWidgetsWithLeakTracking('Adding a new FocusScope attaches the child to its parent.', (WidgetTester tester) async { + testWidgets('Adding a new FocusScope attaches the child to its parent.', (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final FocusScopeNode parentFocusScope = FocusScopeNode(debugLabel: 'Parent Scope Node'); addTearDown(parentFocusScope.dispose); @@ -474,7 +473,7 @@ void main() { expect(find.text('A FOCUSED'), findsOneWidget); }); - testWidgetsWithLeakTracking('Setting parentNode determines focus tree hierarchy.', (WidgetTester tester) async { + testWidgets('Setting parentNode determines focus tree hierarchy.', (WidgetTester tester) async { final FocusNode topNode = FocusNode(debugLabel: 'Top'); addTearDown(topNode.dispose); final FocusNode parentNode = FocusNode(debugLabel: 'Parent'); @@ -544,7 +543,7 @@ void main() { expect(insertedNode.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Setting parentNode determines focus scope tree hierarchy.', (WidgetTester tester) async { + testWidgets('Setting parentNode determines focus scope tree hierarchy.', (WidgetTester tester) async { final FocusScopeNode topNode = FocusScopeNode(debugLabel: 'Top'); addTearDown(topNode.dispose); final FocusScopeNode parentNode = FocusScopeNode(debugLabel: 'Parent'); @@ -615,7 +614,7 @@ void main() { }); // Arguably, this isn't correct behavior, but it is what happens now. - testWidgetsWithLeakTracking("Removing focused widget doesn't move focus to next widget within FocusScope", (WidgetTester tester) async { + testWidgets("Removing focused widget doesn't move focus to next widget within FocusScope", (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); final FocusScopeNode parentFocusScope = FocusScopeNode(debugLabel: 'Parent Scope'); @@ -673,7 +672,7 @@ void main() { expect(find.text('b'), findsOneWidget); }); - testWidgetsWithLeakTracking('Removing a FocusScope removes its node from the tree', (WidgetTester tester) async { + testWidgets('Removing a FocusScope removes its node from the tree', (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); final GlobalKey<TestFocusState> scopeKeyA = GlobalKey(); @@ -737,7 +736,7 @@ void main() { }); // By "pinned", it means kept in the tree by a GlobalKey. - testWidgetsWithLeakTracking("Removing pinned focused scope doesn't move focus to focused widget within next FocusScope", (WidgetTester tester) async { + testWidgets("Removing pinned focused scope doesn't move focus to focused widget within next FocusScope", (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); final GlobalKey<TestFocusState> scopeKeyA = GlobalKey(); @@ -825,7 +824,7 @@ void main() { expect(find.text('B FOCUSED'), findsOneWidget); }); - testWidgetsWithLeakTracking("Removing unpinned focused scope doesn't move focus to focused widget within next FocusScope", (WidgetTester tester) async { + testWidgets("Removing unpinned focused scope doesn't move focus to focused widget within next FocusScope", (WidgetTester tester) async { final GlobalKey<TestFocusState> keyA = GlobalKey(); final GlobalKey<TestFocusState> keyB = GlobalKey(); final FocusScopeNode parentFocusScope1 = FocusScopeNode(debugLabel: 'Parent Scope 1'); @@ -907,7 +906,7 @@ void main() { expect(find.text('B FOCUSED'), findsOneWidget); }); - testWidgetsWithLeakTracking('Moving widget from one scope to another retains focus', (WidgetTester tester) async { + testWidgets('Moving widget from one scope to another retains focus', (WidgetTester tester) async { final FocusScopeNode parentFocusScope1 = FocusScopeNode(); addTearDown(parentFocusScope1.dispose); final FocusScopeNode parentFocusScope2 = FocusScopeNode(); @@ -990,7 +989,7 @@ void main() { expect(find.text('b'), findsOneWidget); }); - testWidgetsWithLeakTracking('Moving FocusScopeNodes retains focus', (WidgetTester tester) async { + testWidgets('Moving FocusScopeNodes retains focus', (WidgetTester tester) async { final FocusScopeNode parentFocusScope1 = FocusScopeNode(debugLabel: 'Scope 1'); addTearDown(parentFocusScope1.dispose); final FocusScopeNode parentFocusScope2 = FocusScopeNode(debugLabel: 'Scope 2'); @@ -1078,7 +1077,7 @@ void main() { expect(find.text('b'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can focus root node.', (WidgetTester tester) async { + testWidgets('Can focus root node.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); await tester.pumpWidget( Focus( @@ -1097,7 +1096,7 @@ void main() { expect(rootNode, equals(firstElement.owner!.focusManager.rootScope)); }); - testWidgetsWithLeakTracking('Can autofocus a node.', (WidgetTester tester) async { + testWidgets('Can autofocus a node.', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); await tester.pumpWidget( @@ -1122,7 +1121,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking("Won't autofocus a node if one is already focused.", (WidgetTester tester) async { + testWidgets("Won't autofocus a node if one is already focused.", (WidgetTester tester) async { final FocusNode focusNodeA = FocusNode(debugLabel: 'Test Node A'); addTearDown(focusNodeA.dispose); final FocusNode focusNodeB = FocusNode(debugLabel: 'Test Node B'); @@ -1163,7 +1162,7 @@ void main() { expect(focusNodeA.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking("FocusScope doesn't update the focusNode attributes when the widget updates if withExternalFocusNode is used", (WidgetTester tester) async { + testWidgets("FocusScope doesn't update the focusNode attributes when the widget updates if withExternalFocusNode is used", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusScopeNode focusScopeNode = FocusScopeNode(); addTearDown(focusScopeNode.dispose); @@ -1235,7 +1234,7 @@ void main() { }); group('Focus', () { - testWidgetsWithLeakTracking('Focus.of stops at the nearest Focus widget.', (WidgetTester tester) async { + testWidgets('Focus.of stops at the nearest Focus widget.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -1283,7 +1282,7 @@ void main() { expect(Focus.of(element5).parent!.parent, equals(root)); expect(Focus.of(element6).parent!.parent!.parent, equals(root)); }); - testWidgetsWithLeakTracking('Can traverse Focus children.', (WidgetTester tester) async { + testWidgets('Can traverse Focus children.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -1357,7 +1356,7 @@ void main() { expect(keys, equals(<Key>[key7, key8])); }); - testWidgetsWithLeakTracking('Can set focus.', (WidgetTester tester) async { + testWidgets('Can set focus.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); late bool gotFocus; await tester.pumpWidget( @@ -1377,7 +1376,7 @@ void main() { expect(node.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Focus is ignored when set to not focusable.', (WidgetTester tester) async { + testWidgets('Focus is ignored when set to not focusable.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); bool? gotFocus; await tester.pumpWidget( @@ -1398,7 +1397,7 @@ void main() { expect(node.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Focus is lost when set to not focusable.', (WidgetTester tester) async { + testWidgets('Focus is lost when set to not focusable.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); bool? gotFocus; await tester.pumpWidget( @@ -1438,7 +1437,7 @@ void main() { expect(node.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Child of unfocusable Focus can get focus.', (WidgetTester tester) async { + testWidgets('Child of unfocusable Focus can get focus.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode focusNode = FocusNode(); @@ -1471,7 +1470,7 @@ void main() { expect(unfocusableNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Nodes are removed when all Focuses are removed.', (WidgetTester tester) async { + testWidgets('Nodes are removed when all Focuses are removed.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); late bool gotFocus; await tester.pumpWidget( @@ -1497,7 +1496,7 @@ void main() { expect(FocusManager.instance.rootScope.descendants, isEmpty); }); - testWidgetsWithLeakTracking('Focus widgets set Semantics information about focus', (WidgetTester tester) async { + testWidgets('Focus widgets set Semantics information about focus', (WidgetTester tester) async { final GlobalKey<TestFocusState> key = GlobalKey(); await tester.pumpWidget( @@ -1526,7 +1525,7 @@ void main() { expect(semantics.hasFlag(SemanticsFlag.isFocusable), isFalse); }); - testWidgetsWithLeakTracking('Setting canRequestFocus on focus node causes update.', (WidgetTester tester) async { + testWidgets('Setting canRequestFocus on focus node causes update.', (WidgetTester tester) async { final GlobalKey<TestFocusState> key = GlobalKey(); final TestFocus testFocus = TestFocus(key: key); @@ -1543,7 +1542,7 @@ void main() { expect(key.currentState!.focusNode.canRequestFocus, isFalse); }); - testWidgetsWithLeakTracking('canRequestFocus causes descendants of scope to be skipped.', (WidgetTester tester) async { + testWidgets('canRequestFocus causes descendants of scope to be skipped.', (WidgetTester tester) async { final GlobalKey scope1 = GlobalKey(debugLabel: 'scope1'); final GlobalKey scope2 = GlobalKey(debugLabel: 'scope2'); final GlobalKey focus1 = GlobalKey(debugLabel: 'focus1'); @@ -1652,7 +1651,7 @@ void main() { expect(Focus.of(container1.currentContext!).hasFocus, isTrue); }); - testWidgetsWithLeakTracking('skipTraversal works as expected.', (WidgetTester tester) async { + testWidgets('skipTraversal works as expected.', (WidgetTester tester) async { final FocusScopeNode scope1 = FocusScopeNode(debugLabel: 'scope1'); addTearDown(scope1.dispose); final FocusScopeNode scope2 = FocusScopeNode(debugLabel: 'scope2'); @@ -1710,7 +1709,7 @@ void main() { expect(scope1.traversalDescendants, equals(<FocusNode>[focus2, focus1, scope2])); }); - testWidgetsWithLeakTracking('descendantsAreFocusable works as expected.', (WidgetTester tester) async { + testWidgets('descendantsAreFocusable works as expected.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode focusNode = FocusNode(); @@ -1750,7 +1749,7 @@ void main() { expect(unfocusableNode.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('descendantsAreTraversable works as expected.', (WidgetTester tester) async { + testWidgets('descendantsAreTraversable works as expected.', (WidgetTester tester) async { final FocusScopeNode scopeNode = FocusScopeNode(debugLabel: 'scope'); addTearDown(scopeNode.dispose); final FocusNode node1 = FocusNode(debugLabel: 'node 1'); @@ -1787,7 +1786,7 @@ void main() { expect(node2.traversalDescendants, equals(<FocusNode>[])); }); - testWidgetsWithLeakTracking("Focus doesn't introduce a Semantics node when includeSemantics is false", (WidgetTester tester) async { + testWidgets("Focus doesn't introduce a Semantics node when includeSemantics is false", (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Focus(includeSemantics: false, child: Container())); final TestSemantics expectedSemantics = TestSemantics.root(); @@ -1795,7 +1794,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Focus updates the onKey handler when the widget updates', (WidgetTester tester) async { + testWidgets('Focus updates the onKey handler when the widget updates', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1845,7 +1844,7 @@ void main() { expect(keyEventHandled, isTrue); }); - testWidgetsWithLeakTracking('Focus updates the onKeyEvent handler when the widget updates', (WidgetTester tester) async { + testWidgets('Focus updates the onKeyEvent handler when the widget updates', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1895,7 +1894,7 @@ void main() { expect(keyEventHandled, isTrue); }); - testWidgetsWithLeakTracking("Focus doesn't update the focusNode attributes when the widget updates if withExternalFocusNode is used", (WidgetTester tester) async { + testWidgets("Focus doesn't update the focusNode attributes when the widget updates if withExternalFocusNode is used", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1965,7 +1964,7 @@ void main() { expect(keyEventHandled, isTrue); }); - testWidgetsWithLeakTracking('Focus passes changes in attribute values to its focus node', (WidgetTester tester) async { + testWidgets('Focus passes changes in attribute values to its focus node', (WidgetTester tester) async { await tester.pumpWidget( Focus( child: Container(), @@ -1975,7 +1974,7 @@ void main() { }); group('ExcludeFocus', () { - testWidgetsWithLeakTracking("Descendants of ExcludeFocus aren't focusable.", (WidgetTester tester) async { + testWidgets("Descendants of ExcludeFocus aren't focusable.", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode focusNode = FocusNode(); @@ -2015,7 +2014,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/61700 - testWidgetsWithLeakTracking("ExcludeFocus doesn't transfer focus to another descendant.", (WidgetTester tester) async { + testWidgets("ExcludeFocus doesn't transfer focus to another descendant.", (WidgetTester tester) async { final FocusNode parentFocusNode = FocusNode(debugLabel: 'group'); addTearDown(parentFocusNode.dispose); final FocusNode focusNode1 = FocusNode(debugLabel: 'node 1'); @@ -2087,7 +2086,7 @@ void main() { expect(parentFocusNode.enclosingScope!.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking("ExcludeFocus doesn't introduce a Semantics node", (WidgetTester tester) async { + testWidgets("ExcludeFocus doesn't introduce a Semantics node", (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(ExcludeFocus(child: Container())); final TestSemantics expectedSemantics = TestSemantics.root(); @@ -2096,7 +2095,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/92693 - testWidgetsWithLeakTracking('Setting parent FocusScope.canRequestFocus to false, does not set descendant Focus._internalNode._canRequestFocus to false', (WidgetTester tester) async { + testWidgets('Setting parent FocusScope.canRequestFocus to false, does not set descendant Focus._internalNode._canRequestFocus to false', (WidgetTester tester) async { final FocusNode childFocusNode = FocusNode(debugLabel: 'node 1'); addTearDown(childFocusNode.dispose); diff --git a/packages/flutter/test/widgets/focus_traversal_test.dart b/packages/flutter/test/widgets/focus_traversal_test.dart index f300c309101..c1f45ea874b 100644 --- a/packages/flutter/test/widgets/focus_traversal_test.dart +++ b/packages/flutter/test/widgets/focus_traversal_test.dart @@ -8,13 +8,12 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { group(WidgetOrderTraversalPolicy, () { - testWidgetsWithLeakTracking('Find the initial focus if there is none yet.', (WidgetTester tester) async { + testWidgets('Find the initial focus if there is none yet.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -53,7 +52,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Find the initial focus if there is none yet and traversing backwards.', (WidgetTester tester) async { + testWidgets('Find the initial focus if there is none yet and traversing backwards.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -96,7 +95,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('focus traversal should work case 1', (WidgetTester tester) async { + testWidgets('focus traversal should work case 1', (WidgetTester tester) async { final FocusNode outer1 = FocusNode(debugLabel: 'outer1', skipTraversal: true); final FocusNode outer2 = FocusNode(debugLabel: 'outer2', skipTraversal: true); final FocusNode inner1 = FocusNode(debugLabel: 'inner1', ); @@ -152,7 +151,7 @@ void main() { expect(FocusManager.instance.primaryFocus, inner2); }); - testWidgetsWithLeakTracking('focus traversal should work case 2', (WidgetTester tester) async { + testWidgets('focus traversal should work case 2', (WidgetTester tester) async { final FocusNode outer1 = FocusNode(debugLabel: 'outer1', skipTraversal: true); final FocusNode outer2 = FocusNode(debugLabel: 'outer2', skipTraversal: true); final FocusNode inner1 = FocusNode(debugLabel: 'inner1', ); @@ -203,7 +202,7 @@ void main() { expect(FocusManager.instance.primaryFocus, inner2); }); - testWidgetsWithLeakTracking('Move focus to next node.', (WidgetTester tester) async { + testWidgets('Move focus to next node.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -320,7 +319,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Move focus to previous node.', (WidgetTester tester) async { + testWidgets('Move focus to previous node.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -394,7 +393,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Move focus to next/previous node while skipping nodes in policy', (WidgetTester tester) async { + testWidgets('Move focus to next/previous node while skipping nodes in policy', (WidgetTester tester) async { final List<FocusNode> nodes = List<FocusNode>.generate(7, (int index) => FocusNode(debugLabel: 'Node $index')); addTearDown(() { @@ -434,7 +433,7 @@ void main() { expect(nodes[0].hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking('Find the initial focus when a route is pushed or popped.', (WidgetTester tester) async { + testWidgets('Find the initial focus when a route is pushed or popped.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode testNode1 = FocusNode(debugLabel: 'First Focus Node'); @@ -503,7 +502,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Custom requestFocusCallback gets called on the next/previous focus.', (WidgetTester tester) async { + testWidgets('Custom requestFocusCallback gets called on the next/previous focus.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode testNode1 = FocusNode(debugLabel: 'Focus Node'); addTearDown(testNode1.dispose); @@ -548,7 +547,7 @@ void main() { }); - testWidgetsWithLeakTracking('Nested navigator does not trap focus', (WidgetTester tester) async { + testWidgets('Nested navigator does not trap focus', (WidgetTester tester) async { final FocusNode node1 = FocusNode(); addTearDown(node1.dispose); final FocusNode node2 = FocusNode(); @@ -639,7 +638,7 @@ void main() { }); group(ReadingOrderTraversalPolicy, () { - testWidgetsWithLeakTracking('Find the initial focus if there is none yet.', (WidgetTester tester) async { + testWidgets('Find the initial focus if there is none yet.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -678,7 +677,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Move reading focus to next node.', (WidgetTester tester) async { + testWidgets('Move reading focus to next node.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -793,7 +792,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Requesting nextFocus on node focuses its descendant', (WidgetTester tester) async { + testWidgets('Requesting nextFocus on node focuses its descendant', (WidgetTester tester) async { for (final bool canRequestFocus in <bool>{true, false}) { final FocusNode node1 = FocusNode(); final FocusNode node2 = FocusNode(); @@ -833,7 +832,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Move reading focus to previous node.', (WidgetTester tester) async { + testWidgets('Move reading focus to previous node.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -907,7 +906,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Focus order is correct in the presence of different directionalities.', (WidgetTester tester) async { + testWidgets('Focus order is correct in the presence of different directionalities.', (WidgetTester tester) async { const int nodeCount = 10; final FocusScopeNode scopeNode = FocusScopeNode(); addTearDown(scopeNode.dispose); @@ -1029,7 +1028,7 @@ void main() { expect(order, orderedEquals(<int>[0, 1, 2, 4, 3, 5, 6, 8, 7, 9])); }); - testWidgetsWithLeakTracking('Focus order is reading order regardless of widget order, even when overlapping.', (WidgetTester tester) async { + testWidgets('Focus order is reading order regardless of widget order, even when overlapping.', (WidgetTester tester) async { const int nodeCount = 10; final List<FocusNode> nodes = List<FocusNode>.generate(nodeCount, (int index) => FocusNode(debugLabel: 'Node $index')); addTearDown(() { @@ -1129,7 +1128,7 @@ void main() { expect(order, orderedEquals(<int>[1, 2, 3, 4, 5, 6, 7, 8, 9, 0])); }); - testWidgetsWithLeakTracking('Custom requestFocusCallback gets called on the next/previous focus.', (WidgetTester tester) async { + testWidgets('Custom requestFocusCallback gets called on the next/previous focus.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode testNode1 = FocusNode(debugLabel: 'Focus Node'); addTearDown(testNode1.dispose); @@ -1177,7 +1176,7 @@ void main() { }); group(OrderedTraversalPolicy, () { - testWidgetsWithLeakTracking('Find the initial focus if there is none yet.', (WidgetTester tester) async { + testWidgets('Find the initial focus if there is none yet.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); await tester.pumpWidget(FocusTraversalGroup( @@ -1216,7 +1215,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Fall back to the secondary sort if no FocusTraversalOrder exists.', (WidgetTester tester) async { + testWidgets('Fall back to the secondary sort if no FocusTraversalOrder exists.', (WidgetTester tester) async { const int nodeCount = 10; final List<FocusNode> nodes = List<FocusNode>.generate(nodeCount, (int index) => FocusNode(debugLabel: 'Node $index')); addTearDown(() { @@ -1261,7 +1260,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Move focus to next/previous node using numerical order.', (WidgetTester tester) async { + testWidgets('Move focus to next/previous node using numerical order.', (WidgetTester tester) async { const int nodeCount = 10; final List<FocusNode> nodes = List<FocusNode>.generate(nodeCount, (int index) => FocusNode(debugLabel: 'Node $index')); addTearDown(() { @@ -1308,7 +1307,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Move focus to next/previous node using lexical order.', (WidgetTester tester) async { + testWidgets('Move focus to next/previous node using lexical order.', (WidgetTester tester) async { const int nodeCount = 10; /// Generate ['J' ... 'A']; @@ -1358,7 +1357,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Focus order is correct in the presence of FocusTraversalPolicyGroups.', (WidgetTester tester) async { + testWidgets('Focus order is correct in the presence of FocusTraversalPolicyGroups.', (WidgetTester tester) async { const int nodeCount = 10; final FocusScopeNode scopeNode = FocusScopeNode(); addTearDown(scopeNode.dispose); @@ -1492,7 +1491,7 @@ void main() { expect(order, orderedEquals(expectedOrder)); }); - testWidgetsWithLeakTracking('Find the initial focus when a route is pushed or popped.', (WidgetTester tester) async { + testWidgets('Find the initial focus when a route is pushed or popped.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode testNode1 = FocusNode(debugLabel: 'First Focus Node'); @@ -1567,7 +1566,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Custom requestFocusCallback gets called on the next/previous focus.', (WidgetTester tester) async { + testWidgets('Custom requestFocusCallback gets called on the next/previous focus.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode testNode1 = FocusNode(debugLabel: 'Focus Node'); addTearDown(testNode1.dispose); @@ -1615,7 +1614,7 @@ void main() { }); group(DirectionalFocusTraversalPolicyMixin, () { - testWidgetsWithLeakTracking('Move focus in all directions.', (WidgetTester tester) async { + testWidgets('Move focus in all directions.', (WidgetTester tester) async { final GlobalKey upperLeftKey = GlobalKey(debugLabel: 'upperLeftKey'); final GlobalKey upperRightKey = GlobalKey(debugLabel: 'upperRightKey'); final GlobalKey lowerLeftKey = GlobalKey(debugLabel: 'lowerLeftKey'); @@ -1755,7 +1754,7 @@ void main() { expect(scope.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Directional focus avoids hysteresis.', (WidgetTester tester) async { + testWidgets('Directional focus avoids hysteresis.', (WidgetTester tester) async { List<bool?> focus = List<bool?>.generate(6, (int _) => null); final List<FocusNode> nodes = List<FocusNode>.generate(6, (int index) => FocusNode(debugLabel: 'Node $index')); addTearDown(() { @@ -1879,7 +1878,7 @@ void main() { clear(); }); - testWidgetsWithLeakTracking('Directional prefers the closest node even on irregular grids', (WidgetTester tester) async { + testWidgets('Directional prefers the closest node even on irregular grids', (WidgetTester tester) async { const int cols = 3; const int rows = 3; List<bool?> focus = List<bool?>.generate(rows * cols, (int _) => null); @@ -2020,7 +2019,7 @@ void main() { clear(); }); - testWidgetsWithLeakTracking('Closest vertical is picked when only out of band items are considered', (WidgetTester tester) async { + testWidgets('Closest vertical is picked when only out of band items are considered', (WidgetTester tester) async { const int rows = 4; List<bool?> focus = List<bool?>.generate(rows, (int _) => null); final List<FocusNode> nodes = List<FocusNode>.generate(rows, (int index) => FocusNode(debugLabel: 'Node $index')); @@ -2111,7 +2110,7 @@ void main() { clear(); }); - testWidgetsWithLeakTracking('Closest horizontal is picked when only out of band items are considered', (WidgetTester tester) async { + testWidgets('Closest horizontal is picked when only out of band items are considered', (WidgetTester tester) async { const int cols = 4; List<bool?> focus = List<bool?>.generate(cols, (int _) => null); final List<FocusNode> nodes = List<FocusNode>.generate(cols, (int index) => FocusNode(debugLabel: 'Node $index')); @@ -2202,7 +2201,7 @@ void main() { clear(); }); - testWidgetsWithLeakTracking('Can find first focus in all directions.', (WidgetTester tester) async { + testWidgets('Can find first focus in all directions.', (WidgetTester tester) async { final GlobalKey upperLeftKey = GlobalKey(debugLabel: 'upperLeftKey'); final GlobalKey upperRightKey = GlobalKey(debugLabel: 'upperRightKey'); final GlobalKey lowerLeftKey = GlobalKey(debugLabel: 'lowerLeftKey'); @@ -2262,7 +2261,7 @@ void main() { expect(policy.findFirstFocusInDirection(scope, TraversalDirection.right), equals(upperLeftNode)); }); - testWidgetsWithLeakTracking('Can find focus when policy data dirty', (WidgetTester tester) async { + testWidgets('Can find focus when policy data dirty', (WidgetTester tester) async { final FocusNode focusTop = FocusNode(debugLabel: 'top'); addTearDown(focusTop.dispose); final FocusNode focusCenter = FocusNode(debugLabel: 'center'); @@ -2316,7 +2315,7 @@ void main() { expect(focusTop.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Focus traversal actions are invoked when shortcuts are used.', (WidgetTester tester) async { + testWidgets('Focus traversal actions are invoked when shortcuts are used.', (WidgetTester tester) async { final GlobalKey upperLeftKey = GlobalKey(debugLabel: 'upperLeftKey'); final GlobalKey upperRightKey = GlobalKey(debugLabel: 'upperRightKey'); final GlobalKey lowerLeftKey = GlobalKey(debugLabel: 'lowerLeftKey'); @@ -2406,7 +2405,7 @@ void main() { // ignore: deprecated_member_use }, skip: isBrowser, variant: KeySimulatorTransitModeVariant.all()); // https://github.com/flutter/flutter/issues/35347 - testWidgetsWithLeakTracking('Focus traversal actions works when current focus skip traversal', (WidgetTester tester) async { + testWidgets('Focus traversal actions works when current focus skip traversal', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: 'key1'); final GlobalKey key2 = GlobalKey(debugLabel: 'key2'); final GlobalKey key3 = GlobalKey(debugLabel: 'key3'); @@ -2462,7 +2461,7 @@ void main() { // ignore: deprecated_member_use }, skip: isBrowser, variant: KeySimulatorTransitModeVariant.all()); // https://github.com/flutter/flutter/issues/35347 - testWidgetsWithLeakTracking('Focus traversal inside a vertical scrollable scrolls to stay visible.', (WidgetTester tester) async { + testWidgets('Focus traversal inside a vertical scrollable scrolls to stay visible.', (WidgetTester tester) async { final List<int> items = List<int>.generate(11, (int index) => index).toList(); final List<FocusNode> nodes = List<FocusNode>.generate(11, (int index) => FocusNode(debugLabel: 'Item ${index + 1}')).toList(); addTearDown(() { @@ -2569,7 +2568,7 @@ void main() { // ignore: deprecated_member_use }, skip: isBrowser, variant: KeySimulatorTransitModeVariant.all()); // https://github.com/flutter/flutter/issues/35347 - testWidgetsWithLeakTracking('Focus traversal inside a horizontal scrollable scrolls to stay visible.', (WidgetTester tester) async { + testWidgets('Focus traversal inside a horizontal scrollable scrolls to stay visible.', (WidgetTester tester) async { final List<int> items = List<int>.generate(11, (int index) => index).toList(); final List<FocusNode> nodes = List<FocusNode>.generate(11, (int index) => FocusNode(debugLabel: 'Item ${index + 1}')).toList(); addTearDown(() { @@ -2677,7 +2676,7 @@ void main() { // ignore: deprecated_member_use }, skip: isBrowser, variant: KeySimulatorTransitModeVariant.all()); // https://github.com/flutter/flutter/issues/35347 - testWidgetsWithLeakTracking('Arrow focus traversal actions can be re-enabled for text fields.', (WidgetTester tester) async { + testWidgets('Arrow focus traversal actions can be re-enabled for text fields.', (WidgetTester tester) async { final GlobalKey upperLeftKey = GlobalKey(debugLabel: 'upperLeftKey'); final GlobalKey upperRightKey = GlobalKey(debugLabel: 'upperRightKey'); final GlobalKey lowerLeftKey = GlobalKey(debugLabel: 'lowerLeftKey'); @@ -2701,7 +2700,7 @@ void main() { final FocusNode focusNodeLowerRight = FocusNode(debugLabel: 'lowerRight'); addTearDown(focusNodeLowerRight.dispose); - Widget generatetestWidgetsWithLeakTracking(bool ignoreTextFields) { + Widget generatetestWidgets(bool ignoreTextFields) { final Map<ShortcutActivator, Intent> shortcuts = <ShortcutActivator, Intent>{ const SingleActivator(LogicalKeyboardKey.arrowLeft): DirectionalFocusIntent(TraversalDirection.left, ignoreTextFields: ignoreTextFields), const SingleActivator(LogicalKeyboardKey.arrowRight): DirectionalFocusIntent(TraversalDirection.right, ignoreTextFields: ignoreTextFields), @@ -2780,7 +2779,7 @@ void main() { ); } - await tester.pumpWidget(generatetestWidgetsWithLeakTracking(false)); + await tester.pumpWidget(generatetestWidgets(false)); expect(focusNodeUpperLeft.hasPrimaryFocus, isTrue); await tester.sendKeyEvent(LogicalKeyboardKey.arrowRight); @@ -2792,7 +2791,7 @@ void main() { await tester.sendKeyEvent(LogicalKeyboardKey.arrowUp); expect(focusNodeUpperLeft.hasPrimaryFocus, isTrue); - await tester.pumpWidget(generatetestWidgetsWithLeakTracking(true)); + await tester.pumpWidget(generatetestWidgets(true)); expect(focusNodeUpperLeft.hasPrimaryFocus, isTrue); await tester.sendKeyEvent(LogicalKeyboardKey.arrowRight); @@ -2809,7 +2808,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Focus traversal does not break when no focusable is available on a MaterialApp', (WidgetTester tester) async { + testWidgets('Focus traversal does not break when no focusable is available on a MaterialApp', (WidgetTester tester) async { final List<Object> events = <Object>[]; await tester.pumpWidget(MaterialApp(home: Container())); @@ -2827,7 +2826,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Focus traversal does not throw when no focusable is available in a group', (WidgetTester tester) async { + testWidgets('Focus traversal does not throw when no focusable is available in a group', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: Scaffold(body: ListTile(title: Text('title'))))); final FocusNode? initialFocus = primaryFocus; await tester.sendKeyEvent(LogicalKeyboardKey.tab); @@ -2835,7 +2834,7 @@ void main() { expect(primaryFocus, equals(initialFocus)); }); - testWidgetsWithLeakTracking('Focus traversal does not break when no focusable is available on a WidgetsApp', (WidgetTester tester) async { + testWidgets('Focus traversal does not break when no focusable is available on a WidgetsApp', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; await tester.pumpWidget( @@ -2863,7 +2862,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Custom requestFocusCallback gets called on focusInDirection up/down/left/right.', (WidgetTester tester) async { + testWidgets('Custom requestFocusCallback gets called on focusInDirection up/down/left/right.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final FocusNode testNode1 = FocusNode(debugLabel: 'Focus Node'); addTearDown(testNode1.dispose); @@ -2920,7 +2919,7 @@ void main() { }); group(FocusTraversalGroup, () { - testWidgetsWithLeakTracking("Focus traversal group doesn't introduce a Semantics node", (WidgetTester tester) async { + testWidgets("Focus traversal group doesn't introduce a Semantics node", (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(FocusTraversalGroup(child: Container())); final TestSemantics expectedSemantics = TestSemantics.root(); @@ -2928,7 +2927,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking("Descendants of FocusTraversalGroup aren't focusable if descendantsAreFocusable is false.", (WidgetTester tester) async { + testWidgets("Descendants of FocusTraversalGroup aren't focusable if descendantsAreFocusable is false.", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode focusNode = FocusNode(); @@ -2969,7 +2968,7 @@ void main() { expect(unfocusableNode.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Group applies correct policy if focus tree is different from widget tree.', (WidgetTester tester) async { + testWidgets('Group applies correct policy if focus tree is different from widget tree.', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final GlobalKey key3 = GlobalKey(debugLabel: '3'); @@ -3014,7 +3013,7 @@ void main() { expect(FocusTraversalGroup.of(key2.currentContext!), const TypeMatcher<SkipAllButFirstAndLastPolicy>()); }); - testWidgetsWithLeakTracking("Descendants of FocusTraversalGroup aren't traversable if descendantsAreTraversable is false.", (WidgetTester tester) async { + testWidgets("Descendants of FocusTraversalGroup aren't traversable if descendantsAreTraversable is false.", (WidgetTester tester) async { final FocusNode node1 = FocusNode(); addTearDown(node1.dispose); final FocusNode node2 = FocusNode(); @@ -3051,7 +3050,7 @@ void main() { expect(node2.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking("FocusTraversalGroup with skipTraversal for all descendants set to true doesn't cause an exception.", (WidgetTester tester) async { + testWidgets("FocusTraversalGroup with skipTraversal for all descendants set to true doesn't cause an exception.", (WidgetTester tester) async { final FocusNode node1 = FocusNode(); addTearDown(node1.dispose); final FocusNode node2 = FocusNode(); @@ -3089,7 +3088,7 @@ void main() { expect(node2.hasPrimaryFocus, isFalse); }); - testWidgetsWithLeakTracking("Nested FocusTraversalGroup with unfocusable children doesn't assert.", (WidgetTester tester) async { + testWidgets("Nested FocusTraversalGroup with unfocusable children doesn't assert.", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(debugLabel: '1'); final GlobalKey key2 = GlobalKey(debugLabel: '2'); final FocusNode focusNode = FocusNode(); @@ -3140,7 +3139,7 @@ void main() { expect(unfocusableNode.hasFocus, isFalse); }); - testWidgetsWithLeakTracking("Empty FocusTraversalGroup doesn't cause an exception.", (WidgetTester tester) async { + testWidgets("Empty FocusTraversalGroup doesn't cause an exception.", (WidgetTester tester) async { final GlobalKey key = GlobalKey(debugLabel: 'Test Key'); final FocusNode focusNode = FocusNode(debugLabel: 'Test Node'); addTearDown(focusNode.dispose); @@ -3173,7 +3172,7 @@ void main() { }); group(RawKeyboardListener, () { - testWidgetsWithLeakTracking('Raw keyboard listener introduces a Semantics node by default', (WidgetTester tester) async { + testWidgets('Raw keyboard listener introduces a Semantics node by default', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3202,7 +3201,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking("Raw keyboard listener doesn't introduce a Semantics node when specified", (WidgetTester tester) async { + testWidgets("Raw keyboard listener doesn't introduce a Semantics node when specified", (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3221,7 +3220,7 @@ void main() { }); group(ExcludeFocusTraversal, () { - testWidgetsWithLeakTracking("Descendants aren't traversable", (WidgetTester tester) async { + testWidgets("Descendants aren't traversable", (WidgetTester tester) async { final FocusNode node1 = FocusNode(debugLabel: 'node 1'); addTearDown(node1.dispose); final FocusNode node2 = FocusNode(debugLabel: 'node 2'); @@ -3273,7 +3272,7 @@ void main() { expect(node4.hasPrimaryFocus, isTrue); }); - testWidgetsWithLeakTracking("Doesn't introduce a Semantics node", (WidgetTester tester) async { + testWidgets("Doesn't introduce a Semantics node", (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(ExcludeFocusTraversal(child: Container())); final TestSemantics expectedSemantics = TestSemantics.root(); @@ -3289,7 +3288,7 @@ void main() { // other focusable HTML elements surrounding Flutter. // // See also: https://github.com/flutter/flutter/issues/114463 - testWidgetsWithLeakTracking('Default route edge traversal behavior', (WidgetTester tester) async { + testWidgets('Default route edge traversal behavior', (WidgetTester tester) async { final FocusNode nodeA = FocusNode(); addTearDown(nodeA.dispose); final FocusNode nodeB = FocusNode(); @@ -3371,7 +3370,7 @@ void main() { // This test creates a FocusScopeNode configured to traverse focus in a closed // loop. After traversing one loop, it changes the behavior to leave the // FlutterView, then verifies that the new behavior did indeed take effect. - testWidgetsWithLeakTracking('FocusScopeNode.traversalEdgeBehavior takes effect after update', (WidgetTester tester) async { + testWidgets('FocusScopeNode.traversalEdgeBehavior takes effect after update', (WidgetTester tester) async { final FocusScopeNode scope = FocusScopeNode(); addTearDown(scope.dispose); expect(scope.traversalEdgeBehavior, TraversalEdgeBehavior.closedLoop); @@ -3463,7 +3462,7 @@ void main() { expect(nodeB.hasFocus, true); }); - testWidgetsWithLeakTracking('NextFocusAction converts invoke result to KeyEventResult', (WidgetTester tester) async { + testWidgets('NextFocusAction converts invoke result to KeyEventResult', (WidgetTester tester) async { expect( NextFocusAction().toKeyEventResult(const NextFocusIntent(), true), KeyEventResult.handled, @@ -3474,7 +3473,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PreviousFocusAction converts invoke result to KeyEventResult', (WidgetTester tester) async { + testWidgets('PreviousFocusAction converts invoke result to KeyEventResult', (WidgetTester tester) async { expect( PreviousFocusAction().toKeyEventResult(const PreviousFocusIntent(), true), KeyEventResult.handled, @@ -3485,7 +3484,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RequestFocusAction calls the RequestFocusIntent.requestFocusCallback', (WidgetTester tester) async { + testWidgets('RequestFocusAction calls the RequestFocusIntent.requestFocusCallback', (WidgetTester tester) async { bool calledCallback = false; final FocusNode nodeA = FocusNode(); addTearDown(nodeA.dispose); diff --git a/packages/flutter/test/widgets/form_test.dart b/packages/flutter/test/widgets/form_test.dart index a7d7da216cd..2ff305900d6 100644 --- a/packages/flutter/test/widgets/form_test.dart +++ b/packages/flutter/test/widgets/form_test.dart @@ -6,10 +6,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('onSaved callback is called', (WidgetTester tester) async { + testWidgets('onSaved callback is called', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); String? fieldValue; @@ -49,7 +48,7 @@ void main() { await checkText(''); }); - testWidgetsWithLeakTracking('onChanged callback is called', (WidgetTester tester) async { + testWidgets('onChanged callback is called', (WidgetTester tester) async { String? fieldValue; Widget builder() { @@ -86,7 +85,7 @@ void main() { await checkText(''); }); - testWidgetsWithLeakTracking('Validator sets the error text only when validate is called', (WidgetTester tester) async { + testWidgets('Validator sets the error text only when validate is called', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); String? errorText(String? value) => '${value ?? ''}/error'; @@ -140,7 +139,7 @@ void main() { await checkErrorText(''); }); - testWidgetsWithLeakTracking('Should announce error text when validate returns error', (WidgetTester tester) async { + testWidgets('Should announce error text when validate returns error', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); await tester.pumpWidget( MaterialApp( @@ -179,7 +178,7 @@ void main() { }); - testWidgetsWithLeakTracking('isValid returns true when a field is valid', (WidgetTester tester) async { + testWidgets('isValid returns true when a field is valid', (WidgetTester tester) async { final GlobalKey<FormFieldState<String>> fieldKey1 = GlobalKey<FormFieldState<String>>(); final GlobalKey<FormFieldState<String>> fieldKey2 = GlobalKey<FormFieldState<String>>(); const String validString = 'Valid string'; @@ -224,7 +223,7 @@ void main() { expect(fieldKey2.currentState!.isValid, isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'isValid returns false when the field is invalid and does not change error display', (WidgetTester tester) async { final GlobalKey<FormFieldState<String>> fieldKey1 = GlobalKey<FormFieldState<String>>(); @@ -273,7 +272,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Multiple TextFormFields communicate', (WidgetTester tester) async { + testWidgets('Multiple TextFormFields communicate', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final GlobalKey<FormFieldState<String>> fieldKey = GlobalKey<FormFieldState<String>>(); // Input 2's validator depends on a input 1's value. @@ -323,7 +322,7 @@ void main() { await checkErrorText(''); }); - testWidgetsWithLeakTracking('Provide initial value to input when no controller is specified', (WidgetTester tester) async { + testWidgets('Provide initial value to input when no controller is specified', (WidgetTester tester) async { const String initialValue = 'hello'; final GlobalKey<FormFieldState<String>> inputKey = GlobalKey<FormFieldState<String>>(); @@ -367,7 +366,7 @@ void main() { expect(editableText.widget.controller.text, equals('world')); }); - testWidgetsWithLeakTracking('Controller defines initial value', (WidgetTester tester) async { + testWidgets('Controller defines initial value', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'hello'); addTearDown(controller.dispose); const String initialValue = 'hello'; @@ -415,7 +414,7 @@ void main() { expect(controller.text, equals('world')); }); - testWidgetsWithLeakTracking('TextFormField resets to its initial value', (WidgetTester tester) async { + testWidgets('TextFormField resets to its initial value', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final GlobalKey<FormFieldState<String>> inputKey = GlobalKey<FormFieldState<String>>(); final TextEditingController controller = TextEditingController(text: 'Plover'); @@ -462,7 +461,7 @@ void main() { expect(controller.text, equals('Plover')); }); - testWidgetsWithLeakTracking('TextEditingController updates to/from form field value', (WidgetTester tester) async { + testWidgets('TextEditingController updates to/from form field value', (WidgetTester tester) async { final TextEditingController controller1 = TextEditingController(text: 'Foo'); addTearDown(controller1.dispose); final TextEditingController controller2 = TextEditingController(text: 'Bar'); @@ -571,7 +570,7 @@ void main() { expect(controller2.text, equals('Xyzzy')); }); - testWidgetsWithLeakTracking('No crash when a TextFormField is removed from the tree', (WidgetTester tester) async { + testWidgets('No crash when a TextFormField is removed from the tree', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); String? fieldValue; @@ -625,7 +624,7 @@ void main() { expect(formKey.currentState!.validate(), isTrue); }); - testWidgetsWithLeakTracking('Does not auto-validate before value changes when autovalidateMode is set to onUserInteraction', (WidgetTester tester) async { + testWidgets('Does not auto-validate before value changes when autovalidateMode is set to onUserInteraction', (WidgetTester tester) async { late FormFieldState<String> formFieldState; String? errorText(String? value) => '$value/error'; @@ -661,7 +660,7 @@ void main() { expect(find.text(errorText('foo')!), findsNothing); }); - testWidgetsWithLeakTracking('auto-validate before value changes if autovalidateMode was set to always', (WidgetTester tester) async { + testWidgets('auto-validate before value changes if autovalidateMode was set to always', (WidgetTester tester) async { late FormFieldState<String> formFieldState; String? errorText(String? value) => '$value/error'; @@ -694,7 +693,7 @@ void main() { expect(formFieldState.hasError, isTrue); }); - testWidgetsWithLeakTracking('Form auto-validates form fields only after one of them changes if autovalidateMode is onUserInteraction', (WidgetTester tester) async { + testWidgets('Form auto-validates form fields only after one of them changes if autovalidateMode is onUserInteraction', (WidgetTester tester) async { const String initialValue = 'foo'; String? errorText(String? value) => 'error/$value'; @@ -748,7 +747,7 @@ void main() { expect(find.text(errorText(initialValue)!), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('Form auto-validates form fields even before any have changed if autovalidateMode is set to always', (WidgetTester tester) async { + testWidgets('Form auto-validates form fields even before any have changed if autovalidateMode is set to always', (WidgetTester tester) async { String? errorText(String? value) => 'error/$value'; Widget builder() { @@ -778,7 +777,7 @@ void main() { expect(find.text(errorText('')!), findsOneWidget); }); - testWidgetsWithLeakTracking('Form.reset() resets form fields, and auto validation will only happen on the next user interaction if autovalidateMode is onUserInteraction', (WidgetTester tester) async { + testWidgets('Form.reset() resets form fields, and auto validation will only happen on the next user interaction if autovalidateMode is onUserInteraction', (WidgetTester tester) async { final GlobalKey<FormState> formState = GlobalKey<FormState>(); String? errorText(String? value) => '$value/error'; @@ -823,7 +822,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/63753. - testWidgetsWithLeakTracking('Validate form should return correct validation if the value is composing', (WidgetTester tester) async { + testWidgets('Validate form should return correct validation if the value is composing', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); String? fieldValue; @@ -860,7 +859,7 @@ void main() { expect(formKey.currentState!.validate(), isFalse); }); - testWidgetsWithLeakTracking('hasInteractedByUser returns false when the input has not changed', (WidgetTester tester) async { + testWidgets('hasInteractedByUser returns false when the input has not changed', (WidgetTester tester) async { final GlobalKey<FormFieldState<String>> fieldKey = GlobalKey<FormFieldState<String>>(); final Widget widget = MaterialApp( @@ -884,7 +883,7 @@ void main() { expect(fieldKey.currentState!.hasInteractedByUser, isFalse); }); - testWidgetsWithLeakTracking('hasInteractedByUser returns true after the input has changed', (WidgetTester tester) async { + testWidgets('hasInteractedByUser returns true after the input has changed', (WidgetTester tester) async { final GlobalKey<FormFieldState<String>> fieldKey = GlobalKey<FormFieldState<String>>(); final Widget widget = MaterialApp( @@ -913,7 +912,7 @@ void main() { expect(fieldKey.currentState!.hasInteractedByUser, isTrue); }); - testWidgetsWithLeakTracking('hasInteractedByUser returns false after the field is reset', (WidgetTester tester) async { + testWidgets('hasInteractedByUser returns false after the field is reset', (WidgetTester tester) async { final GlobalKey<FormFieldState<String>> fieldKey = GlobalKey<FormFieldState<String>>(); final Widget widget = MaterialApp( diff --git a/packages/flutter/test/widgets/fractionally_sized_box_test.dart b/packages/flutter/test/widgets/fractionally_sized_box_test.dart index 1a9f7ef6757..ddebf069199 100644 --- a/packages/flutter/test/widgets/fractionally_sized_box_test.dart +++ b/packages/flutter/test/widgets/fractionally_sized_box_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('FractionallySizedBox', (WidgetTester tester) async { + testWidgets('FractionallySizedBox', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(OverflowBox( minWidth: 0.0, @@ -30,7 +29,7 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(const Offset(25.0, 37.5))); }); - testWidgetsWithLeakTracking('FractionallySizedBox alignment', (WidgetTester tester) async { + testWidgets('FractionallySizedBox alignment', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, @@ -46,7 +45,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(800.0 - 400.0 / 2.0, 0.0 + 300.0 / 2.0))); }); - testWidgetsWithLeakTracking('FractionallySizedBox alignment (direction-sensitive)', (WidgetTester tester) async { + testWidgets('FractionallySizedBox alignment (direction-sensitive)', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, @@ -62,7 +61,7 @@ void main() { expect(box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset(0.0 + 400.0 / 2.0, 0.0 + 300.0 / 2.0))); }); - testWidgetsWithLeakTracking('OverflowBox alignment with FractionallySizedBox', (WidgetTester tester) async { + testWidgets('OverflowBox alignment with FractionallySizedBox', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, diff --git a/packages/flutter/test/widgets/framework_test.dart b/packages/flutter/test/widgets/framework_test.dart index d646ac388cb..1bc83707479 100644 --- a/packages/flutter/test/widgets/framework_test.dart +++ b/packages/flutter/test/widgets/framework_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; typedef ElementRebuildCallback = void Function(StatefulElement element); @@ -23,13 +22,13 @@ class _MyGlobalObjectKey<T extends State<StatefulWidget>> extends GlobalObjectKe } void main() { - testWidgetsWithLeakTracking('UniqueKey control test', (WidgetTester tester) async { + testWidgets('UniqueKey control test', (WidgetTester tester) async { final Key key = UniqueKey(); expect(key, hasOneLineDescription); expect(key, isNot(equals(UniqueKey()))); }); - testWidgetsWithLeakTracking('ObjectKey control test', (WidgetTester tester) async { + testWidgets('ObjectKey control test', (WidgetTester tester) async { final Object a = Object(); final Object b = Object(); final Key keyA = ObjectKey(a); @@ -42,7 +41,7 @@ void main() { expect(keyA, isNot(equals(keyB))); }); - testWidgetsWithLeakTracking('GlobalObjectKey toString test', (WidgetTester tester) async { + testWidgets('GlobalObjectKey toString test', (WidgetTester tester) async { const GlobalObjectKey one = GlobalObjectKey(1); const GlobalObjectKey<TestState> two = GlobalObjectKey<TestState>(2); const GlobalObjectKey three = _MyGlobalObjectKey(3); @@ -54,7 +53,7 @@ void main() { expect(four.toString(), equals('[_MyGlobalObjectKey<TestState> ${describeIdentity(4)}]')); }); - testWidgetsWithLeakTracking('GlobalObjectKey control test', (WidgetTester tester) async { + testWidgets('GlobalObjectKey control test', (WidgetTester tester) async { final Object a = Object(); final Object b = Object(); final Key keyA = GlobalObjectKey(a); @@ -67,7 +66,7 @@ void main() { expect(keyA, isNot(equals(keyB))); }); - testWidgetsWithLeakTracking('GlobalKey correct case 1 - can move global key from container widget to layoutbuilder', (WidgetTester tester) async { + testWidgets('GlobalKey correct case 1 - can move global key from container widget to layoutbuilder', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'correct'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -102,7 +101,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('GlobalKey correct case 2 - can move global key from layoutbuilder to container widget', (WidgetTester tester) async { + testWidgets('GlobalKey correct case 2 - can move global key from layoutbuilder to container widget', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'correct'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -136,7 +135,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('GlobalKey correct case 3 - can deal with early rebuild in layoutbuilder - move backward', (WidgetTester tester) async { + testWidgets('GlobalKey correct case 3 - can deal with early rebuild in layoutbuilder - move backward', (WidgetTester tester) async { const Key key1 = GlobalObjectKey('Text1'); const Key key2 = GlobalObjectKey('Text2'); Key? rebuiltKeyOfSecondChildBeforeLayout; @@ -225,7 +224,7 @@ void main() { expect(rebuiltKeyOfSecondChildAfterLayout, key1); }); - testWidgetsWithLeakTracking('GlobalKey correct case 4 - can deal with early rebuild in layoutbuilder - move forward', (WidgetTester tester) async { + testWidgets('GlobalKey correct case 4 - can deal with early rebuild in layoutbuilder - move forward', (WidgetTester tester) async { const Key key1 = GlobalObjectKey('Text1'); const Key key2 = GlobalObjectKey('Text2'); const Key key3 = GlobalObjectKey('Text3'); @@ -328,7 +327,7 @@ void main() { expect(rebuiltKeyOfThirdChildAfterLayout, key2); }); - testWidgetsWithLeakTracking('GlobalKey correct case 5 - can deal with early rebuild in layoutbuilder - only one global key', (WidgetTester tester) async { + testWidgets('GlobalKey correct case 5 - can deal with early rebuild in layoutbuilder - only one global key', (WidgetTester tester) async { const Key key1 = GlobalObjectKey('Text1'); Key? rebuiltKeyOfSecondChildBeforeLayout; Key? rebuiltKeyOfThirdChildAfterLayout; @@ -419,7 +418,7 @@ void main() { expect(rebuiltKeyOfThirdChildAfterLayout, key1); }); - testWidgetsWithLeakTracking('GlobalKey duplication 1 - double appearance', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 1 - double appearance', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -448,7 +447,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 2 - splitting and changing type', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 2 - splitting and changing type', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( @@ -494,7 +493,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 3 - splitting and changing type', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 3 - splitting and changing type', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -521,7 +520,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 4 - splitting and half changing type', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 4 - splitting and half changing type', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -548,7 +547,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 5 - splitting and half changing type', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 5 - splitting and half changing type', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -566,7 +565,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 6 - splitting and not changing type', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 6 - splitting and not changing type', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -584,7 +583,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 7 - appearing later', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 7 - appearing later', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -603,7 +602,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 8 - appearing earlier', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 8 - appearing earlier', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -622,7 +621,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 9 - moving and appearing later', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 9 - moving and appearing later', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -643,7 +642,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 10 - moving and appearing earlier', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 10 - moving and appearing earlier', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -664,7 +663,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 11 - double sibling appearance', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 11 - double sibling appearance', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -676,7 +675,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 12 - all kinds of badness at once', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 12 - all kinds of badness at once', (WidgetTester tester) async { final Key key1 = GlobalKey(debugLabel: 'problematic'); final Key key2 = GlobalKey(debugLabel: 'problematic'); // intentionally the same label final Key key3 = GlobalKey(debugLabel: 'also problematic'); @@ -724,7 +723,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 13 - all kinds of badness at once', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 13 - all kinds of badness at once', (WidgetTester tester) async { final Key key1 = GlobalKey(debugLabel: 'problematic'); final Key key2 = GlobalKey(debugLabel: 'problematic'); // intentionally the same label final Key key3 = GlobalKey(debugLabel: 'also problematic'); @@ -771,7 +770,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 14 - moving during build - before', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 14 - moving during build - before', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -790,7 +789,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('GlobalKey duplication 15 - duplicating during build - before', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 15 - duplicating during build - before', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -811,7 +810,7 @@ void main() { expect(tester.takeException(), isFlutterError); }); - testWidgetsWithLeakTracking('GlobalKey duplication 16 - moving during build - after', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 16 - moving during build - after', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -830,7 +829,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('GlobalKey duplication 17 - duplicating during build - after', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 17 - duplicating during build - after', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); await tester.pumpWidget(Stack( textDirection: TextDirection.ltr, @@ -858,7 +857,7 @@ void main() { expect(count, 1); }); - testWidgetsWithLeakTracking('GlobalKey duplication 18 - subtree build duplicate key with same type', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 18 - subtree build duplicate key with same type', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); final Stack stack = Stack( textDirection: TextDirection.ltr, @@ -895,7 +894,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 19 - subtree build duplicate key with different types', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 19 - subtree build duplicate key with different types', (WidgetTester tester) async { final Key key = GlobalKey(debugLabel: 'problematic'); final Stack stack = Stack( textDirection: TextDirection.ltr, @@ -923,7 +922,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey duplication 20 - real duplication with early rebuild in layoutbuilder will throw', (WidgetTester tester) async { + testWidgets('GlobalKey duplication 20 - real duplication with early rebuild in layoutbuilder will throw', (WidgetTester tester) async { const Key key1 = GlobalObjectKey('Text1'); const Key key2 = GlobalObjectKey('Text2'); Key? rebuiltKeyOfSecondChildBeforeLayout; @@ -1024,7 +1023,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GlobalKey - detach and re-attach child to different parents', (WidgetTester tester) async { + testWidgets('GlobalKey - detach and re-attach child to different parents', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1062,7 +1061,7 @@ void main() { element.createChild(0, after: null); }); - testWidgetsWithLeakTracking('GlobalKey - re-attach child to new parents, and the old parent is deactivated(unmounted)', (WidgetTester tester) async { + testWidgets('GlobalKey - re-attach child to new parents, and the old parent is deactivated(unmounted)', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/62055 const Key key1 = GlobalObjectKey('key1'); const Key key2 = GlobalObjectKey('key2'); @@ -1110,7 +1109,7 @@ void main() { expect(tabController.index, 0); }); - testWidgetsWithLeakTracking('Defunct setState throws exception', (WidgetTester tester) async { + testWidgets('Defunct setState throws exception', (WidgetTester tester) async { late StateSetter setState; await tester.pumpWidget(StatefulBuilder( @@ -1128,12 +1127,12 @@ void main() { expect(() { setState(() { }); }, throwsFlutterError); }); - testWidgetsWithLeakTracking('State toString', (WidgetTester tester) async { + testWidgets('State toString', (WidgetTester tester) async { final TestState state = TestState(); expect(state.toString(), contains('no widget')); }); - testWidgetsWithLeakTracking('debugPrintGlobalKeyedWidgetLifecycle control test', (WidgetTester tester) async { + testWidgets('debugPrintGlobalKeyedWidgetLifecycle control test', (WidgetTester tester) async { expect(debugPrintGlobalKeyedWidgetLifecycle, isFalse); final DebugPrintCallback oldCallback = debugPrint; @@ -1156,7 +1155,7 @@ void main() { expect(log[1], matches('Discarding .+ from inactive elements list.')); }); - testWidgetsWithLeakTracking('MultiChildRenderObjectElement.children', (WidgetTester tester) async { + testWidgets('MultiChildRenderObjectElement.children', (WidgetTester tester) async { GlobalKey key0, key1, key2; await tester.pumpWidget(Column( key: key0 = GlobalKey(), @@ -1175,7 +1174,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can not attach a non-RenderObjectElement to the MultiChildRenderObjectElement - mount', (WidgetTester tester) async { + testWidgets('Can not attach a non-RenderObjectElement to the MultiChildRenderObjectElement - mount', (WidgetTester tester) async { await tester.pumpWidget( Column( children: <Widget>[ @@ -1200,7 +1199,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can not attach a non-RenderObjectElement to the MultiChildRenderObjectElement - update', (WidgetTester tester) async { + testWidgets('Can not attach a non-RenderObjectElement to the MultiChildRenderObjectElement - update', (WidgetTester tester) async { await tester.pumpWidget( Column( children: <Widget>[ @@ -1233,7 +1232,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Element diagnostics', (WidgetTester tester) async { + testWidgets('Element diagnostics', (WidgetTester tester) async { GlobalKey key0; await tester.pumpWidget(Column( key: key0 = GlobalKey(), @@ -1325,7 +1324,7 @@ void main() { } }); - testWidgetsWithLeakTracking('didUpdateDependencies is not called on a State that never rebuilds', (WidgetTester tester) async { + testWidgets('didUpdateDependencies is not called on a State that never rebuilds', (WidgetTester tester) async { final GlobalKey<DependentState> key = GlobalKey<DependentState>(); /// Initial build - should call didChangeDependencies, not deactivate @@ -1354,7 +1353,7 @@ void main() { expect(state.deactivatedCount, 2); }); - testWidgetsWithLeakTracking('StatefulElement subclass can decorate State.build', (WidgetTester tester) async { + testWidgets('StatefulElement subclass can decorate State.build', (WidgetTester tester) async { late bool isDidChangeDependenciesDecorated; late bool isBuildDecorated; @@ -1378,7 +1377,7 @@ void main() { expect(isDidChangeDependenciesDecorated, isFalse); }); group('BuildContext.debugDoingbuild', () { - testWidgetsWithLeakTracking('StatelessWidget', (WidgetTester tester) async { + testWidgets('StatelessWidget', (WidgetTester tester) async { late bool debugDoingBuildOnBuild; await tester.pumpWidget( StatelessWidgetSpy( @@ -1393,7 +1392,7 @@ void main() { expect(context.debugDoingBuild, isFalse); expect(debugDoingBuildOnBuild, isTrue); }); - testWidgetsWithLeakTracking('StatefulWidget', (WidgetTester tester) async { + testWidgets('StatefulWidget', (WidgetTester tester) async { late bool debugDoingBuildOnBuild; late bool debugDoingBuildOnInitState; late bool debugDoingBuildOnDidChangeDependencies; @@ -1462,7 +1461,7 @@ void main() { expect(debugDoingBuildOnDispose, isFalse); expect(debugDoingBuildOnDeactivate, isFalse); }); - testWidgetsWithLeakTracking('RenderObjectWidget', (WidgetTester tester) async { + testWidgets('RenderObjectWidget', (WidgetTester tester) async { late bool debugDoingBuildOnCreateRenderObject; bool? debugDoingBuildOnUpdateRenderObject; bool? debugDoingBuildOnDidUnmountRenderObject; @@ -1523,7 +1522,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('A widget whose element has an invalid visitChildren implementation triggers a useful error message', (WidgetTester tester) async { + testWidgets('A widget whose element has an invalid visitChildren implementation triggers a useful error message', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(_WidgetWithNoVisitChildren(_StatefulLeaf(key: key))); (key.currentState! as _StatefulLeafState).markNeedsBuild(); @@ -1549,7 +1548,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can create BuildOwner that does not interfere with pointer router or raw key event handler', (WidgetTester tester) async { + testWidgets('Can create BuildOwner that does not interfere with pointer router or raw key event handler', (WidgetTester tester) async { final int pointerRouterCount = GestureBinding.instance.pointerRouter.debugGlobalRouteCount; final RawKeyEventHandler? rawKeyEventHandler = RawKeyboard.instance.keyEventHandler; expect(rawKeyEventHandler, isNotNull); @@ -1610,7 +1609,7 @@ void main() { expect(dependenciesProperty.toDescription(), '[Directionality, FocusTraversalOrder, NavigationBarTheme]'); }); - testWidgetsWithLeakTracking('BuildOwner.globalKeyCount keeps track of in-use global keys', (WidgetTester tester) async { + testWidgets('BuildOwner.globalKeyCount keeps track of in-use global keys', (WidgetTester tester) async { final int initialCount = tester.binding.buildOwner!.globalKeyCount; final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -1624,7 +1623,7 @@ void main() { expect(tester.binding.buildOwner!.globalKeyCount, initialCount + 0); }); - testWidgetsWithLeakTracking('Widget and State properties are nulled out when unmounted', (WidgetTester tester) async { + testWidgets('Widget and State properties are nulled out when unmounted', (WidgetTester tester) async { await tester.pumpWidget(const _StatefulLeaf()); final StatefulElement element = tester.element<StatefulElement>(find.byType(_StatefulLeaf)); expect(element.state, isA<State<_StatefulLeaf>>()); @@ -1640,7 +1639,7 @@ void main() { expect(() => element.widget, throwsA(isA<TypeError>())); }); - testWidgetsWithLeakTracking('LayerLink can be swapped between parent and child container layers', (WidgetTester tester) async { + testWidgets('LayerLink can be swapped between parent and child container layers', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/96959. final LayerLink link = LayerLink(); await tester.pumpWidget(_TestLeaderLayerWidget( @@ -1662,7 +1661,7 @@ void main() { }); - testWidgetsWithLeakTracking('Deactivate and activate are called correctly', (WidgetTester tester) async { + testWidgets('Deactivate and activate are called correctly', (WidgetTester tester) async { final List<String> states = <String>[]; Widget build([Key? key]) { return StatefulWidgetSpy( @@ -1696,7 +1695,7 @@ void main() { expect(states, <String>['deactivate', 'dispose']); }); - testWidgetsWithLeakTracking('Element.deactivate reports its deactivation to the InheritedElement it depends on', (WidgetTester tester) async { + testWidgets('Element.deactivate reports its deactivation to the InheritedElement it depends on', (WidgetTester tester) async { final List<Key> removedDependentWidgetKeys = <Key>[]; InheritedElement elementCreator(InheritedWidget widget) { @@ -1746,7 +1745,7 @@ void main() { expect(removedDependentWidgetKeys.first, const Key('dependent')); }); - testWidgetsWithLeakTracking('RenderObjectElement.unmount disposes of its renderObject', (WidgetTester tester) async { + testWidgets('RenderObjectElement.unmount disposes of its renderObject', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); final RenderObjectElement element = tester.allElements.whereType<RenderObjectElement>().last; final RenderObject renderObject = element.renderObject; @@ -1758,7 +1757,7 @@ void main() { expect(renderObject.debugDisposed, true); }); - testWidgetsWithLeakTracking('Getting the render object of an unmounted element throws', (WidgetTester tester) async { + testWidgets('Getting the render object of an unmounted element throws', (WidgetTester tester) async { await tester.pumpWidget(const _StatefulLeaf()); final StatefulElement element = tester.element<StatefulElement>(find.byType(_StatefulLeaf)); expect(element.state, isA<State<_StatefulLeaf>>()); @@ -1813,7 +1812,7 @@ The findRenderObject() method was called for the following element: expect(child.doesDependOnInheritedElement(ancestor), isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'MultiChildRenderObjectElement.updateChildren test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/120762. diff --git a/packages/flutter/test/widgets/gesture_detector_semantics_test.dart b/packages/flutter/test/widgets/gesture_detector_semantics_test.dart index fc43260892e..4632cf53bc5 100644 --- a/packages/flutter/test/widgets/gesture_detector_semantics_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_semantics_test.dart @@ -6,12 +6,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Vertical gesture detector has up/down actions', (WidgetTester tester) async { + testWidgets('Vertical gesture detector has up/down actions', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int callCount = 0; @@ -45,7 +44,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Horizontal gesture detector has up/down actions', (WidgetTester tester) async { + testWidgets('Horizontal gesture detector has up/down actions', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int callCount = 0; @@ -79,7 +78,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('All registered handlers for the gesture kind are called', (WidgetTester tester) async { + testWidgets('All registered handlers for the gesture kind are called', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Set<String> logs = <String>{}; @@ -103,7 +102,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Replacing recognizers should update semantic handlers', (WidgetTester tester) async { + testWidgets('Replacing recognizers should update semantic handlers', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // How the test is set up: @@ -174,7 +173,7 @@ void main() { }); group("RawGestureDetector's custom semantics delegate", () { - testWidgetsWithLeakTracking('should update semantics notations when switching from the default delegate', (WidgetTester tester) async { + testWidgets('should update semantics notations when switching from the default delegate', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Map<Type, GestureRecognizerFactory> gestures = _buildGestureMap(() => LongPressGestureRecognizer(), null) @@ -209,7 +208,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('should update semantics notations when switching to the default delegate', (WidgetTester tester) async { + testWidgets('should update semantics notations when switching to the default delegate', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Map<Type, GestureRecognizerFactory> gestures = _buildGestureMap(() => LongPressGestureRecognizer(), null) @@ -244,7 +243,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('should update semantics notations when switching from a different custom delegate', (WidgetTester tester) async { + testWidgets('should update semantics notations when switching from a different custom delegate', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Map<Type, GestureRecognizerFactory> gestures = _buildGestureMap(() => LongPressGestureRecognizer(), null) @@ -280,7 +279,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('should correctly call callbacks', (WidgetTester tester) async { + testWidgets('should correctly call callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> logs = <String>[]; final GlobalKey<RawGestureDetectorState> detectorKey = GlobalKey(); @@ -322,7 +321,7 @@ void main() { group("RawGestureDetector's default semantics delegate", () { group('should map onTap to', () { - testWidgetsWithLeakTracking('null when there is no TapGR', (WidgetTester tester) async { + testWidgets('null when there is no TapGR', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -340,7 +339,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('non-null when there is TapGR with no callbacks', (WidgetTester tester) async { + testWidgets('non-null when there is TapGR with no callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -361,7 +360,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('a callback that correctly calls callbacks', (WidgetTester tester) async { + testWidgets('a callback that correctly calls callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey detectorKey = GlobalKey(); final List<String> logs = <String>[]; @@ -395,7 +394,7 @@ void main() { }); group('should map onLongPress to', () { - testWidgetsWithLeakTracking('null when there is no LongPressGR ', (WidgetTester tester) async { + testWidgets('null when there is no LongPressGR ', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -413,7 +412,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('non-null when there is LongPressGR with no callbacks', (WidgetTester tester) async { + testWidgets('non-null when there is LongPressGR with no callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -434,7 +433,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('a callback that correctly calls callbacks', (WidgetTester tester) async { + testWidgets('a callback that correctly calls callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey detectorKey = GlobalKey(); final List<String> logs = <String>[]; @@ -467,7 +466,7 @@ void main() { }); group('should map onHorizontalDragUpdate to', () { - testWidgetsWithLeakTracking('null when there is no matching recognizers ', (WidgetTester tester) async { + testWidgets('null when there is no matching recognizers ', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -485,7 +484,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('non-null when there is either matching recognizer with no callbacks', (WidgetTester tester) async { + testWidgets('non-null when there is either matching recognizer with no callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -527,7 +526,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('a callback that correctly calls callbacks', (WidgetTester tester) async { + testWidgets('a callback that correctly calls callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey detectorKey = GlobalKey(); final List<String> logs = <String>[]; @@ -577,7 +576,7 @@ void main() { }); group('should map onVerticalDragUpdate to', () { - testWidgetsWithLeakTracking('null when there is no matching recognizers ', (WidgetTester tester) async { + testWidgets('null when there is no matching recognizers ', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -595,7 +594,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('non-null when there is either matching recognizer with no callbacks', (WidgetTester tester) async { + testWidgets('non-null when there is either matching recognizer with no callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( @@ -618,7 +617,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('a callback that correctly calls callbacks', (WidgetTester tester) async { + testWidgets('a callback that correctly calls callbacks', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey detectorKey = GlobalKey(); final List<String> logs = <String>[]; @@ -667,7 +666,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('should update semantics notations when receiving new gestures', (WidgetTester tester) async { + testWidgets('should update semantics notations when receiving new gestures', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Center( diff --git a/packages/flutter/test/widgets/gesture_detector_test.dart b/packages/flutter/test/widgets/gesture_detector_test.dart index f368c4171f0..a0a1b6d3d91 100644 --- a/packages/flutter/test/widgets/gesture_detector_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_test.dart @@ -6,12 +6,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { const Offset forcePressOffset = Offset(400.0, 50.0); - testWidgetsWithLeakTracking('Uncontested scrolls start immediately', (WidgetTester tester) async { + testWidgets('Uncontested scrolls start immediately', (WidgetTester tester) async { bool didStartDrag = false; double? updatedDragDelta; bool didEndDrag = false; @@ -59,7 +58,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('Match two scroll gestures in succession', (WidgetTester tester) async { + testWidgets('Match two scroll gestures in succession', (WidgetTester tester) async { int gestureCount = 0; double dragDistance = 0.0; @@ -92,7 +91,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking("Pan doesn't crash", (WidgetTester tester) async { + testWidgets("Pan doesn't crash", (WidgetTester tester) async { bool didStartPan = false; Offset? panDelta; bool didEndPan = false; @@ -136,7 +135,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Translucent', (WidgetTester tester) async { + testWidgets('Translucent', (WidgetTester tester) async { bool didReceivePointerDown; bool didTap; @@ -207,7 +206,7 @@ void main() { expect(didTap, isTrue); }, variant: buttonVariant); - testWidgetsWithLeakTracking('Empty', (WidgetTester tester) async { + testWidgets('Empty', (WidgetTester tester) async { bool didTap = false; await tester.pumpWidget( Center( @@ -229,7 +228,7 @@ void main() { expect(didTap, isTrue); }, variant: buttonVariant); - testWidgetsWithLeakTracking('Only container', (WidgetTester tester) async { + testWidgets('Only container', (WidgetTester tester) async { bool didTap = false; await tester.pumpWidget( Center( @@ -252,7 +251,7 @@ void main() { expect(didTap, isFalse); }, variant: buttonVariant); - testWidgetsWithLeakTracking('cache render object', (WidgetTester tester) async { + testWidgets('cache render object', (WidgetTester tester) async { void inputCallback() { } await tester.pumpWidget( @@ -284,7 +283,7 @@ void main() { expect(renderObj1, same(renderObj2)); }, variant: buttonVariant); - testWidgetsWithLeakTracking('Tap down occurs after kPressTimeout', (WidgetTester tester) async { + testWidgets('Tap down occurs after kPressTimeout', (WidgetTester tester) async { int tapDown = 0; int tap = 0; int tapCancel = 0; @@ -392,7 +391,7 @@ void main() { expect(longPress, 1); }, variant: buttonVariant); - testWidgetsWithLeakTracking('Long Press Up Callback called after long press', (WidgetTester tester) async { + testWidgets('Long Press Up Callback called after long press', (WidgetTester tester) async { int longPressUp = 0; await tester.pumpWidget( @@ -442,7 +441,7 @@ void main() { }, variant: buttonVariant); }); - testWidgetsWithLeakTracking('Primary and secondary long press callbacks should work together in GestureDetector', (WidgetTester tester) async { + testWidgets('Primary and secondary long press callbacks should work together in GestureDetector', (WidgetTester tester) async { bool primaryLongPress = false, secondaryLongPress = false; await tester.pumpWidget( @@ -478,7 +477,7 @@ void main() { expect(secondaryLongPress, isTrue); }); - testWidgetsWithLeakTracking('Force Press Callback called after force press', (WidgetTester tester) async { + testWidgets('Force Press Callback called after force press', (WidgetTester tester) async { int forcePressStart = 0; int forcePressPeaked = 0; int forcePressUpdate = 0; @@ -581,7 +580,7 @@ void main() { expect(forcePressEnded, 1); }); - testWidgetsWithLeakTracking('Force Press Callback not called if long press triggered before force press', (WidgetTester tester) async { + testWidgets('Force Press Callback not called if long press triggered before force press', (WidgetTester tester) async { int forcePressStart = 0; int longPressTimes = 0; @@ -646,7 +645,7 @@ void main() { expect(forcePressStart, 0); }); - testWidgetsWithLeakTracking('Force Press Callback not called if drag triggered before force press', (WidgetTester tester) async { + testWidgets('Force Press Callback not called if drag triggered before force press', (WidgetTester tester) async { int forcePressStart = 0; int horizontalDragStart = 0; @@ -707,7 +706,7 @@ void main() { }); group("RawGestureDetectorState's debugFillProperties", () { - testWidgetsWithLeakTracking('when default', (WidgetTester tester) async { + testWidgets('when default', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final GlobalKey key = GlobalKey(); await tester.pumpWidget(RawGestureDetector( @@ -725,7 +724,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('should show gestures, custom semantics and behavior', (WidgetTester tester) async { + testWidgets('should show gestures, custom semantics and behavior', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final GlobalKey key = GlobalKey(); await tester.pumpWidget(RawGestureDetector( @@ -762,7 +761,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('should not show semantics when excludeFromSemantics is true', (WidgetTester tester) async { + testWidgets('should not show semantics when excludeFromSemantics is true', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final GlobalKey key = GlobalKey(); await tester.pumpWidget(RawGestureDetector( @@ -833,7 +832,7 @@ void main() { } }); - testWidgetsWithLeakTracking('replaceGestureRecognizers not during layout', (WidgetTester tester) async { + testWidgets('replaceGestureRecognizers not during layout', (WidgetTester tester) async { final GlobalKey<RawGestureDetectorState> key = GlobalKey<RawGestureDetectorState>(); await tester.pumpWidget( Directionality( @@ -877,7 +876,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('supportedDevices update test', (WidgetTester tester) async { + testWidgets('supportedDevices update test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/111716 bool didStartPan = false; Offset? panDelta; @@ -947,7 +946,7 @@ void main() { expect(didEndPan, isTrue); }); - testWidgetsWithLeakTracking('supportedDevices is respected', (WidgetTester tester) async { + testWidgets('supportedDevices is respected', (WidgetTester tester) async { bool didStartPan = false; Offset? panDelta; bool didEndPan = false; @@ -995,7 +994,7 @@ void main() { }); group('DoubleTap', () { - testWidgetsWithLeakTracking('onDoubleTap is called even if onDoubleTapDown has not been not provided', (WidgetTester tester) async { + testWidgets('onDoubleTap is called even if onDoubleTapDown has not been not provided', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( Directionality( @@ -1018,7 +1017,7 @@ void main() { expect(log, <String>['double-tap']); }); - testWidgetsWithLeakTracking('onDoubleTapDown is called even if onDoubleTap has not been not provided', (WidgetTester tester) async { + testWidgets('onDoubleTapDown is called even if onDoubleTap has not been not provided', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/widgets/gesture_disambiguation_test.dart b/packages/flutter/test/widgets/gesture_disambiguation_test.dart index 617e1046deb..0788d5a5c16 100644 --- a/packages/flutter/test/widgets/gesture_disambiguation_test.dart +++ b/packages/flutter/test/widgets/gesture_disambiguation_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('onTap detection with canceled pointer and a drag listener', (WidgetTester tester) async { + testWidgets('onTap detection with canceled pointer and a drag listener', (WidgetTester tester) async { int detector1TapCount = 0; int detector2TapCount = 0; diff --git a/packages/flutter/test/widgets/global_keys_duplicated_test.dart b/packages/flutter/test/widgets/global_keys_duplicated_test.dart index f2e2430cf8f..ec37b19be24 100644 --- a/packages/flutter/test/widgets/global_keys_duplicated_test.dart +++ b/packages/flutter/test/widgets/global_keys_duplicated_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // There's also some duplicate GlobalKey tests in the framework_test.dart file. void main() { - testWidgetsWithLeakTracking('GlobalKey children of one node', (WidgetTester tester) async { + testWidgets('GlobalKey children of one node', (WidgetTester tester) async { // This is actually a test of the regular duplicate key logic, which // happens before the duplicate GlobalKey logic. await tester.pumpWidget(const Stack(children: <Widget>[ @@ -24,7 +23,7 @@ void main() { expect(error.toString(), contains('[GlobalObjectKey ${describeIdentity(0)}]')); }); - testWidgetsWithLeakTracking('GlobalKey children of two nodes - A', (WidgetTester tester) async { + testWidgets('GlobalKey children of two nodes - A', (WidgetTester tester) async { await tester.pumpWidget(const Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -44,7 +43,7 @@ void main() { expect(error.toString(), endsWith('\nA GlobalKey can only be specified on one widget at a time in the widget tree.')); }); - testWidgetsWithLeakTracking('GlobalKey children of two different nodes - B', (WidgetTester tester) async { + testWidgets('GlobalKey children of two different nodes - B', (WidgetTester tester) async { await tester.pumpWidget(const Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -62,7 +61,7 @@ void main() { expect(error.toString(), endsWith('\nA GlobalKey can only be specified on one widget at a time in the widget tree.')); }); - testWidgetsWithLeakTracking('GlobalKey children of two nodes - C', (WidgetTester tester) async { + testWidgets('GlobalKey children of two nodes - C', (WidgetTester tester) async { late StateSetter nestedSetState; bool flag = false; await tester.pumpWidget(Stack( diff --git a/packages/flutter/test/widgets/global_keys_moving_test.dart b/packages/flutter/test/widgets/global_keys_moving_test.dart index 1fd8eaf1be1..4984289950a 100644 --- a/packages/flutter/test/widgets/global_keys_moving_test.dart +++ b/packages/flutter/test/widgets/global_keys_moving_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Item { GlobalKey key1 = GlobalKey(); @@ -56,7 +55,7 @@ Widget builder() { } void main() { - testWidgetsWithLeakTracking('moving subtrees with global keys - smoketest', (WidgetTester tester) async { + testWidgets('moving subtrees with global keys - smoketest', (WidgetTester tester) async { await tester.pumpWidget(builder()); final StatefulLeafState leaf = tester.firstState(find.byType(StatefulLeaf)); leaf.markNeedsBuild(); diff --git a/packages/flutter/test/widgets/grid_paper_test.dart b/packages/flutter/test/widgets/grid_paper_test.dart index cd0c8d93bb8..d64a14cfc74 100644 --- a/packages/flutter/test/widgets/grid_paper_test.dart +++ b/packages/flutter/test/widgets/grid_paper_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('GridPaper control test', (WidgetTester tester) async { + testWidgets('GridPaper control test', (WidgetTester tester) async { await tester.pumpWidget(const GridPaper()); final List<Layer> layers1 = tester.layers; await tester.pumpWidget(const GridPaper()); diff --git a/packages/flutter/test/widgets/grid_view_layout_test.dart b/packages/flutter/test/widgets/grid_view_layout_test.dart index ea1e43e725d..221b96080b1 100644 --- a/packages/flutter/test/widgets/grid_view_layout_test.dart +++ b/packages/flutter/test/widgets/grid_view_layout_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Empty GridView', (WidgetTester tester) async { + testWidgets('Empty GridView', (WidgetTester tester) async { final List<Widget> children = <Widget>[ const DecoratedBox(decoration: BoxDecoration()), const DecoratedBox(decoration: BoxDecoration()), diff --git a/packages/flutter/test/widgets/grid_view_test.dart b/packages/flutter/test/widgets/grid_view_test.dart index b87a1444266..c03baf8c151 100644 --- a/packages/flutter/test/widgets/grid_view_test.dart +++ b/packages/flutter/test/widgets/grid_view_test.dart @@ -6,14 +6,13 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart' show TestClipPaintingContext; import 'states.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('GridView.builder respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('GridView.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -51,7 +50,7 @@ void main() { expect(finderCalled, true); }); - testWidgetsWithLeakTracking('Empty GridView', (WidgetTester tester) async { + testWidgets('Empty GridView', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -63,7 +62,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('GridView.count control test', (WidgetTester tester) async { + testWidgets('GridView.count control test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -136,7 +135,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('GridView.extent control test', (WidgetTester tester) async { + testWidgets('GridView.extent control test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -183,7 +182,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('GridView large scroll jump', (WidgetTester tester) async { + testWidgets('GridView large scroll jump', (WidgetTester tester) async { final List<int> log = <int>[]; await tester.pumpWidget( @@ -275,7 +274,7 @@ void main() { } }); - testWidgetsWithLeakTracking('GridView - change crossAxisCount', (WidgetTester tester) async { + testWidgets('GridView - change crossAxisCount', (WidgetTester tester) async { final List<int> log = <int>[]; await tester.pumpWidget( @@ -346,7 +345,7 @@ void main() { expect(find.text('4'), findsNothing); }); - testWidgetsWithLeakTracking('SliverGridRegularTileLayout - can handle close to zero mainAxisStride', (WidgetTester tester) async { + testWidgets('SliverGridRegularTileLayout - can handle close to zero mainAxisStride', (WidgetTester tester) async { const SliverGridDelegateWithMaxCrossAxisExtent delegate = SliverGridDelegateWithMaxCrossAxisExtent( childAspectRatio: 1e300, maxCrossAxisExtent: 500.0, @@ -370,7 +369,7 @@ void main() { expect(layout.getMinChildIndexForScrollOffset(1000.0), 0.0); }); - testWidgetsWithLeakTracking('GridView - change maxChildCrossAxisExtent', (WidgetTester tester) async { + testWidgets('GridView - change maxChildCrossAxisExtent', (WidgetTester tester) async { final List<int> log = <int>[]; await tester.pumpWidget( @@ -441,7 +440,7 @@ void main() { expect(find.text('4'), findsNothing); }); - testWidgetsWithLeakTracking('One-line GridView paints', (WidgetTester tester) async { + testWidgets('One-line GridView paints', (WidgetTester tester) async { const Color green = Color(0xFF00FF00); final Container container = Container( @@ -470,7 +469,7 @@ void main() { expect(find.byType(GridView), isNot(paints..rect(color: green)..rect(color: green)..rect(color: green))); }); - testWidgetsWithLeakTracking('GridView in zero context', (WidgetTester tester) async { + testWidgets('GridView in zero context', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -491,7 +490,7 @@ void main() { expect(find.text('1'), findsNothing); }); - testWidgetsWithLeakTracking('GridView in unbounded context', (WidgetTester tester) async { + testWidgets('GridView in unbounded context', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -511,7 +510,7 @@ void main() { expect(find.text('19'), findsOneWidget); }); - testWidgetsWithLeakTracking('GridView.builder control test', (WidgetTester tester) async { + testWidgets('GridView.builder control test', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -532,7 +531,7 @@ void main() { expect(find.text('12'), findsNothing); }); - testWidgetsWithLeakTracking('GridView.builder with undefined itemCount', (WidgetTester tester) async { + testWidgets('GridView.builder with undefined itemCount', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -554,7 +553,7 @@ void main() { expect(find.text('13'), findsOneWidget); }); - testWidgetsWithLeakTracking('GridView cross axis layout', (WidgetTester tester) async { + testWidgets('GridView cross axis layout', (WidgetTester tester) async { final Key target = UniqueKey(); Widget build(TextDirection textDirection) { @@ -580,7 +579,7 @@ void main() { expect(tester.getBottomRight(find.byKey(target)), const Offset(800.0, 200.0)); }); - testWidgetsWithLeakTracking('GridView crossAxisSpacing', (WidgetTester tester) async { + testWidgets('GridView crossAxisSpacing', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/27151. final Key target = UniqueKey(); @@ -608,7 +607,7 @@ void main() { expect(tester.getBottomRight(find.byKey(target)), const Offset(800.0, 194.0)); }); - testWidgetsWithLeakTracking('GridView does not cache itemBuilder calls', (WidgetTester tester) async { + testWidgets('GridView does not cache itemBuilder calls', (WidgetTester tester) async { final Map<int, int> counters = <int, int>{}; await tester.pumpWidget(Directionality( @@ -643,7 +642,7 @@ void main() { expect(counters[4], 2); }); - testWidgetsWithLeakTracking('GridView does not report visual overflow unnecessarily', (WidgetTester tester) async { + testWidgets('GridView does not report visual overflow unnecessarily', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -667,7 +666,7 @@ void main() { context.dispose(); }); - testWidgetsWithLeakTracking('GridView respects clipBehavior', (WidgetTester tester) async { + testWidgets('GridView respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -734,7 +733,7 @@ void main() { context.dispose(); }); - testWidgetsWithLeakTracking('GridView.builder respects clipBehavior', (WidgetTester tester) async { + testWidgets('GridView.builder respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -750,7 +749,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('GridView.custom respects clipBehavior', (WidgetTester tester) async { + testWidgets('GridView.custom respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -768,7 +767,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('GridView.count respects clipBehavior', (WidgetTester tester) async { + testWidgets('GridView.count respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -783,7 +782,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('GridView.extent respects clipBehavior', (WidgetTester tester) async { + testWidgets('GridView.extent respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -798,7 +797,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('SliverGridDelegateWithFixedCrossAxisCount mainAxisExtent works as expected', (WidgetTester tester) async { + testWidgets('SliverGridDelegateWithFixedCrossAxisCount mainAxisExtent works as expected', (WidgetTester tester) async { const int crossAxisCount = 4; const double mainAxisExtent = 100.0; @@ -824,7 +823,7 @@ void main() { expect(tester.getSize(find.text('4')), equals(const Size(200.0, mainAxisExtent))); }); - testWidgetsWithLeakTracking('SliverGridDelegateWithMaxCrossAxisExtent mainAxisExtent works as expected', (WidgetTester tester) async { + testWidgets('SliverGridDelegateWithMaxCrossAxisExtent mainAxisExtent works as expected', (WidgetTester tester) async { const double maxCrossAxisExtent = 200.0; const double mainAxisExtent = 100.0; @@ -850,7 +849,7 @@ void main() { expect(tester.getSize(find.text('4')), equals(const Size(200.0, mainAxisExtent))); }); - testWidgetsWithLeakTracking('SliverGridDelegateWithMaxCrossAxisExtent throws assertion error when maxCrossAxisExtent is 0', (WidgetTester tester) async { + testWidgets('SliverGridDelegateWithMaxCrossAxisExtent throws assertion error when maxCrossAxisExtent is 0', (WidgetTester tester) async { const double maxCrossAxisExtent = 0; expect(() => Directionality( @@ -861,7 +860,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('SliverGrid sets correct extent for null returning builder delegate', (WidgetTester tester) async { + testWidgets('SliverGrid sets correct extent for null returning builder delegate', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/130685 final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/heroes_test.dart b/packages/flutter/test/widgets/heroes_test.dart index 444df552454..d9bd88e1fc0 100644 --- a/packages/flutter/test/widgets/heroes_test.dart +++ b/packages/flutter/test/widgets/heroes_test.dart @@ -191,7 +191,7 @@ Future<void> main() async { transitionFromUserGestures = false; }); - testWidgetsWithLeakTracking('Heroes animate', (WidgetTester tester) async { + testWidgets('Heroes animate', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(routes: routes)); @@ -301,7 +301,7 @@ Future<void> main() async { expect(find.byKey(thirdKey), isInCard); }); - testWidgetsWithLeakTracking('Heroes still animate after hero controller is swapped.', (WidgetTester tester) async { + testWidgets('Heroes still animate after hero controller is swapped.', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); final UniqueKey heroKey = UniqueKey(); final HeroController controller1 = HeroController(); @@ -404,7 +404,7 @@ Future<void> main() async { expect(find.byKey(heroKey), findsNothing); }); - testWidgetsWithLeakTracking('Heroes animate should hide original hero', (WidgetTester tester) async { + testWidgets('Heroes animate should hide original hero', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(routes: routes)); // Checks initial state. expect(find.byKey(firstKey), isOnstage); @@ -427,7 +427,7 @@ Future<void> main() async { expect(find.byKey(secondKey), isInCard); }); - testWidgetsWithLeakTracking('Destination hero is rebuilt midflight', (WidgetTester tester) async { + testWidgets('Destination hero is rebuilt midflight', (WidgetTester tester) async { final MutatingRoute route = MutatingRoute(); await tester.pumpWidget(MaterialApp( @@ -452,7 +452,7 @@ Future<void> main() async { await tester.pump(const Duration(seconds: 1)); }); - testWidgetsWithLeakTracking('Heroes animation is fastOutSlowIn', (WidgetTester tester) async { + testWidgets('Heroes animation is fastOutSlowIn', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(routes: routes)); await tester.tap(find.text('two')); await tester.pump(); // begin navigation @@ -492,7 +492,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('Heroes are not interactive', (WidgetTester tester) async { + testWidgets('Heroes are not interactive', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(MaterialApp( @@ -562,7 +562,7 @@ Future<void> main() async { expect(log, equals(<String>['bar'])); }); - testWidgetsWithLeakTracking('Popping on first frame does not cause hero observer to crash', (WidgetTester tester) async { + testWidgets('Popping on first frame does not cause hero observer to crash', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute<void>( @@ -583,7 +583,7 @@ Future<void> main() async { await tester.pump(); // ...and removes it straight away (since it's already at 0.0) }); - testWidgetsWithLeakTracking('Overlapping starting and ending a hero transition works ok', (WidgetTester tester) async { + testWidgets('Overlapping starting and ending a hero transition works ok', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute<void>( @@ -612,7 +612,7 @@ Future<void> main() async { await tester.pump(); }); - testWidgetsWithLeakTracking('One route, two heroes, same tag, throws', (WidgetTester tester) async { + testWidgets('One route, two heroes, same tag, throws', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: ListView( @@ -667,7 +667,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('Hero push transition interrupted by a pop', (WidgetTester tester) async { + testWidgets('Hero push transition interrupted by a pop', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( routes: routes, )); @@ -732,7 +732,7 @@ Future<void> main() async { expect(find.byKey(secondKey), findsNothing); }); - testWidgetsWithLeakTracking('Hero pop transition interrupted by a push', (WidgetTester tester) async { + testWidgets('Hero pop transition interrupted by a push', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( routes: routes, @@ -809,7 +809,7 @@ Future<void> main() async { expect(find.byKey(firstKey), findsNothing); }); - testWidgetsWithLeakTracking('Destination hero disappears mid-flight', (WidgetTester tester) async { + testWidgets('Destination hero disappears mid-flight', (WidgetTester tester) async { const Key homeHeroKey = Key('home hero'); const Key routeHeroKey = Key('route hero'); bool routeIncludesHero = true; @@ -912,7 +912,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('Destination hero scrolls mid-flight', (WidgetTester tester) async { + testWidgets('Destination hero scrolls mid-flight', (WidgetTester tester) async { const Key homeHeroKey = Key('home hero'); const Key routeHeroKey = Key('route hero'); const Key routeContainerKey = Key('route hero container'); @@ -999,7 +999,7 @@ Future<void> main() async { expect(finalHeroY, 75.0); // 100 less 25 for the scroll }); - testWidgetsWithLeakTracking('Destination hero scrolls out of view mid-flight', (WidgetTester tester) async { + testWidgets('Destination hero scrolls out of view mid-flight', (WidgetTester tester) async { const Key homeHeroKey = Key('home hero'); const Key routeHeroKey = Key('route hero'); const Key routeContainerKey = Key('route hero container'); @@ -1076,7 +1076,7 @@ Future<void> main() async { expect(find.byKey(routeHeroKey), findsNothing); }); - testWidgetsWithLeakTracking('Aborted flight', (WidgetTester tester) async { + testWidgets('Aborted flight', (WidgetTester tester) async { // See https://github.com/flutter/flutter/issues/5798 const Key heroABKey = Key('AB hero'); const Key heroBCKey = Key('BC hero'); @@ -1211,7 +1211,7 @@ Future<void> main() async { expect(tester.getTopLeft(find.byKey(heroBCKey)).dy, 0.0); }); - testWidgetsWithLeakTracking('Stateful hero child state survives flight', (WidgetTester tester) async { + testWidgets('Stateful hero child state survives flight', (WidgetTester tester) async { final MaterialPageRoute<void> route = MaterialPageRoute<void>( builder: (BuildContext context) { return Material( @@ -1295,7 +1295,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('Hero createRectTween', (WidgetTester tester) async { + testWidgets('Hero createRectTween', (WidgetTester tester) async { RectTween createRectTween(Rect? begin, Rect? end) { return MaterialRectCenterArcTween(begin: begin, end: end); } @@ -1407,7 +1407,7 @@ Future<void> main() async { expect(tester.getCenter(find.byKey(firstKey)), const Offset(50.0, 50.0)); }); - testWidgetsWithLeakTracking('Hero createRectTween for Navigator that is not full screen', (WidgetTester tester) async { + testWidgets('Hero createRectTween for Navigator that is not full screen', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25272 RectTween createRectTween(Rect? begin, Rect? end) { @@ -1528,7 +1528,7 @@ Future<void> main() async { }); - testWidgetsWithLeakTracking('Pop interrupts push, reverses flight', (WidgetTester tester) async { + testWidgets('Pop interrupts push, reverses flight', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp(routes: routes)); await tester.tap(find.text('twoInset')); await tester.pump(); // begin navigation from / to /twoInset. @@ -1621,7 +1621,7 @@ Future<void> main() async { expect(tester.getTopLeft(find.byKey(firstKey)).dx, x0); }); - testWidgetsWithLeakTracking('Can override flight shuttle in to hero', (WidgetTester tester) async { + testWidgets('Can override flight shuttle in to hero', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: ListView( @@ -1665,7 +1665,7 @@ Future<void> main() async { expect(find.text('baz'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can override flight shuttle in from hero', (WidgetTester tester) async { + testWidgets('Can override flight shuttle in from hero', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: ListView( @@ -1708,7 +1708,7 @@ Future<void> main() async { }); // Regression test for https://github.com/flutter/flutter/issues/77720. - testWidgetsWithLeakTracking("toHero's shuttle builder over fromHero's shuttle builder", (WidgetTester tester) async { + testWidgets("toHero's shuttle builder over fromHero's shuttle builder", (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: ListView( @@ -1761,7 +1761,7 @@ Future<void> main() async { expect(find.text('toHero text'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can override flight launch pads', (WidgetTester tester) async { + testWidgets('Can override flight launch pads', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: ListView( @@ -1808,7 +1808,7 @@ Future<void> main() async { expect(find.text('Joker'), findsOneWidget); }); - testWidgetsWithLeakTracking('Heroes do not transition on back gestures by default', (WidgetTester tester) async { + testWidgets('Heroes do not transition on back gestures by default', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( routes: routes, )); @@ -1847,7 +1847,7 @@ Future<void> main() async { expect(find.byKey(secondKey), isInCard); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Heroes can transition on gesture in one frame', (WidgetTester tester) async { + testWidgets('Heroes can transition on gesture in one frame', (WidgetTester tester) async { transitionFromUserGestures = true; await tester.pumpWidget(MaterialApp( routes: routes, @@ -1890,7 +1890,7 @@ Future<void> main() async { expect(find.byKey(secondKey), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Heroes animate should hide destination hero and display original hero in case of dismissed', (WidgetTester tester) async { + testWidgets('Heroes animate should hide destination hero and display original hero in case of dismissed', (WidgetTester tester) async { transitionFromUserGestures = true; await tester.pumpWidget(MaterialApp( routes: routes, @@ -1926,7 +1926,7 @@ Future<void> main() async { expect(find.byKey(secondKey), isInCard); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Handles transitions when a non-default initial route is set', (WidgetTester tester) async { + testWidgets('Handles transitions when a non-default initial route is set', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( routes: routes, initialRoute: '/two', @@ -1936,7 +1936,7 @@ Future<void> main() async { expect(find.text('three'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can push/pop on outer Navigator if nested Navigator contains Heroes', (WidgetTester tester) async { + testWidgets('Can push/pop on outer Navigator if nested Navigator contains Heroes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28042. const String heroTag = 'You are my hero!'; @@ -2010,7 +2010,7 @@ Future<void> main() async { expect(find.byKey(nestedRouteHeroBottom, skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('Can hero from route in root Navigator to route in nested Navigator', (WidgetTester tester) async { + testWidgets('Can hero from route in root Navigator to route in nested Navigator', (WidgetTester tester) async { const String heroTag = 'foo'; final GlobalKey<NavigatorState> rootNavigator = GlobalKey(); final Key smallContainer = UniqueKey(); @@ -2096,7 +2096,7 @@ Future<void> main() async { expect(tester.getSize(find.byKey(smallContainer)), const Size(100,100)); }); - testWidgetsWithLeakTracking('Hero within a Hero, throws', (WidgetTester tester) async { + testWidgets('Hero within a Hero, throws', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -2114,7 +2114,7 @@ Future<void> main() async { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Can push/pop on outer Navigator if nested Navigators contains same Heroes', (WidgetTester tester) async { + testWidgets('Can push/pop on outer Navigator if nested Navigators contains same Heroes', (WidgetTester tester) async { const String heroTag = 'foo'; final GlobalKey<NavigatorState> rootNavigator = GlobalKey<NavigatorState>(); final Key rootRouteHero = UniqueKey(); @@ -2198,7 +2198,7 @@ Future<void> main() async { expect(find.byKey(nestedRouteHeroOne, skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('Hero within a Hero subtree, throws', (WidgetTester tester) async { + testWidgets('Hero within a Hero subtree, throws', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -2216,7 +2216,7 @@ Future<void> main() async { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Hero within a Hero subtree with Builder, throws', (WidgetTester tester) async { + testWidgets('Hero within a Hero subtree with Builder, throws', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2238,7 +2238,7 @@ Future<void> main() async { expect(tester.takeException(),isAssertionError); }); - testWidgetsWithLeakTracking('Hero within a Hero subtree with LayoutBuilder, throws', (WidgetTester tester) async { + testWidgets('Hero within a Hero subtree with LayoutBuilder, throws', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -2260,7 +2260,7 @@ Future<void> main() async { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Heroes fly on pushReplacement', (WidgetTester tester) async { + testWidgets('Heroes fly on pushReplacement', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/28041. const String heroTag = 'foo'; @@ -2347,7 +2347,7 @@ Future<void> main() async { expect(tester.getSize(find.byKey(smallContainer)), const Size(100,100)); }); - testWidgetsWithLeakTracking('On an iOS back swipe and snap, only a single flight should take place', (WidgetTester tester) async { + testWidgets('On an iOS back swipe and snap, only a single flight should take place', (WidgetTester tester) async { int shuttlesBuilt = 0; Widget shuttleBuilder( BuildContext flightContext, @@ -2410,7 +2410,7 @@ Future<void> main() async { expect(shuttlesBuilt, 2); }); - testWidgetsWithLeakTracking( + testWidgets( "From hero's state should be preserved, " 'heroes work well with child widgets that has global keys', (WidgetTester tester) async { @@ -2477,7 +2477,7 @@ Future<void> main() async { }, ); - testWidgetsWithLeakTracking( + testWidgets( "Hero works with images that don't have both width and height specified", // Regression test for https://github.com/flutter/flutter/issues/32356 // and https://github.com/flutter/flutter/issues/31503 @@ -2565,7 +2565,7 @@ Future<void> main() async { ); // Regression test for https://github.com/flutter/flutter/issues/38183. - testWidgetsWithLeakTracking('Remove user gesture driven flights when the gesture is invalid', (WidgetTester tester) async { + testWidgets('Remove user gesture driven flights when the gesture is invalid', (WidgetTester tester) async { transitionFromUserGestures = true; await tester.pumpWidget(MaterialApp( routes: routes, @@ -2594,7 +2594,7 @@ Future<void> main() async { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); // Regression test for https://github.com/flutter/flutter/issues/40239. - testWidgetsWithLeakTracking( + testWidgets( 'In a pop transition, when fromHero is null, the to hero should eventually become visible', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey(); @@ -2643,7 +2643,7 @@ Future<void> main() async { }, ); - testWidgetsWithLeakTracking('popped hero uses fastOutSlowIn curve', (WidgetTester tester) async { + testWidgets('popped hero uses fastOutSlowIn curve', (WidgetTester tester) async { final Key container1 = UniqueKey(); final Key container2 = UniqueKey(); final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); @@ -2721,7 +2721,7 @@ Future<void> main() async { expect(heroSize, tween.transform(1.0)); }); - testWidgetsWithLeakTracking('Heroes in enabled HeroMode do transition', (WidgetTester tester) async { + testWidgets('Heroes in enabled HeroMode do transition', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Column( @@ -2792,7 +2792,7 @@ Future<void> main() async { expect(find.byKey(secondKey), isInCard); }); - testWidgetsWithLeakTracking('Heroes in disabled HeroMode do not transition', (WidgetTester tester) async { + testWidgets('Heroes in disabled HeroMode do not transition', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Column( @@ -2870,7 +2870,7 @@ Future<void> main() async { expect(find.byKey(secondKey), isOnstage); }); - testWidgetsWithLeakTracking('kept alive Hero does not throw when the transition begins', (WidgetTester tester) async { + testWidgets('kept alive Hero does not throw when the transition begins', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( @@ -2923,7 +2923,7 @@ Future<void> main() async { expect(find.byType(Placeholder), findsOneWidget); }); - testWidgetsWithLeakTracking('toHero becomes unpaintable after the transition begins', (WidgetTester tester) async { + testWidgets('toHero becomes unpaintable after the transition begins', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -2999,7 +2999,7 @@ Future<void> main() async { expect(find.byType(Placeholder), findsNothing); }); - testWidgetsWithLeakTracking('diverting to a keepalive but unpaintable hero', (WidgetTester tester) async { + testWidgets('diverting to a keepalive but unpaintable hero', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( @@ -3079,7 +3079,7 @@ Future<void> main() async { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('smooth transition between different incoming data', (WidgetTester tester) async { + testWidgets('smooth transition between different incoming data', (WidgetTester tester) async { addTearDown(tester.view.reset); final GlobalKey<NavigatorState> navigatorKey = GlobalKey(); diff --git a/packages/flutter/test/widgets/hit_testing_test.dart b/packages/flutter/test/widgets/hit_testing_test.dart index 39ff67cca89..bd4cd9377a9 100644 --- a/packages/flutter/test/widgets/hit_testing_test.dart +++ b/packages/flutter/test/widgets/hit_testing_test.dart @@ -6,17 +6,16 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('toString control test', (WidgetTester tester) async { + testWidgets('toString control test', (WidgetTester tester) async { await tester.pumpWidget(const Center(child: Text('Hello', textDirection: TextDirection.ltr))); final HitTestResult result = tester.hitTestOnBinding(Offset.zero); expect(result, hasOneLineDescription); expect(result.path.first, hasOneLineDescription); }); - testWidgetsWithLeakTracking('A mouse click should only cause one hit test', (WidgetTester tester) async { + testWidgets('A mouse click should only cause one hit test', (WidgetTester tester) async { int hitCount = 0; await tester.pumpWidget( _HitTestCounter( @@ -32,7 +31,7 @@ void main() { expect(hitCount, 1); }); - testWidgetsWithLeakTracking('Non-mouse events should not cause movement hit tests', (WidgetTester tester) async { + testWidgets('Non-mouse events should not cause movement hit tests', (WidgetTester tester) async { int hitCount = 0; await tester.pumpWidget( _HitTestCounter( diff --git a/packages/flutter/test/widgets/html_element_view_test.dart b/packages/flutter/test/widgets/html_element_view_test.dart index 58961ab7633..dd8866e9faa 100644 --- a/packages/flutter/test/widgets/html_element_view_test.dart +++ b/packages/flutter/test/widgets/html_element_view_test.dart @@ -15,7 +15,6 @@ import 'package:flutter/src/widgets/_html_element_view_web.dart' show debugOverridePlatformViewRegistry; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:web/web.dart' as web; final Object _mockHtmlElement = Object(); @@ -43,7 +42,7 @@ void main() { }); group('HtmlElementView', () { - testWidgetsWithLeakTracking('Create HTML view', (WidgetTester tester) async { + testWidgets('Create HTML view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); @@ -65,7 +64,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Create HTML view with PlatformViewCreatedCallback', (WidgetTester tester) async { + testWidgets('Create HTML view with PlatformViewCreatedCallback', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); @@ -98,7 +97,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Create HTML view with creation params', (WidgetTester tester) async { + testWidgets('Create HTML view with creation params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); await tester.pumpWidget( @@ -133,7 +132,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Resize HTML view', (WidgetTester tester) async { + testWidgets('Resize HTML view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); await tester.pumpWidget( @@ -169,7 +168,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Change HTML view type', (WidgetTester tester) async { + testWidgets('Change HTML view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); fakePlatformViewRegistry.registerViewFactory('maps', _mockViewFactory); @@ -201,7 +200,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dispose HTML view', (WidgetTester tester) async { + testWidgets('Dispose HTML view', (WidgetTester tester) async { fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); await tester.pumpWidget( const Center( @@ -228,7 +227,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('HTML view survives widget tree change', (WidgetTester tester) async { + testWidgets('HTML view survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); fakePlatformViewRegistry.registerViewFactory('webview', _mockViewFactory); final GlobalKey key = GlobalKey(); @@ -260,7 +259,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('HtmlElementView has correct semantics', (WidgetTester tester) async { + testWidgets('HtmlElementView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); @@ -307,7 +306,7 @@ void main() { debugOverridePlatformViewRegistry = null; }); - testWidgetsWithLeakTracking('Create platform view from tagName', (WidgetTester tester) async { + testWidgets('Create platform view from tagName', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); await tester.pumpWidget( @@ -332,7 +331,7 @@ void main() { expect(htmlElement.tagName, equalsIgnoringCase('div')); }); - testWidgetsWithLeakTracking('Create invisible platform view', (WidgetTester tester) async { + testWidgets('Create invisible platform view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); await tester.pumpWidget( @@ -358,7 +357,7 @@ void main() { expect(htmlElement.tagName, equalsIgnoringCase('script')); }); - testWidgetsWithLeakTracking('onElementCreated', (WidgetTester tester) async { + testWidgets('onElementCreated', (WidgetTester tester) async { final List<Object> createdElements = <Object>[]; void onElementCreated(Object element) { createdElements.add(element); diff --git a/packages/flutter/test/widgets/hyperlink_test.dart b/packages/flutter/test/widgets/hyperlink_test.dart index 6a70dfaffd9..5505df3c1c6 100644 --- a/packages/flutter/test/widgets/hyperlink_test.dart +++ b/packages/flutter/test/widgets/hyperlink_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can tap a hyperlink', (WidgetTester tester) async { + testWidgets('Can tap a hyperlink', (WidgetTester tester) async { bool didTapLeft = false; final TapGestureRecognizer tapLeft = TapGestureRecognizer() ..onTap = () { diff --git a/packages/flutter/test/widgets/icon_test.dart b/packages/flutter/test/widgets/icon_test.dart index d9e140996a6..79f77e3365a 100644 --- a/packages/flutter/test/widgets/icon_test.dart +++ b/packages/flutter/test/widgets/icon_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Can set opacity for an Icon', (WidgetTester tester) async { + testWidgets('Can set opacity for an Icon', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -26,7 +25,7 @@ void main() { expect(text.text.style!.color, const Color(0xFF666666).withOpacity(0.5)); }); - testWidgetsWithLeakTracking('Icon sizing - no theme, default size', (WidgetTester tester) async { + testWidgets('Icon sizing - no theme, default size', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -40,7 +39,7 @@ void main() { expect(renderObject.size, equals(const Size.square(24.0))); }); - testWidgetsWithLeakTracking('Icon sizing - no theme, explicit size', (WidgetTester tester) async { + testWidgets('Icon sizing - no theme, explicit size', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -57,7 +56,7 @@ void main() { expect(renderObject.size, equals(const Size.square(96.0))); }); - testWidgetsWithLeakTracking('Icon sizing - sized theme', (WidgetTester tester) async { + testWidgets('Icon sizing - sized theme', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -74,7 +73,7 @@ void main() { expect(renderObject.size, equals(const Size.square(36.0))); }); - testWidgetsWithLeakTracking('Icon sizing - sized theme, explicit size', (WidgetTester tester) async { + testWidgets('Icon sizing - sized theme, explicit size', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -94,7 +93,7 @@ void main() { expect(renderObject.size, equals(const Size.square(48.0))); }); - testWidgetsWithLeakTracking('Icon sizing - sizeless theme, default size', (WidgetTester tester) async { + testWidgets('Icon sizing - sizeless theme, default size', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -111,7 +110,7 @@ void main() { expect(renderObject.size, equals(const Size.square(24.0))); }); - testWidgetsWithLeakTracking('Icon sizing - no theme, default size, considering text scaler', (WidgetTester tester) async { + testWidgets('Icon sizing - no theme, default size, considering text scaler', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData( @@ -133,7 +132,7 @@ void main() { expect(renderObject.size, equals(const Size.square(48.0))); }); - testWidgetsWithLeakTracking('Icon sizing - no theme, explicit size, considering text scaler', (WidgetTester tester) async { + testWidgets('Icon sizing - no theme, explicit size, considering text scaler', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData( @@ -156,7 +155,7 @@ void main() { expect(renderObject.size, equals(const Size.square(192.0))); }); - testWidgetsWithLeakTracking('Icon sizing - sized theme, considering text scaler', (WidgetTester tester) async { + testWidgets('Icon sizing - sized theme, considering text scaler', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData( @@ -181,7 +180,7 @@ void main() { expect(renderObject.size, equals(const Size.square(72.0))); }); - testWidgetsWithLeakTracking('Icon sizing - sized theme, explicit size, considering text scale', (WidgetTester tester) async { + testWidgets('Icon sizing - sized theme, explicit size, considering text scale', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData( @@ -210,7 +209,7 @@ void main() { expect(renderObject.size, equals(const Size.square(48.0))); }); - testWidgetsWithLeakTracking('Icon sizing - sizeless theme, default size, default consideration for text scaler', (WidgetTester tester) async { + testWidgets('Icon sizing - sizeless theme, default size, default consideration for text scaler', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData( @@ -232,7 +231,7 @@ void main() { expect(renderObject.size, equals(const Size.square(24.0))); }); - testWidgetsWithLeakTracking('Icon with custom font', (WidgetTester tester) async { + testWidgets('Icon with custom font', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -246,7 +245,7 @@ void main() { expect(richText.text.style!.fontFamily, equals('Roboto')); }); - testWidgetsWithLeakTracking("Icon's TextStyle makes sure the font body is vertically center-aligned", (WidgetTester tester) async { + testWidgets("Icon's TextStyle makes sure the font body is vertically center-aligned", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/138592. await tester.pumpWidget( const Directionality( @@ -262,7 +261,7 @@ void main() { expect(richText.text.style?.leadingDistribution, TextLeadingDistribution.even); }); - testWidgetsWithLeakTracking('Icon with custom fontFamilyFallback', (WidgetTester tester) async { + testWidgets('Icon with custom fontFamilyFallback', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -276,7 +275,7 @@ void main() { expect(richText.text.style!.fontFamilyFallback, equals(<String>['FallbackFont'])); }); - testWidgetsWithLeakTracking('Icon with semantic label', (WidgetTester tester) async { + testWidgets('Icon with semantic label', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -296,7 +295,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Null icon with semantic label', (WidgetTester tester) async { + testWidgets('Null icon with semantic label', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -316,7 +315,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking("Changing semantic label from null doesn't rebuild tree ", (WidgetTester tester) async { + testWidgets("Changing semantic label from null doesn't rebuild tree ", (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -347,7 +346,7 @@ void main() { expect(richText2, same(richText1)); }); - testWidgetsWithLeakTracking('IconData comparison', (WidgetTester tester) async { + testWidgets('IconData comparison', (WidgetTester tester) async { expect(const IconData(123), const IconData(123)); expect(const IconData(123), isNot(const IconData(123, matchTextDirection: true))); expect(const IconData(123), isNot(const IconData(123, fontFamily: 'f'))); @@ -360,7 +359,7 @@ void main() { }); - testWidgetsWithLeakTracking('Fill, weight, grade, and optical size variations are passed', (WidgetTester tester) async { + testWidgets('Fill, weight, grade, and optical size variations are passed', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -393,7 +392,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Fill, weight, grade, and optical size can be set at the theme-level', (WidgetTester tester) async { + testWidgets('Fill, weight, grade, and optical size can be set at the theme-level', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -418,7 +417,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Theme-level fill, weight, grade, and optical size can be overridden', (WidgetTester tester) async { + testWidgets('Theme-level fill, weight, grade, and optical size can be overridden', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/image_filter_quality_test.dart b/packages/flutter/test/widgets/image_filter_quality_test.dart index 5025b25e186..dcbeadfd438 100644 --- a/packages/flutter/test/widgets/image_filter_quality_test.dart +++ b/packages/flutter/test/widgets/image_filter_quality_test.dart @@ -13,18 +13,17 @@ import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Image at default filterQuality', (WidgetTester tester) async { + testWidgets('Image at default filterQuality', (WidgetTester tester) async { await testImageQuality(tester, null); }); - testWidgetsWithLeakTracking('Image at high filterQuality', (WidgetTester tester) async { + testWidgets('Image at high filterQuality', (WidgetTester tester) async { await testImageQuality(tester, ui.FilterQuality.high); }); - testWidgetsWithLeakTracking('Image at none filterQuality', (WidgetTester tester) async { + testWidgets('Image at none filterQuality', (WidgetTester tester) async { await testImageQuality(tester, ui.FilterQuality.none); }); } diff --git a/packages/flutter/test/widgets/image_filter_test.dart b/packages/flutter/test/widgets/image_filter_test.dart index 0cad97b4c46..29da67bae4d 100644 --- a/packages/flutter/test/widgets/image_filter_test.dart +++ b/packages/flutter/test/widgets/image_filter_test.dart @@ -14,10 +14,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Image filter - blur', (WidgetTester tester) async { + testWidgets('Image filter - blur', (WidgetTester tester) async { await tester.pumpWidget( RepaintBoundary( child: ImageFiltered( @@ -32,7 +31,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Image filter - blur with offset', (WidgetTester tester) async { + testWidgets('Image filter - blur with offset', (WidgetTester tester) async { final Key key = GlobalKey(); await tester.pumpWidget( RepaintBoundary( @@ -52,7 +51,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Image filter - dilate', (WidgetTester tester) async { + testWidgets('Image filter - dilate', (WidgetTester tester) async { await tester.pumpWidget( RepaintBoundary( child: ImageFiltered( @@ -67,7 +66,7 @@ void main() { ); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/101874 - testWidgetsWithLeakTracking('Image filter - erode', (WidgetTester tester) async { + testWidgets('Image filter - erode', (WidgetTester tester) async { await tester.pumpWidget( RepaintBoundary( child: ImageFiltered( @@ -83,7 +82,7 @@ void main() { ); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/101874 - testWidgetsWithLeakTracking('Image filter - matrix', (WidgetTester tester) async { + testWidgets('Image filter - matrix', (WidgetTester tester) async { final ImageFilter matrix = ImageFilter.matrix(Float64List.fromList(<double>[ 0.5, 0.0, 0.0, 0.0, // 0.0, 0.5, 0.0, 0.0, // @@ -120,7 +119,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Image filter - matrix with offset', (WidgetTester tester) async { + testWidgets('Image filter - matrix with offset', (WidgetTester tester) async { final Matrix4 matrix = Matrix4.rotationZ(pi / 18); final ImageFilter matrixFilter = ImageFilter.matrix(matrix.storage); final Key key = GlobalKey(); @@ -158,7 +157,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Image filter - reuses its layer', (WidgetTester tester) async { + testWidgets('Image filter - reuses its layer', (WidgetTester tester) async { Future<void> pumpWithSigma(double sigma) async { await tester.pumpWidget( RepaintBoundary( @@ -179,7 +178,7 @@ void main() { expect(renderObject.debugLayer, same(originalLayer)); }); - testWidgetsWithLeakTracking('Image filter - enabled and disabled', (WidgetTester tester) async { + testWidgets('Image filter - enabled and disabled', (WidgetTester tester) async { Future<void> pumpWithEnabledState(bool enabled) async { await tester.pumpWidget( RepaintBoundary( diff --git a/packages/flutter/test/widgets/image_headers_test.dart b/packages/flutter/test/widgets/image_headers_test.dart index 2d833f49e02..f00f00fcdae 100644 --- a/packages/flutter/test/widgets/image_headers_test.dart +++ b/packages/flutter/test/widgets/image_headers_test.dart @@ -7,14 +7,13 @@ import 'dart:io'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; void main() { final MockHttpClient client = MockHttpClient(); - testWidgetsWithLeakTracking('Headers', (WidgetTester tester) async { + testWidgets('Headers', (WidgetTester tester) async { HttpOverrides.runZoned<Future<void>>(() async { await tester.pumpWidget(Image.network( 'https://www.example.com/images/frame.png', diff --git a/packages/flutter/test/widgets/image_icon_test.dart b/packages/flutter/test/widgets/image_icon_test.dart index 2aa1d732903..0d4709406a9 100644 --- a/packages/flutter/test/widgets/image_icon_test.dart +++ b/packages/flutter/test/widgets/image_icon_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../painting/mocks_for_image_cache.dart'; @@ -21,7 +20,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ImageIcon sizing - no theme, default size', (WidgetTester tester) async { + testWidgets('ImageIcon sizing - no theme, default size', (WidgetTester tester) async { await tester.pumpWidget( Center( child: ImageIcon(image), @@ -33,7 +32,7 @@ void main() { expect(find.byType(Image), findsOneWidget); }); - testWidgetsWithLeakTracking('Icon opacity', (WidgetTester tester) async { + testWidgets('Icon opacity', (WidgetTester tester) async { await tester.pumpWidget( Center( child: IconTheme( @@ -46,7 +45,7 @@ void main() { expect(tester.widget<Image>(find.byType(Image)).color!.alpha, equals(128)); }); - testWidgetsWithLeakTracking('ImageIcon sizing - no theme, explicit size', (WidgetTester tester) async { + testWidgets('ImageIcon sizing - no theme, explicit size', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: ImageIcon( @@ -60,7 +59,7 @@ void main() { expect(renderObject.size, equals(const Size.square(96.0))); }); - testWidgetsWithLeakTracking('ImageIcon sizing - sized theme', (WidgetTester tester) async { + testWidgets('ImageIcon sizing - sized theme', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: IconTheme( @@ -74,7 +73,7 @@ void main() { expect(renderObject.size, equals(const Size.square(36.0))); }); - testWidgetsWithLeakTracking('ImageIcon sizing - sized theme, explicit size', (WidgetTester tester) async { + testWidgets('ImageIcon sizing - sized theme, explicit size', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: IconTheme( @@ -91,7 +90,7 @@ void main() { expect(renderObject.size, equals(const Size.square(48.0))); }); - testWidgetsWithLeakTracking('ImageIcon sizing - sizeless theme, default size', (WidgetTester tester) async { + testWidgets('ImageIcon sizing - sizeless theme, default size', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: IconTheme( @@ -105,7 +104,7 @@ void main() { expect(renderObject.size, equals(const Size.square(24.0))); }); - testWidgetsWithLeakTracking('ImageIcon has semantics data', (WidgetTester tester) async { + testWidgets('ImageIcon has semantics data', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( const Directionality( diff --git a/packages/flutter/test/widgets/image_resolution_test.dart b/packages/flutter/test/widgets/image_resolution_test.dart index afacf9ae922..44cbd04fe46 100644 --- a/packages/flutter/test/widgets/image_resolution_test.dart +++ b/packages/flutter/test/widgets/image_resolution_test.dart @@ -13,7 +13,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; @@ -170,7 +169,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Image for device pixel ratio 1.0', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 1.0', (WidgetTester tester) async { const double ratio = 1.0; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -182,7 +181,7 @@ void main() { expect(getRenderImage(tester, key).scale, 1.0); }); - testWidgetsWithLeakTracking('Image for device pixel ratio 0.5', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 0.5', (WidgetTester tester) async { const double ratio = 0.5; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -194,7 +193,7 @@ void main() { expect(getRenderImage(tester, key).scale, 1.0); }); - testWidgetsWithLeakTracking('Image for device pixel ratio 1.5', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 1.5', (WidgetTester tester) async { const double ratio = 1.5; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -209,7 +208,7 @@ void main() { // A 1.75 DPR screen is typically a low-resolution screen, such that physical // pixels are visible to the user. For such screens we prefer to pick the // higher resolution image, if available. - testWidgetsWithLeakTracking('Image for device pixel ratio 1.75', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 1.75', (WidgetTester tester) async { const double ratio = 1.75; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -221,7 +220,7 @@ void main() { expect(getRenderImage(tester, key).scale, 2.0); }); - testWidgetsWithLeakTracking('Image for device pixel ratio 2.3', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 2.3', (WidgetTester tester) async { const double ratio = 2.3; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -233,7 +232,7 @@ void main() { expect(getRenderImage(tester, key).scale, 2.0); }); - testWidgetsWithLeakTracking('Image for device pixel ratio 3.7', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 3.7', (WidgetTester tester) async { const double ratio = 3.7; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -245,7 +244,7 @@ void main() { expect(getRenderImage(tester, key).scale, 4.0); }); - testWidgetsWithLeakTracking('Image for device pixel ratio 5.1', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 5.1', (WidgetTester tester) async { const double ratio = 5.1; Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageAtRatio(image, key, ratio, false, images)); @@ -257,7 +256,7 @@ void main() { expect(getRenderImage(tester, key).scale, 4.0); }); - testWidgetsWithLeakTracking('Image for device pixel ratio 1.0, with a main asset and a 1.0x asset', (WidgetTester tester) async { + testWidgets('Image for device pixel ratio 1.0, with a main asset and a 1.0x asset', (WidgetTester tester) async { // If both a main asset and a 1.0x asset are specified, then prefer // the 1.0x asset. @@ -287,19 +286,19 @@ void main() { expect(getRenderImage(tester, key).image!.height, 480); }); - testWidgetsWithLeakTracking('Image cache resize upscale display 5', (WidgetTester tester) async { + testWidgets('Image cache resize upscale display 5', (WidgetTester tester) async { final Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageCacheResized(image, key, 5, 5, 20, 20)); expect(getRenderImage(tester, key).size, const Size(5.0, 5.0)); }); - testWidgetsWithLeakTracking('Image cache resize upscale display 50', (WidgetTester tester) async { + testWidgets('Image cache resize upscale display 50', (WidgetTester tester) async { final Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageCacheResized(image, key, 50, 50, 20, 20)); expect(getRenderImage(tester, key).size, const Size(50.0, 50.0)); }); - testWidgetsWithLeakTracking('Image cache resize downscale display 5', (WidgetTester tester) async { + testWidgets('Image cache resize downscale display 5', (WidgetTester tester) async { final Key key = GlobalKey(); await pumpTreeToLayout(tester, buildImageCacheResized(image, key, 5, 5, 1, 1)); expect(getRenderImage(tester, key).size, const Size(5.0, 5.0)); @@ -309,7 +308,7 @@ void main() { // visible physical pixel size (see the test for 1.75 DPR above). However, // if higher resolution assets are not available we will pick the best // available. - testWidgetsWithLeakTracking('Low-resolution assets', (WidgetTester tester) async { + testWidgets('Low-resolution assets', (WidgetTester tester) async { const Map<Object?, Object?> manifest = <Object?, Object?>{ 'assets/image.png': <Map<String, Object>>[ <String, Object>{'asset': 'assets/image.png'}, diff --git a/packages/flutter/test/widgets/image_rtl_test.dart b/packages/flutter/test/widgets/image_rtl_test.dart index 905ba88d4aa..d85267850b2 100644 --- a/packages/flutter/test/widgets/image_rtl_test.dart +++ b/packages/flutter/test/widgets/image_rtl_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' as ui show Image; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestImageProvider extends ImageProvider<TestImageProvider> { const TestImageProvider(this.image); @@ -38,7 +37,7 @@ void main() { testImage.dispose(); }); - testWidgetsWithLeakTracking('DecorationImage RTL with alignment topEnd and match', (WidgetTester tester) async { + testWidgets('DecorationImage RTL with alignment topEnd and match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -77,7 +76,7 @@ void main() { expect(find.byType(Container), isNot(paints..scale()..scale())); }); - testWidgetsWithLeakTracking('DecorationImage LTR with alignment topEnd (and pointless match)', (WidgetTester tester) async { + testWidgets('DecorationImage LTR with alignment topEnd (and pointless match)', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -113,7 +112,7 @@ void main() { expect(find.byType(Container), isNot(paints..scale())); }); - testWidgetsWithLeakTracking('DecorationImage RTL with alignment topEnd', (WidgetTester tester) async { + testWidgets('DecorationImage RTL with alignment topEnd', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -148,7 +147,7 @@ void main() { expect(find.byType(Container), isNot(paints..scale())); }); - testWidgetsWithLeakTracking('DecorationImage LTR with alignment topEnd', (WidgetTester tester) async { + testWidgets('DecorationImage LTR with alignment topEnd', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -183,7 +182,7 @@ void main() { expect(find.byType(Container), isNot(paints..scale())); }); - testWidgetsWithLeakTracking('DecorationImage RTL with alignment center-right and match', (WidgetTester tester) async { + testWidgets('DecorationImage RTL with alignment center-right and match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -215,7 +214,7 @@ void main() { expect(find.byType(Container), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('DecorationImage RTL with alignment center-right and no match', (WidgetTester tester) async { + testWidgets('DecorationImage RTL with alignment center-right and no match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -242,7 +241,7 @@ void main() { expect(find.byType(Container), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('DecorationImage LTR with alignment center-right and match', (WidgetTester tester) async { + testWidgets('DecorationImage LTR with alignment center-right and match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -270,7 +269,7 @@ void main() { expect(find.byType(Container), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('DecorationImage LTR with alignment center-right and no match', (WidgetTester tester) async { + testWidgets('DecorationImage LTR with alignment center-right and no match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -298,7 +297,7 @@ void main() { expect(find.byType(Container), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('Image RTL with alignment topEnd and match', (WidgetTester tester) async { + testWidgets('Image RTL with alignment topEnd and match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -335,7 +334,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..scale()..scale())); }); - testWidgetsWithLeakTracking('Image LTR with alignment topEnd (and pointless match)', (WidgetTester tester) async { + testWidgets('Image LTR with alignment topEnd (and pointless match)', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -369,7 +368,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..scale())); }); - testWidgetsWithLeakTracking('Image RTL with alignment topEnd', (WidgetTester tester) async { + testWidgets('Image RTL with alignment topEnd', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -402,7 +401,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..scale())); }); - testWidgetsWithLeakTracking('Image LTR with alignment topEnd', (WidgetTester tester) async { + testWidgets('Image LTR with alignment topEnd', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -435,7 +434,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..scale())); }); - testWidgetsWithLeakTracking('Image RTL with alignment center-right and match', (WidgetTester tester) async { + testWidgets('Image RTL with alignment center-right and match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -463,7 +462,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('Image RTL with alignment center-right and no match', (WidgetTester tester) async { + testWidgets('Image RTL with alignment center-right and no match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -488,7 +487,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('Image LTR with alignment center-right and match', (WidgetTester tester) async { + testWidgets('Image LTR with alignment center-right and match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -514,7 +513,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('Image LTR with alignment center-right and no match', (WidgetTester tester) async { + testWidgets('Image LTR with alignment center-right and no match', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -540,7 +539,7 @@ void main() { expect(find.byType(SizedBox), isNot(paints..drawImageRect()..drawImageRect())); }); - testWidgetsWithLeakTracking('Image - Switch needing direction', (WidgetTester tester) async { + testWidgets('Image - Switch needing direction', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/implicit_animations_test.dart b/packages/flutter/test/widgets/implicit_animations_test.dart index d71b942d23d..2815289802b 100644 --- a/packages/flutter/test/widgets/implicit_animations_test.dart +++ b/packages/flutter/test/widgets/implicit_animations_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class MockOnEndFunction { int called = 0; @@ -25,7 +24,7 @@ void main() { mockOnEndFunction = MockOnEndFunction(); }); - testWidgetsWithLeakTracking('BoxConstraintsTween control test', (WidgetTester tester) async { + testWidgets('BoxConstraintsTween control test', (WidgetTester tester) async { final BoxConstraintsTween tween = BoxConstraintsTween( begin: BoxConstraints.tight(const Size(20.0, 50.0)), end: BoxConstraints.tight(const Size(10.0, 30.0)), @@ -37,7 +36,7 @@ void main() { expect(result.maxHeight, 45.0); }); - testWidgetsWithLeakTracking('DecorationTween control test', (WidgetTester tester) async { + testWidgets('DecorationTween control test', (WidgetTester tester) async { final DecorationTween tween = DecorationTween( begin: const BoxDecoration(color: Color(0xFF00FF00)), end: const BoxDecoration(color: Color(0xFFFFFF00)), @@ -46,7 +45,7 @@ void main() { expect(result.color, const Color(0xFF3FFF00)); }); - testWidgetsWithLeakTracking('EdgeInsetsTween control test', (WidgetTester tester) async { + testWidgets('EdgeInsetsTween control test', (WidgetTester tester) async { final EdgeInsetsTween tween = EdgeInsetsTween( begin: const EdgeInsets.symmetric(vertical: 50.0), end: const EdgeInsets.only(top: 10.0, bottom: 30.0), @@ -58,7 +57,7 @@ void main() { expect(result.bottom, 45.0); }); - testWidgetsWithLeakTracking('Matrix4Tween control test', (WidgetTester tester) async { + testWidgets('Matrix4Tween control test', (WidgetTester tester) async { final Matrix4Tween tween = Matrix4Tween( begin: Matrix4.translationValues(10.0, 20.0, 30.0), end: Matrix4.translationValues(14.0, 24.0, 34.0), @@ -67,7 +66,7 @@ void main() { expect(result, equals(Matrix4.translationValues(11.0, 21.0, 31.0))); }); - testWidgetsWithLeakTracking('AnimatedContainer onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedContainer onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -90,7 +89,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedPadding onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedPadding onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -113,7 +112,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedAlign onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedAlign onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -136,7 +135,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedPositioned onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedPositioned onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -159,7 +158,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedPositionedDirectional onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedPositionedDirectional onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -182,7 +181,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedSlide onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedSlide onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -204,7 +203,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedSlide transition test', (WidgetTester tester) async { + testWidgets('AnimatedSlide transition test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( switchKey: switchKey, @@ -242,7 +241,7 @@ void main() { expect(state.builds, equals(2)); }); - testWidgetsWithLeakTracking('AnimatedScale onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedScale onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -264,7 +263,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedScale transition test', (WidgetTester tester) async { + testWidgets('AnimatedScale transition test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( switchKey: switchKey, @@ -302,7 +301,7 @@ void main() { expect(state.builds, equals(2)); }); - testWidgetsWithLeakTracking('AnimatedRotation onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedRotation onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -324,7 +323,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedRotation transition test', (WidgetTester tester) async { + testWidgets('AnimatedRotation transition test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( switchKey: switchKey, @@ -362,7 +361,7 @@ void main() { expect(state.builds, equals(2)); }); - testWidgetsWithLeakTracking('AnimatedOpacity onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedOpacity onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -384,7 +383,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedOpacity transition test', (WidgetTester tester) async { + testWidgets('AnimatedOpacity transition test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( switchKey: switchKey, @@ -422,7 +421,7 @@ void main() { expect(state.builds, equals(2)); }); - testWidgetsWithLeakTracking('AnimatedFractionallySizedBox onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedFractionallySizedBox onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -444,7 +443,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('SliverAnimatedOpacity onEnd callback test', (WidgetTester tester) async { + testWidgets('SliverAnimatedOpacity onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(TestAnimatedWidget( callback: mockOnEndFunction.handler, switchKey: switchKey, @@ -465,7 +464,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('SliverAnimatedOpacity transition test', (WidgetTester tester) async { + testWidgets('SliverAnimatedOpacity transition test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( switchKey: switchKey, @@ -503,7 +502,7 @@ void main() { expect(state.builds, equals(2)); }); - testWidgetsWithLeakTracking('AnimatedDefaultTextStyle onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedDefaultTextStyle onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -526,7 +525,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedPhysicalModel onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedPhysicalModel onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -549,7 +548,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('TweenAnimationBuilder onEnd callback test', (WidgetTester tester) async { + testWidgets('TweenAnimationBuilder onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -572,7 +571,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('AnimatedTheme onEnd callback test', (WidgetTester tester) async { + testWidgets('AnimatedTheme onEnd callback test', (WidgetTester tester) async { await tester.pumpWidget(wrap( child: TestAnimatedWidget( callback: mockOnEndFunction.handler, @@ -595,7 +594,7 @@ void main() { await tapTest2and3(tester, widgetFinder, mockOnEndFunction); }); - testWidgetsWithLeakTracking('Ensure CurvedAnimations are disposed on widget change', + testWidgets('Ensure CurvedAnimations are disposed on widget change', (WidgetTester tester) async { final GlobalKey<ImplicitlyAnimatedWidgetState<AnimatedOpacity>> key = GlobalKey<ImplicitlyAnimatedWidgetState<AnimatedOpacity>>(); diff --git a/packages/flutter/test/widgets/implicit_semantics_test.dart b/packages/flutter/test/widgets/implicit_semantics_test.dart index 41d6ac7e21f..42ef7922353 100644 --- a/packages/flutter/test/widgets/implicit_semantics_test.dart +++ b/packages/flutter/test/widgets/implicit_semantics_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Implicit Semantics merge behavior', (WidgetTester tester) async { + testWidgets('Implicit Semantics merge behavior', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -173,7 +172,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Do not merge with conflicts', (WidgetTester tester) async { + testWidgets('Do not merge with conflicts', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/inherited_dependencies_test.dart b/packages/flutter/test/widgets/inherited_dependencies_test.dart index 22840f52892..2ed743e47cc 100644 --- a/packages/flutter/test/widgets/inherited_dependencies_test.dart +++ b/packages/flutter/test/widgets/inherited_dependencies_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/src/widgets/basic.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('InheritedWidget dependencies show up in diagnostic properties', (WidgetTester tester) async { + testWidgets('InheritedWidget dependencies show up in diagnostic properties', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(Directionality( key: key, diff --git a/packages/flutter/test/widgets/inherited_model_test.dart b/packages/flutter/test/widgets/inherited_model_test.dart index b1ae5ef2f69..6753361cb42 100644 --- a/packages/flutter/test/widgets/inherited_model_test.dart +++ b/packages/flutter/test/widgets/inherited_model_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // A simple "flat" InheritedModel: the data model is just 3 integer // valued fields: a, b, c. @@ -74,7 +73,7 @@ class _ShowABCFieldState extends State<ShowABCField> { } void main() { - testWidgetsWithLeakTracking('InheritedModel basics', (WidgetTester tester) async { + testWidgets('InheritedModel basics', (WidgetTester tester) async { int a = 0; int b = 1; int c = 2; @@ -190,7 +189,7 @@ void main() { expect(find.text('a: 2 b: 2 c: 3'), findsOneWidget); }); - testWidgetsWithLeakTracking('Looking up an non existent InheritedModel ancestor returns null', (WidgetTester tester) async { + testWidgets('Looking up an non existent InheritedModel ancestor returns null', (WidgetTester tester) async { ABCModel? inheritedModel; await tester.pumpWidget( @@ -206,7 +205,7 @@ void main() { expect(inheritedModel, null); }); - testWidgetsWithLeakTracking('Inner InheritedModel shadows the outer one', (WidgetTester tester) async { + testWidgets('Inner InheritedModel shadows the outer one', (WidgetTester tester) async { int a = 0; int b = 1; int c = 2; @@ -324,7 +323,7 @@ void main() { expect(find.text('a: 102 b: 102 c: null'), findsOneWidget); }); - testWidgetsWithLeakTracking('InheritedModel inner models supported aspect change', (WidgetTester tester) async { + testWidgets('InheritedModel inner models supported aspect change', (WidgetTester tester) async { int a = 0; int b = 1; int c = 2; diff --git a/packages/flutter/test/widgets/inherited_test.dart b/packages/flutter/test/widgets/inherited_test.dart index 478ed93d419..f7a86c76499 100644 --- a/packages/flutter/test/widgets/inherited_test.dart +++ b/packages/flutter/test/widgets/inherited_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; @@ -56,7 +55,7 @@ class ChangeNotifierInherited extends InheritedNotifier<ChangeNotifier> { } void main() { - testWidgetsWithLeakTracking('Inherited notifies dependents', (WidgetTester tester) async { + testWidgets('Inherited notifies dependents', (WidgetTester tester) async { final List<TestInherited> log = <TestInherited>[]; final Builder builder = Builder( @@ -82,7 +81,7 @@ void main() { expect(log, equals(<TestInherited>[first, third])); }); - testWidgetsWithLeakTracking('Update inherited when reparenting state', (WidgetTester tester) async { + testWidgets('Update inherited when reparenting state', (WidgetTester tester) async { final GlobalKey globalKey = GlobalKey(); final List<TestInherited> log = <TestInherited>[]; @@ -112,7 +111,7 @@ void main() { expect(log, equals(<TestInherited>[first, second])); }); - testWidgetsWithLeakTracking('Update inherited when removing node', (WidgetTester tester) async { + testWidgets('Update inherited when removing node', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -167,7 +166,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('Update inherited when removing node and child has global key', (WidgetTester tester) async { + testWidgets('Update inherited when removing node and child has global key', (WidgetTester tester) async { final List<String> log = <String>[]; @@ -231,7 +230,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('Update inherited when removing node and child has global key with constant child', (WidgetTester tester) async { + testWidgets('Update inherited when removing node and child has global key with constant child', (WidgetTester tester) async { final List<int> log = <int>[]; final Key key = GlobalKey(); @@ -290,7 +289,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('Update inherited when removing node and child has global key with constant child, minimised', (WidgetTester tester) async { + testWidgets('Update inherited when removing node and child has global key with constant child, minimised', (WidgetTester tester) async { final List<int> log = <int>[]; @@ -337,7 +336,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('Inherited widget notifies descendants when descendant previously failed to find a match', (WidgetTester tester) async { + testWidgets('Inherited widget notifies descendants when descendant previously failed to find a match', (WidgetTester tester) async { int? inheritedValue = -1; final Widget inner = Container( @@ -366,7 +365,7 @@ void main() { expect(inheritedValue, equals(3)); }); - testWidgetsWithLeakTracking("Inherited widget doesn't notify descendants when descendant did not previously fail to find a match and had no dependencies", (WidgetTester tester) async { + testWidgets("Inherited widget doesn't notify descendants when descendant did not previously fail to find a match and had no dependencies", (WidgetTester tester) async { int buildCount = 0; final Widget inner = Container( @@ -393,7 +392,7 @@ void main() { expect(buildCount, equals(1)); }); - testWidgetsWithLeakTracking('Inherited widget does notify descendants when descendant did not previously fail to find a match but did have other dependencies', (WidgetTester tester) async { + testWidgets('Inherited widget does notify descendants when descendant did not previously fail to find a match but did have other dependencies', (WidgetTester tester) async { int buildCount = 0; final Widget inner = Container( @@ -424,7 +423,7 @@ void main() { expect(buildCount, equals(2)); }); - testWidgetsWithLeakTracking("BuildContext.getInheritedWidgetOfExactType doesn't create a dependency", (WidgetTester tester) async { + testWidgets("BuildContext.getInheritedWidgetOfExactType doesn't create a dependency", (WidgetTester tester) async { int buildCount = 0; final GlobalKey<void> inheritedKey = GlobalKey(); final ChangeNotifier notifier = ChangeNotifier(); @@ -451,7 +450,7 @@ void main() { expect(buildCount, equals(1)); }); - testWidgetsWithLeakTracking('initState() dependency on Inherited asserts', (WidgetTester tester) async { + testWidgets('initState() dependency on Inherited asserts', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/5491 bool exceptionCaught = false; @@ -463,7 +462,7 @@ void main() { expect(exceptionCaught, isTrue); }); - testWidgetsWithLeakTracking('InheritedNotifier', (WidgetTester tester) async { + testWidgets('InheritedNotifier', (WidgetTester tester) async { int buildCount = 0; final ChangeNotifier notifier = ChangeNotifier(); addTearDown(notifier.dispose); diff --git a/packages/flutter/test/widgets/inherited_theme_test.dart b/packages/flutter/test/widgets/inherited_theme_test.dart index 6315cc4674a..1b677ac81af 100644 --- a/packages/flutter/test/widgets/inherited_theme_test.dart +++ b/packages/flutter/test/widgets/inherited_theme_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestRoute extends PageRouteBuilder<void> { TestRoute(Widget child) : super( @@ -27,7 +26,7 @@ class IconTextBox extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('InheritedTheme.captureAll()', (WidgetTester tester) async { + testWidgets('InheritedTheme.captureAll()', (WidgetTester tester) async { const double fontSize = 32; const double iconSize = 48; const Color textColor = Color(0xFF00FF00); @@ -147,7 +146,7 @@ void main() { expect(getIconStyle().fontSize, iconSize); }); - testWidgetsWithLeakTracking('InheritedTheme.captureAll() multiple IconTheme ancestors', (WidgetTester tester) async { + testWidgets('InheritedTheme.captureAll() multiple IconTheme ancestors', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/39087 const Color outerColor = Color(0xFF0000FF); @@ -207,7 +206,7 @@ void main() { expect(getIconStyle(icon2).fontSize, iconSize); }); - testWidgetsWithLeakTracking('InheritedTheme.captureAll() multiple DefaultTextStyle ancestors', (WidgetTester tester) async { + testWidgets('InheritedTheme.captureAll() multiple DefaultTextStyle ancestors', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/39087 const Color textColor = Color(0xFF00FF00); diff --git a/packages/flutter/test/widgets/init_state_test.dart b/packages/flutter/test/widgets/init_state_test.dart index 759f325d917..d6b74a256d3 100644 --- a/packages/flutter/test/widgets/init_state_test.dart +++ b/packages/flutter/test/widgets/init_state_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; List<String> ancestors = <String>[]; @@ -29,7 +28,7 @@ class TestWidgetState extends State<TestWidget> { } void main() { - testWidgetsWithLeakTracking('initState() is called when we are in the tree', (WidgetTester tester) async { + testWidgets('initState() is called when we are in the tree', (WidgetTester tester) async { await tester.pumpWidget(const Parent(child: TestWidget())); expect(ancestors, containsAllInOrder(<String>['Parent', 'View', 'RootWidget'])); }); diff --git a/packages/flutter/test/widgets/interactive_viewer_test.dart b/packages/flutter/test/widgets/interactive_viewer_test.dart index cf6be6a5998..f13a125df62 100644 --- a/packages/flutter/test/widgets/interactive_viewer_test.dart +++ b/packages/flutter/test/widgets/interactive_viewer_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:vector_math/vector_math_64.dart' show Matrix4, Quad, Vector3; import 'gesture_utils.dart'; @@ -25,7 +24,7 @@ void main() { transformationController.dispose(); }); - testWidgetsWithLeakTracking('child fits in viewport', (WidgetTester tester) async { + testWidgets('child fits in viewport', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -75,7 +74,7 @@ void main() { expect(transformationController.value, isNot(equals(Matrix4.identity()))); }); - testWidgetsWithLeakTracking('boundary slightly bigger than child', (WidgetTester tester) async { + testWidgets('boundary slightly bigger than child', (WidgetTester tester) async { const double boundaryMargin = 10.0; await tester.pumpWidget( MaterialApp( @@ -130,7 +129,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), 200.0 / 220.0); }); - testWidgetsWithLeakTracking('child bigger than viewport', (WidgetTester tester) async { + testWidgets('child bigger than viewport', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -205,7 +204,7 @@ void main() { expect(transformationController.value, isNot(equals(Matrix4.identity()))); }); - testWidgetsWithLeakTracking('child has no dimensions', (WidgetTester tester) async { + testWidgets('child has no dimensions', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -239,7 +238,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('no boundary', (WidgetTester tester) async { + testWidgets('no boundary', (WidgetTester tester) async { const double minScale = 0.8; await tester.pumpWidget( MaterialApp( @@ -294,7 +293,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), minScale); }); - testWidgetsWithLeakTracking('PanAxis.free allows panning in all directions for diagonal gesture', (WidgetTester tester) async { + testWidgets('PanAxis.free allows panning in all directions for diagonal gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -331,7 +330,7 @@ void main() { expect(translation.y, childOffset.dy - childInterior.dy); }); - testWidgetsWithLeakTracking('PanAxis.aligned allows panning in one direction only for diagonal gesture', (WidgetTester tester) async { + testWidgets('PanAxis.aligned allows panning in one direction only for diagonal gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -369,7 +368,7 @@ void main() { expect(translation.y, childOffset.dy - childInterior.dy); }); - testWidgetsWithLeakTracking('PanAxis.aligned allows panning in one direction only for horizontal leaning gesture', (WidgetTester tester) async { + testWidgets('PanAxis.aligned allows panning in one direction only for horizontal leaning gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -407,7 +406,7 @@ void main() { expect(translation.y, 0.0); }); - testWidgetsWithLeakTracking('PanAxis.horizontal allows panning in the horizontal direction only for diagonal gesture', (WidgetTester tester) async { + testWidgets('PanAxis.horizontal allows panning in the horizontal direction only for diagonal gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -445,7 +444,7 @@ void main() { expect(translation.y, 0.0); }); - testWidgetsWithLeakTracking('PanAxis.horizontal allows panning in the horizontal direction only for horizontal leaning gesture', (WidgetTester tester) async { + testWidgets('PanAxis.horizontal allows panning in the horizontal direction only for horizontal leaning gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -483,7 +482,7 @@ void main() { expect(translation.y, 0.0); }); - testWidgetsWithLeakTracking('PanAxis.horizontal does not allow panning in vertical direction on vertical gesture', (WidgetTester tester) async { + testWidgets('PanAxis.horizontal does not allow panning in vertical direction on vertical gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -521,7 +520,7 @@ void main() { expect(translation.y, 0.0); }); - testWidgetsWithLeakTracking('PanAxis.vertical allows panning in the vertical direction only for diagonal gesture', (WidgetTester tester) async { + testWidgets('PanAxis.vertical allows panning in the vertical direction only for diagonal gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -559,7 +558,7 @@ void main() { expect(translation.x, 0.0); }); - testWidgetsWithLeakTracking('PanAxis.vertical allows panning in the vertical direction only for vertical leaning gesture', (WidgetTester tester) async { + testWidgets('PanAxis.vertical allows panning in the vertical direction only for vertical leaning gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -597,7 +596,7 @@ void main() { expect(translation.x, 0.0); }); - testWidgetsWithLeakTracking('PanAxis.vertical does not allow panning in horizontal direction on vertical gesture', (WidgetTester tester) async { + testWidgets('PanAxis.vertical does not allow panning in horizontal direction on vertical gesture', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -635,7 +634,7 @@ void main() { expect(translation.y, 0.0); }); - testWidgetsWithLeakTracking('inertia fling and boundary sliding', (WidgetTester tester) async { + testWidgets('inertia fling and boundary sliding', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( @@ -693,7 +692,7 @@ void main() { expect(translation.y, moreOrLessEquals(boundaryMargin, epsilon: 1e-9)); }); - testWidgetsWithLeakTracking('Scaling automatically causes a centering translation', (WidgetTester tester) async { + testWidgets('Scaling automatically causes a centering translation', (WidgetTester tester) async { const double boundaryMargin = 50.0; const double minScale = 0.1; await tester.pumpWidget( @@ -777,7 +776,7 @@ void main() { expect(newSceneFocalPoint.dy, moreOrLessEquals(sceneFocalPoint.dy, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Scaling automatically causes a centering translation even when alignPanAxis is set', (WidgetTester tester) async { + testWidgets('Scaling automatically causes a centering translation even when alignPanAxis is set', (WidgetTester tester) async { const double boundaryMargin = 50.0; const double minScale = 0.1; await tester.pumpWidget( @@ -868,7 +867,7 @@ void main() { expect(newSceneFocalPoint.dy, moreOrLessEquals(sceneFocalPoint.dy, epsilon: 1.0)); }); - testWidgetsWithLeakTracking('Can scale with mouse', (WidgetTester tester) async { + testWidgets('Can scale with mouse', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -889,7 +888,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), greaterThan(1.0)); }); - testWidgetsWithLeakTracking('Cannot scale with mouse when scale is disabled', (WidgetTester tester) async { + testWidgets('Cannot scale with mouse when scale is disabled', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -911,7 +910,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), equals(1.0)); }); - testWidgetsWithLeakTracking('Scale with mouse returns onInteraction properties', (WidgetTester tester) async{ + testWidgets('Scale with mouse returns onInteraction properties', (WidgetTester tester) async{ late Offset focalPoint; late Offset localFocalPoint; late double scaleChange; @@ -962,7 +961,7 @@ void main() { expect(scenePoint, const Offset(100, 100)); }); - testWidgetsWithLeakTracking('Scaling amount is equal forth and back with a mouse scroll', (WidgetTester tester) async { + testWidgets('Scaling amount is equal forth and back with a mouse scroll', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -993,7 +992,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), 1.0); }); - testWidgetsWithLeakTracking('onInteraction can be used to get scene point', (WidgetTester tester) async{ + testWidgets('onInteraction can be used to get scene point', (WidgetTester tester) async{ late Offset focalPoint; late Offset localFocalPoint; late double scaleChange; @@ -1046,7 +1045,7 @@ void main() { expect(scenePoint.dy, greaterThan(0.0)); }); - testWidgetsWithLeakTracking('onInteraction is called even when disabled (touch)', (WidgetTester tester) async { + testWidgets('onInteraction is called even when disabled (touch)', (WidgetTester tester) async { bool calledStart = false; bool calledUpdate = false; bool calledEnd = false; @@ -1117,7 +1116,7 @@ void main() { expect(calledEnd, isTrue); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking('onInteraction is called even when disabled (mouse)', (WidgetTester tester) async { + testWidgets('onInteraction is called even when disabled (mouse)', (WidgetTester tester) async { bool calledStart = false; bool calledUpdate = false; bool calledEnd = false; @@ -1176,7 +1175,7 @@ void main() { expect(calledEnd, isTrue); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.linux, TargetPlatform.windows })); - testWidgetsWithLeakTracking('viewport changes size', (WidgetTester tester) async { + testWidgets('viewport changes size', (WidgetTester tester) async { addTearDown(tester.view.reset); await tester.pumpWidget( @@ -1225,7 +1224,7 @@ void main() { expect(transformationController.value, equals(Matrix4.identity())); }); - testWidgetsWithLeakTracking('gesture can start as pan and become scale', (WidgetTester tester) async { + testWidgets('gesture can start as pan and become scale', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( @@ -1282,7 +1281,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/65304 - testWidgetsWithLeakTracking('can view beyond boundary when necessary for a small child', (WidgetTester tester) async { + testWidgets('can view beyond boundary when necessary for a small child', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1321,7 +1320,7 @@ void main() { expect(transformationController.value, equals(Matrix4.identity())); }); - testWidgetsWithLeakTracking('scale does not jump when wrapped in GestureDetector', (WidgetTester tester) async { + testWidgets('scale does not jump when wrapped in GestureDetector', (WidgetTester tester) async { double? initialScale; double? scale; await tester.pumpWidget( @@ -1396,7 +1395,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), greaterThan(1.0)); }); - testWidgetsWithLeakTracking('Check if ClipRect is present in the tree', (WidgetTester tester) async { + testWidgets('Check if ClipRect is present in the tree', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1437,7 +1436,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('builder can change widgets that are off-screen', (WidgetTester tester) async { + testWidgets('builder can change widgets that are off-screen', (WidgetTester tester) async { const double childHeight = 10.0; await tester.pumpWidget( MaterialApp( @@ -1521,7 +1520,7 @@ void main() { // Accessing the intrinsic size of a LayoutBuilder throws an error, so // InteractiveViewer only uses a LayoutBuilder when it's needed by // InteractiveViewer.builder. - testWidgetsWithLeakTracking('LayoutBuilder is only used for InteractiveViewer.builder', (WidgetTester tester) async { + testWidgets('LayoutBuilder is only used for InteractiveViewer.builder', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -1553,7 +1552,7 @@ void main() { expect(find.byType(LayoutBuilder), findsOneWidget); }); - testWidgetsWithLeakTracking('scaleFactor', (WidgetTester tester) async { + testWidgets('scaleFactor', (WidgetTester tester) async { const double scrollAmount = 30.0; Future<void> pumpScaleFactor(double scaleFactor) { return tester.pumpWidget( @@ -1632,7 +1631,7 @@ void main() { expect(scaleHighZoomedIn - scaleHighZoomedOut, lessThan(scaleZoomedIn - scaleZoomedOut)); }); - testWidgetsWithLeakTracking('alignment argument is used properly', (WidgetTester tester) async { + testWidgets('alignment argument is used properly', (WidgetTester tester) async { const Alignment alignment = Alignment.center; await tester.pumpWidget(MaterialApp( @@ -1648,7 +1647,7 @@ void main() { expect(transform.alignment, alignment); }); - testWidgetsWithLeakTracking('interactionEndFrictionCoefficient', (WidgetTester tester) async { + testWidgets('interactionEndFrictionCoefficient', (WidgetTester tester) async { // Use the default interactionEndFrictionCoefficient. final TransformationController transformationController1 = TransformationController(); addTearDown(transformationController1.dispose); @@ -1706,7 +1705,7 @@ void main() { expect(translation2.y, lessThan(translation1.y)); }); - testWidgetsWithLeakTracking('discrete scroll pointer events', (WidgetTester tester) async { + testWidgets('discrete scroll pointer events', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( @@ -1749,7 +1748,7 @@ void main() { expect(translation.y, -125); }); - testWidgetsWithLeakTracking('discrete scale pointer event', (WidgetTester tester) async { + testWidgets('discrete scale pointer event', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( @@ -1785,7 +1784,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), 2.5); // capped at maxScale (2.5) }); - testWidgetsWithLeakTracking('trackpadScrollCausesScale', (WidgetTester tester) async { + testWidgets('trackpadScrollCausesScale', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( @@ -1820,7 +1819,7 @@ void main() { expect(transformationController.value.getMaxScaleOnAxis(), moreOrLessEquals(1.499302500056767)); }); - testWidgetsWithLeakTracking('trackpad pointer scroll events cause scale', (WidgetTester tester) async { + testWidgets('trackpad pointer scroll events cause scale', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( @@ -1870,7 +1869,7 @@ void main() { expect(translation.y, moreOrLessEquals(-99.37155332430822)); }); - testWidgetsWithLeakTracking('Scaling inertia', (WidgetTester tester) async { + testWidgets('Scaling inertia', (WidgetTester tester) async { const double boundaryMargin = 50.0; await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/widgets/intrinsic_width_test.dart b/packages/flutter/test/widgets/intrinsic_width_test.dart index b3c1c05e58a..20848ef9f8d 100644 --- a/packages/flutter/test/widgets/intrinsic_width_test.dart +++ b/packages/flutter/test/widgets/intrinsic_width_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Intrinsic stepWidth, stepHeight', (WidgetTester tester) async { + testWidgets('Intrinsic stepWidth, stepHeight', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25224 Widget buildFrame(double? stepWidth, double? stepHeight) { return Center( diff --git a/packages/flutter/test/widgets/invert_colors_test.dart b/packages/flutter/test/widgets/invert_colors_test.dart index 11be7632ae1..2c475a9715e 100644 --- a/packages/flutter/test/widgets/invert_colors_test.dart +++ b/packages/flutter/test/widgets/invert_colors_test.dart @@ -10,10 +10,9 @@ library; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('InvertColors', (WidgetTester tester) async { + testWidgets('InvertColors', (WidgetTester tester) async { await tester.pumpWidget(const RepaintBoundary( child: SizedBox( width: 200.0, @@ -30,7 +29,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('InvertColors and ColorFilter', (WidgetTester tester) async { + testWidgets('InvertColors and ColorFilter', (WidgetTester tester) async { await tester.pumpWidget(const RepaintBoundary( child: SizedBox( width: 200.0, diff --git a/packages/flutter/test/widgets/keep_alive_test.dart b/packages/flutter/test/widgets/keep_alive_test.dart index c44843916d7..89a44907feb 100644 --- a/packages/flutter/test/widgets/keep_alive_test.dart +++ b/packages/flutter/test/widgets/keep_alive_test.dart @@ -7,7 +7,6 @@ import 'dart:io' show Platform; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Leaf extends StatefulWidget { const Leaf({ @@ -55,7 +54,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('KeepAlive with ListView with itemExtent', (WidgetTester tester) async { + testWidgets('KeepAlive with ListView with itemExtent', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -103,7 +102,7 @@ void main() { expect(find.byKey(const GlobalObjectKey<_LeafState>(90), skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('KeepAlive with ListView without itemExtent', (WidgetTester tester) async { + testWidgets('KeepAlive with ListView without itemExtent', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -150,7 +149,7 @@ void main() { expect(find.byKey(const GlobalObjectKey<_LeafState>(90), skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('KeepAlive with GridView', (WidgetTester tester) async { + testWidgets('KeepAlive with GridView', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -199,7 +198,7 @@ void main() { expect(find.byKey(const GlobalObjectKey<_LeafState>(90), skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('KeepAlive render tree description', (WidgetTester tester) async { + testWidgets('KeepAlive render tree description', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/key_test.dart b/packages/flutter/test/widgets/key_test.dart index 8ba6247659e..b6031887325 100644 --- a/packages/flutter/test/widgets/key_test.dart +++ b/packages/flutter/test/widgets/key_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestValueKey<T> extends ValueKey<T> { const TestValueKey(super.value); @@ -20,7 +19,7 @@ class NotEquals { } void main() { - testWidgetsWithLeakTracking('Keys', (WidgetTester tester) async { + testWidgets('Keys', (WidgetTester tester) async { expect(ValueKey<int>(nonconst(3)) == ValueKey<int>(nonconst(3)), isTrue); expect(ValueKey<num>(nonconst(3)) == ValueKey<int>(nonconst(3)), isFalse); expect(ValueKey<int>(nonconst(3)) == ValueKey<int>(nonconst(2)), isFalse); diff --git a/packages/flutter/test/widgets/keyboard_listener_test.dart b/packages/flutter/test/widgets/keyboard_listener_test.dart index 1149bddd684..b9babb73ca7 100644 --- a/packages/flutter/test/widgets/keyboard_listener_test.dart +++ b/packages/flutter/test/widgets/keyboard_listener_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can dispose without keyboard', (WidgetTester tester) async { + testWidgets('Can dispose without keyboard', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); await tester.pumpWidget(KeyboardListener(focusNode: focusNode, child: Container())); @@ -16,7 +15,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('Fuchsia key event', (WidgetTester tester) async { + testWidgets('Fuchsia key event', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; final FocusNode focusNode = FocusNode(); @@ -44,7 +43,7 @@ void main() { await tester.pumpWidget(Container()); }, skip: isBrowser); // [intended] This is a Fuchsia-specific test. - testWidgetsWithLeakTracking('Web key event', (WidgetTester tester) async { + testWidgets('Web key event', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; final FocusNode focusNode = FocusNode(); @@ -72,7 +71,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('Defunct listeners do not receive events', (WidgetTester tester) async { + testWidgets('Defunct listeners do not receive events', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; final FocusNode focusNode = FocusNode(); diff --git a/packages/flutter/test/widgets/layout_builder_and_global_keys_test.dart b/packages/flutter/test/widgets/layout_builder_and_global_keys_test.dart index d3c9178eaa3..68e6f4ee27d 100644 --- a/packages/flutter/test/widgets/layout_builder_and_global_keys_test.dart +++ b/packages/flutter/test/widgets/layout_builder_and_global_keys_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/src/rendering/sliver.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Wrapper extends StatelessWidget { const Wrapper({ @@ -42,7 +41,7 @@ class StatefulWrapperState extends State<StatefulWrapper> { } void main() { - testWidgetsWithLeakTracking('Moving global key inside a LayoutBuilder', (WidgetTester tester) async { + testWidgets('Moving global key inside a LayoutBuilder', (WidgetTester tester) async { final GlobalKey<StatefulWrapperState> key = GlobalKey<StatefulWrapperState>(); await tester.pumpWidget( LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { @@ -61,7 +60,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Moving global key inside a SliverLayoutBuilder', (WidgetTester tester) async { + testWidgets('Moving global key inside a SliverLayoutBuilder', (WidgetTester tester) async { final GlobalKey<StatefulWrapperState> key = GlobalKey<StatefulWrapperState>(); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/layout_builder_and_parent_data_test.dart b/packages/flutter/test/widgets/layout_builder_and_parent_data_test.dart index b9871426953..6388fa320e5 100644 --- a/packages/flutter/test/widgets/layout_builder_and_parent_data_test.dart +++ b/packages/flutter/test/widgets/layout_builder_and_parent_data_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class SizeChanger extends StatefulWidget { const SizeChanger({ @@ -43,7 +42,7 @@ class SizeChangerState extends State<SizeChanger> { } void main() { - testWidgetsWithLeakTracking('Applying parent data inside a LayoutBuilder', (WidgetTester tester) async { + testWidgets('Applying parent data inside a LayoutBuilder', (WidgetTester tester) async { int frame = 1; await tester.pumpWidget(SizeChanger( // when this is triggered, the child LayoutBuilder will build again child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { diff --git a/packages/flutter/test/widgets/layout_builder_and_state_test.dart b/packages/flutter/test/widgets/layout_builder_and_state_test.dart index 3db4baef0b7..f5687492e71 100644 --- a/packages/flutter/test/widgets/layout_builder_and_state_test.dart +++ b/packages/flutter/test/widgets/layout_builder_and_state_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; @@ -50,7 +49,7 @@ class Wrapper extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('Calling setState on a widget that moves into a LayoutBuilder in the same frame', (WidgetTester tester) async { + testWidgets('Calling setState on a widget that moves into a LayoutBuilder in the same frame', (WidgetTester tester) async { StatefulWrapperState statefulWrapper; final Widget inner = Wrapper( child: StatefulWrapper( diff --git a/packages/flutter/test/widgets/layout_builder_mutations_test.dart b/packages/flutter/test/widgets/layout_builder_mutations_test.dart index d5e4748d028..14f151bfe01 100644 --- a/packages/flutter/test/widgets/layout_builder_mutations_test.dart +++ b/packages/flutter/test/widgets/layout_builder_mutations_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/src/widgets/media_query.dart'; import 'package:flutter/src/widgets/scroll_view.dart'; import 'package:flutter/src/widgets/sliver_layout_builder.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Wrapper extends StatelessWidget { const Wrapper({ @@ -26,7 +25,7 @@ class Wrapper extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('Moving a global key from another LayoutBuilder at layout time', (WidgetTester tester) async { + testWidgets('Moving a global key from another LayoutBuilder at layout time', (WidgetTester tester) async { final GlobalKey victimKey = GlobalKey(); await tester.pumpWidget(Row( @@ -72,7 +71,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Moving a global key from another SliverLayoutBuilder at layout time', (WidgetTester tester) async { + testWidgets('Moving a global key from another SliverLayoutBuilder at layout time', (WidgetTester tester) async { final GlobalKey victimKey1 = GlobalKey(); final GlobalKey victimKey2 = GlobalKey(); @@ -129,7 +128,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('LayoutBuilder does not layout twice', (WidgetTester tester) async { + testWidgets('LayoutBuilder does not layout twice', (WidgetTester tester) async { // This widget marks itself dirty when the closest MediaQuery changes. final _LayoutCount widget = _LayoutCount(); late StateSetter setState; diff --git a/packages/flutter/test/widgets/layout_builder_test.dart b/packages/flutter/test/widgets/layout_builder_test.dart index 87281622923..bdadc5d8205 100644 --- a/packages/flutter/test/widgets/layout_builder_test.dart +++ b/packages/flutter/test/widgets/layout_builder_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('LayoutBuilder parent size', (WidgetTester tester) async { + testWidgets('LayoutBuilder parent size', (WidgetTester tester) async { late Size layoutBuilderSize; final Key childKey = UniqueKey(); final Key parentKey = UniqueKey(); @@ -39,7 +38,7 @@ void main() { expect(childBox.size, equals(const Size(50.0, 100.0))); }); - testWidgetsWithLeakTracking('SliverLayoutBuilder parent geometry', (WidgetTester tester) async { + testWidgets('SliverLayoutBuilder parent geometry', (WidgetTester tester) async { late SliverConstraints parentConstraints1; late SliverConstraints parentConstraints2; final Key childKey1 = UniqueKey(); @@ -89,7 +88,7 @@ void main() { expect(childSliver2.geometry, parentSliver2.geometry); }); - testWidgetsWithLeakTracking('LayoutBuilder stateful child', (WidgetTester tester) async { + testWidgets('LayoutBuilder stateful child', (WidgetTester tester) async { late Size layoutBuilderSize; late StateSetter setState; final Key childKey = UniqueKey(); @@ -135,7 +134,7 @@ void main() { expect(childBox.size, equals(const Size(100.0, 200.0))); }); - testWidgetsWithLeakTracking('SliverLayoutBuilder stateful descendants', (WidgetTester tester) async { + testWidgets('SliverLayoutBuilder stateful descendants', (WidgetTester tester) async { late StateSetter setState; double childWidth = 10.0; double childHeight = 20.0; @@ -204,7 +203,7 @@ void main() { expect(parentSliver.geometry!.paintExtent, 600); }); - testWidgetsWithLeakTracking('LayoutBuilder stateful parent', (WidgetTester tester) async { + testWidgets('LayoutBuilder stateful parent', (WidgetTester tester) async { late Size layoutBuilderSize; late StateSetter setState; final Key childKey = UniqueKey(); @@ -248,7 +247,7 @@ void main() { expect(box.size, equals(const Size(100.0, 200.0))); }); - testWidgetsWithLeakTracking('LayoutBuilder and Inherited -- do not rebuild when not using inherited', (WidgetTester tester) async { + testWidgets('LayoutBuilder and Inherited -- do not rebuild when not using inherited', (WidgetTester tester) async { int built = 0; final Widget target = LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { @@ -271,7 +270,7 @@ void main() { expect(built, 1); }); - testWidgetsWithLeakTracking('LayoutBuilder and Inherited -- do rebuild when using inherited', (WidgetTester tester) async { + testWidgets('LayoutBuilder and Inherited -- do rebuild when using inherited', (WidgetTester tester) async { int built = 0; final Widget target = LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { @@ -295,7 +294,7 @@ void main() { expect(built, 2); }); - testWidgetsWithLeakTracking('SliverLayoutBuilder and Inherited -- do not rebuild when not using inherited', (WidgetTester tester) async { + testWidgets('SliverLayoutBuilder and Inherited -- do not rebuild when not using inherited', (WidgetTester tester) async { int built = 0; final Widget target = Directionality( textDirection: TextDirection.ltr, @@ -326,7 +325,7 @@ void main() { expect(built, 1); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverLayoutBuilder and Inherited -- do rebuild when not using inherited', (WidgetTester tester) async { int built = 0; @@ -361,7 +360,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('nested SliverLayoutBuilder', (WidgetTester tester) async { + testWidgets('nested SliverLayoutBuilder', (WidgetTester tester) async { late SliverConstraints parentConstraints1; late SliverConstraints parentConstraints2; final Key childKey = UniqueKey(); @@ -406,7 +405,7 @@ void main() { expect(parentSliver1.geometry, parentSliver2.geometry); }); - testWidgetsWithLeakTracking('localToGlobal works with SliverLayoutBuilder', (WidgetTester tester) async { + testWidgets('localToGlobal works with SliverLayoutBuilder', (WidgetTester tester) async { final Key childKey1 = UniqueKey(); final Key childKey2 = UniqueKey(); final ScrollController scrollController = ScrollController(); @@ -463,7 +462,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('hitTest works within SliverLayoutBuilder', (WidgetTester tester) async { + testWidgets('hitTest works within SliverLayoutBuilder', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); List<int> hitCounts = <int> [0, 0, 0]; @@ -592,7 +591,7 @@ void main() { expect(hitCounts, const <int> [0, 0, 0]); }); - testWidgetsWithLeakTracking('LayoutBuilder does not call builder when layout happens but layout constraints do not change', (WidgetTester tester) async { + testWidgets('LayoutBuilder does not call builder when layout happens but layout constraints do not change', (WidgetTester tester) async { int builderInvocationCount = 0; Future<void> pumpTestWidget(Size size) async { @@ -668,7 +667,7 @@ void main() { expect(spy.performResizeCount, 2); }); - testWidgetsWithLeakTracking('LayoutBuilder descendant widget can access [RenderBox.size] when rebuilding during layout', (WidgetTester tester) async { + testWidgets('LayoutBuilder descendant widget can access [RenderBox.size] when rebuilding during layout', (WidgetTester tester) async { Size? childSize; int buildCount = 0; @@ -700,7 +699,7 @@ void main() { expect(childSize, const Size(10.0, 10.0)); }); - testWidgetsWithLeakTracking('LayoutBuilder will only invoke builder if updateShouldRebuild returns true', (WidgetTester tester) async { + testWidgets('LayoutBuilder will only invoke builder if updateShouldRebuild returns true', (WidgetTester tester) async { int buildCount = 0; int paintCount = 0; Offset? mostRecentOffset; diff --git a/packages/flutter/test/widgets/linked_scroll_view_test.dart b/packages/flutter/test/widgets/linked_scroll_view_test.dart index ee1373ec545..ee2a5c5921c 100644 --- a/packages/flutter/test/widgets/linked_scroll_view_test.dart +++ b/packages/flutter/test/widgets/linked_scroll_view_test.dart @@ -14,7 +14,6 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class LinkedScrollController extends ScrollController { LinkedScrollController({ this.before, this.after }); @@ -382,7 +381,7 @@ class _TestState extends State<Test> { } void main() { - testWidgetsWithLeakTracking('LinkedScrollController - 1', (WidgetTester tester) async { + testWidgets('LinkedScrollController - 1', (WidgetTester tester) async { await tester.pumpWidget(const Test()); expect(find.text('Hello A'), findsOneWidget); expect(find.text('Hello 1'), findsOneWidget); @@ -460,7 +459,7 @@ void main() { expect(find.text('Hello D'), findsNothing); expect(find.text('Hello 4'), findsOneWidget); }); - testWidgetsWithLeakTracking('LinkedScrollController - 2', (WidgetTester tester) async { + testWidgets('LinkedScrollController - 2', (WidgetTester tester) async { await tester.pumpWidget(const Test()); expect(find.text('Hello A'), findsOneWidget); expect(find.text('Hello B'), findsOneWidget); diff --git a/packages/flutter/test/widgets/list_body_test.dart b/packages/flutter/test/widgets/list_body_test.dart index 0bf2b609b82..6ac39df8d32 100644 --- a/packages/flutter/test/widgets/list_body_test.dart +++ b/packages/flutter/test/widgets/list_body_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/src/foundation/assertions.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const List<Widget> children = <Widget>[ SizedBox(width: 200.0, height: 150.0), @@ -30,7 +29,7 @@ void expectRects(WidgetTester tester, List<Rect> expected) { void main() { - testWidgetsWithLeakTracking('ListBody down', (WidgetTester tester) async { + testWidgets('ListBody down', (WidgetTester tester) async { await tester.pumpWidget(const Flex( direction: Axis.vertical, children: <Widget>[ ListBody(children: children) ], @@ -47,7 +46,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListBody up', (WidgetTester tester) async { + testWidgets('ListBody up', (WidgetTester tester) async { await tester.pumpWidget(const Flex( direction: Axis.vertical, children: <Widget>[ ListBody(reverse: true, children: children) ], @@ -64,7 +63,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListBody right', (WidgetTester tester) async { + testWidgets('ListBody right', (WidgetTester tester) async { await tester.pumpWidget(const Flex( textDirection: TextDirection.ltr, direction: Axis.horizontal, @@ -87,7 +86,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListBody left', (WidgetTester tester) async { + testWidgets('ListBody left', (WidgetTester tester) async { await tester.pumpWidget(const Flex( textDirection: TextDirection.ltr, direction: Axis.horizontal, @@ -110,7 +109,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Limited space along main axis error', (WidgetTester tester) async { + testWidgets('Limited space along main axis error', (WidgetTester tester) async { final FlutterExceptionHandler oldHandler = FlutterError.onError!; final List<FlutterErrorDetails> errors = <FlutterErrorDetails>[]; FlutterError.onError = (FlutterErrorDetails error) => errors.add(error); @@ -143,7 +142,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Nested ListBody unbounded cross axis error', (WidgetTester tester) async { + testWidgets('Nested ListBody unbounded cross axis error', (WidgetTester tester) async { final FlutterExceptionHandler oldHandler = FlutterError.onError!; final List<FlutterErrorDetails> errors = <FlutterErrorDetails>[]; FlutterError.onError = (FlutterErrorDetails error) => errors.add(error); diff --git a/packages/flutter/test/widgets/list_view_builder_test.dart b/packages/flutter/test/widgets/list_view_builder_test.dart index ccc83e24838..8df1c4fc532 100644 --- a/packages/flutter/test/widgets/list_view_builder_test.dart +++ b/packages/flutter/test/widgets/list_view_builder_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; void main() { - testWidgetsWithLeakTracking('ListView.builder mount/dismount smoke test', (WidgetTester tester) async { + testWidgets('ListView.builder mount/dismount smoke test', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment @@ -62,7 +61,7 @@ void main() { check(visible: <int>[0, 1, 2, 3, 4, 5], hidden: <int>[ 6, 7, 8]); }); - testWidgetsWithLeakTracking('ListView.builder vertical', (WidgetTester tester) async { + testWidgets('ListView.builder vertical', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment @@ -138,7 +137,7 @@ void main() { callbackTracker.clear(); }); - testWidgetsWithLeakTracking('ListView.builder horizontal', (WidgetTester tester) async { + testWidgets('ListView.builder horizontal', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment @@ -215,7 +214,7 @@ void main() { callbackTracker.clear(); }); - testWidgetsWithLeakTracking('ListView.builder 10 items, 2-3 items visible', (WidgetTester tester) async { + testWidgets('ListView.builder 10 items, 2-3 items visible', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // The root view is 800x600 in the test environment and our list @@ -268,7 +267,7 @@ void main() { callbackTracker.clear(); }); - testWidgetsWithLeakTracking('ListView.builder 30 items with big jump, using prototypeItem', (WidgetTester tester) async { + testWidgets('ListView.builder 30 items with big jump, using prototypeItem', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // The root view is 800x600 in the test environment and our list @@ -316,7 +315,7 @@ void main() { callbackTracker.clear(); }); - testWidgetsWithLeakTracking('ListView.separated', (WidgetTester tester) async { + testWidgets('ListView.separated', (WidgetTester tester) async { Widget buildFrame({ required int itemCount }) { return Directionality( textDirection: TextDirection.ltr, @@ -362,7 +361,7 @@ void main() { }); - testWidgetsWithLeakTracking('ListView.separated uses correct semanticChildCount', (WidgetTester tester) async { + testWidgets('ListView.separated uses correct semanticChildCount', (WidgetTester tester) async { Widget buildFrame({ required int itemCount}) { return Directionality( textDirection: TextDirection.ltr, @@ -410,7 +409,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/72292 - testWidgetsWithLeakTracking('ListView.builder and SingleChildScrollView can work well together', (WidgetTester tester) async { + testWidgets('ListView.builder and SingleChildScrollView can work well together', (WidgetTester tester) async { Widget builder(int itemCount) { return Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/list_view_correction_test.dart b/packages/flutter/test/widgets/list_view_correction_test.dart index c6d44618e9e..3fd35bf2c61 100644 --- a/packages/flutter/test/widgets/list_view_correction_test.dart +++ b/packages/flutter/test/widgets/list_view_correction_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ListView can handle shrinking top elements', (WidgetTester tester) async { + testWidgets('ListView can handle shrinking top elements', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -68,7 +67,7 @@ void main() { expect(tester.getTopLeft(find.text('2')).dy, equals(200.0)); }); - testWidgetsWithLeakTracking('ListView can handle shrinking top elements with cache extent', (WidgetTester tester) async { + testWidgets('ListView can handle shrinking top elements with cache extent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -127,7 +126,7 @@ void main() { expect(tester.getTopLeft(find.text('2')).dy, equals(150.0)); }); - testWidgetsWithLeakTracking('ListView can handle inserts at 0', (WidgetTester tester) async { + testWidgets('ListView can handle inserts at 0', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/list_view_fling_test.dart b/packages/flutter/test/widgets/list_view_fling_test.dart index aa76b397aee..ebf7019b4b4 100644 --- a/packages/flutter/test/widgets/list_view_fling_test.dart +++ b/packages/flutter/test/widgets/list_view_fling_test.dart @@ -4,13 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const double kHeight = 10.0; const double kFlingOffset = kHeight * 20.0; void main() { - testWidgetsWithLeakTracking("Flings don't stutter", (WidgetTester tester) async { + testWidgets("Flings don't stutter", (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/list_view_horizontal_test.dart b/packages/flutter/test/widgets/list_view_horizontal_test.dart index 7e3999b4507..26b0533da0a 100644 --- a/packages/flutter/test/widgets/list_view_horizontal_test.dart +++ b/packages/flutter/test/widgets/list_view_horizontal_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const List<int> items = <int>[0, 1, 2, 3, 4, 5]; @@ -29,7 +28,7 @@ Widget buildFrame({ bool reverse = false, required TextDirection textDirection } } void main() { - testWidgetsWithLeakTracking('Drag horizontally with scroll anchor at start (LTR)', (WidgetTester tester) async { + testWidgets('Drag horizontally with scroll anchor at start (LTR)', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(textDirection: TextDirection.ltr)); await tester.pump(const Duration(seconds: 1)); @@ -148,7 +147,7 @@ void main() { expect(find.text('5'), findsNothing); }); - testWidgetsWithLeakTracking('Drag horizontally with scroll anchor at end (LTR)', (WidgetTester tester) async { + testWidgets('Drag horizontally with scroll anchor at end (LTR)', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(reverse: true, textDirection: TextDirection.ltr)); await tester.pump(const Duration(seconds: 1)); @@ -248,7 +247,7 @@ void main() { expect(find.text('5'), findsOneWidget); }); - testWidgetsWithLeakTracking('Drag horizontally with scroll anchor at start (RTL)', (WidgetTester tester) async { + testWidgets('Drag horizontally with scroll anchor at start (RTL)', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(textDirection: TextDirection.rtl)); await tester.pump(const Duration(seconds: 1)); @@ -348,7 +347,7 @@ void main() { expect(find.text('5'), findsOneWidget); }); - testWidgetsWithLeakTracking('Drag horizontally with scroll anchor at end (LTR)', (WidgetTester tester) async { + testWidgets('Drag horizontally with scroll anchor at end (LTR)', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(reverse: true, textDirection: TextDirection.rtl)); await tester.pump(const Duration(seconds: 1)); diff --git a/packages/flutter/test/widgets/list_view_misc_test.dart b/packages/flutter/test/widgets/list_view_misc_test.dart index 3d7a4a1bd65..1bedd192a26 100644 --- a/packages/flutter/test/widgets/list_view_misc_test.dart +++ b/packages/flutter/test/widgets/list_view_misc_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Key blockKey = Key('test'); void main() { - testWidgetsWithLeakTracking('Cannot scroll a non-overflowing block', (WidgetTester tester) async { + testWidgets('Cannot scroll a non-overflowing block', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -37,7 +36,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Can scroll an overflowing block', (WidgetTester tester) async { + testWidgets('Can scroll an overflowing block', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -68,7 +67,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('ListView reverse', (WidgetTester tester) async { + testWidgets('ListView reverse', (WidgetTester tester) async { int first = 0; int second = 0; @@ -112,7 +111,7 @@ void main() { expect(second, equals(1)); }); - testWidgetsWithLeakTracking('ListView controller', (WidgetTester tester) async { + testWidgets('ListView controller', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -129,7 +128,7 @@ void main() { expect(controller.offset, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverBlockChildListDelegate.estimateMaxScrollOffset hits end', (WidgetTester tester) async { + testWidgets('SliverBlockChildListDelegate.estimateMaxScrollOffset hits end', (WidgetTester tester) async { final SliverChildListDelegate delegate = SliverChildListDelegate(<Widget>[ Container(), Container(), @@ -163,7 +162,7 @@ void main() { expect(maxScrollOffset, equals(26.0)); }); - testWidgetsWithLeakTracking('Resizing a ListView child restores scroll offset', (WidgetTester tester) async { + testWidgets('Resizing a ListView child restores scroll offset', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/9221 final AnimationController controller = AnimationController( vsync: const TestVSync(), diff --git a/packages/flutter/test/widgets/list_view_relayout_test.dart b/packages/flutter/test/widgets/list_view_relayout_test.dart index f0d0e53ed03..7d0ff9bb14c 100644 --- a/packages/flutter/test/widgets/list_view_relayout_test.dart +++ b/packages/flutter/test/widgets/list_view_relayout_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Nested ListView with shrinkWrap', (WidgetTester tester) async { + testWidgets('Nested ListView with shrinkWrap', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -37,7 +36,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Underflowing ListView should relayout for additional children', (WidgetTester tester) async { + testWidgets('Underflowing ListView should relayout for additional children', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/5950 await tester.pumpWidget( @@ -66,7 +65,7 @@ void main() { expect(find.text('200'), findsOneWidget); }); - testWidgetsWithLeakTracking('Underflowing ListView contentExtent should track additional children', (WidgetTester tester) async { + testWidgets('Underflowing ListView contentExtent should track additional children', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -103,7 +102,7 @@ void main() { expect(list.geometry!.scrollExtent, equals(0.0)); }); - testWidgetsWithLeakTracking('Overflowing ListView should relayout for missing children', (WidgetTester tester) async { + testWidgets('Overflowing ListView should relayout for missing children', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -144,7 +143,7 @@ void main() { expect(find.text('400'), findsNothing); }); - testWidgetsWithLeakTracking('Overflowing ListView should not relayout for additional children', (WidgetTester tester) async { + testWidgets('Overflowing ListView should not relayout for additional children', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -178,7 +177,7 @@ void main() { expect(find.text('100'), findsNothing); }); - testWidgetsWithLeakTracking('Overflowing ListView should become scrollable', (WidgetTester tester) async { + testWidgets('Overflowing ListView should become scrollable', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/5920 // When a ListView's viewport hasn't overflowed, scrolling is disabled. // When children are added that cause it to overflow, scrolling should diff --git a/packages/flutter/test/widgets/list_view_semantics_test.dart b/packages/flutter/test/widgets/list_view_semantics_test.dart index 3fdf022de95..88727fff1f4 100644 --- a/packages/flutter/test/widgets/list_view_semantics_test.dart +++ b/packages/flutter/test/widgets/list_view_semantics_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -15,7 +14,7 @@ void main() { const int itemCount = 10; const double itemHeight = 150.0; - testWidgetsWithLeakTracking('forward vertical', (WidgetTester tester) async { + testWidgets('forward vertical', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -46,7 +45,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('reverse vertical', (WidgetTester tester) async { + testWidgets('reverse vertical', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -78,7 +77,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('forward horizontal', (WidgetTester tester) async { + testWidgets('forward horizontal', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -110,7 +109,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('reverse horizontal', (WidgetTester tester) async { + testWidgets('reverse horizontal', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index 8a5ba4797e9..19341c7745a 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -6,7 +6,6 @@ import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart' show TestClipPaintingContext; @@ -78,7 +77,7 @@ class _StatefulListViewState extends State<_StatefulListView> { void main() { // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('ListView.builder respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('ListView.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -114,7 +113,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('ListView.separator respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('ListView.separator respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -150,7 +149,7 @@ void main() { expect(finderCalled, true); }); - testWidgetsWithLeakTracking('ListView default control', (WidgetTester tester) async { + testWidgets('ListView default control', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -161,7 +160,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListView itemExtent control test', (WidgetTester tester) async { + testWidgets('ListView itemExtent control test', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -208,7 +207,7 @@ void main() { expect(find.text('5'), findsNothing); }); - testWidgetsWithLeakTracking('ListView large scroll jump', (WidgetTester tester) async { + testWidgets('ListView large scroll jump', (WidgetTester tester) async { final List<int> log = <int>[]; await tester.pumpWidget( @@ -250,7 +249,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('ListView large scroll jump and keepAlive first child not keepAlive', (WidgetTester tester) async { + testWidgets('ListView large scroll jump and keepAlive first child not keepAlive', (WidgetTester tester) async { Future<void> checkAndScroll([ String zero = '0:false' ]) async { expect(find.text(zero), findsOneWidget); expect(find.text('1:false'), findsOneWidget); @@ -287,7 +286,7 @@ void main() { await checkAndScroll('0:true'); }); - testWidgetsWithLeakTracking('ListView can build out of underflow', (WidgetTester tester) async { + testWidgets('ListView can build out of underflow', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -343,7 +342,7 @@ void main() { expect(find.text('5'), findsNothing); }); - testWidgetsWithLeakTracking('ListView can build out of overflow padding', (WidgetTester tester) async { + testWidgets('ListView can build out of overflow padding', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -362,7 +361,7 @@ void main() { expect(find.text('padded', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('ListView with itemExtent in unbounded context', (WidgetTester tester) async { + testWidgets('ListView with itemExtent in unbounded context', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -382,7 +381,7 @@ void main() { expect(find.text('19'), findsOneWidget); }); - testWidgetsWithLeakTracking('ListView with shrink wrap in bounded context correctly uses cache extent', (WidgetTester tester) async { + testWidgets('ListView with shrink wrap in bounded context correctly uses cache extent', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Directionality( @@ -406,7 +405,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('ListView hidden items should stay hidden if their semantics are updated', (WidgetTester tester) async { + testWidgets('ListView hidden items should stay hidden if their semantics are updated', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Directionality( @@ -441,7 +440,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('didFinishLayout has correct indices', (WidgetTester tester) async { + testWidgets('didFinishLayout has correct indices', (WidgetTester tester) async { final TestSliverChildListDelegate delegate = TestSliverChildListDelegate( List<Widget>.generate( 20, @@ -487,7 +486,7 @@ void main() { delegate.log.clear(); }); - testWidgetsWithLeakTracking('ListView automatically pad MediaQuery on axis', (WidgetTester tester) async { + testWidgets('ListView automatically pad MediaQuery on axis', (WidgetTester tester) async { EdgeInsets? innerMediaQueryPadding; await tester.pumpWidget( @@ -515,7 +514,7 @@ void main() { expect(innerMediaQueryPadding, const EdgeInsets.symmetric(horizontal: 30.0)); }); - testWidgetsWithLeakTracking('ListView clips if overflow is smaller than cacheExtent', (WidgetTester tester) async { + testWidgets('ListView clips if overflow is smaller than cacheExtent', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17426. await tester.pumpWidget( @@ -546,7 +545,7 @@ void main() { expect(find.byType(Viewport), paints..clipRect()); }); - testWidgetsWithLeakTracking('ListView does not clips if no overflow', (WidgetTester tester) async { + testWidgets('ListView does not clips if no overflow', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -569,7 +568,7 @@ void main() { expect(find.byType(Viewport), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('ListView (fixed extent) clips if overflow is smaller than cacheExtent', (WidgetTester tester) async { + testWidgets('ListView (fixed extent) clips if overflow is smaller than cacheExtent', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17426. await tester.pumpWidget( @@ -601,7 +600,7 @@ void main() { expect(find.byType(Viewport), paints..clipRect()); }); - testWidgetsWithLeakTracking('ListView (fixed extent) does not clips if no overflow', (WidgetTester tester) async { + testWidgets('ListView (fixed extent) does not clips if no overflow', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -625,7 +624,7 @@ void main() { expect(find.byType(Viewport), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('ListView.horizontal has implicit scrolling by default', (WidgetTester tester) async { + testWidgets('ListView.horizontal has implicit scrolling by default', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Directionality( @@ -658,7 +657,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Updates viewport dimensions when scroll direction changes', (WidgetTester tester) async { + testWidgets('Updates viewport dimensions when scroll direction changes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/43380. final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -696,7 +695,7 @@ void main() { expect(controller.position.viewportDimension, 100.0); }); - testWidgetsWithLeakTracking('ListView respects clipBehavior', (WidgetTester tester) async { + testWidgets('ListView respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -733,7 +732,7 @@ void main() { context.dispose(); }); - testWidgetsWithLeakTracking('ListView.builder respects clipBehavior', (WidgetTester tester) async { + testWidgets('ListView.builder respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -748,7 +747,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('ListView.custom respects clipBehavior', (WidgetTester tester) async { + testWidgets('ListView.custom respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -765,7 +764,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('ListView.separated respects clipBehavior', (WidgetTester tester) async { + testWidgets('ListView.separated respects clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -782,7 +781,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/pull/131393 - testWidgetsWithLeakTracking('itemExtentBuilder test', (WidgetTester tester) async { + testWidgets('itemExtentBuilder test', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final List<int> buildLog = <int>[]; @@ -913,7 +912,7 @@ void main() { expect(buildLog.max, 61); }); - testWidgetsWithLeakTracking('itemExtent, prototypeItem and itemExtentBuilder conflicts test', (WidgetTester tester) async { + testWidgets('itemExtent, prototypeItem and itemExtentBuilder conflicts test', (WidgetTester tester) async { Object? error; try { await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/list_view_vertical_test.dart b/packages/flutter/test/widgets/list_view_vertical_test.dart index 16a103732d0..73b0910b0a7 100644 --- a/packages/flutter/test/widgets/list_view_vertical_test.dart +++ b/packages/flutter/test/widgets/list_view_vertical_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const List<int> items = <int>[0, 1, 2, 3, 4, 5]; @@ -21,7 +20,7 @@ Widget buildFrame() { } void main() { - testWidgetsWithLeakTracking('Drag vertically', (WidgetTester tester) async { + testWidgets('Drag vertically', (WidgetTester tester) async { await tester.pumpWidget(buildFrame()); await tester.pump(); @@ -64,7 +63,7 @@ void main() { expect(find.text('5'), findsNothing); }); - testWidgetsWithLeakTracking('Drag vertically', (WidgetTester tester) async { + testWidgets('Drag vertically', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/list_view_viewporting_test.dart b/packages/flutter/test/widgets/list_view_viewporting_test.dart index 09b7cc875c8..d6c02fcc8aa 100644 --- a/packages/flutter/test/widgets/list_view_viewporting_test.dart +++ b/packages/flutter/test/widgets/list_view_viewporting_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; void main() { - testWidgetsWithLeakTracking('ListView mount/dismount smoke test', (WidgetTester tester) async { + testWidgets('ListView mount/dismount smoke test', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment @@ -60,7 +59,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('ListView vertical', (WidgetTester tester) async { + testWidgets('ListView vertical', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment @@ -126,7 +125,7 @@ void main() { callbackTracker.clear(); }); - testWidgetsWithLeakTracking('ListView horizontal', (WidgetTester tester) async { + testWidgets('ListView horizontal', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment @@ -183,7 +182,7 @@ void main() { callbackTracker.clear(); }); - testWidgetsWithLeakTracking('ListView reinvoke builders', (WidgetTester tester) async { + testWidgets('ListView reinvoke builders', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; final List<String?> text = <String?>[]; @@ -235,7 +234,7 @@ void main() { text.clear(); }); - testWidgetsWithLeakTracking('ListView reinvoke builders', (WidgetTester tester) async { + testWidgets('ListView reinvoke builders', (WidgetTester tester) async { late StateSetter setState; ThemeData themeData = ThemeData.light(useMaterial3: false); @@ -278,7 +277,7 @@ void main() { expect(widget.color, equals(Colors.green)); }); - testWidgetsWithLeakTracking('ListView padding', (WidgetTester tester) async { + testWidgets('ListView padding', (WidgetTester tester) async { Widget itemBuilder(BuildContext context, int index) { return Container( key: ValueKey<int>(index), @@ -305,7 +304,7 @@ void main() { expect(firstBox.size.width, equals(800.0 - 12.0)); }); - testWidgetsWithLeakTracking('ListView underflow extents', (WidgetTester tester) async { + testWidgets('ListView underflow extents', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -440,7 +439,7 @@ void main() { expect(position.minScrollExtent, equals(0.0)); }); - testWidgetsWithLeakTracking('ListView should not paint hidden children', (WidgetTester tester) async { + testWidgets('ListView should not paint hidden children', (WidgetTester tester) async { const Text text = Text('test'); final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); @@ -472,7 +471,7 @@ void main() { expect(list, paintsExactlyCountTimes(#drawParagraph, 2)); }); - testWidgetsWithLeakTracking('ListView should paint with offset', (WidgetTester tester) async { + testWidgets('ListView should paint with offset', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 120.0); addTearDown(controller.dispose); @@ -508,7 +507,7 @@ void main() { expect(renderObject, paintsExactlyCountTimes(#drawParagraph, 10)); }); - testWidgetsWithLeakTracking('ListView should paint with rtl', (WidgetTester tester) async { + testWidgets('ListView should paint with rtl', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, diff --git a/packages/flutter/test/widgets/list_view_with_inherited_test.dart b/packages/flutter/test/widgets/list_view_with_inherited_test.dart index d47e6f96f9b..1cfdbdaecea 100644 --- a/packages/flutter/test/widgets/list_view_with_inherited_test.dart +++ b/packages/flutter/test/widgets/list_view_with_inherited_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; List<String> items = <String>[ 'one', @@ -41,7 +40,7 @@ Widget buildFrame() { } void main() { - testWidgetsWithLeakTracking('ListView is a build function (smoketest)', (WidgetTester tester) async { + testWidgets('ListView is a build function (smoketest)', (WidgetTester tester) async { await tester.pumpWidget(buildFrame()); expect(find.text('one'), findsOneWidget); expect(find.text('two'), findsOneWidget); diff --git a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart index 729f54e9c66..90bfe790054 100644 --- a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart +++ b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart' show TestCallbackPainter, TestClipPaintingContext; @@ -55,7 +54,7 @@ void main() { }); group('construction check', () { - testWidgetsWithLeakTracking('ListWheelScrollView needs positive diameter ratio', (WidgetTester tester) async { + testWidgets('ListWheelScrollView needs positive diameter ratio', (WidgetTester tester) async { expect( () => ListWheelScrollView( diameterRatio: nonconst(-2.0), @@ -70,7 +69,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListWheelScrollView can have zero child', (WidgetTester tester) async { + testWidgets('ListWheelScrollView can have zero child', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -83,7 +82,7 @@ void main() { expect(tester.getSize(find.byType(ListWheelScrollView)), const Size(800.0, 600.0)); }); - testWidgetsWithLeakTracking('FixedExtentScrollController onAttach, onDetach', (WidgetTester tester) async { + testWidgets('FixedExtentScrollController onAttach, onDetach', (WidgetTester tester) async { int attach = 0; int detach = 0; final FixedExtentScrollController controller = FixedExtentScrollController( @@ -114,7 +113,7 @@ void main() { expect(detach, 1); }); - testWidgetsWithLeakTracking('ListWheelScrollView needs positive magnification', (WidgetTester tester) async { + testWidgets('ListWheelScrollView needs positive magnification', (WidgetTester tester) async { expect( () { ListWheelScrollView( @@ -128,7 +127,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ListWheelScrollView needs valid overAndUnderCenterOpacity', (WidgetTester tester) async { + testWidgets('ListWheelScrollView needs valid overAndUnderCenterOpacity', (WidgetTester tester) async { expect( () { ListWheelScrollView( @@ -175,7 +174,7 @@ void main() { }); group('infinite scrolling', () { - testWidgetsWithLeakTracking('infinite looping list', (WidgetTester tester) async { + testWidgets('infinite looping list', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(); addTearDown(controller.dispose); @@ -221,7 +220,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('infinite child builder', (WidgetTester tester) async { + testWidgets('infinite child builder', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(); addTearDown(controller.dispose); @@ -262,7 +261,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('child builder with lower and upper limits', (WidgetTester tester) async { + testWidgets('child builder with lower and upper limits', (WidgetTester tester) async { // Adjust the content dimensions at the end of `RenderListWheelViewport.performLayout()` final List<int> paintedChildren = <int>[]; @@ -320,7 +319,7 @@ void main() { }); group('layout', () { - testWidgetsWithLeakTracking('Flings with high velocity should not break the children lower and upper limits', (WidgetTester tester) async { + testWidgets('Flings with high velocity should not break the children lower and upper limits', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/112526 final FixedExtentScrollController controller = FixedExtentScrollController(); addTearDown(controller.dispose); @@ -361,7 +360,7 @@ void main() { }, variant: TargetPlatformVariant(TargetPlatform.values.toSet())); // Regression test for https://github.com/flutter/flutter/issues/90953 - testWidgetsWithLeakTracking('ListWheelScrollView childDelegate update test 2', (WidgetTester tester) async { + testWidgets('ListWheelScrollView childDelegate update test 2', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 2); addTearDown(controller.dispose); @@ -426,7 +425,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/58144 - testWidgetsWithLeakTracking('ListWheelScrollView childDelegate update test', (WidgetTester tester) async { + testWidgets('ListWheelScrollView childDelegate update test', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(); addTearDown(controller.dispose); @@ -459,7 +458,7 @@ void main() { expect(tester.renderObject(find.text('1')).attached, true); }); - testWidgetsWithLeakTracking("ListWheelScrollView takes parent's size with small children", (WidgetTester tester) async { + testWidgets("ListWheelScrollView takes parent's size with small children", (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -480,7 +479,7 @@ void main() { expect(tester.getBottomRight(find.byType(ListWheelScrollView)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking("ListWheelScrollView takes parent's size with large children", (WidgetTester tester) async { + testWidgets("ListWheelScrollView takes parent's size with large children", (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -501,7 +500,7 @@ void main() { expect(tester.getBottomRight(find.byType(ListWheelScrollView)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking("ListWheelScrollView children can't be bigger than itemExtent", (WidgetTester tester) async { + testWidgets("ListWheelScrollView children can't be bigger than itemExtent", (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -523,7 +522,7 @@ void main() { expect(find.text('blah'), findsOneWidget); }); - testWidgetsWithLeakTracking('builder is never called twice for same index', (WidgetTester tester) async { + testWidgets('builder is never called twice for same index', (WidgetTester tester) async { final Set<int> builtChildren = <int>{}; final FixedExtentScrollController controller = FixedExtentScrollController(); addTearDown(controller.dispose); @@ -560,7 +559,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('only visible children are maintained as children of the rendered viewport', (WidgetTester tester) async { + testWidgets('only visible children are maintained as children of the rendered viewport', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(); addTearDown(controller.dispose); @@ -597,7 +596,7 @@ void main() { expect(viewport.childCount, 4); }); - testWidgetsWithLeakTracking('a tighter squeeze lays out more children', (WidgetTester tester) async { + testWidgets('a tighter squeeze lays out more children', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); @@ -642,7 +641,7 @@ void main() { expect(viewport.childCount, 13); }); - testWidgetsWithLeakTracking('Active children are laid out with correct offset', (WidgetTester tester) async { + testWidgets('Active children are laid out with correct offset', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/123497 Future<void> buildWidget(double width) async { return tester.pumpWidget( @@ -679,7 +678,7 @@ void main() { }); group('pre-transform viewport', () { - testWidgetsWithLeakTracking('ListWheelScrollView starts and ends from the middle', (WidgetTester tester) async { + testWidgets('ListWheelScrollView starts and ends from the middle', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final List<int> paintedChildren = <int>[]; @@ -722,7 +721,7 @@ void main() { expect(paintedChildren, <int>[96, 97, 98, 99]); }); - testWidgetsWithLeakTracking('A child gets painted as soon as its first pixel is in the viewport', (WidgetTester tester) async { + testWidgets('A child gets painted as soon as its first pixel is in the viewport', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 50.0); addTearDown(controller.dispose); final List<int> paintedChildren = <int>[]; @@ -757,7 +756,7 @@ void main() { expect(paintedChildren, <int>[0, 1, 2, 3, 4]); }); - testWidgetsWithLeakTracking('A child is no longer painted after its last pixel leaves the viewport', (WidgetTester tester) async { + testWidgets('A child is no longer painted after its last pixel leaves the viewport', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 250.0); addTearDown(controller.dispose); final List<int> paintedChildren = <int>[]; @@ -802,7 +801,7 @@ void main() { }); group('viewport transformation', () { - testWidgetsWithLeakTracking('Center child is magnified', (WidgetTester tester) async { + testWidgets('Center child is magnified', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -826,7 +825,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default middle transform', (WidgetTester tester) async { + testWidgets('Default middle transform', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -855,7 +854,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Curve the wheel to the left', (WidgetTester tester) async { + testWidgets('Curve the wheel to the left', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); @@ -882,7 +881,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrolling, diameterRatio, perspective all changes matrix', (WidgetTester tester) async { + testWidgets('Scrolling, diameterRatio, perspective all changes matrix', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 200.0); addTearDown(controller.dispose); @@ -1002,7 +1001,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('offAxisFraction, magnification changes matrix', (WidgetTester tester) async { + testWidgets('offAxisFraction, magnification changes matrix', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 200.0); addTearDown(controller.dispose); @@ -1102,7 +1101,7 @@ void main() { }); group('scroll notifications', () { - testWidgetsWithLeakTracking('no onSelectedItemChanged callback on first build', (WidgetTester tester) async { + testWidgets('no onSelectedItemChanged callback on first build', (WidgetTester tester) async { bool itemChangeCalled = false; void onItemChange(int _) { itemChangeCalled = true; } @@ -1127,7 +1126,7 @@ void main() { expect(itemChangeCalled, false); }); - testWidgetsWithLeakTracking('onSelectedItemChanged when a new item is closest to center', (WidgetTester tester) async { + testWidgets('onSelectedItemChanged when a new item is closest to center', (WidgetTester tester) async { final List<int> selectedItems = <int>[]; await tester.pumpWidget( @@ -1164,7 +1163,7 @@ void main() { expect(selectedItems, <int>[1, 2, 1]); }); - testWidgetsWithLeakTracking('onSelectedItemChanged reports only in valid range', (WidgetTester tester) async { + testWidgets('onSelectedItemChanged reports only in valid range', (WidgetTester tester) async { final List<int> selectedItems = <int>[]; await tester.pumpWidget( @@ -1200,7 +1199,7 @@ void main() { }); group('scroll controller', () { - testWidgetsWithLeakTracking('initialItem', (WidgetTester tester) async { + testWidgets('initialItem', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); final List<int> paintedChildren = <int>[]; @@ -1227,7 +1226,7 @@ void main() { expect(controller.selectedItem, 10); }); - testWidgetsWithLeakTracking('controller jump', (WidgetTester tester) async { + testWidgets('controller jump', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); final List<int> paintedChildren = <int>[]; @@ -1260,7 +1259,7 @@ void main() { expect(controller.selectedItem, 0); }); - testWidgetsWithLeakTracking('controller animateToItem', (WidgetTester tester) async { + testWidgets('controller animateToItem', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); final List<int> paintedChildren = <int>[]; @@ -1298,7 +1297,7 @@ void main() { expect(controller.selectedItem, 0); }); - testWidgetsWithLeakTracking('onSelectedItemChanged and controller are in sync', (WidgetTester tester) async { + testWidgets('onSelectedItemChanged and controller are in sync', (WidgetTester tester) async { final List<int> selectedItems = <int>[]; final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); @@ -1334,7 +1333,7 @@ void main() { expect(controller.selectedItem, 10); }); - testWidgetsWithLeakTracking('controller hot swappable', (WidgetTester tester) async { + testWidgets('controller hot swappable', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1421,7 +1420,7 @@ void main() { expect(controller2.hasClients, isFalse); }); - testWidgetsWithLeakTracking('controller can be reused', (WidgetTester tester) async { + testWidgets('controller can be reused', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 3); addTearDown(controller.dispose); @@ -1472,7 +1471,7 @@ void main() { }); group('physics', () { - testWidgetsWithLeakTracking('fling velocities too low snaps back to the same item', (WidgetTester tester) async { + testWidgets('fling velocities too low snaps back to the same item', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 40); addTearDown(controller.dispose); final List<double> scrolledPositions = <double>[]; @@ -1523,7 +1522,7 @@ void main() { expect(scrolledPositions.last, moreOrLessEquals(40 * 1000.0, epsilon: 0.2)); }); - testWidgetsWithLeakTracking('high fling velocities lands exactly on items', (WidgetTester tester) async { + testWidgets('high fling velocities lands exactly on items', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 40); addTearDown(controller.dispose); final List<double> scrolledPositions = <double>[]; @@ -1577,7 +1576,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); }); - testWidgetsWithLeakTracking('ListWheelScrollView getOffsetToReveal', (WidgetTester tester) async { + testWidgets('ListWheelScrollView getOffsetToReveal', (WidgetTester tester) async { List<Widget> outerChildren; final List<Widget> innerChildren = List<Widget>.generate(10, (int index) => Container()); final ScrollController controller = ScrollController(initialScrollOffset: 300.0); @@ -1647,7 +1646,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(165.0, 265.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('will not assert on getOffsetToReveal Axis', (WidgetTester tester) async { + testWidgets('will not assert on getOffsetToReveal Axis', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); @@ -1681,7 +1680,7 @@ void main() { viewport.getOffsetToReveal(target, 0.0, axis: Axis.horizontal); }); - testWidgetsWithLeakTracking('ListWheelScrollView showOnScreen', (WidgetTester tester) async { + testWidgets('ListWheelScrollView showOnScreen', (WidgetTester tester) async { List<Widget> outerChildren; final List<Widget> innerChildren = List<Widget>.generate(10, (int index) => Container()); final ScrollController controller = ScrollController(initialScrollOffset: 300.0); @@ -1738,7 +1737,7 @@ void main() { }); group('gestures', () { - testWidgetsWithLeakTracking('ListWheelScrollView allows taps for on its children', (WidgetTester tester) async { + testWidgets('ListWheelScrollView allows taps for on its children', (WidgetTester tester) async { final FixedExtentScrollController controller = FixedExtentScrollController(initialItem: 10); addTearDown(controller.dispose); final List<int> children = List<int>.generate(100, (int index) => index); @@ -1781,7 +1780,7 @@ void main() { expect(tappedChildren, paintedChildren); }); - testWidgetsWithLeakTracking('ListWheelScrollView allows for horizontal drags on its children', (WidgetTester tester) async { + testWidgets('ListWheelScrollView allows for horizontal drags on its children', (WidgetTester tester) async { final PageController pageController = PageController(); addTearDown(pageController.dispose); @@ -1809,7 +1808,7 @@ void main() { expect(pageController.page, 1.0); }); - testWidgetsWithLeakTracking('ListWheelScrollView does not crash and does not allow taps on children that were laid out, but not painted', (WidgetTester tester) async { + testWidgets('ListWheelScrollView does not crash and does not allow taps on children that were laid out, but not painted', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126491 final FixedExtentScrollController controller = FixedExtentScrollController(); @@ -1870,7 +1869,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('ListWheelScrollView creates only one opacity layer for all children', (WidgetTester tester) async { + testWidgets('ListWheelScrollView creates only one opacity layer for all children', (WidgetTester tester) async { await tester.pumpWidget( ListWheelScrollView( overAndUnderCenterOpacity: 0.5, diff --git a/packages/flutter/test/widgets/listener_test.dart b/packages/flutter/test/widgets/listener_test.dart index 64daf2e4bb9..5b80b2fc2be 100644 --- a/packages/flutter/test/widgets/listener_test.dart +++ b/packages/flutter/test/widgets/listener_test.dart @@ -8,12 +8,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'gesture_utils.dart'; void main() { - testWidgetsWithLeakTracking('Events bubble up the tree', (WidgetTester tester) async { + testWidgets('Events bubble up the tree', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -47,7 +46,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('Detects hover events from touch devices', (WidgetTester tester) async { + testWidgets('Detects hover events from touch devices', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -75,7 +74,7 @@ void main() { }); group('transformed events', () { - testWidgetsWithLeakTracking('simple offset for touch/signal', (WidgetTester tester) async { + testWidgets('simple offset for touch/signal', (WidgetTester tester) async { final List<PointerEvent> events = <PointerEvent>[]; final Key key = UniqueKey(); @@ -146,7 +145,7 @@ void main() { expect(events.single.transform, expectedTransform); }); - testWidgetsWithLeakTracking('scaled for touch/signal', (WidgetTester tester) async { + testWidgets('scaled for touch/signal', (WidgetTester tester) async { final List<PointerEvent> events = <PointerEvent>[]; final Key key = UniqueKey(); @@ -223,7 +222,7 @@ void main() { expect(events.single.transform, expectedTransform); }); - testWidgetsWithLeakTracking('scaled and offset for touch/signal', (WidgetTester tester) async { + testWidgets('scaled and offset for touch/signal', (WidgetTester tester) async { final List<PointerEvent> events = <PointerEvent>[]; final Key key = UniqueKey(); @@ -301,7 +300,7 @@ void main() { expect(events.single.transform, expectedTransform); }); - testWidgetsWithLeakTracking('rotated for touch/signal', (WidgetTester tester) async { + testWidgets('rotated for touch/signal', (WidgetTester tester) async { final List<PointerEvent> events = <PointerEvent>[]; final Key key = UniqueKey(); @@ -379,7 +378,7 @@ void main() { }); }); - testWidgetsWithLeakTracking("RenderPointerListener's debugFillProperties when default", (WidgetTester tester) async { + testWidgets("RenderPointerListener's debugFillProperties when default", (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final RenderPointerListener renderListener = RenderPointerListener(); addTearDown(renderListener.dispose); @@ -400,7 +399,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking("RenderPointerListener's debugFillProperties when full", (WidgetTester tester) async { + testWidgets("RenderPointerListener's debugFillProperties when full", (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final RenderErrorBox renderErrorBox = RenderErrorBox(); diff --git a/packages/flutter/test/widgets/listview_end_append_test.dart b/packages/flutter/test/widgets/listview_end_append_test.dart index 1e1cf76869b..6d587828fd9 100644 --- a/packages/flutter/test/widgets/listview_end_append_test.dart +++ b/packages/flutter/test/widgets/listview_end_append_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ListView.builder() fixed itemExtent, scroll to end, append, scroll', (WidgetTester tester) async { + testWidgets('ListView.builder() fixed itemExtent, scroll to end, append, scroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/9506 Widget buildFrame(int itemCount) { @@ -36,7 +35,7 @@ void main() { expect(find.text('item 3'), findsOneWidget); }); - testWidgetsWithLeakTracking('ListView.builder() fixed itemExtent, scroll to end, append, scroll', (WidgetTester tester) async { + testWidgets('ListView.builder() fixed itemExtent, scroll to end, append, scroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/9506 Widget buildFrame(int itemCount) { diff --git a/packages/flutter/test/widgets/localizations_test.dart b/packages/flutter/test/widgets/localizations_test.dart index 213fe955f59..ff96e095faf 100644 --- a/packages/flutter/test/widgets/localizations_test.dart +++ b/packages/flutter/test/widgets/localizations_test.dart @@ -6,12 +6,11 @@ import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { final TestAutomatedTestWidgetsFlutterBinding binding = TestAutomatedTestWidgetsFlutterBinding(); - testWidgetsWithLeakTracking('Locale is available when Localizations widget stops deferring frames', (WidgetTester tester) async { + testWidgets('Locale is available when Localizations widget stops deferring frames', (WidgetTester tester) async { final FakeLocalizationsDelegate delegate = FakeLocalizationsDelegate(); await tester.pumpWidget(Localizations( locale: const Locale('fo'), @@ -38,7 +37,7 @@ void main() { expect(find.text('loaded'), findsOneWidget); }); - testWidgetsWithLeakTracking('Localizations.localeOf throws when no localizations exist', (WidgetTester tester) async { + testWidgets('Localizations.localeOf throws when no localizations exist', (WidgetTester tester) async { final GlobalKey contextKey = GlobalKey(debugLabel: 'Test Key'); await tester.pumpWidget(Container(key: contextKey)); @@ -49,7 +48,7 @@ void main() { ))); }); - testWidgetsWithLeakTracking('Localizations.maybeLocaleOf returns null when no localizations exist', (WidgetTester tester) async { + testWidgets('Localizations.maybeLocaleOf returns null when no localizations exist', (WidgetTester tester) async { final GlobalKey contextKey = GlobalKey(debugLabel: 'Test Key'); await tester.pumpWidget(Container(key: contextKey)); diff --git a/packages/flutter/test/widgets/lookup_boundary_test.dart b/packages/flutter/test/widgets/lookup_boundary_test.dart index d1af4fa09a7..36d2d3b310b 100644 --- a/packages/flutter/test/widgets/lookup_boundary_test.dart +++ b/packages/flutter/test/widgets/lookup_boundary_test.dart @@ -5,11 +5,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('LookupBoundary.dependOnInheritedWidgetOfExactType', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { InheritedWidget? containerThroughBoundary; InheritedWidget? containerStoppedAtBoundary; @@ -33,7 +32,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('ignores ancestor boundary', (WidgetTester tester) async { + testWidgets('ignores ancestor boundary', (WidgetTester tester) async { InheritedWidget? inheritedWidget; final Key inheritedKey = UniqueKey(); @@ -54,7 +53,7 @@ void main() { expect(inheritedWidget, equals(tester.widget(find.byKey(inheritedKey)))); }); - testWidgetsWithLeakTracking('finds widget before boundary', (WidgetTester tester) async { + testWidgets('finds widget before boundary', (WidgetTester tester) async { InheritedWidget? containerThroughBoundary; InheritedWidget? containerStoppedAtBoundary; @@ -81,7 +80,7 @@ void main() { expect(containerStoppedAtBoundary, equals(tester.widget(find.byKey(inheritedKey)))); }); - testWidgetsWithLeakTracking('creates dependency', (WidgetTester tester) async { + testWidgets('creates dependency', (WidgetTester tester) async { MyInheritedWidget? inheritedWidget; final Widget widgetTree = DidChangeDependencySpy( @@ -109,7 +108,7 @@ void main() { expect(tester.state<_DidChangeDependencySpyState>(find.byType(DidChangeDependencySpy)).didChangeDependenciesCount, 2); }); - testWidgetsWithLeakTracking('causes didChangeDependencies to be called on move even if dependency was not fulfilled due to boundary', (WidgetTester tester) async { + testWidgets('causes didChangeDependencies to be called on move even if dependency was not fulfilled due to boundary', (WidgetTester tester) async { MyInheritedWidget? inheritedWidget; final Key globalKey = GlobalKey(); @@ -174,7 +173,7 @@ void main() { expect(tester.state<_DidChangeDependencySpyState>(find.byType(DidChangeDependencySpy)).didChangeDependenciesCount, 3); }); - testWidgetsWithLeakTracking('causes didChangeDependencies to be called on move even if dependency was non-existant', (WidgetTester tester) async { + testWidgets('causes didChangeDependencies to be called on move even if dependency was non-existant', (WidgetTester tester) async { MyInheritedWidget? inheritedWidget; final Key globalKey = GlobalKey(); @@ -213,7 +212,7 @@ void main() { }); group('LookupBoundary.getElementForInheritedWidgetOfExactType', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { InheritedElement? containerThroughBoundary; InheritedElement? containerStoppedAtBoundary; @@ -237,7 +236,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('ignores ancestor boundary', (WidgetTester tester) async { + testWidgets('ignores ancestor boundary', (WidgetTester tester) async { InheritedElement? inheritedWidget; final Key inheritedKey = UniqueKey(); @@ -258,7 +257,7 @@ void main() { expect(inheritedWidget, equals(tester.element(find.byKey(inheritedKey)))); }); - testWidgetsWithLeakTracking('finds widget before boundary', (WidgetTester tester) async { + testWidgets('finds widget before boundary', (WidgetTester tester) async { InheritedElement? containerThroughBoundary; InheritedElement? containerStoppedAtBoundary; @@ -285,7 +284,7 @@ void main() { expect(containerStoppedAtBoundary, equals(tester.element(find.byKey(inheritedKey)))); }); - testWidgetsWithLeakTracking('does not creates dependency', (WidgetTester tester) async { + testWidgets('does not creates dependency', (WidgetTester tester) async { final Widget widgetTree = DidChangeDependencySpy( onDidChangeDependencies: (BuildContext context) { @@ -310,7 +309,7 @@ void main() { expect(tester.state<_DidChangeDependencySpyState>(find.byType(DidChangeDependencySpy)).didChangeDependenciesCount, 1); }); - testWidgetsWithLeakTracking('does not cause didChangeDependencies to be called on move when found', (WidgetTester tester) async { + testWidgets('does not cause didChangeDependencies to be called on move when found', (WidgetTester tester) async { final Key globalKey = GlobalKey(); final Widget widgetTree = DidChangeDependencySpy( @@ -370,7 +369,7 @@ void main() { expect(tester.state<_DidChangeDependencySpyState>(find.byType(DidChangeDependencySpy)).didChangeDependenciesCount, 1); }); - testWidgetsWithLeakTracking('does not cause didChangeDependencies to be called on move when nothing was found', (WidgetTester tester) async { + testWidgets('does not cause didChangeDependencies to be called on move when nothing was found', (WidgetTester tester) async { final Key globalKey = GlobalKey(); final Widget widgetTree = DidChangeDependencySpy( @@ -405,7 +404,7 @@ void main() { }); group('LookupBoundary.findAncestorWidgetOfExactType', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { Widget? containerThroughBoundary; Widget? containerStoppedAtBoundary; Widget? boundaryThroughBoundary; @@ -436,7 +435,7 @@ void main() { expect(boundaryStoppedAtBoundary, equals(tester.widget(find.byKey(boundaryKey)))); }); - testWidgetsWithLeakTracking('finds right widget before boundary', (WidgetTester tester) async { + testWidgets('finds right widget before boundary', (WidgetTester tester) async { Widget? containerThroughBoundary; Widget? containerStoppedAtBoundary; @@ -467,7 +466,7 @@ void main() { expect(containerStoppedAtBoundary, equals(tester.widget(find.byKey(innerContainerKey)))); }); - testWidgetsWithLeakTracking('works if nothing is found', (WidgetTester tester) async { + testWidgets('works if nothing is found', (WidgetTester tester) async { Widget? containerStoppedAtBoundary; await tester.pumpWidget(Builder( @@ -480,7 +479,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('does not establish a dependency', (WidgetTester tester) async { + testWidgets('does not establish a dependency', (WidgetTester tester) async { Widget? containerThroughBoundary; Widget? containerStoppedAtBoundary; Widget? containerStoppedAtBoundaryUnfulfilled; @@ -521,7 +520,7 @@ void main() { }); group('LookupBoundary.findAncestorStateOfType', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { State? containerThroughBoundary; State? containerStoppedAtBoundary; @@ -544,7 +543,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('finds right widget before boundary', (WidgetTester tester) async { + testWidgets('finds right widget before boundary', (WidgetTester tester) async { State? containerThroughBoundary; State? containerStoppedAtBoundary; @@ -573,7 +572,7 @@ void main() { expect(containerStoppedAtBoundary, equals(tester.state(find.byKey(innerContainerKey)))); }); - testWidgetsWithLeakTracking('works if nothing is found', (WidgetTester tester) async { + testWidgets('works if nothing is found', (WidgetTester tester) async { State? containerStoppedAtBoundary; await tester.pumpWidget(Builder( @@ -586,7 +585,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('does not establish a dependency', (WidgetTester tester) async { + testWidgets('does not establish a dependency', (WidgetTester tester) async { State? containerThroughBoundary; State? containerStoppedAtBoundary; State? containerStoppedAtBoundaryUnfulfilled; @@ -627,7 +626,7 @@ void main() { }); group('LookupBoundary.findRootAncestorStateOfType', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { State? containerThroughBoundary; State? containerStoppedAtBoundary; @@ -650,7 +649,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('finds right widget before boundary', (WidgetTester tester) async { + testWidgets('finds right widget before boundary', (WidgetTester tester) async { State? containerThroughBoundary; State? containerStoppedAtBoundary; @@ -679,7 +678,7 @@ void main() { expect(containerStoppedAtBoundary, equals(tester.state(find.byKey(innerContainerKey)))); }); - testWidgetsWithLeakTracking('works if nothing is found', (WidgetTester tester) async { + testWidgets('works if nothing is found', (WidgetTester tester) async { State? containerStoppedAtBoundary; await tester.pumpWidget(Builder( @@ -692,7 +691,7 @@ void main() { expect(containerStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('does not establish a dependency', (WidgetTester tester) async { + testWidgets('does not establish a dependency', (WidgetTester tester) async { State? containerThroughBoundary; State? containerStoppedAtBoundary; State? containerStoppedAtBoundaryUnfulfilled; @@ -733,7 +732,7 @@ void main() { }); group('LookupBoundary.findAncestorRenderObjectOfType', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { RenderPadding? paddingThroughBoundary; RenderPadding? passingStoppedAtBoundary; @@ -757,7 +756,7 @@ void main() { expect(passingStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('finds right widget before boundary', (WidgetTester tester) async { + testWidgets('finds right widget before boundary', (WidgetTester tester) async { RenderPadding? paddingThroughBoundary; RenderPadding? paddingStoppedAtBoundary; @@ -789,7 +788,7 @@ void main() { expect(paddingStoppedAtBoundary, equals(tester.renderObject(find.byKey(innerPaddingKey)))); }); - testWidgetsWithLeakTracking('works if nothing is found', (WidgetTester tester) async { + testWidgets('works if nothing is found', (WidgetTester tester) async { RenderPadding? paddingStoppedAtBoundary; await tester.pumpWidget(Builder( @@ -802,7 +801,7 @@ void main() { expect(paddingStoppedAtBoundary, isNull); }); - testWidgetsWithLeakTracking('does not establish a dependency', (WidgetTester tester) async { + testWidgets('does not establish a dependency', (WidgetTester tester) async { RenderPadding? paddingThroughBoundary; RenderPadding? paddingStoppedAtBoundary; RenderWrap? wrapStoppedAtBoundaryUnfulfilled; @@ -844,7 +843,7 @@ void main() { }); group('LookupBoundary.visitAncestorElements', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { final List<Element> throughBoundary = <Element>[]; final List<Element> stoppedAtBoundary = <Element>[]; final List<Element> stoppedAtBoundaryTerminatedEarly = <Element>[]; @@ -910,7 +909,7 @@ void main() { }); group('LookupBoundary.visitChildElements', () { - testWidgetsWithLeakTracking('respects boundary', (WidgetTester tester) async { + testWidgets('respects boundary', (WidgetTester tester) async { final Key root = UniqueKey(); final Key child1 = UniqueKey(); final Key child2 = UniqueKey(); @@ -962,7 +961,7 @@ void main() { }); group('LookupBoundary.debugIsHidingAncestorWidgetOfExactType', () { - testWidgetsWithLeakTracking('is hiding', (WidgetTester tester) async { + testWidgets('is hiding', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Container( padding: const EdgeInsets.all(10), @@ -979,7 +978,7 @@ void main() { expect(isHidden, isTrue); }); - testWidgetsWithLeakTracking('is not hiding entity within boundary', (WidgetTester tester) async { + testWidgets('is not hiding entity within boundary', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Container( padding: const EdgeInsets.all(10), @@ -1000,7 +999,7 @@ void main() { expect(isHidden, isFalse); }); - testWidgetsWithLeakTracking('is not hiding if no boundary exists', (WidgetTester tester) async { + testWidgets('is not hiding if no boundary exists', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Container( padding: const EdgeInsets.all(10), @@ -1015,7 +1014,7 @@ void main() { expect(isHidden, isFalse); }); - testWidgetsWithLeakTracking('is not hiding if no boundary and no entity exists', (WidgetTester tester) async { + testWidgets('is not hiding if no boundary and no entity exists', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Builder( builder: (BuildContext context) { @@ -1028,7 +1027,7 @@ void main() { }); group('LookupBoundary.debugIsHidingAncestorStateOfType', () { - testWidgetsWithLeakTracking('is hiding', (WidgetTester tester) async { + testWidgets('is hiding', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(MyStatefulContainer( child: LookupBoundary( @@ -1043,7 +1042,7 @@ void main() { expect(isHidden, isTrue); }); - testWidgetsWithLeakTracking('is not hiding entity within boundary', (WidgetTester tester) async { + testWidgets('is not hiding entity within boundary', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(MyStatefulContainer( child: LookupBoundary( @@ -1060,7 +1059,7 @@ void main() { expect(isHidden, isFalse); }); - testWidgetsWithLeakTracking('is not hiding if no boundary exists', (WidgetTester tester) async { + testWidgets('is not hiding if no boundary exists', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(MyStatefulContainer( child: Builder( @@ -1073,7 +1072,7 @@ void main() { expect(isHidden, isFalse); }); - testWidgetsWithLeakTracking('is not hiding if no boundary and no entity exists', (WidgetTester tester) async { + testWidgets('is not hiding if no boundary and no entity exists', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Builder( builder: (BuildContext context) { @@ -1086,7 +1085,7 @@ void main() { }); group('LookupBoundary.debugIsHidingAncestorRenderObjectOfType', () { - testWidgetsWithLeakTracking('is hiding', (WidgetTester tester) async { + testWidgets('is hiding', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Padding( padding: EdgeInsets.zero, @@ -1102,7 +1101,7 @@ void main() { expect(isHidden, isTrue); }); - testWidgetsWithLeakTracking('is not hiding entity within boundary', (WidgetTester tester) async { + testWidgets('is not hiding entity within boundary', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Padding( padding: EdgeInsets.zero, @@ -1121,7 +1120,7 @@ void main() { expect(isHidden, isFalse); }); - testWidgetsWithLeakTracking('is not hiding if no boundary exists', (WidgetTester tester) async { + testWidgets('is not hiding if no boundary exists', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Padding( padding: EdgeInsets.zero, @@ -1135,7 +1134,7 @@ void main() { expect(isHidden, isFalse); }); - testWidgetsWithLeakTracking('is not hiding if no boundary and no entity exists', (WidgetTester tester) async { + testWidgets('is not hiding if no boundary and no entity exists', (WidgetTester tester) async { bool? isHidden; await tester.pumpWidget(Builder( builder: (BuildContext context) { diff --git a/packages/flutter/test/widgets/magnifier_test.dart b/packages/flutter/test/widgets/magnifier_test.dart index 4cae88b19f6..922e2e9d31a 100644 --- a/packages/flutter/test/widgets/magnifier_test.dart +++ b/packages/flutter/test/widgets/magnifier_test.dart @@ -9,7 +9,6 @@ import 'package:fake_async/fake_async.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class _MockAnimationController extends AnimationController { _MockAnimationController() @@ -43,7 +42,7 @@ void main() { } group('Raw Magnifier', () { - testWidgetsWithLeakTracking('should render with correct focal point and decoration', + testWidgets('should render with correct focal point and decoration', (WidgetTester tester) async { final Key appKey = UniqueKey(); const Size magnifierSize = Size(100, 100); @@ -117,7 +116,7 @@ void main() { magnifierController.removeFromOverlay(); }); - testWidgetsWithLeakTracking( + testWidgets( 'should immediately remove from overlay on no animation controller', (WidgetTester tester) async { await runFakeAsync((FakeAsync async) async { @@ -150,7 +149,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('should update shown based on animation status', + testWidgets('should update shown based on animation status', (WidgetTester tester) async { await runFakeAsync((FakeAsync async) async { final MagnifierController magnifierController = @@ -215,7 +214,7 @@ void main() { }); group('show', () { - testWidgetsWithLeakTracking('should insert below below widget', (WidgetTester tester) async { + testWidgets('should insert below below widget', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Text('text'), )); @@ -249,7 +248,7 @@ void main() { expect(allOverlayChildren.first.widget.key, fakeMagnifier.key); }); - testWidgetsWithLeakTracking('should insert newly built widget without animating out if overlay != null', + testWidgets('should insert newly built widget without animating out if overlay != null', (WidgetTester tester) async { await runFakeAsync((FakeAsync async) async { final _MockAnimationController animationController = diff --git a/packages/flutter/test/widgets/mark_needs_build_test.dart b/packages/flutter/test/widgets/mark_needs_build_test.dart index af21964be22..9fa2d008b33 100644 --- a/packages/flutter/test/widgets/mark_needs_build_test.dart +++ b/packages/flutter/test/widgets/mark_needs_build_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('setState can be called from build, initState, didChangeDependencies, and didUpdateWidget', (WidgetTester tester) async { + testWidgets('setState can be called from build, initState, didChangeDependencies, and didUpdateWidget', (WidgetTester tester) async { // Initial build. await tester.pumpWidget( const Directionality( diff --git a/packages/flutter/test/widgets/media_query_test.dart b/packages/flutter/test/widgets/media_query_test.dart index f2608a21405..e337c8f1d7d 100644 --- a/packages/flutter/test/widgets/media_query_test.dart +++ b/packages/flutter/test/widgets/media_query_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' show Brightness, DisplayFeature, DisplayFeatureState, DisplayFe import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class _MediaQueryAspectCase { const _MediaQueryAspectCase(this.method, this.data); @@ -44,7 +43,7 @@ class _MediaQueryAspectVariant extends TestVariant<_MediaQueryAspectCase> { } void main() { - testWidgetsWithLeakTracking('MediaQuery does not have a default', (WidgetTester tester) async { + testWidgets('MediaQuery does not have a default', (WidgetTester tester) async { late final FlutterError error; // Cannot use tester.pumpWidget here because it wraps the widget in a View, // which introduces a MediaQuery ancestor. @@ -88,7 +87,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('MediaQuery.of finds a MediaQueryData when there is one', (WidgetTester tester) async { + testWidgets('MediaQuery.of finds a MediaQueryData when there is one', (WidgetTester tester) async { bool tested = false; await tester.pumpWidget( MediaQuery( @@ -108,7 +107,7 @@ void main() { expect(tested, isTrue); }); - testWidgetsWithLeakTracking('MediaQuery.maybeOf defaults to null', (WidgetTester tester) async { + testWidgets('MediaQuery.maybeOf defaults to null', (WidgetTester tester) async { bool tested = false; // Cannot use tester.pumpWidget here because it wraps the widget in a View, // which introduces a MediaQuery ancestor. @@ -129,7 +128,7 @@ void main() { expect(tested, isTrue); }); - testWidgetsWithLeakTracking('MediaQuery.maybeOf finds a MediaQueryData when there is one', (WidgetTester tester) async { + testWidgets('MediaQuery.maybeOf finds a MediaQueryData when there is one', (WidgetTester tester) async { bool tested = false; await tester.pumpWidget( MediaQuery( @@ -147,7 +146,7 @@ void main() { expect(tested, isTrue); }); - testWidgetsWithLeakTracking('MediaQueryData.fromView is sane', (WidgetTester tester) async { + testWidgets('MediaQueryData.fromView is sane', (WidgetTester tester) async { final MediaQueryData data = MediaQueryData.fromView(tester.view); expect(data, hasOneLineDescription); expect(data.hashCode, equals(data.copyWith().hashCode)); @@ -163,7 +162,7 @@ void main() { expect(data.displayFeatures, isEmpty); }); - testWidgetsWithLeakTracking('MediaQueryData.fromView uses platformData if provided', (WidgetTester tester) async { + testWidgets('MediaQueryData.fromView uses platformData if provided', (WidgetTester tester) async { const MediaQueryData platformData = MediaQueryData( textScaleFactor: 1234, platformBrightness: Brightness.dark, @@ -200,7 +199,7 @@ void main() { expect(data.displayFeatures, tester.view.displayFeatures); }); - testWidgetsWithLeakTracking('MediaQueryData.fromView uses data from platformDispatcher if no platformData is provided', (WidgetTester tester) async { + testWidgets('MediaQueryData.fromView uses data from platformDispatcher if no platformData is provided', (WidgetTester tester) async { tester.platformDispatcher ..textScaleFactorTestValue = 123 ..platformBrightnessTestValue = Brightness.dark @@ -230,7 +229,7 @@ void main() { expect(data.displayFeatures, tester.view.displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.fromView injects a new MediaQuery with data from view, preserving platform-specific data', (WidgetTester tester) async { + testWidgets('MediaQuery.fromView injects a new MediaQuery with data from view, preserving platform-specific data', (WidgetTester tester) async { const MediaQueryData platformData = MediaQueryData( textScaleFactor: 1234, platformBrightness: Brightness.dark, @@ -279,7 +278,7 @@ void main() { expect(data.displayFeatures, tester.view.displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.fromView injects a new MediaQuery with data from view when no surrounding MediaQuery exists', (WidgetTester tester) async { + testWidgets('MediaQuery.fromView injects a new MediaQuery with data from view when no surrounding MediaQuery exists', (WidgetTester tester) async { tester.platformDispatcher ..textScaleFactorTestValue = 123 ..platformBrightnessTestValue = Brightness.dark @@ -330,7 +329,7 @@ void main() { expect(data.displayFeatures, tester.view.displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.fromView updates on notifications (no parent data)', (WidgetTester tester) async { + testWidgets('MediaQuery.fromView updates on notifications (no parent data)', (WidgetTester tester) async { addTearDown(() => tester.platformDispatcher.clearAllTestValues()); addTearDown(() => tester.view.reset()); @@ -393,7 +392,7 @@ void main() { expect(rebuildCount, 5); }); - testWidgetsWithLeakTracking('MediaQuery.fromView updates on notifications (with parent data)', (WidgetTester tester) async { + testWidgets('MediaQuery.fromView updates on notifications (with parent data)', (WidgetTester tester) async { addTearDown(() => tester.platformDispatcher.clearAllTestValues()); addTearDown(() => tester.view.reset()); @@ -452,7 +451,7 @@ void main() { expect(rebuildCount, 2); }); - testWidgetsWithLeakTracking('MediaQuery.fromView updates when parent data changes', (WidgetTester tester) async { + testWidgets('MediaQuery.fromView updates when parent data changes', (WidgetTester tester) async { late MediaQueryData data; int rebuildCount = 0; TextScaler textScaler = const TextScaler.linear(55); @@ -489,7 +488,7 @@ void main() { expect(rebuildCount, 2); }); - testWidgetsWithLeakTracking('MediaQueryData.copyWith defaults to source', (WidgetTester tester) async { + testWidgets('MediaQueryData.copyWith defaults to source', (WidgetTester tester) async { final MediaQueryData data = MediaQueryData.fromView(tester.view); final MediaQueryData copied = data.copyWith(); expect(copied.size, data.size); @@ -511,7 +510,7 @@ void main() { expect(copied.displayFeatures, data.displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.copyWith copies specified values', (WidgetTester tester) async { + testWidgets('MediaQuery.copyWith copies specified values', (WidgetTester tester) async { // Random and unique double values are used to ensure that the correct // values are copied over exactly const Size customSize = Size(3.14, 2.72); @@ -571,7 +570,7 @@ void main() { expect(copied.displayFeatures, customDisplayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.removePadding removes specified padding', (WidgetTester tester) async { + testWidgets('MediaQuery.removePadding removes specified padding', (WidgetTester tester) async { const Size size = Size(2.0, 4.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -643,7 +642,7 @@ void main() { expect(unpadded.displayFeatures, displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.removePadding only removes specified padding', (WidgetTester tester) async { + testWidgets('MediaQuery.removePadding only removes specified padding', (WidgetTester tester) async { const Size size = Size(2.0, 4.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -712,7 +711,7 @@ void main() { expect(unpadded.displayFeatures, displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.removeViewInsets removes specified viewInsets', (WidgetTester tester) async { + testWidgets('MediaQuery.removeViewInsets removes specified viewInsets', (WidgetTester tester) async { const Size size = Size(2.0, 4.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -784,7 +783,7 @@ void main() { expect(unpadded.displayFeatures, displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.removeViewInsets removes only specified viewInsets', (WidgetTester tester) async { + testWidgets('MediaQuery.removeViewInsets removes only specified viewInsets', (WidgetTester tester) async { const Size size = Size(2.0, 4.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -853,7 +852,7 @@ void main() { expect(unpadded.displayFeatures, displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.removeViewPadding removes specified viewPadding', (WidgetTester tester) async { + testWidgets('MediaQuery.removeViewPadding removes specified viewPadding', (WidgetTester tester) async { const Size size = Size(2.0, 4.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -925,7 +924,7 @@ void main() { expect(unpadded.displayFeatures, displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.removeViewPadding removes only specified viewPadding', (WidgetTester tester) async { + testWidgets('MediaQuery.removeViewPadding removes only specified viewPadding', (WidgetTester tester) async { const Size size = Size(2.0, 4.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -994,7 +993,7 @@ void main() { expect(unpadded.displayFeatures, displayFeatures); }); - testWidgetsWithLeakTracking('MediaQuery.textScalerOf', (WidgetTester tester) async { + testWidgets('MediaQuery.textScalerOf', (WidgetTester tester) async { late TextScaler outsideTextScaler; late TextScaler insideTextScaler; @@ -1021,7 +1020,7 @@ void main() { expect(insideTextScaler, const TextScaler.linear(4.0)); }); - testWidgetsWithLeakTracking('MediaQuery.platformBrightnessOf', (WidgetTester tester) async { + testWidgets('MediaQuery.platformBrightnessOf', (WidgetTester tester) async { late Brightness outsideBrightness; late Brightness insideBrightness; @@ -1048,7 +1047,7 @@ void main() { expect(insideBrightness, Brightness.dark); }); - testWidgetsWithLeakTracking('MediaQuery.highContrastOf', (WidgetTester tester) async { + testWidgets('MediaQuery.highContrastOf', (WidgetTester tester) async { late bool outsideHighContrast; late bool insideHighContrast; @@ -1075,7 +1074,7 @@ void main() { expect(insideHighContrast, true); }); - testWidgetsWithLeakTracking('MediaQuery.onOffSwitchLabelsOf', (WidgetTester tester) async { + testWidgets('MediaQuery.onOffSwitchLabelsOf', (WidgetTester tester) async { late bool outsideOnOffSwitchLabels; late bool insideOnOffSwitchLabels; @@ -1102,7 +1101,7 @@ void main() { expect(insideOnOffSwitchLabels, true); }); - testWidgetsWithLeakTracking('MediaQuery.boldTextOf', (WidgetTester tester) async { + testWidgets('MediaQuery.boldTextOf', (WidgetTester tester) async { late bool outsideBoldTextOverride; late bool insideBoldTextOverride; @@ -1129,7 +1128,7 @@ void main() { expect(insideBoldTextOverride, true); }); - testWidgetsWithLeakTracking('MediaQuery.fromView creates a MediaQuery', (WidgetTester tester) async { + testWidgets('MediaQuery.fromView creates a MediaQuery', (WidgetTester tester) async { MediaQuery? mediaQueryOutside; MediaQuery? mediaQueryInside; @@ -1154,7 +1153,7 @@ void main() { expect(mediaQueryOutside, isNot(mediaQueryInside)); }); - testWidgetsWithLeakTracking('MediaQueryData.fromWindow is created using window values', (WidgetTester tester) async { + testWidgets('MediaQueryData.fromWindow is created using window values', (WidgetTester tester) async { final MediaQueryData windowData = MediaQueryData.fromWindow(tester.view); late MediaQueryData fromWindowData; @@ -1190,7 +1189,7 @@ void main() { expect(settingsA, isNot(settingsB)); }); - testWidgetsWithLeakTracking('MediaQuery.removeDisplayFeatures removes specified display features and padding', (WidgetTester tester) async { + testWidgets('MediaQuery.removeDisplayFeatures removes specified display features and padding', (WidgetTester tester) async { const Size size = Size(82.0, 40.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -1264,7 +1263,7 @@ void main() { expect(subScreenMediaQuery.displayFeatures, isEmpty); }); - testWidgetsWithLeakTracking('MediaQuery.removePadding only removes specified display features and padding', (WidgetTester tester) async { + testWidgets('MediaQuery.removePadding only removes specified display features and padding', (WidgetTester tester) async { const Size size = Size(82.0, 40.0); const double devicePixelRatio = 2.0; const TextScaler textScaler = TextScaler.linear(1.2); @@ -1348,14 +1347,14 @@ void main() { expect(subScreenMediaQuery.displayFeatures, <DisplayFeature>[cutoutDisplayFeature]); }); - testWidgetsWithLeakTracking('MediaQueryData.gestureSettings is set from view.gestureSettings', (WidgetTester tester) async { + testWidgets('MediaQueryData.gestureSettings is set from view.gestureSettings', (WidgetTester tester) async { tester.view.gestureSettings = const GestureSettings(physicalDoubleTapSlop: 100, physicalTouchSlop: 100); addTearDown(() => tester.view.resetGestureSettings()); expect(MediaQueryData.fromView(tester.view).gestureSettings.touchSlop, closeTo(33.33, 0.1)); // Repeating, of course }); - testWidgetsWithLeakTracking('MediaQuery can be partially depended-on', (WidgetTester tester) async { + testWidgets('MediaQuery can be partially depended-on', (WidgetTester tester) async { MediaQueryData data = const MediaQueryData( size: Size(800, 600), textScaler: TextScaler.linear(1.1), @@ -1431,7 +1430,7 @@ void main() { expect(textScalerBuildCount, 2); }); - testWidgetsWithLeakTracking('MediaQuery partial dependencies', (WidgetTester tester) async { + testWidgets('MediaQuery partial dependencies', (WidgetTester tester) async { MediaQueryData data = const MediaQueryData(); int buildCount = 0; diff --git a/packages/flutter/test/widgets/modal_barrier_test.dart b/packages/flutter/test/widgets/modal_barrier_test.dart index d502f9cd3f6..8fc615f2c46 100644 --- a/packages/flutter/test/widgets/modal_barrier_test.dart +++ b/packages/flutter/test/widgets/modal_barrier_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -47,7 +46,7 @@ void main() { }); group('ModalBarrier', () { - testWidgetsWithLeakTracking('prevents interactions with widgets behind it', (WidgetTester tester) async { + testWidgets('prevents interactions with widgets behind it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -62,7 +61,7 @@ void main() { expect(tapped, isFalse, reason: 'because the tap is not prevented by ModalBarrier'); }); - testWidgetsWithLeakTracking('prevents hover interactions with widgets behind it', (WidgetTester tester) async { + testWidgets('prevents hover interactions with widgets behind it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -89,7 +88,7 @@ void main() { expect(hovered, isFalse, reason: 'because the hover is not prevented by ModalBarrier'); }); - testWidgetsWithLeakTracking('does not prevent interactions with widgets in front of it', (WidgetTester tester) async { + testWidgets('does not prevent interactions with widgets in front of it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -104,7 +103,7 @@ void main() { expect(tapped, isTrue, reason: 'because the tap is prevented by ModalBarrier'); }); - testWidgetsWithLeakTracking('does not prevent interactions with translucent widgets in front of it', (WidgetTester tester) async { + testWidgets('does not prevent interactions with translucent widgets in front of it', (WidgetTester tester) async { bool dragged = false; final Widget subject = Stack( textDirection: TextDirection.ltr, @@ -131,7 +130,7 @@ void main() { expect(dragged, isTrue, reason: 'because the drag is prevented by ModalBarrier'); }); - testWidgetsWithLeakTracking('does not prevent hover interactions with widgets in front of it', (WidgetTester tester) async { + testWidgets('does not prevent hover interactions with widgets in front of it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -159,7 +158,7 @@ void main() { hovered = false; }); - testWidgetsWithLeakTracking('plays system alert sound when user tries to dismiss it', (WidgetTester tester) async { + testWidgets('plays system alert sound when user tries to dismiss it', (WidgetTester tester) async { final List<String> playedSystemSounds = <String>[]; try { tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( @@ -188,7 +187,7 @@ void main() { expect(playedSystemSounds[0], SystemSoundType.alert.toString()); }); - testWidgetsWithLeakTracking('pops the Navigator when dismissed by primary tap', (WidgetTester tester) async { + testWidgets('pops the Navigator when dismissed by primary tap', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => const SecondWidget(), @@ -221,7 +220,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('pops the Navigator when dismissed by non-primary tap', (WidgetTester tester) async { + testWidgets('pops the Navigator when dismissed by non-primary tap', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => const SecondWidget(), @@ -255,7 +254,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('may pop the Navigator when competing with other gestures', (WidgetTester tester) async { + testWidgets('may pop the Navigator when competing with other gestures', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => const SecondWidgetWithCompetence(), @@ -283,7 +282,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('does not pop the Navigator with a WillPopScope that returns false', (WidgetTester tester) async { + testWidgets('does not pop the Navigator with a WillPopScope that returns false', (WidgetTester tester) async { bool willPopCalled = false; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), @@ -328,7 +327,7 @@ void main() { expect(willPopCalled, isTrue); }); - testWidgetsWithLeakTracking('pops the Navigator with a WillPopScope that returns true', (WidgetTester tester) async { + testWidgets('pops the Navigator with a WillPopScope that returns true', (WidgetTester tester) async { bool willPopCalled = false; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), @@ -373,7 +372,7 @@ void main() { expect(willPopCalled, isTrue); }); - testWidgetsWithLeakTracking('will call onDismiss callback', (WidgetTester tester) async { + testWidgets('will call onDismiss callback', (WidgetTester tester) async { bool dismissCallbackCalled = false; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), @@ -401,7 +400,7 @@ void main() { expect(dismissCallbackCalled, true); }); - testWidgetsWithLeakTracking('when onDismiss throws, should have correct context', (WidgetTester tester) async { + testWidgets('when onDismiss throws, should have correct context', (WidgetTester tester) async { final FlutterExceptionHandler? handler = FlutterError.onError; FlutterErrorDetails? error; FlutterError.onError = (FlutterErrorDetails details) { @@ -424,7 +423,7 @@ void main() { FlutterError.onError = handler; }); - testWidgetsWithLeakTracking('will not pop when given an onDismiss callback', (WidgetTester tester) async { + testWidgets('will not pop when given an onDismiss callback', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => SecondWidget(onDismiss: () {}), @@ -451,7 +450,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Undismissible ModalBarrier hidden in semantic tree', (WidgetTester tester) async { + testWidgets('Undismissible ModalBarrier hidden in semantic tree', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const ModalBarrier(dismissible: false)); @@ -461,7 +460,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Dismissible ModalBarrier includes button in semantic tree on iOS, macOS and android', (WidgetTester tester) async { + testWidgets('Dismissible ModalBarrier includes button in semantic tree on iOS, macOS and android', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, @@ -487,7 +486,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android})); }); group('AnimatedModalBarrier', () { - testWidgetsWithLeakTracking('prevents interactions with widgets behind it', (WidgetTester tester) async { + testWidgets('prevents interactions with widgets behind it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -502,7 +501,7 @@ void main() { expect(tapped, isFalse, reason: 'because the tap is not prevented by ModalBarrier'); }); - testWidgetsWithLeakTracking('prevents hover interactions with widgets behind it', (WidgetTester tester) async { + testWidgets('prevents hover interactions with widgets behind it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -529,7 +528,7 @@ void main() { expect(hovered, isFalse, reason: 'because the hover is not prevented by AnimatedModalBarrier'); }); - testWidgetsWithLeakTracking('does not prevent interactions with widgets in front of it', (WidgetTester tester) async { + testWidgets('does not prevent interactions with widgets in front of it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -544,7 +543,7 @@ void main() { expect(tapped, isTrue, reason: 'because the tap is prevented by AnimatedModalBarrier'); }); - testWidgetsWithLeakTracking('does not prevent interactions with translucent widgets in front of it', (WidgetTester tester) async { + testWidgets('does not prevent interactions with translucent widgets in front of it', (WidgetTester tester) async { bool dragged = false; final Widget subject = Stack( textDirection: TextDirection.ltr, @@ -571,7 +570,7 @@ void main() { expect(dragged, isTrue, reason: 'because the drag is prevented by AnimatedModalBarrier'); }); - testWidgetsWithLeakTracking('does not prevent hover interactions with widgets in front of it', (WidgetTester tester) async { + testWidgets('does not prevent hover interactions with widgets in front of it', (WidgetTester tester) async { final Widget subject = Stack( textDirection: TextDirection.ltr, children: <Widget>[ @@ -599,7 +598,7 @@ void main() { hovered = false; }); - testWidgetsWithLeakTracking('plays system alert sound when user tries to dismiss it', (WidgetTester tester) async { + testWidgets('plays system alert sound when user tries to dismiss it', (WidgetTester tester) async { final List<String> playedSystemSounds = <String>[]; try { tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( @@ -628,7 +627,7 @@ void main() { expect(playedSystemSounds[0], SystemSoundType.alert.toString()); }); - testWidgetsWithLeakTracking('pops the Navigator when dismissed by primary tap', (WidgetTester tester) async { + testWidgets('pops the Navigator when dismissed by primary tap', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => const AnimatedSecondWidget(), @@ -661,7 +660,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('pops the Navigator when dismissed by non-primary tap', (WidgetTester tester) async { + testWidgets('pops the Navigator when dismissed by non-primary tap', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => const AnimatedSecondWidget(), @@ -695,7 +694,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('may pop the Navigator when competing with other gestures', (WidgetTester tester) async { + testWidgets('may pop the Navigator when competing with other gestures', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => const AnimatedSecondWidgetWithCompetence(), @@ -723,7 +722,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('does not pop the Navigator with a WillPopScope that returns false', (WidgetTester tester) async { + testWidgets('does not pop the Navigator with a WillPopScope that returns false', (WidgetTester tester) async { bool willPopCalled = false; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), @@ -768,7 +767,7 @@ void main() { expect(willPopCalled, isTrue); }); - testWidgetsWithLeakTracking('pops the Navigator with a WillPopScope that returns true', (WidgetTester tester) async { + testWidgets('pops the Navigator with a WillPopScope that returns true', (WidgetTester tester) async { bool willPopCalled = false; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), @@ -813,7 +812,7 @@ void main() { expect(willPopCalled, isTrue); }); - testWidgetsWithLeakTracking('will call onDismiss callback', (WidgetTester tester) async { + testWidgets('will call onDismiss callback', (WidgetTester tester) async { bool dismissCallbackCalled = false; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), @@ -841,7 +840,7 @@ void main() { expect(dismissCallbackCalled, true); }); - testWidgetsWithLeakTracking('will not pop when given an onDismiss callback', (WidgetTester tester) async { + testWidgets('will not pop when given an onDismiss callback', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), '/modal': (BuildContext context) => AnimatedSecondWidget(onDismiss: () {}), @@ -868,7 +867,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Undismissible AnimatedModalBarrier hidden in semantic tree', (WidgetTester tester) async { + testWidgets('Undismissible AnimatedModalBarrier hidden in semantic tree', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(AnimatedModalBarrier(dismissible: false, color: colorAnimation)); @@ -878,7 +877,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Dismissible AnimatedModalBarrier includes button in semantic tree on iOS, macOS and android', (WidgetTester tester) async { + testWidgets('Dismissible AnimatedModalBarrier includes button in semantic tree on iOS, macOS and android', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -905,7 +904,7 @@ void main() { }); group('SemanticsClipper', () { - testWidgetsWithLeakTracking('SemanticsClipper correctly clips Semantics.rect in four directions', (WidgetTester tester) async { + testWidgets('SemanticsClipper correctly clips Semantics.rect in four directions', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ValueNotifier<EdgeInsets> notifier = ValueNotifier<EdgeInsets>(const EdgeInsets.fromLTRB(10, 20, 30, 40)); addTearDown(notifier.dispose); @@ -935,7 +934,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android})); }); - testWidgetsWithLeakTracking('uses default mouse cursor', (WidgetTester tester) async { + testWidgets('uses default mouse cursor', (WidgetTester tester) async { await tester.pumpWidget(const Stack( textDirection: TextDirection.ltr, children: <Widget>[ diff --git a/packages/flutter/test/widgets/mouse_region_test.dart b/packages/flutter/test/widgets/mouse_region_test.dart index a26d7b3d799..a2762ae83a8 100644 --- a/packages/flutter/test/widgets/mouse_region_test.dart +++ b/packages/flutter/test/widgets/mouse_region_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class HoverClient extends StatefulWidget { const HoverClient({ @@ -78,7 +77,7 @@ class _HoverFeedbackState extends State<HoverFeedback> { void main() { // Regression test for https://github.com/flutter/flutter/issues/73330 - testWidgetsWithLeakTracking('hitTestBehavior test - HitTestBehavior.deferToChild/opaque', (WidgetTester tester) async { + testWidgets('hitTestBehavior test - HitTestBehavior.deferToChild/opaque', (WidgetTester tester) async { bool onEnter = false; await tester.pumpWidget(Center( child: MouseRegion( @@ -104,7 +103,7 @@ void main() { expect(onEnter, true); }); - testWidgetsWithLeakTracking('hitTestBehavior test - HitTestBehavior.deferToChild and non-opaque', (WidgetTester tester) async { + testWidgets('hitTestBehavior test - HitTestBehavior.deferToChild and non-opaque', (WidgetTester tester) async { bool onEnterRegion1 = false; bool onEnterRegion2 = false; await tester.pumpWidget(Directionality( @@ -144,7 +143,7 @@ void main() { expect(onEnterRegion1, true); }); - testWidgetsWithLeakTracking('hitTestBehavior test - HitTestBehavior.translucent', (WidgetTester tester) async { + testWidgets('hitTestBehavior test - HitTestBehavior.translucent', (WidgetTester tester) async { bool onEnterRegion1 = false; bool onEnterRegion2 = false; await tester.pumpWidget(Directionality( @@ -178,7 +177,7 @@ void main() { expect(onEnterRegion1, true); }); - testWidgetsWithLeakTracking('onEnter and onExit can be triggered with mouse buttons pressed', (WidgetTester tester) async { + testWidgets('onEnter and onExit can be triggered with mouse buttons pressed', (WidgetTester tester) async { PointerEnterEvent? enter; PointerExitEvent? exit; await tester.pumpWidget(Center( @@ -213,7 +212,7 @@ void main() { expect(exit!.localPosition, equals(const Offset(-349.0, -249.0))); }); - testWidgetsWithLeakTracking('detects pointer enter', (WidgetTester tester) async { + testWidgets('detects pointer enter', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -245,7 +244,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking('detects pointer exiting', (WidgetTester tester) async { + testWidgets('detects pointer exiting', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -276,7 +275,7 @@ void main() { expect(exit!.localPosition, equals(const Offset(-349.0, -249.0))); }); - testWidgetsWithLeakTracking('triggers pointer enter when a mouse is connected', (WidgetTester tester) async { + testWidgets('triggers pointer enter when a mouse is connected', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -302,7 +301,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking('triggers pointer exit when a mouse is disconnected', (WidgetTester tester) async { + testWidgets('triggers pointer exit when a mouse is disconnected', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -340,7 +339,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking('triggers pointer enter when widget appears', (WidgetTester tester) async { + testWidgets('triggers pointer enter when widget appears', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -376,7 +375,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking("doesn't trigger pointer exit when widget disappears", (WidgetTester tester) async { + testWidgets("doesn't trigger pointer exit when widget disappears", (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -409,7 +408,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking('triggers pointer enter when widget moves in', (WidgetTester tester) async { + testWidgets('triggers pointer enter when widget moves in', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -451,7 +450,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking('triggers pointer exit when widget moves out', (WidgetTester tester) async { + testWidgets('triggers pointer exit when widget moves out', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -493,7 +492,7 @@ void main() { expect(exit!.localPosition, equals(const Offset(50, 50))); }); - testWidgetsWithLeakTracking('detects hover from touch devices', (WidgetTester tester) async { + testWidgets('detects hover from touch devices', (WidgetTester tester) async { PointerEnterEvent? enter; PointerHoverEvent? move; PointerExitEvent? exit; @@ -523,7 +522,7 @@ void main() { expect(exit, isNull); }); - testWidgetsWithLeakTracking('Hover works with nested listeners', (WidgetTester tester) async { + testWidgets('Hover works with nested listeners', (WidgetTester tester) async { final UniqueKey key1 = UniqueKey(); final UniqueKey key2 = UniqueKey(); final List<PointerEnterEvent> enter1 = <PointerEnterEvent>[]; @@ -598,7 +597,7 @@ void main() { clearLists(); }); - testWidgetsWithLeakTracking('Hover transfers between two listeners', (WidgetTester tester) async { + testWidgets('Hover transfers between two listeners', (WidgetTester tester) async { final UniqueKey key1 = UniqueKey(); final UniqueKey key2 = UniqueKey(); final List<PointerEnterEvent> enter1 = <PointerEnterEvent>[]; @@ -691,7 +690,7 @@ void main() { expect(exit2, isEmpty); }); - testWidgetsWithLeakTracking('applies mouse cursor', (WidgetTester tester) async { + testWidgets('applies mouse cursor', (WidgetTester tester) async { await tester.pumpWidget(const _Scaffold( topLeft: MouseRegion( cursor: SystemMouseCursors.text, @@ -712,7 +711,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); }); - testWidgetsWithLeakTracking('MouseRegion uses updated callbacks', (WidgetTester tester) async { + testWidgets('MouseRegion uses updated callbacks', (WidgetTester tester) async { final List<String> logs = <String>[]; Widget hoverableContainer({ PointerEnterEventListener? onEnter, @@ -774,7 +773,7 @@ void main() { expect(logs, <String>['enter2', 'hover2', 'exit2']); }); - testWidgetsWithLeakTracking('needsCompositing set when parent class needsCompositing is set', (WidgetTester tester) async { + testWidgets('needsCompositing set when parent class needsCompositing is set', (WidgetTester tester) async { await tester.pumpWidget( MouseRegion( onEnter: (PointerEnterEvent _) {}, @@ -796,7 +795,7 @@ void main() { expect(listener.needsCompositing, isFalse); }); - testWidgetsWithLeakTracking('works with transform', (WidgetTester tester) async { + testWidgets('works with transform', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/31986. final Key key = UniqueKey(); const double scaleFactor = 2.0; @@ -863,7 +862,7 @@ void main() { events.clear(); }); - testWidgetsWithLeakTracking('needsCompositing is always false', (WidgetTester tester) async { + testWidgets('needsCompositing is always false', (WidgetTester tester) async { // Pretend that we have a mouse connected. final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -898,7 +897,7 @@ void main() { expect(tester.layers.whereType<TransformLayer>(), hasLength(1)); }); - testWidgetsWithLeakTracking("Callbacks aren't called during build", (WidgetTester tester) async { + testWidgets("Callbacks aren't called during build", (WidgetTester tester) async { final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(location: Offset.zero); @@ -940,7 +939,7 @@ void main() { expect(numExits, equals(0)); }); - testWidgetsWithLeakTracking("MouseRegion activate/deactivate don't duplicate annotations", (WidgetTester tester) async { + testWidgets("MouseRegion activate/deactivate don't duplicate annotations", (WidgetTester tester) async { final GlobalKey feedbackKey = GlobalKey(); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(); @@ -984,7 +983,7 @@ void main() { expect(numExits, equals(0)); }); - testWidgetsWithLeakTracking('Exit event when unplugging mouse should have a position', (WidgetTester tester) async { + testWidgets('Exit event when unplugging mouse should have a position', (WidgetTester tester) async { final List<PointerEnterEvent> enter = <PointerEnterEvent>[]; final List<PointerHoverEvent> hover = <PointerHoverEvent>[]; final List<PointerExitEvent> exit = <PointerExitEvent>[]; @@ -1032,7 +1031,7 @@ void main() { expect(exit.single.delta, Offset.zero); }); - testWidgetsWithLeakTracking('detects pointer enter with closure arguments', (WidgetTester tester) async { + testWidgets('detects pointer enter with closure arguments', (WidgetTester tester) async { await tester.pumpWidget(const _HoverClientWithClosures()); expect(find.text('not hovering'), findsOneWidget); @@ -1049,7 +1048,7 @@ void main() { expect(find.text('HOVERING'), findsOneWidget); }); - testWidgetsWithLeakTracking('MouseRegion paints child once and only once when MouseRegion is inactive', (WidgetTester tester) async { + testWidgets('MouseRegion paints child once and only once when MouseRegion is inactive', (WidgetTester tester) async { int paintCount = 0; await tester.pumpWidget( Directionality( @@ -1067,7 +1066,7 @@ void main() { expect(paintCount, 1); }); - testWidgetsWithLeakTracking('MouseRegion paints child once and only once when MouseRegion is active', (WidgetTester tester) async { + testWidgets('MouseRegion paints child once and only once when MouseRegion is active', (WidgetTester tester) async { int paintCount = 0; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -1089,7 +1088,7 @@ void main() { expect(paintCount, 1); }); - testWidgetsWithLeakTracking('A MouseRegion mounted under the pointer should take effect in the next postframe', (WidgetTester tester) async { + testWidgets('A MouseRegion mounted under the pointer should take effect in the next postframe', (WidgetTester tester) async { bool hovered = false; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -1131,7 +1130,7 @@ void main() { expect(tester.binding.hasScheduledFrame, isFalse); }); - testWidgetsWithLeakTracking('A MouseRegion unmounted under the pointer should not trigger state change', (WidgetTester tester) async { + testWidgets('A MouseRegion unmounted under the pointer should not trigger state change', (WidgetTester tester) async { bool hovered = true; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -1174,7 +1173,7 @@ void main() { expect(tester.binding.hasScheduledFrame, isFalse); }); - testWidgetsWithLeakTracking('A MouseRegion moved into the mouse should take effect in the next postframe', (WidgetTester tester) async { + testWidgets('A MouseRegion moved into the mouse should take effect in the next postframe', (WidgetTester tester) async { bool hovered = false; final List<bool> logHovered = <bool>[]; bool moved = false; @@ -1304,7 +1303,7 @@ void main() { ); } - testWidgetsWithLeakTracking('a transparent one should allow MouseRegions behind it to receive pointers', (WidgetTester tester) async { + testWidgets('a transparent one should allow MouseRegions behind it to receive pointers', (WidgetTester tester) async { final List<String> logs = <String>[]; await tester.pumpWidget(tripleRegions( opaqueC: false, @@ -1351,7 +1350,7 @@ void main() { expect(logs, <String>['exitC', 'exitB', 'exitA']); }); - testWidgetsWithLeakTracking('an opaque one should prevent MouseRegions behind it receiving pointers', (WidgetTester tester) async { + testWidgets('an opaque one should prevent MouseRegions behind it receiving pointers', (WidgetTester tester) async { final List<String> logs = <String>[]; await tester.pumpWidget(tripleRegions( opaqueC: true, @@ -1398,7 +1397,7 @@ void main() { expect(logs, <String>['exitC', 'exitA']); }); - testWidgetsWithLeakTracking('opaque should default to true', (WidgetTester tester) async { + testWidgets('opaque should default to true', (WidgetTester tester) async { final List<String> logs = <String>[]; await tester.pumpWidget(tripleRegions( addLog: (String log) => logs.add(log), @@ -1421,7 +1420,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('an empty opaque MouseRegion is effective', (WidgetTester tester) async { + testWidgets('an empty opaque MouseRegion is effective', (WidgetTester tester) async { bool bottomRegionIsHovered = false; await tester.pumpWidget( Directionality( @@ -1456,7 +1455,7 @@ void main() { expect(bottomRegionIsHovered, isFalse); }); - testWidgetsWithLeakTracking("Changing MouseRegion's callbacks is effective and doesn't repaint", (WidgetTester tester) async { + testWidgets("Changing MouseRegion's callbacks is effective and doesn't repaint", (WidgetTester tester) async { final List<String> logs = <String>[]; const Key key = ValueKey<int>(1); @@ -1520,7 +1519,7 @@ void main() { expect(logs, <String>['paint']); }); - testWidgetsWithLeakTracking('Changing MouseRegion.opaque is effective and repaints', (WidgetTester tester) async { + testWidgets('Changing MouseRegion.opaque is effective and repaints', (WidgetTester tester) async { final List<String> logs = <String>[]; final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -1564,7 +1563,7 @@ void main() { expect(logs, <String>['paint', 'hover-enter']); }); - testWidgetsWithLeakTracking('Changing MouseRegion.cursor is effective and repaints', (WidgetTester tester) async { + testWidgets('Changing MouseRegion.cursor is effective and repaints', (WidgetTester tester) async { final List<String> logPaints = <String>[]; final List<String> logEnters = <String>[]; @@ -1611,7 +1610,7 @@ void main() { logEnters.clear(); }); - testWidgetsWithLeakTracking('Changing whether MouseRegion.cursor is null is effective and repaints', (WidgetTester tester) async { + testWidgets('Changing whether MouseRegion.cursor is null is effective and repaints', (WidgetTester tester) async { final List<String> logEnters = <String>[]; final List<String> logPaints = <String>[]; @@ -1683,7 +1682,7 @@ void main() { logEnters.clear(); }); - testWidgetsWithLeakTracking('Does not trigger side effects during a reparent', (WidgetTester tester) async { + testWidgets('Does not trigger side effects during a reparent', (WidgetTester tester) async { final List<String> logEnters = <String>[]; final List<String> logExits = <String>[]; final List<String> logCursors = <String>[]; @@ -1767,7 +1766,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click); }); - testWidgetsWithLeakTracking("RenderMouseRegion's debugFillProperties when default", (WidgetTester tester) async { + testWidgets("RenderMouseRegion's debugFillProperties when default", (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final RenderMouseRegion renderMouseRegion = RenderMouseRegion(); @@ -1786,7 +1785,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking("RenderMouseRegion's debugFillProperties when full", (WidgetTester tester) async { + testWidgets("RenderMouseRegion's debugFillProperties when full", (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final RenderErrorBox renderErrorBox = RenderErrorBox(); @@ -1817,7 +1816,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('No new frames are scheduled when mouse moves without triggering callbacks', (WidgetTester tester) async { + testWidgets('No new frames are scheduled when mouse moves without triggering callbacks', (WidgetTester tester) async { await tester.pumpWidget(Center( child: MouseRegion( child: const SizedBox( @@ -1837,7 +1836,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/67044 - testWidgetsWithLeakTracking('Handle mouse events should ignore the detached MouseTrackerAnnotation', (WidgetTester tester) async { + testWidgets('Handle mouse events should ignore the detached MouseTrackerAnnotation', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Center( child: Draggable<int>( diff --git a/packages/flutter/test/widgets/multi_view_binding_test.dart b/packages/flutter/test/widgets/multi_view_binding_test.dart index d896cfa196f..6c7c1d09de3 100644 --- a/packages/flutter/test/widgets/multi_view_binding_test.dart +++ b/packages/flutter/test/widgets/multi_view_binding_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('runApp uses deprecated pipelineOwner and renderView', (WidgetTester tester) async { + testWidgets('runApp uses deprecated pipelineOwner and renderView', (WidgetTester tester) async { runApp(const SizedBox()); final RenderObject renderObject = tester.renderObject(find.byType(SizedBox)); @@ -22,7 +21,7 @@ void main() { expect(renderObject.owner, equals(tester.binding.pipelineOwner)); }); - testWidgetsWithLeakTracking('can manually attach RootWidget to build owner', (WidgetTester tester) async { + testWidgets('can manually attach RootWidget to build owner', (WidgetTester tester) async { expect(find.byType(ColoredBox), findsNothing); final RootWidget rootWidget = RootWidget( diff --git a/packages/flutter/test/widgets/multi_view_tree_updates_test.dart b/packages/flutter/test/widgets/multi_view_tree_updates_test.dart index 10fe72f2fdc..a30b3502130 100644 --- a/packages/flutter/test/widgets/multi_view_tree_updates_test.dart +++ b/packages/flutter/test/widgets/multi_view_tree_updates_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'multi_view_testing.dart'; void main() { - testWidgetsWithLeakTracking('Widgets in view update as expected', (WidgetTester tester) async { + testWidgets('Widgets in view update as expected', (WidgetTester tester) async { final Widget widget = View( view: tester.view, child: const TestWidget(), @@ -50,7 +49,7 @@ void main() { expect(tester.renderObject<RenderParagraph>(find.byType(Text)).text.toPlainText(), 'FooBar'); }); - testWidgetsWithLeakTracking('Views in ViewCollection update as expected', (WidgetTester tester) async { + testWidgets('Views in ViewCollection update as expected', (WidgetTester tester) async { Iterable<String> renderParagraphTexts() { return tester.renderObjectList<RenderParagraph>(find.byType(Text)).map((RenderParagraph r) => r.text.toPlainText()); } @@ -104,7 +103,7 @@ void main() { expect(renderParagraphTexts(), <String>['Guten', 'Morgen']); }); - testWidgetsWithLeakTracking('Views in ViewAnchor update as expected', (WidgetTester tester) async { + testWidgets('Views in ViewAnchor update as expected', (WidgetTester tester) async { Iterable<String> renderParagraphTexts() { return tester.renderObjectList<RenderParagraph>(find.byType(Text)).map((RenderParagraph r) => r.text.toPlainText()); } diff --git a/packages/flutter/test/widgets/multichild_test.dart b/packages/flutter/test/widgets/multichild_test.dart index f52afc5ef99..78dc38fe9d0 100644 --- a/packages/flutter/test/widgets/multichild_test.dart +++ b/packages/flutter/test/widgets/multichild_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; @@ -33,7 +32,7 @@ void checkTree(WidgetTester tester, List<BoxDecoration> expectedDecorations) { } void main() { - testWidgetsWithLeakTracking('MultiChildRenderObjectElement control test', (WidgetTester tester) async { + testWidgets('MultiChildRenderObjectElement control test', (WidgetTester tester) async { await tester.pumpWidget( const Stack( @@ -118,7 +117,7 @@ void main() { }); - testWidgetsWithLeakTracking('MultiChildRenderObjectElement with stateless widgets', (WidgetTester tester) async { + testWidgets('MultiChildRenderObjectElement with stateless widgets', (WidgetTester tester) async { await tester.pumpWidget( const Stack( @@ -244,7 +243,7 @@ void main() { checkTree(tester, <BoxDecoration>[]); }); - testWidgetsWithLeakTracking('MultiChildRenderObjectElement with stateful widgets', (WidgetTester tester) async { + testWidgets('MultiChildRenderObjectElement with stateful widgets', (WidgetTester tester) async { await tester.pumpWidget( const Stack( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/multichildobject_with_keys_test.dart b/packages/flutter/test/widgets/multichildobject_with_keys_test.dart index 07d04fa3895..d00260a7740 100644 --- a/packages/flutter/test/widgets/multichildobject_with_keys_test.dart +++ b/packages/flutter/test/widgets/multichildobject_with_keys_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Render and element tree stay in sync when keyed children move around', (WidgetTester tester) async { + testWidgets('Render and element tree stay in sync when keyed children move around', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/48855. await tester.pumpWidget( @@ -60,7 +59,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Building a new MultiChildRenderObjectElement with children having duplicated keys throws', (WidgetTester tester) async { + testWidgets('Building a new MultiChildRenderObjectElement with children having duplicated keys throws', (WidgetTester tester) async { const ValueKey<int> duplicatedKey = ValueKey<int>(1); await tester.pumpWidget(const Column( @@ -80,7 +79,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Updating a MultiChildRenderObjectElement to have children with duplicated keys throws', (WidgetTester tester) async { + testWidgets('Updating a MultiChildRenderObjectElement to have children with duplicated keys throws', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/81541 const ValueKey<int> key1 = ValueKey<int>(1); diff --git a/packages/flutter/test/widgets/navigator_and_layers_test.dart b/packages/flutter/test/widgets/navigator_and_layers_test.dart index 496b69fc359..1283a386438 100644 --- a/packages/flutter/test/widgets/navigator_and_layers_test.dart +++ b/packages/flutter/test/widgets/navigator_and_layers_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; @@ -27,7 +26,7 @@ class TestCustomPainter extends CustomPainter { } void main() { - testWidgetsWithLeakTracking('Do we paint when coming back from a navigation', (WidgetTester tester) async { + testWidgets('Do we paint when coming back from a navigation', (WidgetTester tester) async { final List<String> log = <String>[]; log.add('0'); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/navigator_replacement_test.dart b/packages/flutter/test/widgets/navigator_replacement_test.dart index a1c762c0d60..d43df8a88cf 100644 --- a/packages/flutter/test/widgets/navigator_replacement_test.dart +++ b/packages/flutter/test/widgets/navigator_replacement_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'observer_tester.dart'; void main() { - testWidgetsWithLeakTracking('Back during pushReplacement', (WidgetTester tester) async { + testWidgets('Back during pushReplacement', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: const Material(child: Text('home')), routes: <String, WidgetBuilder>{ @@ -43,7 +42,7 @@ void main() { }); group('pushAndRemoveUntil', () { - testWidgetsWithLeakTracking('notifies appropriately', (WidgetTester tester) async { + testWidgets('notifies appropriately', (WidgetTester tester) async { final TestObserver observer = TestObserver(); final Widget myApp = MaterialApp( home: const Material(child: Text('home')), @@ -111,7 +110,7 @@ void main() { ])); }); - testWidgetsWithLeakTracking('triggers page transition animation for pushed route', (WidgetTester tester) async { + testWidgets('triggers page transition animation for pushed route', (WidgetTester tester) async { final Widget myApp = MaterialApp( home: const Material(child: Text('home')), routes: <String, WidgetBuilder>{ @@ -140,7 +139,7 @@ void main() { expect(find.text('b'), findsOneWidget); }); - testWidgetsWithLeakTracking('Hero transition triggers when preceding route contains hero, and predicate route does not', (WidgetTester tester) async { + testWidgets('Hero transition triggers when preceding route contains hero, and predicate route does not', (WidgetTester tester) async { const String kHeroTag = 'hero'; final Widget myApp = MaterialApp( initialRoute: '/', @@ -185,7 +184,7 @@ void main() { expect(find.text('b'), isOnstage); }); - testWidgetsWithLeakTracking('Hero transition does not trigger when preceding route does not contain hero, but predicate route does', (WidgetTester tester) async { + testWidgets('Hero transition does not trigger when preceding route does not contain hero, but predicate route does', (WidgetTester tester) async { const String kHeroTag = 'hero'; final Widget myApp = MaterialApp( theme: ThemeData( diff --git a/packages/flutter/test/widgets/navigator_restoration_test.dart b/packages/flutter/test/widgets/navigator_restoration_test.dart index e91d41aa1f4..ecbed9bfb76 100644 --- a/packages/flutter/test/widgets/navigator_restoration_test.dart +++ b/packages/flutter/test/widgets/navigator_restoration_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Restoration Smoke Test', (WidgetTester tester) async { + testWidgets('Restoration Smoke Test', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -30,7 +29,7 @@ void main() { expect(findRoute('home', count: 2), findsOneWidget); }); - testWidgetsWithLeakTracking('restorablePushNamed', (WidgetTester tester) async { + testWidgets('restorablePushNamed', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -67,7 +66,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }); - testWidgetsWithLeakTracking('restorablePushReplacementNamed', (WidgetTester tester) async { + testWidgets('restorablePushReplacementNamed', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -100,7 +99,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }); - testWidgetsWithLeakTracking('restorablePopAndPushNamed', (WidgetTester tester) async { + testWidgets('restorablePopAndPushNamed', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -133,7 +132,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }); - testWidgetsWithLeakTracking('restorablePushNamedAndRemoveUntil', (WidgetTester tester) async { + testWidgets('restorablePushNamedAndRemoveUntil', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -166,7 +165,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }); - testWidgetsWithLeakTracking('restorablePush', (WidgetTester tester) async { + testWidgets('restorablePush', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -203,7 +202,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('restorablePush adds route on all platforms', (WidgetTester tester) async { + testWidgets('restorablePush adds route on all platforms', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -213,7 +212,7 @@ void main() { expect(findRoute('Foo'), findsOneWidget); }); - testWidgetsWithLeakTracking('restorablePushReplacement', (WidgetTester tester) async { + testWidgets('restorablePushReplacement', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -246,7 +245,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('restorablePushReplacement adds route on all platforms', (WidgetTester tester) async { + testWidgets('restorablePushReplacement adds route on all platforms', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -256,7 +255,7 @@ void main() { expect(findRoute('Foo'), findsOneWidget); }); - testWidgetsWithLeakTracking('restorablePushAndRemoveUntil', (WidgetTester tester) async { + testWidgets('restorablePushAndRemoveUntil', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -289,7 +288,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('restorablePushAndRemoveUntil adds route on all platforms', (WidgetTester tester) async { + testWidgets('restorablePushAndRemoveUntil adds route on all platforms', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -299,7 +298,7 @@ void main() { expect(findRoute('Foo'), findsOneWidget); }); - testWidgetsWithLeakTracking('restorableReplace', (WidgetTester tester) async { + testWidgets('restorableReplace', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -335,7 +334,7 @@ void main() { expect(findRoute('Bar'), findsNothing); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('restorableReplace adds route on all platforms', (WidgetTester tester) async { + testWidgets('restorableReplace adds route on all platforms', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -347,7 +346,7 @@ void main() { expect(findRoute('Foo'), findsOneWidget); }); - testWidgetsWithLeakTracking('restorableReplaceRouteBelow', (WidgetTester tester) async { + testWidgets('restorableReplaceRouteBelow', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -393,7 +392,7 @@ void main() { expect(findRoute('Anchor', count: 2), findsOneWidget); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('restorableReplaceRouteBelow adds route on all platforms', (WidgetTester tester) async { + testWidgets('restorableReplaceRouteBelow adds route on all platforms', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home', count: 0), findsOneWidget); @@ -413,7 +412,7 @@ void main() { expect(findRoute('Foo', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('restoring a popped route', (WidgetTester tester) async { + testWidgets('restoring a popped route', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -441,7 +440,7 @@ void main() { expect(findRoute('Foo', count: 2), findsOneWidget); }); - testWidgetsWithLeakTracking('popped routes are not restored', (WidgetTester tester) async { + testWidgets('popped routes are not restored', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -466,7 +465,7 @@ void main() { expect(findRoute('home', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('routes that are in the process of push are restored', (WidgetTester tester) async { + testWidgets('routes that are in the process of push are restored', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -495,7 +494,7 @@ void main() { expect(route2.isActive, isTrue); }); - testWidgetsWithLeakTracking('routes that are in the process of pop are not restored', (WidgetTester tester) async { + testWidgets('routes that are in the process of pop are not restored', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -532,7 +531,7 @@ void main() { expect(notifyCount, 1); }); - testWidgetsWithLeakTracking('routes are restored in the right order', (WidgetTester tester) async { + testWidgets('routes are restored in the right order', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); tester.state<NavigatorState>(find.byType(Navigator)).restorablePushNamed('route1'); @@ -570,7 +569,7 @@ void main() { expect(findRoute('home'), findsOneWidget); }); - testWidgetsWithLeakTracking('all routes up to first unrestorable are restored', (WidgetTester tester) async { + testWidgets('all routes up to first unrestorable are restored', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); tester.state<NavigatorState>(find.byType(Navigator)).restorablePushNamed('route1'); @@ -600,7 +599,7 @@ void main() { expect(findRoute('home', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('removing unrestorable routes restores all of them', (WidgetTester tester) async { + testWidgets('removing unrestorable routes restores all of them', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); tester.state<NavigatorState>(find.byType(Navigator)).restorablePushNamed('route1'); @@ -634,7 +633,7 @@ void main() { expect(findRoute('home', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('RestorableRouteFuture', (WidgetTester tester) async { + testWidgets('RestorableRouteFuture', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -674,7 +673,7 @@ void main() { expect(restoredRouteFuture.enabled, isFalse); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/33615 - testWidgetsWithLeakTracking('RestorableRouteFuture in unrestorable context', (WidgetTester tester) async { + testWidgets('RestorableRouteFuture in unrestorable context', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); expect(findRoute('home'), findsOneWidget); @@ -705,7 +704,7 @@ void main() { expect(findRoute('home'), findsOneWidget); }); - testWidgetsWithLeakTracking('Illegal arguments throw', (WidgetTester tester) async { + testWidgets('Illegal arguments throw', (WidgetTester tester) async { await tester.pumpWidget(const TestWidget()); tester.state<NavigatorState>(find.byType(Navigator)).restorablePushNamed('Bar'); await tester.pumpAndSettle(); @@ -788,7 +787,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Moving scopes', (WidgetTester tester) async { + testWidgets('Moving scopes', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root', child: TestWidget( @@ -841,7 +840,7 @@ void main() { expect(findRoute('home', count: 0), findsOneWidget); }); - testWidgetsWithLeakTracking('Restoring pages', (WidgetTester tester) async { + testWidgets('Restoring pages', (WidgetTester tester) async { await tester.pumpWidget(const PagedTestWidget()); expect(findRoute('home', count: 0), findsOneWidget); await tapRouteCounter('home', tester); @@ -883,7 +882,7 @@ void main() { expect(findRoute('bar', count: 0), findsOneWidget); }); - testWidgetsWithLeakTracking('Unrestorable pages', (WidgetTester tester) async { + testWidgets('Unrestorable pages', (WidgetTester tester) async { await tester.pumpWidget(const PagedTestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -937,7 +936,7 @@ void main() { expect(findRoute('home', count: 1), findsOneWidget); }); - testWidgetsWithLeakTracking('removed page is not restored', (WidgetTester tester) async { + testWidgets('removed page is not restored', (WidgetTester tester) async { await tester.pumpWidget(const PagedTestWidget()); await tapRouteCounter('home', tester); expect(findRoute('home', count: 1), findsOneWidget); @@ -977,7 +976,7 @@ void main() { expect(findRoute('p1', count: 0), findsOneWidget); }); - testWidgetsWithLeakTracking('Helpful assert thrown all routes in onGenerateInitialRoutes are not restorable', (WidgetTester tester) async { + testWidgets('Helpful assert thrown all routes in onGenerateInitialRoutes are not restorable', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( restorationScopeId: 'material_app', diff --git a/packages/flutter/test/widgets/navigator_test.dart b/packages/flutter/test/widgets/navigator_test.dart index 45c5c9bd336..23c04080f9c 100644 --- a/packages/flutter/test/widgets/navigator_test.dart +++ b/packages/flutter/test/widgets/navigator_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'navigator_utils.dart'; import 'observer_tester.dart'; @@ -121,7 +120,7 @@ class SlideInOutPageRoute<T> extends PageRouteBuilder<T> { } void main() { - testWidgetsWithLeakTracking('Can navigator navigate to and from a stateful widget', (WidgetTester tester) async { + testWidgets('Can navigator navigate to and from a stateful widget', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const FirstWidget(), // X '/second': (BuildContext context) => const SecondWidget(), // Y @@ -171,7 +170,7 @@ void main() { expect(find.text('Y', skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('Navigator.of fails gracefully when not found in context', (WidgetTester tester) async { + testWidgets('Navigator.of fails gracefully when not found in context', (WidgetTester tester) async { const Key targetKey = Key('foo'); dynamic exception; final Widget widget = ThirdWidget( @@ -186,7 +185,7 @@ void main() { expect('$exception', startsWith('Navigator operation requested with a context')); }); - testWidgetsWithLeakTracking('Navigator can push Route created through page class as Pageless route', (WidgetTester tester) async { + testWidgets('Navigator can push Route created through page class as Pageless route', (WidgetTester tester) async { final GlobalKey<NavigatorState> nav = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -206,7 +205,7 @@ void main() { expect(find.text('home'), findsOneWidget); }); - testWidgetsWithLeakTracking('Navigator can set clip behavior', (WidgetTester tester) async { + testWidgets('Navigator can set clip behavior', (WidgetTester tester) async { const MaterialPage<void> page = MaterialPage<void>(child: Text('page')); await tester.pumpWidget( MediaQuery( @@ -239,7 +238,7 @@ void main() { expect(tester.widget<Overlay>(find.byType(Overlay)).clipBehavior, Clip.none); }); - testWidgetsWithLeakTracking('Zero transition page-based route correctly notifies observers when it is popped', (WidgetTester tester) async { + testWidgets('Zero transition page-based route correctly notifies observers when it is popped', (WidgetTester tester) async { final List<Page<void>> pages = <Page<void>>[ const ZeroTransitionPage(name: 'Page 1'), const ZeroTransitionPage(name: 'Page 2'), @@ -279,7 +278,7 @@ void main() { expect(observations[0].previous, 'Page 1'); }); - testWidgetsWithLeakTracking('Navigator.of rootNavigator finds root Navigator', (WidgetTester tester) async { + testWidgets('Navigator.of rootNavigator finds root Navigator', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Column( @@ -347,7 +346,7 @@ void main() { expect(tester.getTopLeft(find.text('Dialog')).dy, 0.0); }); - testWidgetsWithLeakTracking('Gestures between push and build are ignored', (WidgetTester tester) async { + testWidgets('Gestures between push and build are ignored', (WidgetTester tester) async { final List<String> log = <String>[]; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) { @@ -377,7 +376,7 @@ void main() { expect(log, equals(<String>['left'])); }); - testWidgetsWithLeakTracking('pushnamed can handle Object as type', (WidgetTester tester) async { + testWidgets('pushnamed can handle Object as type', (WidgetTester tester) async { final GlobalKey<NavigatorState> nav = GlobalKey<NavigatorState>(); final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => const Text('/'), @@ -397,7 +396,7 @@ void main() { expect(find.text('/second'), findsOneWidget); }); - testWidgetsWithLeakTracking('Pending gestures are rejected', (WidgetTester tester) async { + testWidgets('Pending gestures are rejected', (WidgetTester tester) async { final List<String> log = <String>[]; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) { @@ -428,7 +427,7 @@ void main() { expect(log, equals(<String>['left'])); }); - testWidgetsWithLeakTracking('popAndPushNamed', (WidgetTester tester) async { + testWidgets('popAndPushNamed', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.popAndPushNamed(context, '/B'); }), @@ -455,7 +454,7 @@ void main() { expect(find.text('B'), findsOneWidget); }); - testWidgetsWithLeakTracking('popAndPushNamed with explicit void type parameter', (WidgetTester tester) async { + testWidgets('popAndPushNamed with explicit void type parameter', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushNamed<void>(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.popAndPushNamed<void, void>(context, '/B'); }), @@ -482,7 +481,7 @@ void main() { expect(find.text('B'), findsOneWidget); }); - testWidgetsWithLeakTracking('Push and pop should trigger the observers', (WidgetTester tester) async { + testWidgets('Push and pop should trigger the observers', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.pop(context); }), @@ -542,7 +541,7 @@ void main() { expect(isPopped, isTrue); }); - testWidgetsWithLeakTracking('Add and remove an observer should work', (WidgetTester tester) async { + testWidgets('Add and remove an observer should work', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.pop(context); }), @@ -589,7 +588,7 @@ void main() { expect(isPopped, isFalse); }); - testWidgetsWithLeakTracking('initial route trigger observer in the right order', (WidgetTester tester) async { + testWidgets('initial route trigger observer in the right order', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => const Text('/'), '/A': (BuildContext context) => const Text('A'), @@ -628,7 +627,7 @@ void main() { expect(observations[2].previous, '/A'); }); - testWidgetsWithLeakTracking('$Route dispatches memory events', (WidgetTester tester) async { + testWidgets('$Route dispatches memory events', (WidgetTester tester) async { Future<void> createAndDisposeRoute() async { final GlobalKey<NavigatorState> nav = GlobalKey<NavigatorState>(); await tester.pumpWidget( @@ -663,7 +662,7 @@ void main() { MemoryAllocations.instance.removeListener(listener); }); - testWidgetsWithLeakTracking('Route didAdd and dispose in same frame work', (WidgetTester tester) async { + testWidgets('Route didAdd and dispose in same frame work', (WidgetTester tester) async { // Regression Test for https://github.com/flutter/flutter/issues/61346. Widget buildNavigator() { return Navigator( @@ -696,7 +695,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Page-based route pop before push finishes', (WidgetTester tester) async { + testWidgets('Page-based route pop before push finishes', (WidgetTester tester) async { List<Page<void>> pages = <Page<void>>[const MaterialPage<void>(child: Text('Page 1'))]; final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); Widget buildNavigator() { @@ -732,7 +731,7 @@ void main() { expect(find.text('Page 1'), findsOneWidget); }); - testWidgetsWithLeakTracking('Pages update does update overlay correctly', (WidgetTester tester) async { + testWidgets('Pages update does update overlay correctly', (WidgetTester tester) async { // Regression Test for https://github.com/flutter/flutter/issues/64941. List<Page<void>> pages = const <Page<void>>[ MaterialPage<void>( @@ -781,7 +780,7 @@ void main() { expect(find.text('page 0'), findsNothing); }); - testWidgetsWithLeakTracking('replaceNamed replaces', (WidgetTester tester) async { + testWidgets('replaceNamed replaces', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushReplacementNamed(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.pushReplacementNamed(context, '/B'); }), @@ -803,7 +802,7 @@ void main() { expect(find.text('B'), findsOneWidget); }); - testWidgetsWithLeakTracking('pushReplacement sets secondaryAnimation after transition, with history change during transition', (WidgetTester tester) async { + testWidgets('pushReplacement sets secondaryAnimation after transition, with history change during transition', (WidgetTester tester) async { final Map<String, SlideInOutPageRoute<dynamic>> routes = <String, SlideInOutPageRoute<dynamic>>{}; final Map<String, WidgetBuilder> builders = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage( @@ -860,7 +859,7 @@ void main() { expect(routes['/A']!.secondaryAnimation!.value, equals(routes['/C']!.animation!.value)); }); - testWidgetsWithLeakTracking('new route removed from navigator history during pushReplacement transition', (WidgetTester tester) async { + testWidgets('new route removed from navigator history during pushReplacement transition', (WidgetTester tester) async { final Map<String, SlideInOutPageRoute<dynamic>> routes = <String, SlideInOutPageRoute<dynamic>>{}; final Map<String, WidgetBuilder> builders = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage( @@ -906,7 +905,7 @@ void main() { expect(routes['/']!.animation!.value, equals(1.0)); }); - testWidgetsWithLeakTracking('pushReplacement triggers secondaryAnimation', (WidgetTester tester) async { + testWidgets('pushReplacement triggers secondaryAnimation', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage( id: '/', @@ -955,7 +954,7 @@ void main() { expect(aOffset.dx, lessThan(aOffsetOriginal.dx)); }); - testWidgetsWithLeakTracking('pushReplacement correctly reports didReplace to the observer', (WidgetTester tester) async { + testWidgets('pushReplacement correctly reports didReplace to the observer', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/56892. final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => const OnTapPage( @@ -1023,7 +1022,7 @@ void main() { expect(find.text('C'), isOnstage); }); - testWidgetsWithLeakTracking('Able to pop all routes', (WidgetTester tester) async { + testWidgets('Able to pop all routes', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => const OnTapPage( id: '/', @@ -1050,7 +1049,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('pushAndRemoveUntil triggers secondaryAnimation', (WidgetTester tester) async { + testWidgets('pushAndRemoveUntil triggers secondaryAnimation', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage( id: '/', @@ -1104,7 +1103,7 @@ void main() { expect(find.text('B'), isOnstage); }); - testWidgetsWithLeakTracking('pushAndRemoveUntil does not remove routes below the first route that pass the predicate', (WidgetTester tester) async { + testWidgets('pushAndRemoveUntil does not remove routes below the first route that pass the predicate', (WidgetTester tester) async { // Regression https://github.com/flutter/flutter/issues/56688 final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ @@ -1140,7 +1139,7 @@ void main() { expect(find.text('home'), isOnstage); }); - testWidgetsWithLeakTracking('replaceNamed returned value', (WidgetTester tester) async { + testWidgets('replaceNamed returned value', (WidgetTester tester) async { late Future<String?> value; final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ @@ -1189,7 +1188,7 @@ void main() { expect(replaceNamedValue, 'B'); }); - testWidgetsWithLeakTracking('removeRoute', (WidgetTester tester) async { + testWidgets('removeRoute', (WidgetTester tester) async { final Map<String, WidgetBuilder> pageBuilders = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.pushNamed(context, '/B'); }), @@ -1275,7 +1274,7 @@ void main() { expect(previousRoute, routes['/']); }); - testWidgetsWithLeakTracking('remove a route whose value is awaited', (WidgetTester tester) async { + testWidgets('remove a route whose value is awaited', (WidgetTester tester) async { late Future<String?> pageValue; final Map<String, WidgetBuilder> pageBuilders = <String, WidgetBuilder>{ '/': (BuildContext context) => OnTapPage(id: '/', onTap: () { pageValue = Navigator.pushNamed(context, '/A'); }), @@ -1303,7 +1302,7 @@ void main() { navigator.removeRoute(routes['/A']!); // stack becomes /, pageValue will not complete }); - testWidgetsWithLeakTracking('replacing route can be observed', (WidgetTester tester) async { + testWidgets('replacing route can be observed', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); final List<String> log = <String>[]; final TestObserver observer = TestObserver() @@ -1373,7 +1372,7 @@ void main() { expect(log, <String>['pushed / (previous is <none>)', 'pushed B (previous is /)', 'pushed C (previous is B)', 'replaced B with D']); }); - testWidgetsWithLeakTracking('didStartUserGesture observable', (WidgetTester tester) async { + testWidgets('didStartUserGesture observable', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }), '/A': (BuildContext context) => OnTapPage(id: 'A', onTap: () { Navigator.pop(context); }), @@ -1404,7 +1403,7 @@ void main() { expect(observedPreviousRoute.settings.name, '/'); }); - testWidgetsWithLeakTracking('ModalRoute.of sets up a route to rebuild if its state changes', (WidgetTester tester) async { + testWidgets('ModalRoute.of sets up a route to rebuild if its state changes', (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); final List<String> log = <String>[]; late Route<void> routeB; @@ -1471,7 +1470,7 @@ void main() { expect(log, <String>['building B', 'building C', 'found C', 'building D']); }); - testWidgetsWithLeakTracking("Routes don't rebuild just because their animations ended", (WidgetTester tester) async { + testWidgets("Routes don't rebuild just because their animations ended", (WidgetTester tester) async { final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>(); final List<String> log = <String>[]; Route<dynamic>? nextRoute = PageRouteBuilder<int>( @@ -1519,7 +1518,7 @@ void main() { expect(log, expected); }); - testWidgetsWithLeakTracking('route semantics', (WidgetTester tester) async { + testWidgets('route semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => OnTapPage(id: '1', onTap: () { Navigator.pushNamed(context, '/A'); }), @@ -1576,7 +1575,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('arguments for named routes on Navigator', (WidgetTester tester) async { + testWidgets('arguments for named routes on Navigator', (WidgetTester tester) async { late GlobalKey currentRouteKey; final List<Object?> arguments = <Object?>[]; @@ -1650,7 +1649,7 @@ void main() { arguments.clear(); }); - testWidgetsWithLeakTracking('arguments for named routes on NavigatorState', (WidgetTester tester) async { + testWidgets('arguments for named routes on NavigatorState', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); final List<Object?> arguments = <Object?>[]; @@ -1721,7 +1720,7 @@ void main() { arguments.clear(); }); - testWidgetsWithLeakTracking('Initial route can have gaps', (WidgetTester tester) async { + testWidgets('Initial route can have gaps', (WidgetTester tester) async { final GlobalKey<NavigatorState> keyNav = GlobalKey<NavigatorState>(); const Key keyRoot = Key('Root'); const Key keyA = Key('A'); @@ -1752,7 +1751,7 @@ void main() { expect(find.byKey(keyABC, skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('The full initial route has to be matched', (WidgetTester tester) async { + testWidgets('The full initial route has to be matched', (WidgetTester tester) async { final GlobalKey<NavigatorState> keyNav = GlobalKey<NavigatorState>(); const Key keyRoot = Key('Root'); const Key keyA = Key('A'); @@ -1782,7 +1781,7 @@ void main() { expect(find.byKey(keyAB), findsNothing); }); - testWidgetsWithLeakTracking("Popping immediately after pushing doesn't crash", (WidgetTester tester) async { + testWidgets("Popping immediately after pushing doesn't crash", (WidgetTester tester) async { // Added this test to protect against regression of https://github.com/flutter/flutter/issues/45539 final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/' : (BuildContext context) => OnTapPage(id: '/', onTap: () { @@ -1831,7 +1830,7 @@ void main() { }); group('error control test', () { - testWidgetsWithLeakTracking('onUnknownRoute null and onGenerateRoute returns null', (WidgetTester tester) async { + testWidgets('onUnknownRoute null and onGenerateRoute returns null', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(Navigator( key: navigatorKey, @@ -1857,7 +1856,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('onUnknownRoute null and onGenerateRoute returns null', (WidgetTester tester) async { + testWidgets('onUnknownRoute null and onGenerateRoute returns null', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(Navigator( key: navigatorKey, @@ -1884,7 +1883,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('OverlayEntry of topmost initial route is marked as opaque', (WidgetTester tester) async { + testWidgets('OverlayEntry of topmost initial route is marked as opaque', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/38038. final Key root = UniqueKey(); @@ -1908,7 +1907,7 @@ void main() { expect(find.byKey(topmost), findsOneWidget); }); - testWidgetsWithLeakTracking('OverlayEntry of topmost route is set to opaque after Push', (WidgetTester tester) async { + testWidgets('OverlayEntry of topmost route is set to opaque after Push', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/38038. final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); @@ -1935,7 +1934,7 @@ void main() { expect(find.byKey(const ValueKey<String>('/A')), findsOneWidget); }); - testWidgetsWithLeakTracking('OverlayEntry of topmost route is set to opaque after Replace', (WidgetTester tester) async { + testWidgets('OverlayEntry of topmost route is set to opaque after Replace', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/38038. final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); @@ -1980,7 +1979,7 @@ void main() { expect(find.byKey(const ValueKey<String>('/C')), findsOneWidget); }); - testWidgetsWithLeakTracking('Pushing opaque Route does not rebuild routes below', (WidgetTester tester) async { + testWidgets('Pushing opaque Route does not rebuild routes below', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/45797. final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); @@ -2014,7 +2013,7 @@ void main() { expect(tester.state<StatefulTestState>(find.byKey(topRoute)).rebuildCount, 1); }); - testWidgetsWithLeakTracking('initial routes below opaque route are offstage', (WidgetTester tester) async { + testWidgets('initial routes below opaque route are offstage', (WidgetTester tester) async { final GlobalKey<NavigatorState> testKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( TestDependencies( @@ -2055,7 +2054,7 @@ void main() { expect(find.text('+/a/b+'), findsNothing); }); - testWidgetsWithLeakTracking('Can provide custom onGenerateInitialRoutes', (WidgetTester tester) async { + testWidgets('Can provide custom onGenerateInitialRoutes', (WidgetTester tester) async { bool onGenerateInitialRoutesCalled = false; final GlobalKey<NavigatorState> testKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( @@ -2088,7 +2087,7 @@ void main() { expect(find.text('World'), findsNothing); }); - testWidgetsWithLeakTracking('Navigator.of able to handle input context is a navigator context', (WidgetTester tester) async { + testWidgets('Navigator.of able to handle input context is a navigator context', (WidgetTester tester) async { final GlobalKey<NavigatorState> testKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -2101,7 +2100,7 @@ void main() { expect(state, testKey.currentState); }); - testWidgetsWithLeakTracking('Navigator.of able to handle input context is a navigator context - root navigator', (WidgetTester tester) async { + testWidgets('Navigator.of able to handle input context is a navigator context - root navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> root = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> sub = GlobalKey<NavigatorState>(); await tester.pumpWidget( @@ -2123,7 +2122,7 @@ void main() { expect(state, root.currentState); }); - testWidgetsWithLeakTracking('Navigator.maybeOf throws when there is no navigator', (WidgetTester tester) async { + testWidgets('Navigator.maybeOf throws when there is no navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> testKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(SizedBox(key: testKey)); @@ -2132,7 +2131,7 @@ void main() { }, throwsFlutterError); }); - testWidgetsWithLeakTracking('Navigator.maybeOf works when there is no navigator', (WidgetTester tester) async { + testWidgets('Navigator.maybeOf works when there is no navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> testKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(SizedBox(key: testKey)); @@ -2140,7 +2139,7 @@ void main() { expect(state, isNull); }); - testWidgetsWithLeakTracking('Navigator.maybeOf able to handle input context is a navigator context', (WidgetTester tester) async { + testWidgets('Navigator.maybeOf able to handle input context is a navigator context', (WidgetTester tester) async { final GlobalKey<NavigatorState> testKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -2154,7 +2153,7 @@ void main() { expect(state, testKey.currentState); }); - testWidgetsWithLeakTracking('Navigator.maybeOf able to handle input context is a navigator context - root navigator', (WidgetTester tester) async { + testWidgets('Navigator.maybeOf able to handle input context is a navigator context - root navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> root = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> sub = GlobalKey<NavigatorState>(); await tester.pumpWidget( @@ -2177,7 +2176,7 @@ void main() { expect(state, root.currentState); }); - testWidgetsWithLeakTracking('pushAndRemove until animates the push', (WidgetTester tester) async { + testWidgets('pushAndRemove until animates the push', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25080. const Duration kFourTenthsOfTheTransitionDuration = Duration(milliseconds: 120); @@ -2259,7 +2258,7 @@ void main() { expect(find.text('Route: 4', skipOffstage: false), findsNothing); }); - testWidgetsWithLeakTracking('Wrapping TickerMode can turn off ticking in routes', (WidgetTester tester) async { + testWidgets('Wrapping TickerMode can turn off ticking in routes', (WidgetTester tester) async { int tickCount = 0; Widget widgetUnderTest({required bool enabled}) { return TickerMode( @@ -2352,7 +2351,7 @@ void main() { expect(popNextOfFirst, secondRoute); }); - testWidgetsWithLeakTracking('hero controller scope works', (WidgetTester tester) async { + testWidgets('hero controller scope works', (WidgetTester tester) async { final GlobalKey<NavigatorState> top = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> sub = GlobalKey<NavigatorState>(); @@ -2424,7 +2423,7 @@ void main() { expect(observations[1].previous, 'top1'); }); - testWidgetsWithLeakTracking('hero controller can correctly transfer subscription - replacing navigator', (WidgetTester tester) async { + testWidgets('hero controller can correctly transfer subscription - replacing navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> key1 = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> key2 = GlobalKey<NavigatorState>(); @@ -2495,7 +2494,7 @@ void main() { expect(observations[0].previous, 'navigator2'); }); - testWidgetsWithLeakTracking('hero controller can correctly transfer subscription - swapping navigator', (WidgetTester tester) async { + testWidgets('hero controller can correctly transfer subscription - swapping navigator', (WidgetTester tester) async { final GlobalKey<NavigatorState> key1 = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> key2 = GlobalKey<NavigatorState>(); @@ -2638,7 +2637,7 @@ void main() { expect(observations2[1].previous, 'navigator1'); }); - testWidgetsWithLeakTracking('hero controller subscribes to multiple navigators does throw', (WidgetTester tester) async { + testWidgets('hero controller subscribes to multiple navigators does throw', (WidgetTester tester) async { final HeroControllerSpy spy = HeroControllerSpy(); addTearDown(spy.dispose); @@ -2678,7 +2677,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('hero controller throws has correct error message', (WidgetTester tester) async { + testWidgets('hero controller throws has correct error message', (WidgetTester tester) async { final HeroControllerSpy spy = HeroControllerSpy(); addTearDown(spy.dispose); @@ -2764,7 +2763,7 @@ void main() { ); } - testWidgetsWithLeakTracking('can initialize with pages list', (WidgetTester tester) async { + testWidgets('can initialize with pages list', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); final List<TestPage> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name:'initial'), @@ -2802,7 +2801,7 @@ void main() { expect(find.text('initial'), findsOneWidget); }); - testWidgetsWithLeakTracking('can handle duplicate page key if update before transition finishes', (WidgetTester tester) async { + testWidgets('can handle duplicate page key if update before transition finishes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/97363. final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); final List<TestPage> myPages1 = <TestPage>[ @@ -2858,7 +2857,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('throw if onPopPage callback is not provided', (WidgetTester tester) async { + testWidgets('throw if onPopPage callback is not provided', (WidgetTester tester) async { final List<TestPage> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name:'initial'), const TestPage(key: ValueKey<String>('2'), name:'second'), @@ -2928,7 +2927,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can pop route with local history entries using page api', (WidgetTester tester) async { + testWidgets('Can pop route with local history entries using page api', (WidgetTester tester) async { List<Page<void>> myPages = const <Page<void>>[ MaterialPage<void>(child: Text('page1')), MaterialPage<void>(child: Text('page2')), @@ -2979,7 +2978,7 @@ void main() { expect(entryRemoved, isTrue); }); - testWidgetsWithLeakTracking('ModalRoute must comply with willHandlePopInternally when there is a PopScope', (WidgetTester tester) async { + testWidgets('ModalRoute must comply with willHandlePopInternally when there is a PopScope', (WidgetTester tester) async { const List<Page<void>> myPages = <Page<void>>[ MaterialPage<void>(child: Text('page1')), MaterialPage<void>( @@ -3012,7 +3011,7 @@ void main() { expect(route.didPop(null), true); }); - testWidgetsWithLeakTracking('can push and pop pages using page api', (WidgetTester tester) async { + testWidgets('can push and pop pages using page api', (WidgetTester tester) async { late Animation<double> secondaryAnimationOfRouteOne; late Animation<double> primaryAnimationOfRouteOne; late Animation<double> secondaryAnimationOfRouteTwo; @@ -3161,7 +3160,7 @@ void main() { expect(primaryAnimationOfRouteThree.status, AnimationStatus.dismissed); }); - testWidgetsWithLeakTracking('can modify routes history and secondary animation still works', (WidgetTester tester) async { + testWidgets('can modify routes history and secondary animation still works', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); late Animation<double> secondaryAnimationOfRouteOne; late Animation<double> primaryAnimationOfRouteOne; @@ -3272,7 +3271,7 @@ void main() { expect(primaryAnimationOfRouteOne.status, AnimationStatus.dismissed); }); - testWidgetsWithLeakTracking('Pop no animation page does not crash', (WidgetTester tester) async { + testWidgets('Pop no animation page does not crash', (WidgetTester tester) async { // Regression Test for https://github.com/flutter/flutter/issues/86604. Widget buildNavigator(bool secondPage) { return TestDependencies( @@ -3297,7 +3296,7 @@ void main() { expect(find.text('page1'), findsOneWidget); }); - testWidgetsWithLeakTracking('can work with pageless route', (WidgetTester tester) async { + testWidgets('can work with pageless route', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<TestPage> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name:'initial'), @@ -3445,7 +3444,7 @@ void main() { expect(myPages.length, 1); }); - testWidgetsWithLeakTracking('complex case 1', (WidgetTester tester) async { + testWidgets('complex case 1', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<TestPage> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name: 'initial'), @@ -3582,7 +3581,7 @@ void main() { }); //Regression test for https://github.com/flutter/flutter/issues/115887 - testWidgetsWithLeakTracking('Complex case 2', (WidgetTester tester) async { + testWidgets('Complex case 2', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<TestPage> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name:'initial'), @@ -3646,7 +3645,7 @@ void main() { expect(find.text('second-pageless1'), findsNothing); }); - testWidgetsWithLeakTracking('complex case 1 - with always remove transition delegate', (WidgetTester tester) async { + testWidgets('complex case 1 - with always remove transition delegate', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); final AlwaysRemoveTransitionDelegate transitionDelegate = AlwaysRemoveTransitionDelegate(); List<TestPage> myPages = <TestPage>[ @@ -3791,7 +3790,7 @@ void main() { expect(find.text('forth'), findsOneWidget); }); - testWidgetsWithLeakTracking('can repush a page that was previously popped before it has finished popping', (WidgetTester tester) async { + testWidgets('can repush a page that was previously popped before it has finished popping', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<Page<dynamic>> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name: 'initial'), @@ -3843,7 +3842,7 @@ void main() { expect(find.text('second'), findsOneWidget); }); - testWidgetsWithLeakTracking('can update pages before a route has finished popping', (WidgetTester tester) async { + testWidgets('can update pages before a route has finished popping', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<Page<dynamic>> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name: 'initial'), @@ -3894,7 +3893,7 @@ void main() { expect(find.text('initial'), findsOneWidget); }); - testWidgetsWithLeakTracking('can update pages before a pageless route has finished popping', (WidgetTester tester) async { + testWidgets('can update pages before a pageless route has finished popping', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/68162. final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<Page<dynamic>> myPages = <TestPage>[ @@ -3941,7 +3940,7 @@ void main() { expect(find.text('initial'), findsOneWidget); }); - testWidgetsWithLeakTracking('pages remove and add trigger observer in the right order', (WidgetTester tester) async { + testWidgets('pages remove and add trigger observer in the right order', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); List<TestPage> myPages = <TestPage>[ const TestPage(key: ValueKey<String>('1'), name:'first'), @@ -4034,7 +4033,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can reuse NavigatorObserver in rebuilt tree', (WidgetTester tester) async { + testWidgets('Can reuse NavigatorObserver in rebuilt tree', (WidgetTester tester) async { final NavigatorObserver observer = NavigatorObserver(); Widget build([Key? key]) { return TestDependencies( @@ -4069,7 +4068,7 @@ void main() { expect(observer.navigator, tester.state<NavigatorState>(find.byType(Navigator))); }); - testWidgetsWithLeakTracking('Navigator requests focus if requestFocus is true', (WidgetTester tester) async { + testWidgets('Navigator requests focus if requestFocus is true', (WidgetTester tester) async { final GlobalKey navigatorKey = GlobalKey(); final GlobalKey innerKey = GlobalKey(); final Map<String, Widget> routes = <String, Widget>{ @@ -4145,7 +4144,7 @@ void main() { expect(focusNode.hasFocus, true); }); - testWidgetsWithLeakTracking('Navigator does not request focus if requestFocus is false', (WidgetTester tester) async { + testWidgets('Navigator does not request focus if requestFocus is false', (WidgetTester tester) async { final GlobalKey navigatorKey = GlobalKey(); final GlobalKey innerKey = GlobalKey(); final Map<String, Widget> routes = <String, Widget>{ @@ -4212,7 +4211,7 @@ void main() { expect(focusNode.hasFocus, true); }); - testWidgetsWithLeakTracking('class implementing NavigatorObserver can be used without problems', (WidgetTester tester) async { + testWidgets('class implementing NavigatorObserver can be used without problems', (WidgetTester tester) async { final _MockNavigatorObserver observer = _MockNavigatorObserver(); Widget build([Key? key]) { return TestDependencies( @@ -4244,7 +4243,7 @@ void main() { observer._checkInvocations(<Symbol>[#navigator, #navigator]); }); - testWidgetsWithLeakTracking("Navigator doesn't override FocusTraversalPolicy of ancestors", (WidgetTester tester) async { + testWidgets("Navigator doesn't override FocusTraversalPolicy of ancestors", (WidgetTester tester) async { FocusTraversalPolicy? policy; await tester.pumpWidget( TestDependencies( @@ -4267,7 +4266,7 @@ void main() { expect(policy, isA<WidgetOrderTraversalPolicy>()); }); - testWidgetsWithLeakTracking('Navigator inserts ReadingOrderTraversalPolicy if no ancestor has a policy', (WidgetTester tester) async { + testWidgets('Navigator inserts ReadingOrderTraversalPolicy if no ancestor has a policy', (WidgetTester tester) async { FocusTraversalPolicy? policy; await tester.pumpWidget( TestDependencies( @@ -4287,7 +4286,7 @@ void main() { expect(policy, isA<ReadingOrderTraversalPolicy>()); }); - testWidgetsWithLeakTracking( + testWidgets( 'Send semantic event to move a11y focus to the last focused item when pop next page', (WidgetTester tester) async { dynamic semanticEvent; @@ -4414,7 +4413,7 @@ void main() { .setMockMethodCallHandler(SystemChannels.platform, null); }); - testWidgetsWithLeakTracking('a single route is already defaulted to false', (WidgetTester tester) async { + testWidgets('a single route is already defaulted to false', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -4429,7 +4428,7 @@ void main() { skip: isBrowser, // [intended] only non-web Android supports predictive back. ); - testWidgetsWithLeakTracking('navigating around a single Navigator with .pop', (WidgetTester tester) async { + testWidgets('navigating around a single Navigator with .pop', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( initialRoute: '/', @@ -4506,7 +4505,7 @@ void main() { skip: isBrowser, // [intended] only non-web Android supports predictive back. ); - testWidgetsWithLeakTracking('navigating around a single Navigator with system back', (WidgetTester tester) async { + testWidgets('navigating around a single Navigator with system back', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( initialRoute: '/', @@ -4583,7 +4582,7 @@ void main() { skip: isBrowser, // [intended] only non-web Android supports predictive back. ); - testWidgetsWithLeakTracking('a single Navigator with a PopScope that defaults to enabled', (WidgetTester tester) async { + testWidgets('a single Navigator with a PopScope that defaults to enabled', (WidgetTester tester) async { bool canPop = true; late StateSetter setState; await tester.pumpWidget( @@ -4623,7 +4622,7 @@ void main() { skip: isBrowser, // [intended] only non-web Android supports predictive back. ); - testWidgetsWithLeakTracking('a single Navigator with a PopScope that defaults to disabled', (WidgetTester tester) async { + testWidgets('a single Navigator with a PopScope that defaults to disabled', (WidgetTester tester) async { bool canPop = false; late StateSetter setState; await tester.pumpWidget( @@ -4665,7 +4664,7 @@ void main() { // Test both system back gestures and Navigator.pop. for (final _BackType backType in _BackType.values) { - testWidgetsWithLeakTracking('navigating around nested Navigators', (WidgetTester tester) async { + testWidgets('navigating around nested Navigators', (WidgetTester tester) async { final GlobalKey<NavigatorState> nav = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> nestedNav = GlobalKey<NavigatorState>(); Future<void> goBack() async { @@ -4765,7 +4764,7 @@ void main() { ); } - testWidgetsWithLeakTracking('nested Navigators with a nested PopScope', (WidgetTester tester) async { + testWidgets('nested Navigators with a nested PopScope', (WidgetTester tester) async { bool canPop = true; late StateSetter setState; await tester.pumpWidget( @@ -4892,7 +4891,7 @@ void main() { ); group('Navigator page API', () { - testWidgetsWithLeakTracking('starting with one route as usual', (WidgetTester tester) async { + testWidgets('starting with one route as usual', (WidgetTester tester) async { late StateSetter builderSetState; final List<_Page> pages = <_Page>[_Page.home]; bool canPop() => pages.length <= 1; @@ -5010,7 +5009,7 @@ void main() { skip: isBrowser, // [intended] only non-web Android supports predictive back. ); - testWidgetsWithLeakTracking('starting with existing route history', (WidgetTester tester) async { + testWidgets('starting with existing route history', (WidgetTester tester) async { final List<_Page> pages = <_Page>[_Page.home, _Page.one]; bool canPop() => pages.length <= 1; diff --git a/packages/flutter/test/widgets/nested_scroll_view_test.dart b/packages/flutter/test/widgets/nested_scroll_view_test.dart index 6527110b86e..c32f6c98930 100644 --- a/packages/flutter/test/widgets/nested_scroll_view_test.dart +++ b/packages/flutter/test/widgets/nested_scroll_view_test.dart @@ -110,7 +110,7 @@ Widget buildTest({ } void main() { - testWidgetsWithLeakTracking('ScrollDirection test', (WidgetTester tester) async { + testWidgets('ScrollDirection test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/107101 final List<ScrollDirection> receivedResult = <ScrollDirection>[]; const List<ScrollDirection> expectedReverseResult = <ScrollDirection>[ScrollDirection.reverse, ScrollDirection.idle]; @@ -212,7 +212,7 @@ void main() { expect(context.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('NestedScrollView overscroll and release and hold', (WidgetTester tester) async { + testWidgets('NestedScrollView overscroll and release and hold', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(find.text('aaa2'), findsOneWidget); await tester.pump(const Duration(milliseconds: 250)); @@ -235,7 +235,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 200.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('NestedScrollView overscroll and release and hold', (WidgetTester tester) async { + testWidgets('NestedScrollView overscroll and release and hold', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(find.text('aaa2'), findsOneWidget); await tester.pump(const Duration(milliseconds: 250)); @@ -260,7 +260,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1000)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('NestedScrollView overscroll and release', (WidgetTester tester) async { + testWidgets('NestedScrollView overscroll and release', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(find.text('aaa2'), findsOneWidget); await tester.pump(const Duration(milliseconds: 500)); @@ -276,7 +276,7 @@ void main() { expect(find.text('aaa2'), findsOneWidget); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('NestedScrollView', (WidgetTester tester) async { + testWidgets('NestedScrollView', (WidgetTester tester) async { await tester.pumpWidget(buildTest()); expect(find.text('aaa2'), findsOneWidget); expect(find.text('aaa3'), findsNothing); @@ -343,7 +343,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('NestedScrollView with a ScrollController', (WidgetTester tester) async { + testWidgets('NestedScrollView with a ScrollController', (WidgetTester tester) async { final ScrollController controller = ScrollController( initialScrollOffset: 50.0, ); @@ -421,7 +421,7 @@ void main() { expect(find.text('ddd1'), findsOneWidget); }); - testWidgetsWithLeakTracking('Three NestedScrollViews with one ScrollController', (WidgetTester tester) async { + testWidgets('Three NestedScrollViews with one ScrollController', (WidgetTester tester) async { final TrackingScrollController controller = TrackingScrollController(); addTearDown(controller.dispose); expect(controller.mostRecentlyUpdatedPosition, isNull); @@ -485,7 +485,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('NestedScrollViews with custom physics', (WidgetTester tester) async { + testWidgets('NestedScrollViews with custom physics', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Localizations( @@ -523,7 +523,7 @@ void main() { expect(point1.dy, greaterThan(point2.dy)); }); - testWidgetsWithLeakTracking('NestedScrollViews respect NeverScrollableScrollPhysics', (WidgetTester tester) async { + testWidgets('NestedScrollViews respect NeverScrollableScrollPhysics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/113753 await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -564,7 +564,7 @@ void main() { expect(point1, point2); }); - testWidgetsWithLeakTracking('NestedScrollView and internal scrolling', (WidgetTester tester) async { + testWidgets('NestedScrollView and internal scrolling', (WidgetTester tester) async { debugDisableShadows = false; const List<String> tabs = <String>['Hello', 'World']; int buildCount = 0; @@ -846,7 +846,7 @@ void main() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('NestedScrollView and bouncing', (WidgetTester tester) async { + testWidgets('NestedScrollView and bouncing', (WidgetTester tester) async { // This verifies that overscroll bouncing works correctly on iOS. For // example, this checks that if you pull to overscroll, friction is applied; // it also makes sure that if you scroll back the other way, the scroll @@ -949,7 +949,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); group('NestedScrollViewState exposes inner and outer controllers', () { - testWidgetsWithLeakTracking('Scrolling by less than the outer extent does not scroll the inner body', (WidgetTester tester) async { + testWidgets('Scrolling by less than the outer extent does not scroll the inner body', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey, @@ -981,7 +981,7 @@ void main() { expect(globalKey.currentState!.innerController.offset, 0.0); }); - testWidgetsWithLeakTracking('Scrolling by exactly the outer extent does not scroll the inner body', (WidgetTester tester) async { + testWidgets('Scrolling by exactly the outer extent does not scroll the inner body', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey, @@ -1013,7 +1013,7 @@ void main() { expect(globalKey.currentState!.innerController.offset, 0.0); }); - testWidgetsWithLeakTracking('Scrolling by greater than the outer extent scrolls the inner body', (WidgetTester tester) async { + testWidgets('Scrolling by greater than the outer extent scrolls the inner body', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey, @@ -1049,7 +1049,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Inertia-cancel event does not modify either position.', (WidgetTester tester) async { + testWidgets('Inertia-cancel event does not modify either position.', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey, @@ -1097,7 +1097,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('scrolling by less than the expanded outer extent does not scroll the inner body', (WidgetTester tester) async { + testWidgets('scrolling by less than the expanded outer extent does not scroll the inner body', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest(key: globalKey)); @@ -1126,7 +1126,7 @@ void main() { expect(globalKey.currentState!.innerController.offset, 0.0); }); - testWidgetsWithLeakTracking('scrolling by exactly the expanded outer extent does not scroll the inner body', (WidgetTester tester) async { + testWidgets('scrolling by exactly the expanded outer extent does not scroll the inner body', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest(key: globalKey)); @@ -1155,7 +1155,7 @@ void main() { expect(globalKey.currentState!.innerController.offset, 0.0); }); - testWidgetsWithLeakTracking('scrolling by greater than the expanded outer extent scrolls the inner body', (WidgetTester tester) async { + testWidgets('scrolling by greater than the expanded outer extent scrolls the inner body', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); await tester.pumpWidget(buildTest(key: globalKey)); @@ -1185,7 +1185,7 @@ void main() { expect(globalKey.currentState!.innerController.offset, 50.0); }); - testWidgetsWithLeakTracking( + testWidgets( 'NestedScrollViewState.outerController should correspond to NestedScrollView.controller', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey = GlobalKey(); @@ -1217,7 +1217,7 @@ void main() { ); group('manipulating controllers when', () { - testWidgetsWithLeakTracking('outer: not scrolled, inner: not scrolled', (WidgetTester tester) async { + testWidgets('outer: not scrolled, inner: not scrolled', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey1 = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey1, @@ -1259,7 +1259,7 @@ void main() { expect(globalKey2.currentState!.outerController.position.pixels, 0.0); }); - testWidgetsWithLeakTracking('outer: not scrolled, inner: scrolled', (WidgetTester tester) async { + testWidgets('outer: not scrolled, inner: scrolled', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey1 = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey1, @@ -1303,7 +1303,7 @@ void main() { expect(globalKey2.currentState!.outerController.position.pixels, 0.0); }); - testWidgetsWithLeakTracking('outer: scrolled, inner: not scrolled', (WidgetTester tester) async { + testWidgets('outer: scrolled, inner: not scrolled', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey1 = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey1, @@ -1347,7 +1347,7 @@ void main() { expect(globalKey2.currentState!.outerController.position.pixels, 0.0); }); - testWidgetsWithLeakTracking('outer: scrolled, inner: scrolled', (WidgetTester tester) async { + testWidgets('outer: scrolled, inner: scrolled', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> globalKey1 = GlobalKey(); await tester.pumpWidget(buildTest( key: globalKey1, @@ -1396,7 +1396,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/39963. - testWidgetsWithLeakTracking('NestedScrollView with SliverOverlapAbsorber in or out of the first screen', (WidgetTester tester) async { + testWidgets('NestedScrollView with SliverOverlapAbsorber in or out of the first screen', (WidgetTester tester) async { await tester.pumpWidget(const _TestLayoutExtentIsNegative(1)); await tester.pumpWidget(const _TestLayoutExtentIsNegative(10)); }); @@ -1475,7 +1475,7 @@ void main() { return geometry.paintExtent; } - testWidgetsWithLeakTracking('float', (WidgetTester tester) async { + testWidgets('float', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( floating: true, @@ -1527,7 +1527,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 56.0, visible: true); }); - testWidgetsWithLeakTracking('float expanded', (WidgetTester tester) async { + testWidgets('float expanded', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( floating: true, @@ -1582,7 +1582,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 200.0, visible: true); }); - testWidgetsWithLeakTracking('float with pointer signal', (WidgetTester tester) async { + testWidgets('float with pointer signal', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( floating: true, @@ -1639,7 +1639,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 56.0, visible: true); }); - testWidgetsWithLeakTracking('snap with pointer signal', (WidgetTester tester) async { + testWidgets('snap with pointer signal', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( floating: true, @@ -1693,7 +1693,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 0.0, visible: false); }); - testWidgetsWithLeakTracking('float expanded with pointer signal', (WidgetTester tester) async { + testWidgets('float expanded with pointer signal', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( floating: true, @@ -1753,7 +1753,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 200.0, visible: true); }); - testWidgetsWithLeakTracking('only snap', (WidgetTester tester) async { + testWidgets('only snap', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); final GlobalKey<NestedScrollViewState> nestedKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( @@ -1888,7 +1888,7 @@ void main() { expect(nestedKey.currentState!.outerController.offset, 56.0); }); - testWidgetsWithLeakTracking('only snap expanded', (WidgetTester tester) async { + testWidgets('only snap expanded', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); final GlobalKey<NestedScrollViewState> nestedKey = GlobalKey(); await tester.pumpWidget(buildFloatTest( @@ -2024,7 +2024,7 @@ void main() { expect(nestedKey.currentState!.outerController.offset, 200.0); }); - testWidgetsWithLeakTracking('float pinned', (WidgetTester tester) async { + testWidgets('float pinned', (WidgetTester tester) async { // This configuration should have the same behavior of a pinned app bar. // No floating should happen, and the app bar should persist. final GlobalKey appBarKey = GlobalKey(); @@ -2079,7 +2079,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 56.0, visible: true); }); - testWidgetsWithLeakTracking('float pinned expanded', (WidgetTester tester) async { + testWidgets('float pinned expanded', (WidgetTester tester) async { // Only the expanded portion (flexible space) of the app bar should float // in and out. final GlobalKey appBarKey = GlobalKey(); @@ -2138,7 +2138,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 200.0, visible: true); }); - testWidgetsWithLeakTracking('float pinned with pointer signal', (WidgetTester tester) async { + testWidgets('float pinned with pointer signal', (WidgetTester tester) async { // This configuration should have the same behavior of a pinned app bar. // No floating should happen, and the app bar should persist. final GlobalKey appBarKey = GlobalKey(); @@ -2198,7 +2198,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 56.0, visible: true); }); - testWidgetsWithLeakTracking('float pinned expanded with pointer signal', (WidgetTester tester) async { + testWidgets('float pinned expanded with pointer signal', (WidgetTester tester) async { // Only the expanded portion (flexible space) of the app bar should float // in and out. final GlobalKey appBarKey = GlobalKey(); @@ -2293,7 +2293,7 @@ void main() { ); } - testWidgetsWithLeakTracking('overscroll, hold for 0 velocity, and release', (WidgetTester tester) async { + testWidgets('overscroll, hold for 0 velocity, and release', (WidgetTester tester) async { // Dragging into an overscroll and holding so that when released, the // ballistic scroll activity has a 0 velocity. final ScrollController controller = ScrollController(); @@ -2321,7 +2321,7 @@ void main() { expect(tester.getCenter(find.text('Item 49')).dy, equals(585.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('overscroll, release, and tap', (WidgetTester tester) async { + testWidgets('overscroll, release, and tap', (WidgetTester tester) async { // Tapping while an inner ballistic scroll activity is in progress will // trigger a secondary ballistic scroll activity with a 0 velocity. final ScrollController controller = ScrollController(); @@ -2356,7 +2356,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/63978 - testWidgetsWithLeakTracking('Inner _NestedScrollPosition.applyClampedDragUpdate correctly calculates range when in overscroll', (WidgetTester tester) async { + testWidgets('Inner _NestedScrollPosition.applyClampedDragUpdate correctly calculates range when in overscroll', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> nestedScrollView = GlobalKey(); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -2410,7 +2410,7 @@ void main() { expect(nestedScrollView.currentState!.innerController.position.pixels, 295.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Scroll pointer signal should not cause overscroll.', (WidgetTester tester) async { + testWidgets('Scroll pointer signal should not cause overscroll.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(buildTest(controller: controller)); @@ -2433,7 +2433,7 @@ void main() { expect(find.text('ddd1'), findsOneWidget); }); - testWidgetsWithLeakTracking('NestedScrollView basic scroll with pointer signal', (WidgetTester tester) async{ + testWidgets('NestedScrollView basic scroll with pointer signal', (WidgetTester tester) async{ await tester.pumpWidget(buildTest()); expect(find.text('aaa2'), findsOneWidget); expect(find.text('aaa3'), findsNothing); @@ -2473,7 +2473,7 @@ void main() { }); // Related to https://github.com/flutter/flutter/issues/64266 - testWidgetsWithLeakTracking( + testWidgets( 'Holding scroll and Scroll pointer signal will update ScrollDirection.forward / ScrollDirection.reverse', (WidgetTester tester) async { ScrollDirection? lastUserScrollingDirection; @@ -2511,7 +2511,7 @@ void main() { ); // Regression test for https://github.com/flutter/flutter/issues/72257 - testWidgetsWithLeakTracking('NestedScrollView works well when rebuilding during scheduleWarmUpFrame', (WidgetTester tester) async { + testWidgets('NestedScrollView works well when rebuilding during scheduleWarmUpFrame', (WidgetTester tester) async { bool? isScrolled; final Widget myApp = MaterialApp( home: Scaffold( @@ -2554,7 +2554,7 @@ void main() { }); // Regression test of https://github.com/flutter/flutter/issues/74372 - testWidgetsWithLeakTracking('ScrollPosition can be accessed during `_updatePosition()`', (WidgetTester tester) async { + testWidgets('ScrollPosition can be accessed during `_updatePosition()`', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); late ScrollPosition position; @@ -2601,7 +2601,7 @@ void main() { expect(position.pixels, 0.0); }); - testWidgetsWithLeakTracking("NestedScrollView doesn't crash due to precision error", (WidgetTester tester) async { + testWidgets("NestedScrollView doesn't crash due to precision error", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/63825 await tester.pumpWidget(MaterialApp( @@ -2648,7 +2648,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('NestedScrollViewCoordinator.pointerScroll dispatches correct scroll notifications', (WidgetTester tester) async { + testWidgets('NestedScrollViewCoordinator.pointerScroll dispatches correct scroll notifications', (WidgetTester tester) async { int scrollEnded = 0; int scrollStarted = 0; bool isScrolled = false; @@ -2710,7 +2710,7 @@ void main() { expect(scrollEnded, 2); }); - testWidgetsWithLeakTracking('SliverAppBar.medium collapses in NestedScrollView', (WidgetTester tester) async { + testWidgets('SliverAppBar.medium collapses in NestedScrollView', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> nestedScrollView = GlobalKey(); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 112; @@ -2792,7 +2792,7 @@ void main() { expect(tester.getSize(expandedTitleClip).height, expandedAppBarHeight - collapsedAppBarHeight); }); - testWidgetsWithLeakTracking('SliverAppBar.large collapses in NestedScrollView', (WidgetTester tester) async { + testWidgets('SliverAppBar.large collapses in NestedScrollView', (WidgetTester tester) async { final GlobalKey<NestedScrollViewState> nestedScrollView = GlobalKey(); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 152; @@ -2875,7 +2875,7 @@ void main() { expect(tester.getSize(expandedTitleClip).height, expandedAppBarHeight - collapsedAppBarHeight); }); - testWidgetsWithLeakTracking('NestedScrollView does not crash when inner scrollable changes while scrolling', (WidgetTester tester) async { + testWidgets('NestedScrollView does not crash when inner scrollable changes while scrolling', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126454. Widget buildApp({required bool nested}) { final Widget innerScrollable = ListView( @@ -2912,7 +2912,7 @@ void main() { await tester.pumpWidget(buildApp(nested: true)); }); - testWidgetsWithLeakTracking('SliverOverlapInjector asserts when there is no SliverOverlapAbsorber', (WidgetTester tester) async { + testWidgets('SliverOverlapInjector asserts when there is no SliverOverlapAbsorber', (WidgetTester tester) async { Widget buildApp() { return MaterialApp( home: Scaffold( @@ -3007,7 +3007,7 @@ void main() { ); } - testWidgetsWithLeakTracking('when headerSliverBuilder is empty', (WidgetTester tester) async { + testWidgets('when headerSliverBuilder is empty', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/117316 // Regression test for https://github.com/flutter/flutter/issues/46089 // Short body / long body @@ -3025,7 +3025,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('when headerSliverBuilder extent is 0', (WidgetTester tester) async { + testWidgets('when headerSliverBuilder extent is 0', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/79077 // Short body / long body for (final _BodyLength bodyLength in _BodyLength.values) { @@ -3179,7 +3179,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('With a pinned SliverAppBar', (WidgetTester tester) async { + testWidgets('With a pinned SliverAppBar', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110956 // Regression test for https://github.com/flutter/flutter/issues/127282 // Regression test for https://github.com/flutter/flutter/issues/32563 @@ -3211,7 +3211,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('$SliverOverlapAbsorberHandle dispatches creation in constructor', (WidgetTester widgetTester) async { + testWidgets('$SliverOverlapAbsorberHandle dispatches creation in constructor', (WidgetTester widgetTester) async { await expectLater( await memoryEvents(() => SliverOverlapAbsorberHandle().dispose(), SliverOverlapAbsorberHandle), areCreateAndDispose, diff --git a/packages/flutter/test/widgets/notification_test.dart b/packages/flutter/test/widgets/notification_test.dart index ddfa0d23111..e58d86f2f06 100644 --- a/packages/flutter/test/widgets/notification_test.dart +++ b/packages/flutter/test/widgets/notification_test.dart @@ -4,16 +4,15 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class MyNotification extends Notification { } void main() { - testWidgetsWithLeakTracking('Notification basics - toString', (WidgetTester tester) async { + testWidgets('Notification basics - toString', (WidgetTester tester) async { expect(MyNotification(), hasOneLineDescription); }); - testWidgetsWithLeakTracking('Notification basics - dispatch', (WidgetTester tester) async { + testWidgets('Notification basics - dispatch', (WidgetTester tester) async { final List<dynamic> log = <dynamic>[]; final GlobalKey key = GlobalKey(); await tester.pumpWidget(NotificationListener<MyNotification>( @@ -37,7 +36,7 @@ void main() { expect(log, <dynamic>['b', notification, 'a', notification]); }); - testWidgetsWithLeakTracking('Notification basics - cancel', (WidgetTester tester) async { + testWidgets('Notification basics - cancel', (WidgetTester tester) async { final List<dynamic> log = <dynamic>[]; final GlobalKey key = GlobalKey(); await tester.pumpWidget(NotificationListener<MyNotification>( @@ -61,7 +60,7 @@ void main() { expect(log, <dynamic>['b', notification]); }); - testWidgetsWithLeakTracking('Notification basics - listener null return value', (WidgetTester tester) async { + testWidgets('Notification basics - listener null return value', (WidgetTester tester) async { final List<Type> log = <Type>[]; final GlobalKey key = GlobalKey(); await tester.pumpWidget(NotificationListener<MyNotification>( @@ -78,7 +77,7 @@ void main() { expect(log, <Type>[MyNotification]); }); - testWidgetsWithLeakTracking('Notification basics - listener null return value', (WidgetTester tester) async { + testWidgets('Notification basics - listener null return value', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); final ScrollMetricsNotification n1 = ScrollMetricsNotification( metrics: FixedScrollMetrics( diff --git a/packages/flutter/test/widgets/obscured_animated_image_test.dart b/packages/flutter/test/widgets/obscured_animated_image_test.dart index 179df2c1a8e..788d8f2d490 100644 --- a/packages/flutter/test/widgets/obscured_animated_image_test.dart +++ b/packages/flutter/test/widgets/obscured_animated_image_test.dart @@ -8,7 +8,6 @@ import 'dart:ui' as ui show Image; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import '../painting/fake_codec.dart'; @@ -18,7 +17,7 @@ Future<void> main() async { final FakeCodec fakeCodec = await FakeCodec.fromData(Uint8List.fromList(kAnimatedGif)); final FakeImageProvider fakeImageProvider = FakeImageProvider(fakeCodec); - testWidgetsWithLeakTracking('Obscured image does not animate', (WidgetTester tester) async { + testWidgets('Obscured image does not animate', (WidgetTester tester) async { final GlobalKey imageKey = GlobalKey(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/widgets/opacity_repaint_test.dart b/packages/flutter/test/widgets/opacity_repaint_test.dart index c858380ef5a..b0aff87cd67 100644 --- a/packages/flutter/test/widgets/opacity_repaint_test.dart +++ b/packages/flutter/test/widgets/opacity_repaint_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('RenderOpacity avoids repainting and does not drop layer at fully opaque', (WidgetTester tester) async { + testWidgets('RenderOpacity avoids repainting and does not drop layer at fully opaque', (WidgetTester tester) async { RenderTestObject.paintCount = 0; await tester.pumpWidget( const ColoredBox( @@ -47,7 +46,7 @@ void main() { expect(RenderTestObject.paintCount, 1); }); - testWidgetsWithLeakTracking('RenderOpacity allows opacity layer to be dropped at 0 opacity', (WidgetTester tester) async { + testWidgets('RenderOpacity allows opacity layer to be dropped at 0 opacity', (WidgetTester tester) async { RenderTestObject.paintCount = 0; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/opacity_test.dart b/packages/flutter/test/widgets/opacity_test.dart index a638dcfe202..e8571771dd0 100644 --- a/packages/flutter/test/widgets/opacity_test.dart +++ b/packages/flutter/test/widgets/opacity_test.dart @@ -12,12 +12,11 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Opacity', (WidgetTester tester) async { + testWidgets('Opacity', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // Opacity 1.0: Semantics and painting @@ -154,7 +153,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('offset is correctly handled in Opacity', (WidgetTester tester) async { + testWidgets('offset is correctly handled in Opacity', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -187,7 +186,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('empty opacity does not crash', (WidgetTester tester) async { + testWidgets('empty opacity does not crash', (WidgetTester tester) async { await tester.pumpWidget( RepaintBoundary(child: Opacity(opacity: 0.5, child: Container())), ); @@ -199,7 +198,7 @@ void main() { image.dispose(); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/49857 - testWidgetsWithLeakTracking('Child shows up in the right spot when opacity is disabled', (WidgetTester tester) async { + testWidgets('Child shows up in the right spot when opacity is disabled', (WidgetTester tester) async { debugDisableOpacityLayers = true; final GlobalKey key = GlobalKey(); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/overflow_bar_test.dart b/packages/flutter/test/widgets/overflow_bar_test.dart index 3145df15132..d8e9520b20c 100644 --- a/packages/flutter/test/widgets/overflow_bar_test.dart +++ b/packages/flutter/test/widgets/overflow_bar_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('OverflowBar documented defaults', (WidgetTester tester) async { + testWidgets('OverflowBar documented defaults', (WidgetTester tester) async { const OverflowBar bar = OverflowBar(); expect(bar.spacing, 0); expect(bar.alignment, null); @@ -18,7 +17,7 @@ void main() { expect(bar.children, const <Widget>[]); }); - testWidgetsWithLeakTracking('Empty OverflowBar', (WidgetTester tester) async { + testWidgets('Empty OverflowBar', (WidgetTester tester) async { const Size size = Size(16, 24); await tester.pumpWidget( @@ -47,7 +46,7 @@ void main() { expect(tester.getSize(find.byType(OverflowBar)), Size.zero); }); - testWidgetsWithLeakTracking('OverflowBar horizontal layout', (WidgetTester tester) async { + testWidgets('OverflowBar horizontal layout', (WidgetTester tester) async { final Key child1Key = UniqueKey(); final Key child2Key = UniqueKey(); final Key child3Key = UniqueKey(); @@ -94,7 +93,7 @@ void main() { expect(tester.getRect(find.byKey(child1Key)), const Rect.fromLTRB(10.0 + 96 + 10.0, 8, 10.0 + 10.0 + 144, 56)); }); - testWidgetsWithLeakTracking('OverflowBar vertical layout', (WidgetTester tester) async { + testWidgets('OverflowBar vertical layout', (WidgetTester tester) async { final Key child1Key = UniqueKey(); final Key child2Key = UniqueKey(); final Key child3Key = UniqueKey(); @@ -175,7 +174,7 @@ void main() { expect(tester.getRect(find.byKey(child3Key)), const Rect.fromLTRB(100.0/2.0 - 32/2, 112, 100.0/2.0 + 32/2, 144)); }); - testWidgetsWithLeakTracking('OverflowBar intrinsic width', (WidgetTester tester) async { + testWidgets('OverflowBar intrinsic width', (WidgetTester tester) async { Widget buildFrame({ required double width }) { return Directionality( textDirection: TextDirection.ltr, @@ -206,7 +205,7 @@ void main() { expect(tester.getSize(find.byType(OverflowBar)).width, 150); }); - testWidgetsWithLeakTracking('OverflowBar intrinsic height', (WidgetTester tester) async { + testWidgets('OverflowBar intrinsic height', (WidgetTester tester) async { Widget buildFrame({ required double maxWidth }) { return Directionality( textDirection: TextDirection.ltr, @@ -238,7 +237,7 @@ void main() { }); - testWidgetsWithLeakTracking('OverflowBar is wider that its intrinsic width', (WidgetTester tester) async { + testWidgets('OverflowBar is wider that its intrinsic width', (WidgetTester tester) async { final Key key0 = UniqueKey(); final Key key1 = UniqueKey(); final Key key2 = UniqueKey(); @@ -274,7 +273,7 @@ void main() { expect(tester.getTopLeft(find.byKey(key2)).dx, 600); }); - testWidgetsWithLeakTracking('OverflowBar with alignment should match Row with mainAxisAlignment', (WidgetTester tester) async { + testWidgets('OverflowBar with alignment should match Row with mainAxisAlignment', (WidgetTester tester) async { final Key key0 = UniqueKey(); final Key key1 = UniqueKey(); final Key key2 = UniqueKey(); diff --git a/packages/flutter/test/widgets/overflow_box_test.dart b/packages/flutter/test/widgets/overflow_box_test.dart index 1d0131677bd..4cd0117ad10 100644 --- a/packages/flutter/test/widgets/overflow_box_test.dart +++ b/packages/flutter/test/widgets/overflow_box_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('OverflowBox control test', (WidgetTester tester) async { + testWidgets('OverflowBox control test', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Align( alignment: Alignment.bottomRight, @@ -35,7 +34,7 @@ void main() { group('when fit is OverflowBoxFit.deferToChild', () { group('OverflowBox behavior with long and short content', () { for (final bool contentSuperLong in <bool>[false, true]) { - testWidgetsWithLeakTracking('contentSuperLong=$contentSuperLong', (WidgetTester tester) async { + testWidgets('contentSuperLong=$contentSuperLong', (WidgetTester tester) async { final GlobalKey<State<StatefulWidget>> key = GlobalKey(); final Column child = Column( @@ -66,7 +65,7 @@ void main() { } }); - testWidgetsWithLeakTracking('no child', (WidgetTester tester) async { + testWidgets('no child', (WidgetTester tester) async { final GlobalKey<State<StatefulWidget>> key = GlobalKey(); await tester.pumpWidget(Directionality( @@ -89,7 +88,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('OverflowBox implements debugFillProperties', (WidgetTester tester) async { + testWidgets('OverflowBox implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const OverflowBox( minWidth: 1.0, @@ -110,7 +109,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('SizedOverflowBox alignment', (WidgetTester tester) async { + testWidgets('SizedOverflowBox alignment', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, @@ -133,7 +132,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SizedOverflowBox alignment (direction-sensitive)', (WidgetTester tester) async { + testWidgets('SizedOverflowBox alignment (direction-sensitive)', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, diff --git a/packages/flutter/test/widgets/overlay_portal_test.dart b/packages/flutter/test/widgets/overlay_portal_test.dart index 5efc9c33da2..29158d50e14 100644 --- a/packages/flutter/test/widgets/overlay_portal_test.dart +++ b/packages/flutter/test/widgets/overlay_portal_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -98,7 +97,7 @@ void main() { _PaintOrder.paintOrder.clear(); }); - testWidgetsWithLeakTracking('The overlay child sees the right inherited widgets', (WidgetTester tester) async { + testWidgets('The overlay child sees the right inherited widgets', (WidgetTester tester) async { int buildCount = 0; TextDirection? directionSeenByOverlayChild; TextDirection textDirection = TextDirection.rtl; @@ -147,7 +146,7 @@ void main() { expect(directionSeenByOverlayChild, textDirection); }); - testWidgetsWithLeakTracking('Safe to deactivate and re-activate OverlayPortal', (WidgetTester tester) async { + testWidgets('Safe to deactivate and re-activate OverlayPortal', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); @@ -173,7 +172,7 @@ void main() { await tester.pumpWidget(SizedBox(child: widget)); }); - testWidgetsWithLeakTracking('Safe to hide overlay child and remove OverlayPortal in the same frame', (WidgetTester tester) async { + testWidgets('Safe to hide overlay child and remove OverlayPortal in the same frame', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/129025. late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); @@ -204,7 +203,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Safe to hide overlay child and reparent OverlayPortal in the same frame', (WidgetTester tester) async { + testWidgets('Safe to hide overlay child and reparent OverlayPortal in the same frame', (WidgetTester tester) async { final OverlayPortal overlayPortal = OverlayPortal( key: GlobalKey(debugLabel: 'key'), controller: controller1, @@ -242,7 +241,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Safe to hide overlay child and reparent OverlayPortal in the same frame 2', (WidgetTester tester) async { + testWidgets('Safe to hide overlay child and reparent OverlayPortal in the same frame 2', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); @@ -272,7 +271,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking( + testWidgets( 'Overlay child remains accessible via tree walk when there is no relayout boundary between OverlayPortal and Overlay', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/133545. @@ -347,7 +346,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('show/hide works', (WidgetTester tester) async { + testWidgets('show/hide works', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); final OverlayPortalController controller = OverlayPortalController(debugLabel: 'local controller'); @@ -388,7 +387,7 @@ void main() { expect(find.byWidget(target), findsOneWidget); }); - testWidgetsWithLeakTracking('overlayChildBuilder is not evaluated until show is called', (WidgetTester tester) async { + testWidgets('overlayChildBuilder is not evaluated until show is called', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); final OverlayPortalController controller = OverlayPortalController(debugLabel: 'local controller'); @@ -414,7 +413,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('overlay child can use Positioned', (WidgetTester tester) async { + testWidgets('overlay child can use Positioned', (WidgetTester tester) async { double dimensions = 30; late StateSetter setState; late final OverlayEntry overlayEntry; @@ -462,7 +461,7 @@ void main() { expect(tester.getSize(find.byType(Placeholder)), const Size(50, 50)) ; }); - testWidgetsWithLeakTracking('overlay child can be hit tested', (WidgetTester tester) async { + testWidgets('overlay child can be hit tested', (WidgetTester tester) async { double offset = 0; late StateSetter setState; late final OverlayEntry overlayEntry; @@ -519,7 +518,7 @@ void main() { expect(isHit, true); }); - testWidgetsWithLeakTracking('works in a LayoutBuilder', (WidgetTester tester) async { + testWidgets('works in a LayoutBuilder', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); @@ -549,7 +548,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('works in a LayoutBuilder 2', (WidgetTester tester) async { + testWidgets('works in a LayoutBuilder 2', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); late StateSetter setState; @@ -588,7 +587,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('works in a LayoutBuilder 3', (WidgetTester tester) async { + testWidgets('works in a LayoutBuilder 3', (WidgetTester tester) async { late final OverlayEntry overlayEntry; addTearDown(() => overlayEntry..remove()..dispose()); late StateSetter setState; @@ -636,7 +635,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('throws when no Overlay', (WidgetTester tester) async { + testWidgets('throws when no Overlay', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -664,7 +663,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('widget is laid out before overlay child', (WidgetTester tester) async { + testWidgets('widget is laid out before overlay child', (WidgetTester tester) async { final GlobalKey widgetKey = GlobalKey(debugLabel: 'widget'); final RenderBox childBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); final RenderBox overlayChildBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); @@ -719,7 +718,7 @@ void main() { verifyTreeIsClean(); }); - testWidgetsWithLeakTracking('adding/removing overlay child does not redirty overlay more than once', (WidgetTester tester) async { + testWidgets('adding/removing overlay child does not redirty overlay more than once', (WidgetTester tester) async { final GlobalKey widgetKey = GlobalKey(debugLabel: 'widget'); final GlobalKey overlayKey = GlobalKey(debugLabel: 'overlay'); final RenderBox childBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); @@ -803,7 +802,7 @@ void main() { tearDown(overlayEntry.remove); tearDownAll(overlayEntry.dispose); - testWidgetsWithLeakTracking('Adding child', (WidgetTester tester) async { + testWidgets('Adding child', (WidgetTester tester) async { controller1.hide(); await tester.pumpWidget(widget); @@ -821,7 +820,7 @@ void main() { await tester.pumpWidget(const SizedBox()); }); - testWidgetsWithLeakTracking('Removing child', (WidgetTester tester) async { + testWidgets('Removing child', (WidgetTester tester) async { controller1.show(); await tester.pumpWidget(widget); @@ -840,7 +839,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Adding/Removing OverlayPortal in LayoutBuilder during layout', (WidgetTester tester) async { + testWidgets('Adding/Removing OverlayPortal in LayoutBuilder during layout', (WidgetTester tester) async { final GlobalKey widgetKey = GlobalKey(debugLabel: 'widget'); final GlobalKey overlayKey = GlobalKey(debugLabel: 'overlay'); controller1.hide(); @@ -1062,7 +1061,7 @@ void main() { }); group('GlobalKey Reparenting', () { - testWidgetsWithLeakTracking('child is laid out before overlay child after OverlayEntry shuffle', (WidgetTester tester) async { + testWidgets('child is laid out before overlay child after OverlayEntry shuffle', (WidgetTester tester) async { int layoutCount = 0; final GlobalKey widgetKey = GlobalKey(debugLabel: 'widget'); @@ -1202,7 +1201,7 @@ void main() { expect(layoutCount2, 1); }); - testWidgetsWithLeakTracking('Swap child and overlayChild', (WidgetTester tester) async { + testWidgets('Swap child and overlayChild', (WidgetTester tester) async { final RenderBox childBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); final RenderBox overlayChildBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); @@ -1244,7 +1243,7 @@ void main() { verifyTreeIsClean(); }); - testWidgetsWithLeakTracking('forgetChild', (WidgetTester tester) async { + testWidgets('forgetChild', (WidgetTester tester) async { final RenderBox childBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); final RenderBox overlayChildBox = RenderConstrainedBox(additionalConstraints: const BoxConstraints()); @@ -1359,7 +1358,7 @@ void main() { verifyTreeIsClean(); }); - testWidgetsWithLeakTracking('Paint order', (WidgetTester tester) async { + testWidgets('Paint order', (WidgetTester tester) async { final GlobalKey outerKey = GlobalKey(debugLabel: 'Original Outer Widget'); final GlobalKey innerKey = GlobalKey(debugLabel: 'Original Inner Widget'); @@ -1484,7 +1483,7 @@ void main() { setState2 = null; }); - testWidgetsWithLeakTracking('between OverlayEntry & overlayChild', (WidgetTester tester) async { + testWidgets('between OverlayEntry & overlayChild', (WidgetTester tester) async { final _RenderLayoutCounter counter1 = _RenderLayoutCounter(); final _RenderLayoutCounter counter2 = _RenderLayoutCounter(); @@ -1532,7 +1531,7 @@ void main() { expect(counter2.layoutCount, 3); }); - testWidgetsWithLeakTracking('between OverlayEntry & overlayChild, featuring LayoutBuilder', (WidgetTester tester) async { + testWidgets('between OverlayEntry & overlayChild, featuring LayoutBuilder', (WidgetTester tester) async { final _RenderLayoutCounter counter1 = _RenderLayoutCounter(); final _RenderLayoutCounter counter2 = _RenderLayoutCounter(); @@ -1583,7 +1582,7 @@ void main() { expect(counter2.layoutCount, 3); }); - testWidgetsWithLeakTracking('between overlayChild & overlayChild', (WidgetTester tester) async { + testWidgets('between overlayChild & overlayChild', (WidgetTester tester) async { final _RenderLayoutCounter counter1 = _RenderLayoutCounter(); final _RenderLayoutCounter counter2 = _RenderLayoutCounter(); @@ -1635,7 +1634,7 @@ void main() { expect(counter2.layoutCount, 3); }); - testWidgetsWithLeakTracking('between overlayChild & overlayChild, featuring LayoutBuilder', (WidgetTester tester) async { + testWidgets('between overlayChild & overlayChild, featuring LayoutBuilder', (WidgetTester tester) async { final _RenderLayoutCounter counter1 = _RenderLayoutCounter(); final _RenderLayoutCounter counter2 = _RenderLayoutCounter(); @@ -1694,7 +1693,7 @@ void main() { expect(counter2.layoutCount, 3); }); - testWidgetsWithLeakTracking('between child & overlayChild', (WidgetTester tester) async { + testWidgets('between child & overlayChild', (WidgetTester tester) async { final _RenderLayoutCounter counter1 = _RenderLayoutCounter(); final _RenderLayoutCounter counter2 = _RenderLayoutCounter(); @@ -1736,7 +1735,7 @@ void main() { expect(counter2.layoutCount, 3); }); - testWidgetsWithLeakTracking('between child & overlayChild, featuring LayoutBuilder', (WidgetTester tester) async { + testWidgets('between child & overlayChild, featuring LayoutBuilder', (WidgetTester tester) async { final _RenderLayoutCounter counter1 = _RenderLayoutCounter(); final _RenderLayoutCounter counter2 = _RenderLayoutCounter(); @@ -1783,7 +1782,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Safe to move the overlay child to a different Overlay and remove the old Overlay', (WidgetTester tester) async { + testWidgets('Safe to move the overlay child to a different Overlay and remove the old Overlay', (WidgetTester tester) async { controller1.show(); final GlobalKey key = GlobalKey(debugLabel: 'key'); final GlobalKey oldOverlayKey = GlobalKey(debugLabel: 'old overlay'); @@ -1849,7 +1848,7 @@ void main() { }); group('Paint order', () { - testWidgetsWithLeakTracking('show bringsToTop', (WidgetTester tester) async { + testWidgets('show bringsToTop', (WidgetTester tester) async { controller1.hide(); const _PaintOrder child1 = _PaintOrder(); @@ -1916,7 +1915,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Paint order does not change after global key reparenting', (WidgetTester tester) async { + testWidgets('Paint order does not change after global key reparenting', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); late StateSetter setState; diff --git a/packages/flutter/test/widgets/overlay_test.dart b/packages/flutter/test/widgets/overlay_test.dart index 5c97adabac3..3f89ff2ac8e 100644 --- a/packages/flutter/test/widgets/overlay_test.dart +++ b/packages/flutter/test/widgets/overlay_test.dart @@ -22,7 +22,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('OverflowEntries context contains Overlay', (WidgetTester tester) async { + testWidgets('OverflowEntries context contains Overlay', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); bool didBuild = false; late final OverlayEntry overlayEntry1; @@ -98,7 +98,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Offstage overlay', (WidgetTester tester) async { + testWidgets('Offstage overlay', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); late final OverlayEntry overlayEntry1; addTearDown(() => overlayEntry1..remove()..dispose()); @@ -188,7 +188,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('insert top', (WidgetTester tester) async { + testWidgets('insert top', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); final List<String> buildOrder = <String>[]; late final OverlayEntry baseEntry; @@ -230,7 +230,7 @@ void main() { expect(buildOrder, <String>['Base', 'New']); }); - testWidgetsWithLeakTracking('insert below', (WidgetTester tester) async { + testWidgets('insert below', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -273,7 +273,7 @@ void main() { expect(buildOrder, <String>['New', 'Base']); }); - testWidgetsWithLeakTracking('insert above', (WidgetTester tester) async { + testWidgets('insert above', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -324,7 +324,7 @@ void main() { expect(buildOrder, <String>['Base', 'New', 'Top']); }); - testWidgetsWithLeakTracking('insertAll top', (WidgetTester tester) async { + testWidgets('insertAll top', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); final List<String> buildOrder = <String>[]; late final OverlayEntry baseEntry; @@ -377,7 +377,7 @@ void main() { expect(buildOrder, <String>['Base', 'New1', 'New2']); }); - testWidgetsWithLeakTracking('insertAll below', (WidgetTester tester) async { + testWidgets('insertAll below', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -430,7 +430,7 @@ void main() { expect(buildOrder, <String>['New1', 'New2','Base']); }); - testWidgetsWithLeakTracking('insertAll above', (WidgetTester tester) async { + testWidgets('insertAll above', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); final List<String> buildOrder = <String>[]; late final OverlayEntry baseEntry; @@ -491,7 +491,7 @@ void main() { expect(buildOrder, <String>['Base', 'New1', 'New2', 'Top']); }); - testWidgetsWithLeakTracking('rearrange', (WidgetTester tester) async { + testWidgets('rearrange', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); final List<int> buildOrder = <int>[]; final List<OverlayEntry> initialEntries = <OverlayEntry>[ @@ -561,7 +561,7 @@ void main() { expect(buildOrder, <int>[3, 4, 2, 0, 1]); }); - testWidgetsWithLeakTracking('rearrange above', (WidgetTester tester) async { + testWidgets('rearrange above', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); final List<int> buildOrder = <int>[]; @@ -632,7 +632,7 @@ void main() { expect(buildOrder, <int>[3, 4, 2, 1, 0]); }); - testWidgetsWithLeakTracking('rearrange below', (WidgetTester tester) async { + testWidgets('rearrange below', (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); final List<int> buildOrder = <int>[]; final List<OverlayEntry> initialEntries = <OverlayEntry>[ @@ -780,7 +780,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('OverlayState.of() throws when called if an Overlay does not exist', (WidgetTester tester) async { + testWidgets('OverlayState.of() throws when called if an Overlay does not exist', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -826,7 +826,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("OverlayState.maybeOf() works when an Overlay does and doesn't exist", (WidgetTester tester) async { + testWidgets("OverlayState.maybeOf() works when an Overlay does and doesn't exist", (WidgetTester tester) async { final GlobalKey overlayKey = GlobalKey(); OverlayState? foundState; late final OverlayEntry baseEntry; @@ -869,7 +869,7 @@ void main() { expect(foundState, isNull); }); - testWidgetsWithLeakTracking('OverlayEntry.opaque can be changed when OverlayEntry is not part of an Overlay (yet)', (WidgetTester tester) async { + testWidgets('OverlayEntry.opaque can be changed when OverlayEntry is not part of an Overlay (yet)', (WidgetTester tester) async { final GlobalKey<OverlayState> overlayKey = GlobalKey<OverlayState>(); final Key root = UniqueKey(); final Key top = UniqueKey(); @@ -912,7 +912,7 @@ void main() { expect(find.byKey(top), findsOneWidget); }); - testWidgetsWithLeakTracking('OverlayEntries do not rebuild when opaqueness changes', (WidgetTester tester) async { + testWidgets('OverlayEntries do not rebuild when opaqueness changes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/45797. final GlobalKey<OverlayState> overlayKey = GlobalKey<OverlayState>(); @@ -974,7 +974,7 @@ void main() { expect(tester.state<StatefulTestState>(find.byKey(top)).rebuildCount, 1); }); - testWidgetsWithLeakTracking('OverlayEntries do not rebuild when opaque entry is added', (WidgetTester tester) async { + testWidgets('OverlayEntries do not rebuild when opaque entry is added', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/45797. final GlobalKey<OverlayState> overlayKey = GlobalKey<OverlayState>(); @@ -1037,7 +1037,7 @@ void main() { expect(tester.state<StatefulTestState>(find.byKey(top)).rebuildCount, 1); }); - testWidgetsWithLeakTracking('entries below opaque entries are ignored for hit testing', (WidgetTester tester) async { + testWidgets('entries below opaque entries are ignored for hit testing', (WidgetTester tester) async { final GlobalKey<OverlayState> overlayKey = GlobalKey<OverlayState>(); int bottomTapCount = 0; late final OverlayEntry baseEntry; @@ -1111,7 +1111,7 @@ void main() { expect(bottomTapCount, 1); }); - testWidgetsWithLeakTracking('Semantics of entries below opaque entries are ignored', (WidgetTester tester) async { + testWidgets('Semantics of entries below opaque entries are ignored', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey<OverlayState> overlayKey = GlobalKey<OverlayState>(); late final OverlayEntry bottomEntry; @@ -1151,7 +1151,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Can use Positioned within OverlayEntry', (WidgetTester tester) async { + testWidgets('Can use Positioned within OverlayEntry', (WidgetTester tester) async { late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -1232,7 +1232,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Overlay always applies clip', (WidgetTester tester) async { + testWidgets('Overlay always applies clip', (WidgetTester tester) async { late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -1257,7 +1257,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('OverlayEntry throws if inserted to an invalid Overlay', (WidgetTester tester) async { + testWidgets('OverlayEntry throws if inserted to an invalid Overlay', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -1331,7 +1331,7 @@ void main() { child: Overlay(key: overlayKey), ); - testWidgetsWithLeakTracking('mounted state can be listened', (WidgetTester tester) async { + testWidgets('mounted state can be listened', (WidgetTester tester) async { await tester.pumpWidget(emptyOverlay); final OverlayState overlay = overlayKey.currentState! as OverlayState; final List<bool> mountedLog = <bool>[]; @@ -1365,7 +1365,7 @@ void main() { expect(mountedLog, <bool>[true, false, true, false]); }); - testWidgetsWithLeakTracking('throw if disposed before removal', (WidgetTester tester) async { + testWidgets('throw if disposed before removal', (WidgetTester tester) async { await tester.pumpWidget(emptyOverlay); final OverlayState overlay = overlayKey.currentState! as OverlayState; final OverlayEntry entry = OverlayEntry( @@ -1400,7 +1400,7 @@ void main() { expect(error, isAssertionError); }); - testWidgetsWithLeakTracking('delayed dispose', (WidgetTester tester) async { + testWidgets('delayed dispose', (WidgetTester tester) async { await tester.pumpWidget(emptyOverlay); final OverlayState overlay = overlayKey.currentState! as OverlayState; final List<bool> mountedLog = <bool>[]; @@ -1436,7 +1436,7 @@ void main() { }); group('LookupBoundary', () { - testWidgetsWithLeakTracking('hides Overlay from Overlay.maybeOf', (WidgetTester tester) async { + testWidgets('hides Overlay from Overlay.maybeOf', (WidgetTester tester) async { OverlayState? overlay; late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -1466,7 +1466,7 @@ void main() { expect(overlay, isNull); }); - testWidgetsWithLeakTracking('hides Overlay from Overlay.of', (WidgetTester tester) async { + testWidgets('hides Overlay from Overlay.of', (WidgetTester tester) async { late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); @@ -1512,7 +1512,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('hides Overlay from debugCheckHasOverlay', (WidgetTester tester) async { + testWidgets('hides Overlay from debugCheckHasOverlay', (WidgetTester tester) async { late final OverlayEntry baseEntry; addTearDown(() => baseEntry..remove()..dispose()); diff --git a/packages/flutter/test/widgets/overscroll_indicator_test.dart b/packages/flutter/test/widgets/overscroll_indicator_test.dart index 4caaa3a9714..340871db323 100644 --- a/packages/flutter/test/widgets/overscroll_indicator_test.dart +++ b/packages/flutter/test/widgets/overscroll_indicator_test.dart @@ -6,7 +6,6 @@ import 'dart:math' as math; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; final Matcher doesNotOverscroll = isNot(paints..circle()); @@ -20,7 +19,7 @@ Future<void> slowDrag(WidgetTester tester, Offset start, Offset offset) async { } void main() { - testWidgetsWithLeakTracking('Overscroll indicator color', (WidgetTester tester) async { + testWidgets('Overscroll indicator color', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -56,7 +55,7 @@ void main() { expect(painter, doesNotOverscroll); }); - testWidgetsWithLeakTracking('Nested scrollable', (WidgetTester tester) async { + testWidgets('Nested scrollable', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -87,7 +86,7 @@ void main() { expect(innerPainter, paints..circle()); }); - testWidgetsWithLeakTracking('Overscroll indicator changes side when you drag on the other side', (WidgetTester tester) async { + testWidgets('Overscroll indicator changes side when you drag on the other side', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -129,7 +128,7 @@ void main() { expect(painter, doesNotOverscroll); }); - testWidgetsWithLeakTracking('Overscroll indicator changes side when you shift sides', (WidgetTester tester) async { + testWidgets('Overscroll indicator changes side when you shift sides', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -167,7 +166,7 @@ void main() { }); group("Flipping direction of scrollable doesn't change overscroll behavior", () { - testWidgetsWithLeakTracking('down', (WidgetTester tester) async { + testWidgets('down', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -187,7 +186,7 @@ void main() { expect(painter, doesNotOverscroll); }); - testWidgetsWithLeakTracking('up', (WidgetTester tester) async { + testWidgets('up', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -209,7 +208,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Overscroll in both directions', (WidgetTester tester) async { + testWidgets('Overscroll in both directions', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -232,7 +231,7 @@ void main() { expect(painter, doesNotOverscroll); }); - testWidgetsWithLeakTracking('Overscroll ignored from alternate axis', (WidgetTester tester) async { + testWidgets('Overscroll ignored from alternate axis', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -261,7 +260,7 @@ void main() { expect(painter, doesNotOverscroll); }); - testWidgetsWithLeakTracking('Overscroll horizontally', (WidgetTester tester) async { + testWidgets('Overscroll horizontally', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -292,7 +291,7 @@ void main() { expect(painter, doesNotOverscroll); }); - testWidgetsWithLeakTracking('Nested overscrolls do not throw exceptions', (WidgetTester tester) async { + testWidgets('Nested overscrolls do not throw exceptions', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: PageView( @@ -314,7 +313,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Changing settings', (WidgetTester tester) async { + testWidgets('Changing settings', (WidgetTester tester) async { RenderObject painter; await tester.pumpWidget( @@ -360,7 +359,7 @@ void main() { expect(painter, isNot(paints..circle()..circle())); }); - testWidgetsWithLeakTracking('CustomScrollView overscroll indicator works if there is sliver before center', (WidgetTester tester) async { + testWidgets('CustomScrollView overscroll indicator works if there is sliver before center', (WidgetTester tester) async { final Key centerKey = UniqueKey(); await tester.pumpWidget( Directionality( @@ -399,7 +398,7 @@ void main() { expect(painter, paints..save()..translate(y: 0.0)..scale()..circle()); }); - testWidgetsWithLeakTracking('CustomScrollView overscroll indicator works well with [CustomScrollView.center] and [OverscrollIndicatorNotification.paintOffset]', (WidgetTester tester) async { + testWidgets('CustomScrollView overscroll indicator works well with [CustomScrollView.center] and [OverscrollIndicatorNotification.paintOffset]', (WidgetTester tester) async { final Key centerKey = UniqueKey(); await tester.pumpWidget( Directionality( @@ -446,7 +445,7 @@ void main() { expect(painter, paints..save()..translate(y: 50.0)..scale()..circle()); }); - testWidgetsWithLeakTracking('The OverscrollIndicator should not overflow the scrollable view edge', (WidgetTester tester) async { + testWidgets('The OverscrollIndicator should not overflow the scrollable view edge', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/64149 await tester.pumpWidget( Directionality( @@ -509,7 +508,7 @@ void main() { }); group('[OverscrollIndicatorNotification.paintOffset] test', () { - testWidgetsWithLeakTracking('Leading', (WidgetTester tester) async { + testWidgets('Leading', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -539,7 +538,7 @@ void main() { expect(painter, paints..save()..translate(y: 50.0 - 30.0)..scale()..circle()); }); - testWidgetsWithLeakTracking('Trailing', (WidgetTester tester) async { + testWidgets('Trailing', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/overscroll_stretch_indicator_test.dart b/packages/flutter/test/widgets/overscroll_stretch_indicator_test.dart index 3f48544f7e4..af368873925 100644 --- a/packages/flutter/test/widgets/overscroll_stretch_indicator_test.dart +++ b/packages/flutter/test/widgets/overscroll_stretch_indicator_test.dart @@ -10,7 +10,6 @@ library; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { Widget buildTest( @@ -77,7 +76,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Stretch overscroll will do nothing when axes do not match', (WidgetTester tester) async { + testWidgets('Stretch overscroll will do nothing when axes do not match', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final ScrollController controller = ScrollController(); @@ -138,7 +137,7 @@ void main() { expect(box2.localToGlobal(Offset.zero), const Offset(0.0, 250.0)); }); - testWidgetsWithLeakTracking('Stretch overscroll vertically', (WidgetTester tester) async { + testWidgets('Stretch overscroll vertically', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -217,7 +216,7 @@ void main() { expect(box3.localToGlobal(Offset.zero).dy, 350.0); }); - testWidgetsWithLeakTracking('Stretch overscroll works in reverse - vertical', (WidgetTester tester) async { + testWidgets('Stretch overscroll works in reverse - vertical', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -252,7 +251,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Stretch overscroll works in reverse - horizontal', (WidgetTester tester) async { + testWidgets('Stretch overscroll works in reverse - horizontal', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -294,7 +293,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Stretch overscroll works in reverse - horizontal - RTL', (WidgetTester tester) async { + testWidgets('Stretch overscroll works in reverse - horizontal - RTL', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -382,7 +381,7 @@ void main() { expect(box3.localToGlobal(Offset.zero).dx, 500.0); }); - testWidgetsWithLeakTracking('Stretch overscroll horizontally', (WidgetTester tester) async { + testWidgets('Stretch overscroll horizontally', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -461,7 +460,7 @@ void main() { expect(box3.localToGlobal(Offset.zero).dx, 500.0); }); - testWidgetsWithLeakTracking('Stretch overscroll horizontally RTL', (WidgetTester tester) async { + testWidgets('Stretch overscroll horizontally RTL', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -503,7 +502,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Disallow stretching overscroll', (WidgetTester tester) async { + testWidgets('Disallow stretching overscroll', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -547,7 +546,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Stretch does not overflow bounds of container', (WidgetTester tester) async { + testWidgets('Stretch does not overflow bounds of container', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/90197 await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -604,7 +603,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Clip behavior is updated as needed', (WidgetTester tester) async { + testWidgets('Clip behavior is updated as needed', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/97867 await tester.pumpWidget( Directionality( @@ -664,7 +663,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('clipBehavior parameter updates overscroll clipping behavior', (WidgetTester tester) async { + testWidgets('clipBehavior parameter updates overscroll clipping behavior', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103491 Widget buildFrame(Clip clipBehavior) { @@ -728,7 +727,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Stretch limit', (WidgetTester tester) async { + testWidgets('Stretch limit', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/99264 await tester.pumpWidget( Directionality( @@ -779,7 +778,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Multiple pointers will not exceed stretch limit', (WidgetTester tester) async { + testWidgets('Multiple pointers will not exceed stretch limit', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/99264 await tester.pumpWidget( Directionality( @@ -849,7 +848,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Stretch overscroll vertically, change direction mid scroll', (WidgetTester tester) async { + testWidgets('Stretch overscroll vertically, change direction mid scroll', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -920,7 +919,7 @@ void main() { expect(box3.localToGlobal(Offset.zero), const Offset(0.0, 200.0)); }); - testWidgetsWithLeakTracking('Stretch overscroll horizontally, change direction mid scroll', (WidgetTester tester) async { + testWidgets('Stretch overscroll horizontally, change direction mid scroll', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -992,7 +991,7 @@ void main() { expect(box3.localToGlobal(Offset.zero), const Offset(200.0, 0.0)); }); - testWidgetsWithLeakTracking('Fling toward the trailing edge causes stretch toward the leading edge', (WidgetTester tester) async { + testWidgets('Fling toward the trailing edge causes stretch toward the leading edge', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -1034,7 +1033,7 @@ void main() { expect(box3.localToGlobal(Offset.zero).dy, 350.0); }); - testWidgetsWithLeakTracking('Fling toward the leading edge causes stretch toward the trailing edge', (WidgetTester tester) async { + testWidgets('Fling toward the leading edge causes stretch toward the trailing edge', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -1088,7 +1087,7 @@ void main() { expect(box3.localToGlobal(Offset.zero).dy, 500.0); }); - testWidgetsWithLeakTracking('changing scroll direction during recede animation will not change the stretch direction', (WidgetTester tester) async { + testWidgets('changing scroll direction during recede animation will not change the stretch direction', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); @@ -1152,7 +1151,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('Stretch overscroll only uses image filter during stretch effect', (WidgetTester tester) async { + testWidgets('Stretch overscroll only uses image filter during stretch effect', (WidgetTester tester) async { final GlobalKey box1Key = GlobalKey(); final GlobalKey box2Key = GlobalKey(); final GlobalKey box3Key = GlobalKey(); diff --git a/packages/flutter/test/widgets/page_forward_transitions_test.dart b/packages/flutter/test/widgets/page_forward_transitions_test.dart index da523ac96f4..9ffc019cc67 100644 --- a/packages/flutter/test/widgets/page_forward_transitions_test.dart +++ b/packages/flutter/test/widgets/page_forward_transitions_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestTransition extends AnimatedWidget { const TestTransition({ @@ -58,7 +57,7 @@ void main() { const Duration kTwoTenthsOfTheTransitionDuration = Duration(milliseconds: 30); const Duration kFourTenthsOfTheTransitionDuration = Duration(milliseconds: 60); - testWidgetsWithLeakTracking('Check onstage/offstage handling around transitions', (WidgetTester tester) async { + testWidgets('Check onstage/offstage handling around transitions', (WidgetTester tester) async { final GlobalKey insideKey = GlobalKey(); @@ -197,7 +196,7 @@ void main() { }); - testWidgetsWithLeakTracking('Check onstage/offstage handling of barriers around transitions', (WidgetTester tester) async { + testWidgets('Check onstage/offstage handling of barriers around transitions', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( onGenerateRoute: (RouteSettings settings) { diff --git a/packages/flutter/test/widgets/page_route_builder_test.dart b/packages/flutter/test/widgets/page_route_builder_test.dart index 7e90c9a4e27..3e6090fa801 100644 --- a/packages/flutter/test/widgets/page_route_builder_test.dart +++ b/packages/flutter/test/widgets/page_route_builder_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestPage extends StatelessWidget { const TestPage({ super.key, this.useMaterial3 }); @@ -94,7 +93,7 @@ class ModalPage extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('Material2 - Barriers show when using PageRouteBuilder', (WidgetTester tester) async { + testWidgets('Material2 - Barriers show when using PageRouteBuilder', (WidgetTester tester) async { await tester.pumpWidget(const TestPage(useMaterial3: false)); await tester.tap(find.byType(FloatingActionButton)); await tester.pumpAndSettle(); @@ -104,7 +103,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Material3 - Barriers show when using PageRouteBuilder', (WidgetTester tester) async { + testWidgets('Material3 - Barriers show when using PageRouteBuilder', (WidgetTester tester) async { await tester.pumpWidget(const TestPage(useMaterial3: true)); await tester.tap(find.byType(FloatingActionButton)); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/widgets/page_storage_test.dart b/packages/flutter/test/widgets/page_storage_test.dart index ec8d39002de..db74aa58b32 100644 --- a/packages/flutter/test/widgets/page_storage_test.dart +++ b/packages/flutter/test/widgets/page_storage_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('PageStorage read and write', (WidgetTester tester) async { + testWidgets('PageStorage read and write', (WidgetTester tester) async { const Key builderKey = PageStorageKey<String>('builderKey'); late StateSetter setState; int storedValue = 0; @@ -38,7 +37,7 @@ void main() { expect(PageStorage.of(builderElement).readState(builderElement), equals(storedValue)); }); - testWidgetsWithLeakTracking('PageStorage read and write by identifier', (WidgetTester tester) async { + testWidgets('PageStorage read and write by identifier', (WidgetTester tester) async { late StateSetter setState; int storedValue = 0; diff --git a/packages/flutter/test/widgets/page_transitions_test.dart b/packages/flutter/test/widgets/page_transitions_test.dart index cc803139502..ba531ac83ee 100644 --- a/packages/flutter/test/widgets/page_transitions_test.dart +++ b/packages/flutter/test/widgets/page_transitions_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestOverlayRoute extends OverlayRoute<void> { TestOverlayRoute({ super.settings }); @@ -48,7 +47,7 @@ class PersistentBottomSheetTestState extends State<PersistentBottomSheetTest> { } void main() { - testWidgetsWithLeakTracking('Check onstage/offstage handling around transitions', (WidgetTester tester) async { + testWidgets('Check onstage/offstage handling around transitions', (WidgetTester tester) async { final GlobalKey containerKey1 = GlobalKey(); final GlobalKey containerKey2 = GlobalKey(); final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ @@ -130,7 +129,7 @@ void main() { expect(Navigator.canPop(containerKey1.currentContext!), isFalse); }); - testWidgetsWithLeakTracking('Check back gesture disables Heroes', (WidgetTester tester) async { + testWidgets('Check back gesture disables Heroes', (WidgetTester tester) async { final GlobalKey containerKey1 = GlobalKey(); final GlobalKey containerKey2 = GlobalKey(); const String kHeroTag = 'hero'; @@ -199,7 +198,7 @@ void main() { expect(settingsOffset.dy, 100.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking("Check back gesture doesn't start during transitions", (WidgetTester tester) async { + testWidgets("Check back gesture doesn't start during transitions", (WidgetTester tester) async { final GlobalKey containerKey1 = GlobalKey(); final GlobalKey containerKey2 = GlobalKey(); final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ @@ -243,7 +242,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); // Tests bug https://github.com/flutter/flutter/issues/6451 - testWidgetsWithLeakTracking('Check back gesture with a persistent bottom sheet showing', (WidgetTester tester) async { + testWidgets('Check back gesture with a persistent bottom sheet showing', (WidgetTester tester) async { final GlobalKey containerKey1 = GlobalKey(); final GlobalKey containerKey2 = GlobalKey(); final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ @@ -296,7 +295,7 @@ void main() { expect(sheet.setStateCalled, isFalse); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Test completed future', (WidgetTester tester) async { + testWidgets('Test completed future', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (_) => const Center(child: Text('home')), '/next': (_) => const Center(child: Text('next')), diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index ef97dd4617c..f6864bc0165 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart' show TestClipPaintingContext; import 'semantics_tester.dart'; @@ -15,7 +14,7 @@ import 'states.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('PageView.builder respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('PageView.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -50,7 +49,7 @@ void main() { expect(finderCalled, true); }); - testWidgetsWithLeakTracking('PageView resize from zero-size viewport should not lose state', (WidgetTester tester) async { + testWidgets('PageView resize from zero-size viewport should not lose state', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/88956 final PageController controller = PageController(initialPage: 1); addTearDown(controller.dispose); @@ -94,7 +93,7 @@ void main() { expect(find.text('Iowa'), findsOneWidget); }); - testWidgetsWithLeakTracking('Change the page through the controller when zero-size viewport', (WidgetTester tester) async { + testWidgets('Change the page through the controller when zero-size viewport', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/88956 final PageController controller = PageController(initialPage: 1); addTearDown(controller.dispose); @@ -133,7 +132,7 @@ void main() { expect(find.text('Illinois'), findsOneWidget); }); - testWidgetsWithLeakTracking('_PagePosition.applyViewportDimension should not throw', (WidgetTester tester) async { + testWidgets('_PagePosition.applyViewportDimension should not throw', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/101007 final PageController controller = PageController(initialPage: 1); addTearDown(controller.dispose); @@ -171,14 +170,14 @@ void main() { await tester.binding.setSurfaceSize(null); }); - testWidgetsWithLeakTracking('PageController cannot return page while unattached', + testWidgets('PageController cannot return page while unattached', (WidgetTester tester) async { final PageController controller = PageController(); addTearDown(controller.dispose); expect(() => controller.page, throwsAssertionError); }); - testWidgetsWithLeakTracking('PageView control test', (WidgetTester tester) async { + testWidgets('PageView control test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Directionality( @@ -245,7 +244,7 @@ void main() { expect(find.text('Arizona'), findsNothing); }); - testWidgetsWithLeakTracking('PageView does not squish when overscrolled', (WidgetTester tester) async { + testWidgets('PageView does not squish when overscrolled', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: PageView( children: List<Widget>.generate(10, (int i) { @@ -283,7 +282,7 @@ void main() { expect(sizeOf(0), equals(const Size(800.0, 600.0))); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('PageController control test', (WidgetTester tester) async { + testWidgets('PageController control test', (WidgetTester tester) async { final PageController controller = PageController(initialPage: 4); addTearDown(controller.dispose); @@ -330,7 +329,7 @@ void main() { expect(find.text('California'), findsOneWidget); }); - testWidgetsWithLeakTracking('PageController page stability', (WidgetTester tester) async { + testWidgets('PageController page stability', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Center( @@ -382,7 +381,7 @@ void main() { expect(find.text('Arizona'), findsOneWidget); }); - testWidgetsWithLeakTracking('PageController nextPage and previousPage return Futures that resolve', (WidgetTester tester) async { + testWidgets('PageController nextPage and previousPage return Futures that resolve', (WidgetTester tester) async { final PageController controller = PageController(); addTearDown(controller.dispose); @@ -416,7 +415,7 @@ void main() { expect(previousPageCompleted, true); }); - testWidgetsWithLeakTracking('PageView in zero-size container', (WidgetTester tester) async { + testWidgets('PageView in zero-size container', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Center( @@ -446,7 +445,7 @@ void main() { expect(find.text('Alabama'), findsOneWidget); }); - testWidgetsWithLeakTracking('Page changes at halfway point', (WidgetTester tester) async { + testWidgets('Page changes at halfway point', (WidgetTester tester) async { final List<int> log = <int>[]; await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -496,7 +495,7 @@ void main() { expect(find.text('Alaska'), findsOneWidget); }); - testWidgetsWithLeakTracking('Bouncing scroll physics ballistics does not overshoot', (WidgetTester tester) async { + testWidgets('Bouncing scroll physics ballistics does not overshoot', (WidgetTester tester) async { final List<int> log = <int>[]; final PageController controller = PageController(viewportFraction: 0.9); addTearDown(controller.dispose); @@ -551,7 +550,7 @@ void main() { expect(find.text('Arizona'), findsNothing); }); - testWidgetsWithLeakTracking('PageView viewportFraction', (WidgetTester tester) async { + testWidgets('PageView viewportFraction', (WidgetTester tester) async { PageController controller = PageController(viewportFraction: 7/8); addTearDown(controller.dispose); @@ -596,7 +595,7 @@ void main() { expect(tester.getTopLeft(find.text('Idaho')), const Offset(790.0, 0.0)); }); - testWidgetsWithLeakTracking('Page snapping disable and reenable', (WidgetTester tester) async { + testWidgets('Page snapping disable and reenable', (WidgetTester tester) async { final List<int> log = <int>[]; Widget build({ required bool pageSnapping }) { @@ -659,7 +658,7 @@ void main() { expect(find.text('Arkansas'), findsNothing); }); - testWidgetsWithLeakTracking('PageView small viewportFraction', (WidgetTester tester) async { + testWidgets('PageView small viewportFraction', (WidgetTester tester) async { final PageController controller = PageController(viewportFraction: 1/8); addTearDown(controller.dispose); @@ -704,7 +703,7 @@ void main() { expect(tester.getTopLeft(find.text('Iowa')), const Offset(750.0, 0.0)); }); - testWidgetsWithLeakTracking('PageView large viewportFraction', (WidgetTester tester) async { + testWidgets('PageView large viewportFraction', (WidgetTester tester) async { final PageController controller = PageController(viewportFraction: 5/4); addTearDown(controller.dispose); @@ -738,7 +737,7 @@ void main() { expect(tester.getTopLeft(find.text('Hawaii')), const Offset(-100.0, 0.0)); }); - testWidgetsWithLeakTracking( + testWidgets( 'Updating PageView large viewportFraction', (WidgetTester tester) async { Widget build(PageController controller) { @@ -777,7 +776,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'PageView large viewportFraction can scroll to the last page and snap', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/45096. @@ -815,7 +814,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'All visible pages are able to receive touch events', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/23873. @@ -864,7 +863,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('the current item remains centered on constraint change', (WidgetTester tester) async { + testWidgets('the current item remains centered on constraint change', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/50505. final PageController controller = PageController( initialPage: kStates.length - 1, @@ -907,7 +906,7 @@ void main() { verifyCentered(); }); - testWidgetsWithLeakTracking('PageView does not report page changed on overscroll', (WidgetTester tester) async { + testWidgets('PageView does not report page changed on overscroll', (WidgetTester tester) async { final PageController controller = PageController( initialPage: kStates.length - 1, ); @@ -934,7 +933,7 @@ void main() { expect(changeIndex, 0); }); - testWidgetsWithLeakTracking('PageView can restore page', (WidgetTester tester) async { + testWidgets('PageView can restore page', (WidgetTester tester) async { final PageController controller = PageController(); addTearDown(controller.dispose); expect( @@ -1016,7 +1015,7 @@ void main() { expect(controller2.page, 0); }); - testWidgetsWithLeakTracking('PageView exposes semantics of children', (WidgetTester tester) async { + testWidgets('PageView exposes semantics of children', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final PageController controller = PageController(); @@ -1056,7 +1055,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('PageMetrics', (WidgetTester tester) async { + testWidgets('PageMetrics', (WidgetTester tester) async { final PageMetrics page = PageMetrics( minScrollExtent: 100.0, maxScrollExtent: 200.0, @@ -1073,7 +1072,7 @@ void main() { expect(page2.page, 4.0); }); - testWidgetsWithLeakTracking('Page controller can handle rounding issue', (WidgetTester tester) async { + testWidgets('Page controller can handle rounding issue', (WidgetTester tester) async { final PageController pageController = PageController(); addTearDown(pageController.dispose); @@ -1094,7 +1093,7 @@ void main() { expect(pageController.page, 1); }); - testWidgetsWithLeakTracking('PageView can participate in a11y scrolling', (WidgetTester tester) async { + testWidgets('PageView can participate in a11y scrolling', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final PageController controller = PageController(); @@ -1173,7 +1172,7 @@ void main() { expect(context.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('PageView.padEnds tests', (WidgetTester tester) async { + testWidgets('PageView.padEnds tests', (WidgetTester tester) async { Finder viewportFinder() => find.byType(SliverFillViewport, skipOffstage: false); // PageView() defaults to true. @@ -1195,7 +1194,7 @@ void main() { expect(tester.widget<SliverFillViewport>(viewportFinder()).padEnds, false); }); - testWidgetsWithLeakTracking('PageView - precision error inside RenderSliverFixedExtentBoxAdaptor', (WidgetTester tester) async { + testWidgets('PageView - precision error inside RenderSliverFixedExtentBoxAdaptor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/95101 final PageController controller = PageController(initialPage: 152); addTearDown(controller.dispose); @@ -1223,7 +1222,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('PageView content should not be stretched on precision error', (WidgetTester tester) async { + testWidgets('PageView content should not be stretched on precision error', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/126561. final PageController controller = PageController(); addTearDown(controller.dispose); @@ -1266,7 +1265,7 @@ void main() { expect(transform.transform.storage.first, 1.0); }); - testWidgetsWithLeakTracking('PageController onAttach, onDetach', (WidgetTester tester) async { + testWidgets('PageController onAttach, onDetach', (WidgetTester tester) async { int attach = 0; int detach = 0; final PageController controller = PageController( diff --git a/packages/flutter/test/widgets/pageable_list_test.dart b/packages/flutter/test/widgets/pageable_list_test.dart index 0dd30a18da5..3cab09a14c5 100644 --- a/packages/flutter/test/widgets/pageable_list_test.dart +++ b/packages/flutter/test/widgets/pageable_list_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Size pageSize = const Size(600.0, 300.0); const List<int> defaultPages = <int>[0, 1, 2, 3, 4, 5]; @@ -60,7 +59,7 @@ Future<void> pageRight(WidgetTester tester) { } void main() { - testWidgetsWithLeakTracking('PageView default control', (WidgetTester tester) async { + testWidgets('PageView default control', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -71,7 +70,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PageView control test (LTR)', (WidgetTester tester) async { + testWidgets('PageView control test (LTR)', (WidgetTester tester) async { currentPage = null; await tester.pumpWidget(buildFrame(textDirection: TextDirection.ltr)); expect(currentPage, isNull); @@ -99,7 +98,7 @@ void main() { expect(currentPage, equals(0)); }); - testWidgetsWithLeakTracking('PageView with reverse (LTR)', (WidgetTester tester) async { + testWidgets('PageView with reverse (LTR)', (WidgetTester tester) async { currentPage = null; await tester.pumpWidget(buildFrame(reverse: true, textDirection: TextDirection.ltr)); await pageRight(tester); @@ -133,7 +132,7 @@ void main() { expect(find.text('5'), findsNothing); }); - testWidgetsWithLeakTracking('PageView control test (RTL)', (WidgetTester tester) async { + testWidgets('PageView control test (RTL)', (WidgetTester tester) async { currentPage = null; await tester.pumpWidget(buildFrame(textDirection: TextDirection.rtl)); await pageRight(tester); @@ -167,7 +166,7 @@ void main() { expect(find.text('5'), findsNothing); }); - testWidgetsWithLeakTracking('PageView with reverse (RTL)', (WidgetTester tester) async { + testWidgets('PageView with reverse (RTL)', (WidgetTester tester) async { currentPage = null; await tester.pumpWidget(buildFrame(reverse: true, textDirection: TextDirection.rtl)); expect(currentPage, isNull); diff --git a/packages/flutter/test/widgets/parent_data_test.dart b/packages/flutter/test/widgets/parent_data_test.dart index d8934ba572a..c0c7770a31b 100644 --- a/packages/flutter/test/widgets/parent_data_test.dart +++ b/packages/flutter/test/widgets/parent_data_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; @@ -50,7 +49,7 @@ void checkTree(WidgetTester tester, List<TestParentData> expectedParentData) { final TestParentData kNonPositioned = TestParentData(); void main() { - testWidgetsWithLeakTracking('ParentDataWidget control test', (WidgetTester tester) async { + testWidgets('ParentDataWidget control test', (WidgetTester tester) async { await tester.pumpWidget( const Stack( textDirection: TextDirection.ltr, @@ -250,7 +249,7 @@ void main() { checkTree(tester, <TestParentData>[]); }); - testWidgetsWithLeakTracking('ParentData overwrite with custom ParentDataWidget subclasses', (WidgetTester tester) async { + testWidgets('ParentData overwrite with custom ParentDataWidget subclasses', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -338,7 +337,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ParentDataWidget conflicting data', (WidgetTester tester) async { + testWidgets('ParentDataWidget conflicting data', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -426,7 +425,7 @@ void main() { checkTree(tester, <TestParentData>[]); }); - testWidgetsWithLeakTracking('ParentDataWidget interacts with global keys', (WidgetTester tester) async { + testWidgets('ParentDataWidget interacts with global keys', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( @@ -484,7 +483,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Parent data invalid ancestor', (WidgetTester tester) async { + testWidgets('Parent data invalid ancestor', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Row( @@ -519,7 +518,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ParentDataWidget can be used with different ancestor RenderObjectWidgets', (WidgetTester tester) async { + testWidgets('ParentDataWidget can be used with different ancestor RenderObjectWidgets', (WidgetTester tester) async { await tester.pumpWidget( OneAncestorWidget( child: Container(), diff --git a/packages/flutter/test/widgets/performance_overlay_test.dart b/packages/flutter/test/widgets/performance_overlay_test.dart index 9af1f11012f..8c337f1182a 100644 --- a/packages/flutter/test/widgets/performance_overlay_test.dart +++ b/packages/flutter/test/widgets/performance_overlay_test.dart @@ -5,15 +5,14 @@ import 'package:flutter/src/rendering/performance_overlay.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Performance overlay smoke test', (WidgetTester tester) async { + testWidgets('Performance overlay smoke test', (WidgetTester tester) async { await tester.pumpWidget(const PerformanceOverlay()); await tester.pumpWidget(PerformanceOverlay.allEnabled()); }); - testWidgetsWithLeakTracking('update widget field checkerboardRasterCacheImages', + testWidgets('update widget field checkerboardRasterCacheImages', (WidgetTester tester) async { await tester.pumpWidget(const PerformanceOverlay()); await tester.pumpWidget( @@ -26,7 +25,7 @@ void main() { true); }); - testWidgetsWithLeakTracking('update widget field checkerboardOffscreenLayers', + testWidgets('update widget field checkerboardOffscreenLayers', (WidgetTester tester) async { await tester.pumpWidget(const PerformanceOverlay()); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/physical_model_test.dart b/packages/flutter/test/widgets/physical_model_test.dart index 066d1c75732..7d3146b9c1b 100644 --- a/packages/flutter/test/widgets/physical_model_test.dart +++ b/packages/flutter/test/widgets/physical_model_test.dart @@ -10,10 +10,9 @@ library; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('PhysicalModel updates clipBehavior in updateRenderObject', (WidgetTester tester) async { + testWidgets('PhysicalModel updates clipBehavior in updateRenderObject', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp(home: PhysicalModel(color: Colors.red)), ); @@ -29,7 +28,7 @@ void main() { expect(renderPhysicalModel.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('PhysicalShape updates clipBehavior in updateRenderObject', (WidgetTester tester) async { + testWidgets('PhysicalShape updates clipBehavior in updateRenderObject', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp(home: PhysicalShape(color: Colors.red, clipper: ShapeBorderClipper(shape: CircleBorder()))), ); @@ -45,7 +44,7 @@ void main() { expect(renderPhysicalShape.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('PhysicalModel - clips when overflows and elevation is 0', (WidgetTester tester) async { + testWidgets('PhysicalModel - clips when overflows and elevation is 0', (WidgetTester tester) async { const Key key = Key('test'); await tester.pumpWidget( Theme( diff --git a/packages/flutter/test/widgets/placeholder_test.dart b/packages/flutter/test/widgets/placeholder_test.dart index 28aadb0dbf2..980f6473edc 100644 --- a/packages/flutter/test/widgets/placeholder_test.dart +++ b/packages/flutter/test/widgets/placeholder_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Placeholder', (WidgetTester tester) async { + testWidgets('Placeholder', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 600.0)); await tester.pumpWidget(const Center(child: Placeholder())); @@ -20,21 +19,21 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(200.0, 300.0)); }); - testWidgetsWithLeakTracking('Placeholder color', (WidgetTester tester) async { + testWidgets('Placeholder color', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); expect(tester.renderObject(find.byType(Placeholder)), paints..path(color: const Color(0xFF455A64))); await tester.pumpWidget(const Placeholder(color: Color(0xFF00FF00))); expect(tester.renderObject(find.byType(Placeholder)), paints..path(color: const Color(0xFF00FF00))); }); - testWidgetsWithLeakTracking('Placeholder stroke width', (WidgetTester tester) async { + testWidgets('Placeholder stroke width', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); expect(tester.renderObject(find.byType(Placeholder)), paints..path(strokeWidth: 2.0)); await tester.pumpWidget(const Placeholder(strokeWidth: 10.0)); expect(tester.renderObject(find.byType(Placeholder)), paints..path(strokeWidth: 10.0)); }); - testWidgetsWithLeakTracking('Placeholder child widget', (WidgetTester tester) async { + testWidgets('Placeholder child widget', (WidgetTester tester) async { await tester.pumpWidget(const Placeholder()); expect(find.text('Label'), findsNothing); await tester.pumpWidget(const MaterialApp(home: Placeholder(child: Text('Label')))); diff --git a/packages/flutter/test/widgets/platform_menu_bar_test.dart b/packages/flutter/test/widgets/platform_menu_bar_test.dart index c72e85130e4..8828115a91c 100644 --- a/packages/flutter/test/widgets/platform_menu_bar_test.dart +++ b/packages/flutter/test/widgets/platform_menu_bar_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/src/foundation/diagnostics.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -48,7 +47,7 @@ void main() { group('PlatformMenuBar', () { group('basic menu structure is transmitted to platform', () { - testWidgetsWithLeakTracking('using onSelected', (WidgetTester tester) async { + testWidgets('using onSelected', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -79,7 +78,7 @@ void main() { equals(expectedStructure), ); }); - testWidgetsWithLeakTracking('using onSelectedIntent', (WidgetTester tester) async { + testWidgets('using onSelectedIntent', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -127,7 +126,7 @@ void main() { ); expect(tester.takeException(), isA<AssertionError>()); }); - testWidgetsWithLeakTracking('diagnostics', (WidgetTester tester) async { + testWidgets('diagnostics', (WidgetTester tester) async { const PlatformMenuItem item = PlatformMenuItem( label: 'label2', shortcut: SingleActivator(LogicalKeyboardKey.keyA), @@ -159,7 +158,7 @@ void main() { }); }); group('MenuBarItem', () { - testWidgetsWithLeakTracking('diagnostics', (WidgetTester tester) async { + testWidgets('diagnostics', (WidgetTester tester) async { const PlatformMenuItem childItem = PlatformMenuItem( label: 'label', ); @@ -183,7 +182,7 @@ void main() { }); group('ShortcutSerialization', () { - testWidgetsWithLeakTracking('character constructor', (WidgetTester tester) async { + testWidgets('character constructor', (WidgetTester tester) async { final ShortcutSerialization serialization = ShortcutSerialization.character('?'); expect(serialization.toChannelRepresentation(), equals(<String, Object?>{ 'shortcutCharacter': '?', @@ -196,7 +195,7 @@ void main() { })); }); - testWidgetsWithLeakTracking('modifier constructor', (WidgetTester tester) async { + testWidgets('modifier constructor', (WidgetTester tester) async { final ShortcutSerialization serialization = ShortcutSerialization.modifier(LogicalKeyboardKey.home); expect(serialization.toChannelRepresentation(), equals(<String, Object?>{ 'shortcutTrigger': LogicalKeyboardKey.home.keyId, diff --git a/packages/flutter/test/widgets/platform_view_test.dart b/packages/flutter/test/widgets/platform_view_test.dart index 8b41d8b243a..cccecfd32a1 100644 --- a/packages/flutter/test/widgets/platform_view_test.dart +++ b/packages/flutter/test/widgets/platform_view_test.dart @@ -14,13 +14,12 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../services/fake_platform_views.dart'; void main() { group('AndroidView', () { - testWidgetsWithLeakTracking('Create Android view', (WidgetTester tester) async { + testWidgets('Create Android view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -48,7 +47,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Create Android view with params', (WidgetTester tester) async { + testWidgets('Create Android view with params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -92,7 +91,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Zero sized Android view is not created', (WidgetTester tester) async { + testWidgets('Zero sized Android view is not created', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -110,7 +109,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Resize Android view', (WidgetTester tester) async { + testWidgets('Resize Android view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -168,7 +167,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Change Android view type', (WidgetTester tester) async { + testWidgets('Change Android view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -206,7 +205,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dispose Android view', (WidgetTester tester) async { + testWidgets('Dispose Android view', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( @@ -234,7 +233,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view survives widget tree change', (WidgetTester tester) async { + testWidgets('Android view survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -272,7 +271,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view gets touch events', (WidgetTester tester) async { + testWidgets('Android view gets touch events', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -299,7 +298,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view transparent hit test behavior', (WidgetTester tester) async { + testWidgets('Android view transparent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -348,7 +347,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Android view translucent hit test behavior', (WidgetTester tester) async { + testWidgets('Android view translucent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -399,7 +398,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Android view opaque hit test behavior', (WidgetTester tester) async { + testWidgets('Android view opaque hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -449,7 +448,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking("Android view touch events are in virtual display's coordinate system", (WidgetTester tester) async { + testWidgets("Android view touch events are in virtual display's coordinate system", (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -479,7 +478,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view directionality', (WidgetTester tester) async { + testWidgets('Android view directionality', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('maps'); @@ -528,7 +527,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view ambient directionality', (WidgetTester tester) async { + testWidgets('Android view ambient directionality', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('maps'); @@ -583,7 +582,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view can lose gesture arenas', (WidgetTester tester) async { + testWidgets('Android view can lose gesture arenas', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -618,7 +617,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view drag gesture recognizer', (WidgetTester tester) async { + testWidgets('Android view drag gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -666,7 +665,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view long press gesture recognizer', (WidgetTester tester) async { + testWidgets('Android view long press gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -711,7 +710,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view tap gesture recognizer', (WidgetTester tester) async { + testWidgets('Android view tap gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -756,7 +755,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view can claim gesture after all pointers are up', (WidgetTester tester) async { + testWidgets('Android view can claim gesture after all pointers are up', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -796,7 +795,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view rebuilt during gesture', (WidgetTester tester) async { + testWidgets('Android view rebuilt during gesture', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -843,7 +842,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Android view with eager gesture recognizer', (WidgetTester tester) async { + testWidgets('Android view with eager gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -893,7 +892,7 @@ void main() { // This test makes sure it doesn't crash. // https://github.com/flutter/flutter/issues/21514 - testWidgetsWithLeakTracking( + testWidgets( 'RenderAndroidView reconstructed with same gestureRecognizers does not crash', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); @@ -919,7 +918,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('AndroidView rebuilt with same gestureRecognizers', (WidgetTester tester) async { + testWidgets('AndroidView rebuilt with same gestureRecognizers', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -955,7 +954,7 @@ void main() { expect(factoryInvocationCount, 1); }); - testWidgetsWithLeakTracking('AndroidView has correct semantics', (WidgetTester tester) async { + testWidgets('AndroidView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); @@ -1010,7 +1009,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('AndroidView can take input focus', (WidgetTester tester) async { + testWidgets('AndroidView can take input focus', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1062,7 +1061,7 @@ void main() { expect(androidViewFocusNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('AndroidView sets a platform view text input client when focused', (WidgetTester tester) async { + testWidgets('AndroidView sets a platform view text input client when focused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1111,7 +1110,7 @@ void main() { expect(lastPlatformViewTextClient['platformViewId'], currentViewId + 1); }); - testWidgetsWithLeakTracking('AndroidView clears platform focus when unfocused', (WidgetTester tester) async { + testWidgets('AndroidView clears platform focus when unfocused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1156,7 +1155,7 @@ void main() { expect(viewsController.lastClearedFocusViewId, currentViewId + 1); }); - testWidgetsWithLeakTracking('can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('can set and update clipBehavior', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1202,7 +1201,7 @@ void main() { } }); - testWidgetsWithLeakTracking('clip is handled correctly during resizing', (WidgetTester tester) async { + testWidgets('clip is handled correctly during resizing', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/67343 final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); @@ -1244,7 +1243,7 @@ void main() { expect(clipRectLayer.clipRect, const Rect.fromLTWH(0.0, 0.0, 50.0, 50.0)); }); - testWidgetsWithLeakTracking('offset is sent to the platform', (WidgetTester tester) async { + testWidgets('offset is sent to the platform', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1270,7 +1269,7 @@ void main() { controller = FakeAndroidViewController(0); }); - testWidgetsWithLeakTracking('AndroidViewSurface sets pointTransformer of view controller', (WidgetTester tester) async { + testWidgets('AndroidViewSurface sets pointTransformer of view controller', (WidgetTester tester) async { final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, @@ -1280,7 +1279,7 @@ void main() { expect(controller.pointTransformer, isNotNull); }); - testWidgetsWithLeakTracking('AndroidViewSurface defaults to texture-based rendering', (WidgetTester tester) async { + testWidgets('AndroidViewSurface defaults to texture-based rendering', (WidgetTester tester) async { final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, @@ -1293,7 +1292,7 @@ void main() { ), findsOneWidget); }); - testWidgetsWithLeakTracking('AndroidViewSurface uses view-based rendering when initially required', (WidgetTester tester) async { + testWidgets('AndroidViewSurface uses view-based rendering when initially required', (WidgetTester tester) async { controller.requiresViewComposition = true; final AndroidViewSurface surface = AndroidViewSurface( controller: controller, @@ -1307,7 +1306,7 @@ void main() { ), findsOneWidget); }); - testWidgetsWithLeakTracking('AndroidViewSurface can switch to view-based rendering after creation', (WidgetTester tester) async { + testWidgets('AndroidViewSurface can switch to view-based rendering after creation', (WidgetTester tester) async { final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, @@ -1339,7 +1338,7 @@ void main() { }); group('UiKitView', () { - testWidgetsWithLeakTracking('Create UIView', (WidgetTester tester) async { + testWidgets('Create UIView', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1362,7 +1361,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Change UIView view type', (WidgetTester tester) async { + testWidgets('Change UIView view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1395,7 +1394,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dispose UIView ', (WidgetTester tester) async { + testWidgets('Dispose UIView ', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( @@ -1423,7 +1422,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dispose UIView before creation completed ', (WidgetTester tester) async { + testWidgets('Dispose UIView before creation completed ', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.creationDelay = Completer<void>(); @@ -1454,7 +1453,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('UIView survives widget tree change', (WidgetTester tester) async { + testWidgets('UIView survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1487,7 +1486,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Create UIView with params', (WidgetTester tester) async { + testWidgets('Create UIView with params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1525,7 +1524,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('UiKitView accepts gestures', (WidgetTester tester) async { + testWidgets('UiKitView accepts gestures', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1553,7 +1552,7 @@ void main() { expect(viewsController.gesturesAccepted[currentViewId + 1], 1); }); - testWidgetsWithLeakTracking('UiKitView transparent hit test behavior', (WidgetTester tester) async { + testWidgets('UiKitView transparent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1598,7 +1597,7 @@ void main() { expect(numPointerDownsOnParent, 1); }); - testWidgetsWithLeakTracking('UiKitView translucent hit test behavior', (WidgetTester tester) async { + testWidgets('UiKitView translucent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1643,7 +1642,7 @@ void main() { expect(numPointerDownsOnParent, 1); }); - testWidgetsWithLeakTracking('UiKitView opaque hit test behavior', (WidgetTester tester) async { + testWidgets('UiKitView opaque hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1686,7 +1685,7 @@ void main() { expect(numPointerDownsOnParent, 0); }); - testWidgetsWithLeakTracking('UiKitView can lose gesture arenas', (WidgetTester tester) async { + testWidgets('UiKitView can lose gesture arenas', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1724,7 +1723,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 1); }); - testWidgetsWithLeakTracking('UiKitView tap gesture recognizers', (WidgetTester tester) async { + testWidgets('UiKitView tap gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1770,7 +1769,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView long press gesture recognizers', (WidgetTester tester) async { + testWidgets('UiKitView long press gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1814,7 +1813,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView drag gesture recognizers', (WidgetTester tester) async { + testWidgets('UiKitView drag gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1858,7 +1857,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView can claim gesture after all pointers are up', (WidgetTester tester) async { + testWidgets('UiKitView can claim gesture after all pointers are up', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1898,7 +1897,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView rebuilt during gesture', (WidgetTester tester) async { + testWidgets('UiKitView rebuilt during gesture', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1943,7 +1942,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView with eager gesture recognizer', (WidgetTester tester) async { + testWidgets('UiKitView with eager gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -1991,7 +1990,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('UiKitView rejects gestures absorbed by siblings', (WidgetTester tester) async { + testWidgets('UiKitView rejects gestures absorbed by siblings', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2021,7 +2020,7 @@ void main() { expect(viewsController.gesturesAccepted[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking( + testWidgets( 'UiKitView rejects gestures absorbed by siblings if the touch is outside of the platform view bounds but inside platform view frame', (WidgetTester tester) async { // UiKitView is positioned at (left=0, top=100, right=300, bottom=600). @@ -2071,7 +2070,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('UiKitView rebuilt with same gestureRecognizers', (WidgetTester tester) async { + testWidgets('UiKitView rebuilt with same gestureRecognizers', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2107,7 +2106,7 @@ void main() { expect(factoryInvocationCount, 1); }); - testWidgetsWithLeakTracking('UiKitView can take input focus', (WidgetTester tester) async { + testWidgets('UiKitView can take input focus', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2160,7 +2159,7 @@ void main() { expect(uiKitViewFocusNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('UiKitView sends TextInput.setPlatformViewClient when focused', (WidgetTester tester) async { + testWidgets('UiKitView sends TextInput.setPlatformViewClient when focused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); @@ -2199,7 +2198,7 @@ void main() { expect(channelArguments['platformViewId'], currentViewId + 1); }); - testWidgetsWithLeakTracking('FocusNode is disposed on UIView dispose', (WidgetTester tester) async { + testWidgets('FocusNode is disposed on UIView dispose', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2227,7 +2226,7 @@ void main() { expect(() => ChangeNotifier.debugAssertNotDisposed(node), throwsAssertionError); }); - testWidgetsWithLeakTracking('UiKitView has correct semantics', (WidgetTester tester) async { + testWidgets('UiKitView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); @@ -2274,7 +2273,7 @@ void main() { }); group('AppKitView', () { - testWidgetsWithLeakTracking('Create AppView', (WidgetTester tester) async { + testWidgets('Create AppView', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2297,7 +2296,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Change AppKitView view type', (WidgetTester tester) async { + testWidgets('Change AppKitView view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2330,7 +2329,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dispose AppKitView ', (WidgetTester tester) async { + testWidgets('Dispose AppKitView ', (WidgetTester tester) async { final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( @@ -2358,7 +2357,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Dispose AppKitView before creation completed ', (WidgetTester tester) async { + testWidgets('Dispose AppKitView before creation completed ', (WidgetTester tester) async { final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.creationDelay = Completer<void>(); @@ -2389,7 +2388,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('AppKitView survives widget tree change', (WidgetTester tester) async { + testWidgets('AppKitView survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2422,7 +2421,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Create AppKitView with params', (WidgetTester tester) async { + testWidgets('Create AppKitView with params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2462,7 +2461,7 @@ void main() { // TODO(schectman): De-skip the following tests once macOS gesture recognizers are present. // https://github.com/flutter/flutter/issues/128519 - testWidgetsWithLeakTracking('AppKitView accepts gestures', (WidgetTester tester) async { + testWidgets('AppKitView accepts gestures', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2490,7 +2489,7 @@ void main() { expect(viewsController.gesturesAccepted[currentViewId + 1], 1); }, skip: true); // https://github.com/flutter/flutter/issues/128519 - testWidgetsWithLeakTracking('AppKitView transparent hit test behavior', (WidgetTester tester) async { + testWidgets('AppKitView transparent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2535,7 +2534,7 @@ void main() { expect(numPointerDownsOnParent, 1); }, skip: true); // https://github.com/flutter/flutter/issues/128519 - testWidgetsWithLeakTracking('AppKitView translucent hit test behavior', (WidgetTester tester) async { + testWidgets('AppKitView translucent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2580,7 +2579,7 @@ void main() { expect(numPointerDownsOnParent, 1); }, skip: true); // https://github.com/flutter/flutter/issues/128519 - testWidgetsWithLeakTracking('AppKitView opaque hit test behavior', (WidgetTester tester) async { + testWidgets('AppKitView opaque hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2623,7 +2622,7 @@ void main() { expect(numPointerDownsOnParent, 0); }, skip: true); // https://github.com/flutter/flutter/issues/128519 - testWidgetsWithLeakTracking('UiKitView can lose gesture arenas', (WidgetTester tester) async { + testWidgets('UiKitView can lose gesture arenas', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2661,7 +2660,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 1); }); - testWidgetsWithLeakTracking('UiKitView tap gesture recognizers', (WidgetTester tester) async { + testWidgets('UiKitView tap gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2707,7 +2706,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView long press gesture recognizers', (WidgetTester tester) async { + testWidgets('UiKitView long press gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2751,7 +2750,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView drag gesture recognizers', (WidgetTester tester) async { + testWidgets('UiKitView drag gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2795,7 +2794,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView can claim gesture after all pointers are up', (WidgetTester tester) async { + testWidgets('UiKitView can claim gesture after all pointers are up', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2835,7 +2834,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView rebuilt during gesture', (WidgetTester tester) async { + testWidgets('UiKitView rebuilt during gesture', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2880,7 +2879,7 @@ void main() { expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking('UiKitView with eager gesture recognizer', (WidgetTester tester) async { + testWidgets('UiKitView with eager gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2928,7 +2927,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('UiKitView rejects gestures absorbed by siblings', (WidgetTester tester) async { + testWidgets('UiKitView rejects gestures absorbed by siblings', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -2958,7 +2957,7 @@ void main() { expect(viewsController.gesturesAccepted[currentViewId + 1], 0); }); - testWidgetsWithLeakTracking( + testWidgets( 'UiKitView rejects gestures absorbed by siblings if the touch is outside of the platform view bounds but inside platform view frame', (WidgetTester tester) async { // UiKitView is positioned at (left=0, top=100, right=300, bottom=600). @@ -3008,7 +3007,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('UiKitView rebuilt with same gestureRecognizers', (WidgetTester tester) async { + testWidgets('UiKitView rebuilt with same gestureRecognizers', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -3044,7 +3043,7 @@ void main() { expect(factoryInvocationCount, 1); }); - testWidgetsWithLeakTracking('AppKitView can take input focus', (WidgetTester tester) async { + testWidgets('AppKitView can take input focus', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -3097,7 +3096,7 @@ void main() { expect(uiKitViewFocusNode.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('AppKitView sends TextInput.setPlatformViewClient when focused', (WidgetTester tester) async { + testWidgets('AppKitView sends TextInput.setPlatformViewClient when focused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); @@ -3136,7 +3135,7 @@ void main() { expect(channelArguments['platformViewId'], currentViewId + 1); }); - testWidgetsWithLeakTracking('FocusNode is disposed on UIView dispose', (WidgetTester tester) async { + testWidgets('FocusNode is disposed on UIView dispose', (WidgetTester tester) async { final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); @@ -3164,7 +3163,7 @@ void main() { expect(() => ChangeNotifier.debugAssertNotDisposed(node), throwsAssertionError); }); - testWidgetsWithLeakTracking('AppKitView has correct semantics', (WidgetTester tester) async { + testWidgets('AppKitView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); @@ -3217,7 +3216,7 @@ void main() { controller = FakePlatformViewController(0); }); - testWidgetsWithLeakTracking('PlatformViewSurface should create platform view layer', (WidgetTester tester) async { + testWidgets('PlatformViewSurface should create platform view layer', (WidgetTester tester) async { final PlatformViewSurface surface = PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, @@ -3227,7 +3226,7 @@ void main() { expect(() => tester.layers.whereType<PlatformViewLayer>().first, returnsNormally); }); - testWidgetsWithLeakTracking('PlatformViewSurface can lose gesture arenas', (WidgetTester tester) async { + testWidgets('PlatformViewSurface can lose gesture arenas', (WidgetTester tester) async { bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( @@ -3263,7 +3262,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PlatformViewSurface gesture recognizers dispatch events', (WidgetTester tester) async { + testWidgets('PlatformViewSurface gesture recognizers dispatch events', (WidgetTester tester) async { bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( @@ -3304,7 +3303,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PlatformViewSurface can claim gesture after all pointers are up', (WidgetTester tester) async { + testWidgets('PlatformViewSurface can claim gesture after all pointers are up', (WidgetTester tester) async { bool verticalDragAcceptedByParent = false; // The long press recognizer rejects the gesture after the PlatformViewSurface gets the pointer up event. // This test makes sure that the PlatformViewSurface can win the gesture after it got the pointer up event. @@ -3339,7 +3338,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PlatformViewSurface rebuilt during gesture', (WidgetTester tester) async { + testWidgets('PlatformViewSurface rebuilt during gesture', (WidgetTester tester) async { await tester.pumpWidget( Align( alignment: Alignment.topLeft, @@ -3381,7 +3380,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PlatformViewSurface with eager gesture recognizer', (WidgetTester tester) async { + testWidgets('PlatformViewSurface with eager gesture recognizer', (WidgetTester tester) async { await tester.pumpWidget( Align( alignment: Alignment.topLeft, @@ -3424,7 +3423,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('PlatformViewRenderBox reconstructed with same gestureRecognizers', (WidgetTester tester) async { + testWidgets('PlatformViewRenderBox reconstructed with same gestureRecognizers', (WidgetTester tester) async { int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { ++factoryInvocationCount; @@ -3450,7 +3449,7 @@ void main() { expect(factoryInvocationCount, 2); }); - testWidgetsWithLeakTracking('PlatformViewSurface rebuilt with same gestureRecognizers', (WidgetTester tester) async { + testWidgets('PlatformViewSurface rebuilt with same gestureRecognizers', (WidgetTester tester) async { int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { ++factoryInvocationCount; @@ -3485,7 +3484,7 @@ void main() { expect(factoryInvocationCount, 1); }); - testWidgetsWithLeakTracking( + testWidgets( 'PlatformViewLink Widget init, should create a placeholder widget before onPlatformViewCreated and a PlatformViewSurface after', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); @@ -3529,7 +3528,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'PlatformViewLink widget should not trigger creation with an empty size', (WidgetTester tester) async { late PlatformViewController controller; @@ -3571,7 +3570,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'PlatformViewLink calls create when needed for Android texture display modes', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); @@ -3626,7 +3625,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('PlatformViewLink includes offset in create call when using texture layer', (WidgetTester tester) async { + testWidgets('PlatformViewLink includes offset in create call when using texture layer', (WidgetTester tester) async { addTearDown(tester.view.reset); late FakeAndroidViewController controller; @@ -3670,7 +3669,7 @@ void main() { expect(controller.createPosition, const Offset(150, 75)); }); - testWidgetsWithLeakTracking( + testWidgets( 'PlatformViewLink does not double-call create for Android Hybrid Composition', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); @@ -3720,7 +3719,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('PlatformViewLink Widget dispose', (WidgetTester tester) async { + testWidgets('PlatformViewLink Widget dispose', (WidgetTester tester) async { late FakePlatformViewController disposedController; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', @@ -3745,7 +3744,7 @@ void main() { expect(disposedController.disposed, true); }); - testWidgetsWithLeakTracking('PlatformViewLink handles onPlatformViewCreated when disposed', (WidgetTester tester) async { + testWidgets('PlatformViewLink handles onPlatformViewCreated when disposed', (WidgetTester tester) async { late PlatformViewCreationParams creationParams; late FakePlatformViewController controller; final PlatformViewLink platformViewLink = PlatformViewLink( @@ -3771,7 +3770,7 @@ void main() { expect(() => creationParams.onPlatformViewCreated(creationParams.id), returnsNormally); }); - testWidgetsWithLeakTracking('PlatformViewLink widget survives widget tree change', (WidgetTester tester) async { + testWidgets('PlatformViewLink widget survives widget tree change', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final List<int> ids = <int>[]; @@ -3826,7 +3825,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PlatformViewLink re-initializes when view type changes', (WidgetTester tester) async { + testWidgets('PlatformViewLink re-initializes when view type changes', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final List<int> ids = <int>[]; final List<int> surfaceViewIds = <int>[]; @@ -3898,7 +3897,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PlatformViewLink can take any widget to return in the SurfaceFactory', (WidgetTester tester) async { + testWidgets('PlatformViewLink can take any widget to return in the SurfaceFactory', (WidgetTester tester) async { final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { @@ -3915,7 +3914,7 @@ void main() { expect(() => tester.allWidgets.whereType<Container>().first, returnsNormally); }); - testWidgetsWithLeakTracking('PlatformViewLink manages the focus properly', (WidgetTester tester) async { + testWidgets('PlatformViewLink manages the focus properly', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); late FakePlatformViewController controller; late ValueChanged<bool> focusChanged; @@ -3980,7 +3979,7 @@ void main() { expect(controller.focusCleared, true); }); - testWidgetsWithLeakTracking('PlatformViewLink sets a platform view text input client when focused', (WidgetTester tester) async { + testWidgets('PlatformViewLink sets a platform view text input client when focused', (WidgetTester tester) async { late FakePlatformViewController controller; late int viewId; @@ -4030,7 +4029,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Platform views respect hitTestBehavior', (WidgetTester tester) async { + testWidgets('Platform views respect hitTestBehavior', (WidgetTester tester) async { final FakePlatformViewController controller = FakePlatformViewController(0); final List<String> logs = <String>[]; @@ -4169,7 +4168,7 @@ void main() { expect(controller.dispatchedPointerEvents[0], isA<PointerHoverEvent>()); }); - testWidgetsWithLeakTracking('HtmlElementView can be instantiated', (WidgetTester tester) async { + testWidgets('HtmlElementView can be instantiated', (WidgetTester tester) async { late final Widget htmlElementView; expect(() { htmlElementView = const HtmlElementView(viewType: 'webview'); diff --git a/packages/flutter/test/widgets/pop_scope_test.dart b/packages/flutter/test/widgets/pop_scope_test.dart index 23f7569ee98..116951ce787 100644 --- a/packages/flutter/test/widgets/pop_scope_test.dart +++ b/packages/flutter/test/widgets/pop_scope_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'navigator_utils.dart'; @@ -35,7 +34,7 @@ void main() { .setMockMethodCallHandler(SystemChannels.platform, null); }); - testWidgetsWithLeakTracking('toggling canPop on root route allows/prevents backs', (WidgetTester tester) async { + testWidgets('toggling canPop on root route allows/prevents backs', (WidgetTester tester) async { bool canPop = false; late StateSetter setState; late BuildContext context; @@ -80,7 +79,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('toggling canPop on secondary route allows/prevents backs', (WidgetTester tester) async { + testWidgets('toggling canPop on secondary route allows/prevents backs', (WidgetTester tester) async { final GlobalKey<NavigatorState> nav = GlobalKey<NavigatorState>(); bool canPop = true; late StateSetter setState; @@ -248,7 +247,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('removing PopScope from the tree removes its effect on navigation', (WidgetTester tester) async { + testWidgets('removing PopScope from the tree removes its effect on navigation', (WidgetTester tester) async { bool usePopScope = true; late StateSetter setState; late BuildContext context; @@ -300,7 +299,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking('identical PopScopes', (WidgetTester tester) async { + testWidgets('identical PopScopes', (WidgetTester tester) async { bool usePopScope1 = true; bool usePopScope2 = true; late StateSetter setState; diff --git a/packages/flutter/test/widgets/positioned_test.dart b/packages/flutter/test/widgets/positioned_test.dart index 33a8331bda3..834bd845f0a 100644 --- a/packages/flutter/test/widgets/positioned_test.dart +++ b/packages/flutter/test/widgets/positioned_test.dart @@ -7,10 +7,9 @@ import 'dart:async'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Positioned constructors', (WidgetTester tester) async { + testWidgets('Positioned constructors', (WidgetTester tester) async { final Widget child = Container(); final Positioned a = Positioned( left: 101.0, @@ -57,7 +56,7 @@ void main() { expect(c.height, null); }); - testWidgetsWithLeakTracking('Can animate position data', (WidgetTester tester) async { + testWidgets('Can animate position data', (WidgetTester tester) async { final RelativeRectTween rect = RelativeRectTween( begin: RelativeRect.fromRect( const Rect.fromLTRB(10.0, 20.0, 20.0, 30.0), diff --git a/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart b/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart index 4b3eea78f76..cc55aecf472 100644 --- a/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart +++ b/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class ExpandingBox extends StatefulWidget { const ExpandingBox({ super.key, required this.collapsedSize, required this.expandedSize }); @@ -54,7 +53,7 @@ class _ExpandingBoxState extends State<ExpandingBox> with AutomaticKeepAliveClie } void main() { - testWidgetsWithLeakTracking('shrink listview', (WidgetTester tester) async { + testWidgets('shrink listview', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: ListView.builder( itemBuilder: (BuildContext context, int index) => index == 0 @@ -99,7 +98,7 @@ void main() { expect(position.pixels, 100.0); }); - testWidgetsWithLeakTracking('shrink listview while dragging', (WidgetTester tester) async { + testWidgets('shrink listview while dragging', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: ListView.builder( itemBuilder: (BuildContext context, int index) => index == 0 @@ -158,7 +157,7 @@ void main() { expect(position.pixels, 50.0); }); - testWidgetsWithLeakTracking('shrink listview while ballistic', (WidgetTester tester) async { + testWidgets('shrink listview while ballistic', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: GestureDetector( onTap: () { assert(false); }, @@ -221,7 +220,7 @@ void main() { expect(position.pixels, 0.0); }); - testWidgetsWithLeakTracking('expanding page views', (WidgetTester tester) async { + testWidgets('expanding page views', (WidgetTester tester) async { await tester.pumpWidget(const Padding(padding: EdgeInsets.only(right: 200.0), child: TabBarDemo())); await tester.tap(find.text('bike')); await tester.pump(); @@ -232,7 +231,7 @@ void main() { expect(bike2.center, bike1.shift(const Offset(100.0, 0.0)).center); }); - testWidgetsWithLeakTracking('changing the size of the viewport when overscrolled', (WidgetTester tester) async { + testWidgets('changing the size of the viewport when overscrolled', (WidgetTester tester) async { Widget build(double height) { return Directionality( textDirection: TextDirection.rtl, @@ -266,7 +265,7 @@ void main() { expect(oldPosition, newPosition); }); - testWidgetsWithLeakTracking('inserting and removing an item when overscrolled', (WidgetTester tester) async { + testWidgets('inserting and removing an item when overscrolled', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/62890 const double itemExtent = 100.0; diff --git a/packages/flutter/test/widgets/raw_keyboard_listener_test.dart b/packages/flutter/test/widgets/raw_keyboard_listener_test.dart index 4bb44325bd9..9b7872f2b31 100644 --- a/packages/flutter/test/widgets/raw_keyboard_listener_test.dart +++ b/packages/flutter/test/widgets/raw_keyboard_listener_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Can dispose without keyboard', (WidgetTester tester) async { + testWidgets('Can dispose without keyboard', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); await tester.pumpWidget(RawKeyboardListener(focusNode: focusNode, child: Container())); @@ -16,7 +15,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('Fuchsia key event', (WidgetTester tester) async { + testWidgets('Fuchsia key event', (WidgetTester tester) async { final List<RawKeyEvent> events = <RawKeyEvent>[]; final FocusNode focusNode = FocusNode(); @@ -48,7 +47,7 @@ void main() { await tester.pumpWidget(Container()); }, skip: isBrowser); // [intended] This is a Fuchsia-specific test. - testWidgetsWithLeakTracking('Web key event', (WidgetTester tester) async { + testWidgets('Web key event', (WidgetTester tester) async { final List<RawKeyEvent> events = <RawKeyEvent>[]; final FocusNode focusNode = FocusNode(); @@ -79,7 +78,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('Defunct listeners do not receive events', (WidgetTester tester) async { + testWidgets('Defunct listeners do not receive events', (WidgetTester tester) async { final List<RawKeyEvent> events = <RawKeyEvent>[]; final FocusNode focusNode = FocusNode(); diff --git a/packages/flutter/test/widgets/reassemble_test.dart b/packages/flutter/test/widgets/reassemble_test.dart index 2145a34cbe6..32eff200232 100644 --- a/packages/flutter/test/widgets/reassemble_test.dart +++ b/packages/flutter/test/widgets/reassemble_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('reassemble does not crash', (WidgetTester tester) async { + testWidgets('reassemble does not crash', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: Text('Hello World'), )); diff --git a/packages/flutter/test/widgets/render_object_element_test.dart b/packages/flutter/test/widgets/render_object_element_test.dart index 95189e03bba..a485d3fed69 100644 --- a/packages/flutter/test/widgets/render_object_element_test.dart +++ b/packages/flutter/test/widgets/render_object_element_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; @immutable class Pair<T> { @@ -240,7 +239,7 @@ class RenderSwapper extends RenderBox { BoxParentData parentDataFor(RenderObject renderObject) => renderObject.parentData! as BoxParentData; void main() { - testWidgetsWithLeakTracking('RenderObjectElement *RenderObjectChild methods get called with correct arguments', (WidgetTester tester) async { + testWidgets('RenderObjectElement *RenderObjectChild methods get called with correct arguments', (WidgetTester tester) async { const Key redKey = ValueKey<String>('red'); const Key blueKey = ValueKey<String>('blue'); Widget widget() { diff --git a/packages/flutter/test/widgets/render_object_widget_test.dart b/packages/flutter/test/widgets/render_object_widget_test.dart index 7aac4ea1876..e6ba52fd823 100644 --- a/packages/flutter/test/widgets/render_object_widget_test.dart +++ b/packages/flutter/test/widgets/render_object_widget_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; final BoxDecoration kBoxDecorationA = BoxDecoration(border: nonconst(null)); final BoxDecoration kBoxDecorationB = BoxDecoration(border: nonconst(null)); @@ -76,7 +75,7 @@ class TestNonVisitingRenderObject extends RenderBox with RenderObjectWithChildMi } void main() { - testWidgetsWithLeakTracking('RenderObjectWidget smoke test', (WidgetTester tester) async { + testWidgets('RenderObjectWidget smoke test', (WidgetTester tester) async { await tester.pumpWidget(DecoratedBox(decoration: kBoxDecorationA)); SingleChildRenderObjectElement element = tester.element(find.byElementType(SingleChildRenderObjectElement)); @@ -95,7 +94,7 @@ void main() { expect(renderObject.position, equals(DecorationPosition.background)); }); - testWidgetsWithLeakTracking('RenderObjectWidget can add and remove children', (WidgetTester tester) async { + testWidgets('RenderObjectWidget can add and remove children', (WidgetTester tester) async { void checkFullTree() { final SingleChildRenderObjectElement element = @@ -179,7 +178,7 @@ void main() { childBareTree(); }); - testWidgetsWithLeakTracking('Detached render tree is intact', (WidgetTester tester) async { + testWidgets('Detached render tree is intact', (WidgetTester tester) async { await tester.pumpWidget(DecoratedBox( decoration: kBoxDecorationA, @@ -221,7 +220,7 @@ void main() { expect(grandChild.child, isNull); }); - testWidgetsWithLeakTracking('Can watch inherited widgets', (WidgetTester tester) async { + testWidgets('Can watch inherited widgets', (WidgetTester tester) async { final Key boxKey = UniqueKey(); final TestOrientedBox box = TestOrientedBox(key: boxKey); @@ -243,7 +242,7 @@ void main() { expect(decoration.color, equals(const Color(0xFF0000FF))); }); - testWidgetsWithLeakTracking('RenderObject not visiting children provides helpful error message', (WidgetTester tester) async { + testWidgets('RenderObject not visiting children provides helpful error message', (WidgetTester tester) async { await tester.pumpWidget( TestNonVisitingWidget( child: Container(color: const Color(0xFFED1D7F)), diff --git a/packages/flutter/test/widgets/reorderable_list_test.dart b/packages/flutter/test/widgets/reorderable_list_test.dart index 532c2208009..dda97386248 100644 --- a/packages/flutter/test/widgets/reorderable_list_test.dart +++ b/packages/flutter/test/widgets/reorderable_list_test.dart @@ -7,12 +7,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('SliverReorderableList works well when having gestureSettings', (WidgetTester tester) async { + testWidgets('SliverReorderableList works well when having gestureSettings', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103404 const int itemCount = 5; int onReorderCallCount = 0; @@ -69,7 +68,7 @@ void main() { expect(items, orderedEquals(<int>[1, 0, 2, 3, 4])); }); - testWidgetsWithLeakTracking('SliverReorderableList item has correct semantics', (WidgetTester tester) async { + testWidgets('SliverReorderableList item has correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const int itemCount = 5; int onReorderCallCount = 0; @@ -129,7 +128,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SliverReorderableList custom semantics action has correct label', (WidgetTester tester) async { + testWidgets('SliverReorderableList custom semantics action has correct label', (WidgetTester tester) async { const int itemCount = 5; final List<int> items = List<int>.generate(itemCount, (int index) => index); // The list has five elements of height 100 @@ -168,7 +167,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgetsWithLeakTracking('SliverReorderableList.builder respects findChildIndexCallback', (WidgetTester tester) async { + testWidgets('SliverReorderableList.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -208,7 +207,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/88191 - testWidgetsWithLeakTracking('Do not crash when dragging with two fingers simultaneously', (WidgetTester tester) async { + testWidgets('Do not crash when dragging with two fingers simultaneously', (WidgetTester tester) async { final List<int> items = List<int>.generate(3, (int index) => index); void handleReorder(int fromIndex, int toIndex) { if (toIndex > fromIndex) { @@ -254,7 +253,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('negative itemCount should assert', (WidgetTester tester) async { + testWidgets('negative itemCount should assert', (WidgetTester tester) async { final List<int> items = <int>[1, 2, 3]; await tester.pumpWidget(MaterialApp( home: StatefulBuilder( @@ -286,7 +285,7 @@ void main() { expect(tester.takeException(), isA<AssertionError>()); }); - testWidgetsWithLeakTracking('zero itemCount should not build widget', (WidgetTester tester) async { + testWidgets('zero itemCount should not build widget', (WidgetTester tester) async { final List<int> items = <int>[1, 2, 3]; await tester.pumpWidget(MaterialApp( home: StatefulBuilder( @@ -333,7 +332,7 @@ void main() { expect(find.text('after'), findsOneWidget); }); - testWidgetsWithLeakTracking('SliverReorderableList, drag and drop, fixed height items', (WidgetTester tester) async { + testWidgets('SliverReorderableList, drag and drop, fixed height items', (WidgetTester tester) async { final List<int> items = List<int>.generate(8, (int index) => index); Future<void> pressDragRelease(Offset start, Offset delta) async { @@ -399,7 +398,7 @@ void main() { expect(items, orderedEquals(<int>[0, 1, 2, 3, 4, 5, 6, 7])); }); - testWidgetsWithLeakTracking('SliverReorderableList, items inherit DefaultTextStyle, IconTheme', (WidgetTester tester) async { + testWidgets('SliverReorderableList, items inherit DefaultTextStyle, IconTheme', (WidgetTester tester) async { const Color textColor = Color(0xffffffff); const Color iconColor = Color(0xff0000ff); @@ -452,7 +451,7 @@ void main() { expect(getTextStyle().color, textColor); }); - testWidgetsWithLeakTracking('SliverReorderableList - custom proxyDecorator', (WidgetTester tester) async { + testWidgets('SliverReorderableList - custom proxyDecorator', (WidgetTester tester) async { const ValueKey<String> fadeTransitionKey = ValueKey<String>('reordered-fade'); await tester.pumpWidget( @@ -515,7 +514,7 @@ void main() { expect(getItemFadeTransition(), findsNothing); }); - testWidgetsWithLeakTracking('ReorderableList supports items with nested list views without throwing layout exception.', (WidgetTester tester) async { + testWidgets('ReorderableList supports items with nested list views without throwing layout exception.', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -569,7 +568,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('ReorderableList supports items with nested list views without throwing layout exception.', (WidgetTester tester) async { + testWidgets('ReorderableList supports items with nested list views without throwing layout exception.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/83224. await tester.pumpWidget( MaterialApp( @@ -624,7 +623,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('SliverReorderableList - properly animates the drop in a reversed list', (WidgetTester tester) async { + testWidgets('SliverReorderableList - properly animates the drop in a reversed list', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110949 final List<int> items = List<int>.generate(8, (int index) => index); @@ -675,7 +674,7 @@ void main() { expect(tester.getTopLeft(find.text('item 0')), const Offset(0, 400)); }); - testWidgetsWithLeakTracking('SliverReorderableList - properly animates the drop at starting position in a reversed list', (WidgetTester tester) async { + testWidgets('SliverReorderableList - properly animates the drop at starting position in a reversed list', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84625 final List<int> items = List<int>.generate(8, (int index) => index); @@ -718,7 +717,7 @@ void main() { expect(tester.getTopLeft(find.text('item 0')), const Offset(0, 500)); }); - testWidgetsWithLeakTracking('SliverReorderableList calls onReorderStart and onReorderEnd correctly', (WidgetTester tester) async { + testWidgets('SliverReorderableList calls onReorderStart and onReorderEnd correctly', (WidgetTester tester) async { final List<int> items = List<int>.generate(8, (int index) => index); int? startIndex, endIndex; final Finder item0 = find.textContaining('item 0'); @@ -769,7 +768,7 @@ void main() { expect(endIndex, equals(0)); }); - testWidgetsWithLeakTracking('ReorderableList calls onReorderStart and onReorderEnd correctly', (WidgetTester tester) async { + testWidgets('ReorderableList calls onReorderStart and onReorderEnd correctly', (WidgetTester tester) async { final List<int> items = List<int>.generate(8, (int index) => index); int? startIndex, endIndex; final Finder item0 = find.textContaining('item 0'); @@ -842,7 +841,7 @@ void main() { - testWidgetsWithLeakTracking('ReorderableList asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('ReorderableList asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; expect(() => ReorderableList( itemBuilder: (BuildContext context, int index) { @@ -862,7 +861,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('SliverReorderableList asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('SliverReorderableList asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; expect(() => SliverReorderableList( itemBuilder: (BuildContext context, int index) { @@ -882,7 +881,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('if itemExtent is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { + testWidgets('if itemExtent is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; await tester.pumpWidget( @@ -927,7 +926,7 @@ void main() { expect(item2Height, 30.0); }); - testWidgetsWithLeakTracking('if prototypeItem is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { + testWidgets('if prototypeItem is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; await tester.pumpWidget( @@ -970,7 +969,7 @@ void main() { }); group('ReorderableDragStartListener', () { - testWidgetsWithLeakTracking('It should allow the item to be dragged when enabled is true', (WidgetTester tester) async { + testWidgets('It should allow the item to be dragged when enabled is true', (WidgetTester tester) async { const int itemCount = 5; int onReorderCallCount = 0; final List<int> items = List<int>.generate(itemCount, (int index) => index); @@ -1016,7 +1015,7 @@ void main() { expect(items, orderedEquals(<int>[1, 0, 2, 3, 4])); }); - testWidgetsWithLeakTracking('It should not allow the item to be dragged when enabled is false', (WidgetTester tester) async { + testWidgets('It should not allow the item to be dragged when enabled is false', (WidgetTester tester) async { const int itemCount = 5; int onReorderCallCount = 0; final List<int> items = List<int>.generate(itemCount, (int index) => index); @@ -1065,7 +1064,7 @@ void main() { }); group('ReorderableDelayedDragStartListener', () { - testWidgetsWithLeakTracking('It should allow the item to be dragged when enabled is true', (WidgetTester tester) async { + testWidgets('It should allow the item to be dragged when enabled is true', (WidgetTester tester) async { const int itemCount = 5; int onReorderCallCount = 0; final List<int> items = List<int>.generate(itemCount, (int index) => index); @@ -1112,7 +1111,7 @@ void main() { expect(items, orderedEquals(<int>[1, 0, 2, 3, 4])); }); - testWidgetsWithLeakTracking('It should not allow the item to be dragged when enabled is false', (WidgetTester tester) async { + testWidgets('It should not allow the item to be dragged when enabled is false', (WidgetTester tester) async { const int itemCount = 5; int onReorderCallCount = 0; final List<int> items = List<int>.generate(itemCount, (int index) => index); @@ -1160,7 +1159,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('SliverReorderableList properly disposes items', (WidgetTester tester) async { + testWidgets('SliverReorderableList properly disposes items', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/105010 const int itemCount = 5; final List<int> items = List<int>.generate(itemCount, (int index) => index); @@ -1227,7 +1226,7 @@ void main() { expect(item0, findsNothing); }); - testWidgetsWithLeakTracking('SliverReorderableList auto scrolls speed is configurable', (WidgetTester tester) async { + testWidgets('SliverReorderableList auto scrolls speed is configurable', (WidgetTester tester) async { Future<void> pumpFor({ required Duration duration, Duration interval = const Duration(milliseconds: 50), @@ -1313,7 +1312,7 @@ void main() { expect(offsetForFastScroller / offsetForSlowScroller, fastVelocityScalar / slowVelocityScalar); }); - testWidgetsWithLeakTracking('Null check error when dragging and dropping last element into last index with reverse:true', (WidgetTester tester) async { + testWidgets('Null check error when dragging and dropping last element into last index with reverse:true', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/132077 const int itemCount = 5; final List<String> items = List<String>.generate(itemCount, (int index) => 'Item ${index+1}'); @@ -1358,7 +1357,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking( + testWidgets( 'When creating a new item, be in the correct position', (WidgetTester tester) async { await tester.pumpWidget( @@ -1407,7 +1406,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Tests the correctness of the drop animation in various scenarios', (WidgetTester tester) async { + testWidgets('Tests the correctness of the drop animation in various scenarios', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/138994 late Size screenSize; final List<double> itemSizes = <double>[20, 50, 30, 80, 100, 30]; diff --git a/packages/flutter/test/widgets/reparent_state_harder_test.dart b/packages/flutter/test/widgets/reparent_state_harder_test.dart index 3deb76318e0..d7029bb8881 100644 --- a/packages/flutter/test/widgets/reparent_state_harder_test.dart +++ b/packages/flutter/test/widgets/reparent_state_harder_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // This is a regression test for https://github.com/flutter/flutter/issues/5588. @@ -93,7 +92,7 @@ class RekeyableDummyStatefulWidgetWrapperState extends State<RekeyableDummyState } void main() { - testWidgetsWithLeakTracking('Handle GlobalKey reparenting in weird orders', (WidgetTester tester) async { + testWidgets('Handle GlobalKey reparenting in weird orders', (WidgetTester tester) async { // This is a bit of a weird test so let's try to explain it a bit. // diff --git a/packages/flutter/test/widgets/reparent_state_test.dart b/packages/flutter/test/widgets/reparent_state_test.dart index ce7ab6bb7f7..a14505a877b 100644 --- a/packages/flutter/test/widgets/reparent_state_test.dart +++ b/packages/flutter/test/widgets/reparent_state_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class StateMarker extends StatefulWidget { const StateMarker({ super.key, this.child }); @@ -51,7 +50,7 @@ class DeactivateLoggerState extends State<DeactivateLogger> { } void main() { - testWidgetsWithLeakTracking('can reparent state', (WidgetTester tester) async { + testWidgets('can reparent state', (WidgetTester tester) async { final GlobalKey left = GlobalKey(); final GlobalKey right = GlobalKey(); @@ -131,7 +130,7 @@ void main() { expect(right.currentState, isNull); }); - testWidgetsWithLeakTracking('can reparent state with multichild widgets', (WidgetTester tester) async { + testWidgets('can reparent state with multichild widgets', (WidgetTester tester) async { final GlobalKey left = GlobalKey(); final GlobalKey right = GlobalKey(); @@ -199,7 +198,7 @@ void main() { expect(right.currentState, isNull); }); - testWidgetsWithLeakTracking('can with scrollable list', (WidgetTester tester) async { + testWidgets('can with scrollable list', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(StateMarker(key: key)); @@ -232,7 +231,7 @@ void main() { expect(keyState.marker, equals('marked')); }); - testWidgetsWithLeakTracking('Reparent during update children', (WidgetTester tester) async { + testWidgets('Reparent during update children', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(Stack( @@ -269,7 +268,7 @@ void main() { expect(keyState.marker, equals('marked')); }); - testWidgetsWithLeakTracking('Reparent to child during update children', (WidgetTester tester) async { + testWidgets('Reparent to child during update children', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(Stack( @@ -331,7 +330,7 @@ void main() { expect(keyState.marker, equals('marked')); }); - testWidgetsWithLeakTracking('Deactivate implies build', (WidgetTester tester) async { + testWidgets('Deactivate implies build', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<String> log = <String>[]; final DeactivateLogger logger = DeactivateLogger(key: key, log: log); @@ -353,7 +352,7 @@ void main() { expect(log, isEmpty); }); - testWidgetsWithLeakTracking('Reparenting with multiple moves', (WidgetTester tester) async { + testWidgets('Reparenting with multiple moves', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); final GlobalKey key3 = GlobalKey(); diff --git a/packages/flutter/test/widgets/reparent_state_with_layout_builder_test.dart b/packages/flutter/test/widgets/reparent_state_with_layout_builder_test.dart index 567f344e823..9578888c30f 100644 --- a/packages/flutter/test/widgets/reparent_state_with_layout_builder_test.dart +++ b/packages/flutter/test/widgets/reparent_state_with_layout_builder_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; // This is a regression test for https://github.com/flutter/flutter/issues/5840. @@ -66,7 +65,7 @@ class StatefulCreationCounterState extends State<StatefulCreationCounter> { } void main() { - testWidgetsWithLeakTracking('reparent state with layout builder', (WidgetTester tester) async { + testWidgets('reparent state with layout builder', (WidgetTester tester) async { expect(StatefulCreationCounterState.creationCount, 0); await tester.pumpWidget(const Bar()); expect(StatefulCreationCounterState.creationCount, 1); @@ -76,7 +75,7 @@ void main() { expect(StatefulCreationCounterState.creationCount, 1); }); - testWidgetsWithLeakTracking('Clean then reparent with dependencies', (WidgetTester tester) async { + testWidgets('Clean then reparent with dependencies', (WidgetTester tester) async { int layoutBuilderBuildCount = 0; late StateSetter keyedSetState; diff --git a/packages/flutter/test/widgets/restorable_property_test.dart b/packages/flutter/test/widgets/restorable_property_test.dart index 835380a7ba0..ebf2560173a 100644 --- a/packages/flutter/test/widgets/restorable_property_test.dart +++ b/packages/flutter/test/widgets/restorable_property_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('value is not accessible when not registered', (WidgetTester tester) async { + testWidgets('value is not accessible when not registered', (WidgetTester tester) async { final RestorableNum<num> numValue = RestorableNum<num>(0); addTearDown(numValue.dispose); expect(() => numValue.value, throwsAssertionError); @@ -58,14 +58,14 @@ void main() { expect(() => objectValue.value, throwsAssertionError); }); - testWidgetsWithLeakTracking('$RestorableProperty dispatches creation in constructor', (WidgetTester widgetTester) async { + testWidgets('$RestorableProperty dispatches creation in constructor', (WidgetTester widgetTester) async { await expectLater( await memoryEvents(() => RestorableDateTimeN(null).dispose(), RestorableDateTimeN), areCreateAndDispose, ); }); - testWidgetsWithLeakTracking('work when not in restoration scope', (WidgetTester tester) async { + testWidgets('work when not in restoration scope', (WidgetTester tester) async { await tester.pumpWidget(const _RestorableWidget()); expect(find.text('hello world'), findsOneWidget); @@ -129,7 +129,7 @@ void main() { expect(find.text('guten tag'), findsOneWidget); }); - testWidgetsWithLeakTracking('restart and restore', (WidgetTester tester) async { + testWidgets('restart and restore', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), @@ -220,7 +220,7 @@ void main() { expect(find.text('guten tag'), findsOneWidget); }); - testWidgetsWithLeakTracking('restore to older state', (WidgetTester tester) async { + testWidgets('restore to older state', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), @@ -318,7 +318,7 @@ void main() { expect(find.text('hello world'), findsOneWidget); }); - testWidgetsWithLeakTracking('call notifiers when value changes', (WidgetTester tester) async { + testWidgets('call notifiers when value changes', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), @@ -500,7 +500,7 @@ void main() { expect(notifyLog, isEmpty); }); - testWidgetsWithLeakTracking('RestorableValue calls didUpdateValue', (WidgetTester tester) async { + testWidgets('RestorableValue calls didUpdateValue', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), @@ -524,7 +524,7 @@ void main() { expect(state.objectValue.didUpdateValueCallCount, 1); }); - testWidgetsWithLeakTracking('RestorableEnum and RestorableEnumN assert if default value is not in enum', (WidgetTester tester) async { + testWidgets('RestorableEnum and RestorableEnumN assert if default value is not in enum', (WidgetTester tester) async { expect(() => RestorableEnum<TestEnum>( TestEnum.four, values: TestEnum.values.toSet().difference(<TestEnum>{TestEnum.four})), throwsAssertionError); @@ -533,7 +533,7 @@ void main() { values: TestEnum.values.toSet().difference(<TestEnum>{TestEnum.four})), throwsAssertionError); }); - testWidgetsWithLeakTracking('RestorableEnum and RestorableEnumN assert if unknown values are set', (WidgetTester tester) async { + testWidgets('RestorableEnum and RestorableEnumN assert if unknown values are set', (WidgetTester tester) async { final RestorableEnum<TestEnum> enumMissingValue = RestorableEnum<TestEnum>( TestEnum.one, values: TestEnum.values.toSet().difference(<TestEnum>{TestEnum.four}), @@ -548,7 +548,7 @@ void main() { expect(() => nullableEnumMissingValue.value = TestEnum.four, throwsAssertionError); }); - testWidgetsWithLeakTracking('RestorableEnum and RestorableEnumN assert if unknown values are restored', (WidgetTester tester) async { + testWidgets('RestorableEnum and RestorableEnumN assert if unknown values are restored', (WidgetTester tester) async { final RestorableEnum<TestEnum> enumMissingValue = RestorableEnum<TestEnum>( TestEnum.one, values: TestEnum.values.toSet().difference(<TestEnum>{TestEnum.four}), @@ -563,7 +563,7 @@ void main() { expect(() => nullableEnumMissingValue.fromPrimitives('four'), throwsAssertionError); }); - testWidgetsWithLeakTracking('RestorableN types are properly defined', (WidgetTester tester) async { + testWidgets('RestorableN types are properly defined', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', child: _RestorableWidget(), diff --git a/packages/flutter/test/widgets/restoration_mixin_test.dart b/packages/flutter/test/widgets/restoration_mixin_test.dart index 45ddb451b07..e11a60ed4dd 100644 --- a/packages/flutter/test/widgets/restoration_mixin_test.dart +++ b/packages/flutter/test/widgets/restoration_mixin_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'restoration.dart'; void main() { - testWidgetsWithLeakTracking('claims bucket', (WidgetTester tester) async { + testWidgets('claims bucket', (WidgetTester tester) async { const String id = 'hello world 1234'; final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); @@ -38,7 +37,7 @@ void main() { expect(state.restoreStateLog.single, isNull); }); - testWidgetsWithLeakTracking('claimed bucket with data', (WidgetTester tester) async { + testWidgets('claimed bucket with data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); @@ -62,7 +61,7 @@ void main() { expect(state.restoreStateLog.single, isNull); }); - testWidgetsWithLeakTracking('renames existing bucket when new ID is provided via widget', (WidgetTester tester) async { + testWidgets('renames existing bucket when new ID is provided via widget', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); @@ -106,7 +105,7 @@ void main() { expect(state.toggleBucketLog, isEmpty); }); - testWidgetsWithLeakTracking('renames existing bucket when didUpdateRestorationId is called', (WidgetTester tester) async { + testWidgets('renames existing bucket when didUpdateRestorationId is called', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); @@ -143,7 +142,7 @@ void main() { expect(state.toggleBucketLog, isEmpty); }); - testWidgetsWithLeakTracking('Disposing widget removes its data', (WidgetTester tester) async { + testWidgets('Disposing widget removes its data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = _createRawDataSet(); @@ -173,7 +172,7 @@ void main() { expect((rawData[childrenMapKey] as Map<String, dynamic>).containsKey('child1'), isFalse); }); - testWidgetsWithLeakTracking('toggling id between null and non-null', (WidgetTester tester) async { + testWidgets('toggling id between null and non-null', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = _createRawDataSet(); @@ -235,7 +234,7 @@ void main() { expect(state.toggleBucketLog.single, same(bucket)); }); - testWidgetsWithLeakTracking('move in and out of scope', (WidgetTester tester) async { + testWidgets('move in and out of scope', (WidgetTester tester) async { final Key key = GlobalKey(); final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); @@ -299,7 +298,7 @@ void main() { expect(state.toggleBucketLog.single, same(bucket)); }); - testWidgetsWithLeakTracking('moving scope moves its data', (WidgetTester tester) async { + testWidgets('moving scope moves its data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = <String, dynamic>{}; @@ -366,7 +365,7 @@ void main() { expect((rawData[childrenMapKey] as Map<Object?, Object?>).containsKey('moving-child'), isTrue); }); - testWidgetsWithLeakTracking('restartAndRestore', (WidgetTester tester) async { + testWidgets('restartAndRestore', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -405,7 +404,7 @@ void main() { expect(state.toggleBucketLog, isEmpty); }); - testWidgetsWithLeakTracking('restore while running', (WidgetTester tester) async { + testWidgets('restore while running', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -444,7 +443,7 @@ void main() { expect(state.toggleBucketLog, isEmpty); }); - testWidgetsWithLeakTracking('can register additional property outside of restoreState', (WidgetTester tester) async { + testWidgets('can register additional property outside of restoreState', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -481,7 +480,7 @@ void main() { expect(state.property.log, <String>['fromPrimitives', 'initWithValue']); }); - testWidgetsWithLeakTracking('cannot register same property twice', (WidgetTester tester) async { + testWidgets('cannot register same property twice', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -511,7 +510,7 @@ void main() { expect(() => state.registerPropertyUnderSameId(), throwsAssertionError); }); - testWidgetsWithLeakTracking('data of disabled property is not stored', (WidgetTester tester) async { + testWidgets('data of disabled property is not stored', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -551,7 +550,7 @@ void main() { expect(state.property.value, 10); // Initialized to default value. }); - testWidgetsWithLeakTracking('Enabling property stores its data again', (WidgetTester tester) async { + testWidgets('Enabling property stores its data again', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -589,7 +588,7 @@ void main() { expect(state.property.value, 40); }); - testWidgetsWithLeakTracking('Unregistering a property removes its data', (WidgetTester tester) async { + testWidgets('Unregistering a property removes its data', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', @@ -615,7 +614,7 @@ void main() { expect(state.bucket!.read<int>('additional'), 11); }); - testWidgetsWithLeakTracking('Disposing a property unregisters it, but keeps data', (WidgetTester tester) async { + testWidgets('Disposing a property unregisters it, but keeps data', (WidgetTester tester) async { await tester.pumpWidget( const RootRestorationScope( restorationId: 'root-child', diff --git a/packages/flutter/test/widgets/restoration_scope_test.dart b/packages/flutter/test/widgets/restoration_scope_test.dart index 892b2f7a508..ae12827adb6 100644 --- a/packages/flutter/test/widgets/restoration_scope_test.dart +++ b/packages/flutter/test/widgets/restoration_scope_test.dart @@ -4,13 +4,12 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'restoration.dart'; void main() { group('UnmanagedRestorationScope', () { - testWidgetsWithLeakTracking('makes bucket available to descendants', (WidgetTester tester) async { + testWidgets('makes bucket available to descendants', (WidgetTester tester) async { final RestorationBucket bucket1 = RestorationBucket.empty( restorationId: 'foo', debugOwner: 'owner', @@ -43,7 +42,7 @@ void main() { expect(state.bucket, bucket2); }); - testWidgetsWithLeakTracking('null bucket disables restoration', (WidgetTester tester) async { + testWidgets('null bucket disables restoration', (WidgetTester tester) async { await tester.pumpWidget( const UnmanagedRestorationScope( child: BucketSpy(), @@ -55,7 +54,7 @@ void main() { }); group('RestorationScope', () { - testWidgetsWithLeakTracking('asserts when none is found', (WidgetTester tester) async { + testWidgets('asserts when none is found', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget(WidgetsApp( color: const Color(0xD0FF0000), @@ -101,7 +100,7 @@ void main() { expect(RestorationScope.of(capturedContext), scope.bucket); }); - testWidgetsWithLeakTracking('makes bucket available to descendants', (WidgetTester tester) async { + testWidgets('makes bucket available to descendants', (WidgetTester tester) async { const String id = 'hello world 1234'; final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); @@ -126,7 +125,7 @@ void main() { expect((rawData[childrenMapKey] as Map<Object?, Object?>).containsKey(id), isTrue); }); - testWidgetsWithLeakTracking('bucket for descendants contains data claimed from parent', (WidgetTester tester) async { + testWidgets('bucket for descendants contains data claimed from parent', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); @@ -148,7 +147,7 @@ void main() { expect(state.bucket!.read<int>('foo'), 22); }); - testWidgetsWithLeakTracking('renames existing bucket when new ID is provided', (WidgetTester tester) async { + testWidgets('renames existing bucket when new ID is provided', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); @@ -188,7 +187,7 @@ void main() { expect(state.bucket, same(bucket)); }); - testWidgetsWithLeakTracking('Disposing a scope removes its data', (WidgetTester tester) async { + testWidgets('Disposing a scope removes its data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = _createRawDataSet(); @@ -219,7 +218,7 @@ void main() { expect((rawData[childrenMapKey] as Map<String, dynamic>).containsKey('child1'), isFalse); }); - testWidgetsWithLeakTracking('no bucket for descendants when id is null', (WidgetTester tester) async { + testWidgets('no bucket for descendants when id is null', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: <String, dynamic>{}); @@ -265,7 +264,7 @@ void main() { expect(state.bucket, isNull); }); - testWidgetsWithLeakTracking('no bucket for descendants when scope is null', (WidgetTester tester) async { + testWidgets('no bucket for descendants when scope is null', (WidgetTester tester) async { final Key scopeKey = GlobalKey(); await tester.pumpWidget( @@ -310,7 +309,7 @@ void main() { expect(state.bucket, isNull); }); - testWidgetsWithLeakTracking('no bucket for descendants when scope and id are null', (WidgetTester tester) async { + testWidgets('no bucket for descendants when scope and id are null', (WidgetTester tester) async { await tester.pumpWidget( const RestorationScope( restorationId: null, @@ -321,7 +320,7 @@ void main() { expect(state.bucket, isNull); }); - testWidgetsWithLeakTracking('moving scope moves its data', (WidgetTester tester) async { + testWidgets('moving scope moves its data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = <String, dynamic>{}; diff --git a/packages/flutter/test/widgets/restoration_scopes_moving_test.dart b/packages/flutter/test/widgets/restoration_scopes_moving_test.dart index 0b91adc024a..1edea3feb8a 100644 --- a/packages/flutter/test/widgets/restoration_scopes_moving_test.dart +++ b/packages/flutter/test/widgets/restoration_scopes_moving_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('widget moves scopes during restore', (WidgetTester tester) async { + testWidgets('widget moves scopes during restore', (WidgetTester tester) async { await tester.pumpWidget(const RootRestorationScope( restorationId: 'root', child: Directionality( @@ -69,7 +68,7 @@ void main() { expect(tester.state<TestWidgetWithCounterChildState>(find.byType(TestWidgetWithCounterChild)).toggleCount, 0); }); - testWidgetsWithLeakTracking('restoration is turned on later', (WidgetTester tester) async { + testWidgets('restoration is turned on later', (WidgetTester tester) async { tester.binding.restorationManager.disableRestoration(); await tester.pumpWidget(const RootRestorationScope( restorationId: 'root-child', diff --git a/packages/flutter/test/widgets/rich_text_test.dart b/packages/flutter/test/widgets/rich_text_test.dart index e1b79af25fd..8b098deccb8 100644 --- a/packages/flutter/test/widgets/rich_text_test.dart +++ b/packages/flutter/test/widgets/rich_text_test.dart @@ -6,10 +6,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('RichText with recognizers without handlers does not throw', (WidgetTester tester) async { + testWidgets('RichText with recognizers without handlers does not throw', (WidgetTester tester) async { final TapGestureRecognizer recognizer1 = TapGestureRecognizer(); addTearDown(recognizer1.dispose); final LongPressGestureRecognizer recognizer2 = LongPressGestureRecognizer(); @@ -48,7 +47,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TextSpan Locale works', (WidgetTester tester) async { + testWidgets('TextSpan Locale works', (WidgetTester tester) async { final TapGestureRecognizer recognizer1 = TapGestureRecognizer(); addTearDown(recognizer1.dispose); final DoubleTapGestureRecognizer recognizer2 = DoubleTapGestureRecognizer(); @@ -102,7 +101,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('TextSpan spellOut works', (WidgetTester tester) async { + testWidgets('TextSpan spellOut works', (WidgetTester tester) async { final TapGestureRecognizer recognizer1 = TapGestureRecognizer(); addTearDown(recognizer1.dispose); final DoubleTapGestureRecognizer recognizer2 = DoubleTapGestureRecognizer(); @@ -156,7 +155,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('WidgetSpan calculate correct intrinsic heights', (WidgetTester tester) async { + testWidgets('WidgetSpan calculate correct intrinsic heights', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -188,7 +187,7 @@ void main() { expect(tester.getSize(find.byType(IntrinsicHeight)).height, 3 * 16); }); - testWidgetsWithLeakTracking('RichText implements debugFillProperties', (WidgetTester tester) async { + testWidgets('RichText implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); RichText( text: const TextSpan(text: 'rich text'), diff --git a/packages/flutter/test/widgets/root_restoration_scope_test.dart b/packages/flutter/test/widgets/root_restoration_scope_test.dart index 07e2e046f2a..68ce67e7d32 100644 --- a/packages/flutter/test/widgets/root_restoration_scope_test.dart +++ b/packages/flutter/test/widgets/root_restoration_scope_test.dart @@ -7,7 +7,6 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'restoration.dart'; @@ -22,7 +21,7 @@ void main() { binding._restorationManager.dispose(); }); - testWidgetsWithLeakTracking('does not inject root bucket if inside scope', (WidgetTester tester) async { + testWidgets('does not inject root bucket if inside scope', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = <String, dynamic>{}; @@ -54,7 +53,7 @@ void main() { expect(find.text('Hello'), findsOneWidget); }); - testWidgetsWithLeakTracking('waits for root bucket', (WidgetTester tester) async { + testWidgets('waits for root bucket', (WidgetTester tester) async { final Completer<RestorationBucket> bucketCompleter = Completer<RestorationBucket>(); binding.restorationManager.rootBucket = bucketCompleter.future; @@ -91,7 +90,7 @@ void main() { expect((rawData[childrenMapKey] as Map<Object?, Object?>).containsKey('root-child'), isTrue); }); - testWidgetsWithLeakTracking('no delay when root is available synchronously', (WidgetTester tester) async { + testWidgets('no delay when root is available synchronously', (WidgetTester tester) async { final Map<String, dynamic> rawData = <String, dynamic>{}; final RestorationBucket root = RestorationBucket.root(manager: binding.restorationManager, rawData: rawData); addTearDown(root.dispose); @@ -118,7 +117,7 @@ void main() { expect((rawData[childrenMapKey] as Map<Object?, Object?>).containsKey('root-child'), isTrue); }); - testWidgetsWithLeakTracking('does not insert root when restoration id is null', (WidgetTester tester) async { + testWidgets('does not insert root when restoration id is null', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -185,7 +184,7 @@ void main() { expect(state.bucket, isNull); }); - testWidgetsWithLeakTracking('injects root bucket when moved out of scope', (WidgetTester tester) async { + testWidgets('injects root bucket when moved out of scope', (WidgetTester tester) async { final Key rootScopeKey = GlobalKey(); final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); @@ -270,7 +269,7 @@ void main() { expect((inScopeRawData[childrenMapKey] as Map<Object?, Object?>).containsKey('root-child'), isTrue); }); - testWidgetsWithLeakTracking('injects new root when old one is decommissioned', (WidgetTester tester) async { + testWidgets('injects new root when old one is decommissioned', (WidgetTester tester) async { final Map<String, dynamic> firstRawData = <String, dynamic>{}; final RestorationBucket firstRoot = RestorationBucket.root(manager: binding.restorationManager, rawData: firstRawData); addTearDown(firstRoot.dispose); @@ -314,7 +313,7 @@ void main() { expect(state.bucket!.read<int>('foo'), 22); }); - testWidgetsWithLeakTracking('injects null when rootBucket is null', (WidgetTester tester) async { + testWidgets('injects null when rootBucket is null', (WidgetTester tester) async { final Completer<RestorationBucket?> completer = Completer<RestorationBucket?>(); binding.restorationManager.rootBucket = completer.future; @@ -352,7 +351,7 @@ void main() { expect(state.bucket, isNotNull); }); - testWidgetsWithLeakTracking('can switch to null', (WidgetTester tester) async { + testWidgets('can switch to null', (WidgetTester tester) async { final RestorationBucket root = RestorationBucket.root(manager: binding.restorationManager, rawData: null); addTearDown(root.dispose); binding.restorationManager.rootBucket = SynchronousFuture<RestorationBucket>(root); diff --git a/packages/flutter/test/widgets/rotated_box_test.dart b/packages/flutter/test/widgets/rotated_box_test.dart index 9e93264aaea..c47bfd09d5d 100644 --- a/packages/flutter/test/widgets/rotated_box_test.dart +++ b/packages/flutter/test/widgets/rotated_box_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Rotated box control test', (WidgetTester tester) async { + testWidgets('Rotated box control test', (WidgetTester tester) async { final List<String> log = <String>[]; final Key rotatedBoxKey = UniqueKey(); diff --git a/packages/flutter/test/widgets/route_notification_messages_test.dart b/packages/flutter/test/widgets/route_notification_messages_test.dart index 07504dd925b..2342aa9c97f 100644 --- a/packages/flutter/test/widgets/route_notification_messages_test.dart +++ b/packages/flutter/test/widgets/route_notification_messages_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class OnTapPage extends StatelessWidget { const OnTapPage({super.key, required this.id, required this.onTap}); @@ -33,7 +32,7 @@ class OnTapPage extends StatelessWidget { } void main() { - testWidgetsWithLeakTracking('Push and Pop should send platform messages', (WidgetTester tester) async { + testWidgets('Push and Pop should send platform messages', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => OnTapPage( id: '/', @@ -108,7 +107,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Navigator does not report route name by default', (WidgetTester tester) async { + testWidgets('Navigator does not report route name by default', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.navigation, (MethodCall methodCall) async { log.add(methodCall); @@ -142,7 +141,7 @@ void main() { expect(log, hasLength(0)); }); - testWidgetsWithLeakTracking('Replace should send platform messages', (WidgetTester tester) async { + testWidgets('Replace should send platform messages', (WidgetTester tester) async { final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ '/': (BuildContext context) => OnTapPage( id: '/', @@ -218,7 +217,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Nameless routes should send platform messages', (WidgetTester tester) async { + testWidgets('Nameless routes should send platform messages', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.navigation, (MethodCall methodCall) async { log.add(methodCall); @@ -262,7 +261,7 @@ void main() { expect(log, isEmpty); }); - testWidgetsWithLeakTracking('PlatformRouteInformationProvider reports URL', (WidgetTester tester) async { + testWidgets('PlatformRouteInformationProvider reports URL', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.navigation, (MethodCall methodCall) async { log.add(methodCall); diff --git a/packages/flutter/test/widgets/router_restoration_test.dart b/packages/flutter/test/widgets/router_restoration_test.dart index 921d20b1594..91f7cbff463 100644 --- a/packages/flutter/test/widgets/router_restoration_test.dart +++ b/packages/flutter/test/widgets/router_restoration_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Router state restoration without RouteInformationProvider', (WidgetTester tester) async { + testWidgets('Router state restoration without RouteInformationProvider', (WidgetTester tester) async { final UniqueKey router = UniqueKey(); _TestRouterDelegate delegate() => tester.widget<Router<Object?>>(find.byKey(router)).routerDelegate as _TestRouterDelegate; diff --git a/packages/flutter/test/widgets/router_test.dart b/packages/flutter/test/widgets/router_test.dart index d1b84fd8083..01a4afbb78a 100644 --- a/packages/flutter/test/widgets/router_test.dart +++ b/packages/flutter/test/widgets/router_test.dart @@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Simple router basic functionality - synchronized', (WidgetTester tester) async { + testWidgets('Simple router basic functionality - synchronized', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -41,7 +41,7 @@ void main() { expect(find.text('update'), findsOneWidget); }); - testWidgetsWithLeakTracking('Simple router basic functionality - asynchronized', (WidgetTester tester) async { + testWidgets('Simple router basic functionality - asynchronized', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -88,7 +88,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Interrupts route parsing should not crash', (WidgetTester tester) async { + testWidgets('Interrupts route parsing should not crash', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -140,7 +140,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Router.maybeOf can be null', (WidgetTester tester) async { + testWidgets('Router.maybeOf can be null', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(buildBoilerPlate( Text('dummy', key: key), @@ -157,7 +157,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Simple router can handle pop route', (WidgetTester tester) async { + testWidgets('Simple router can handle pop route', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -199,7 +199,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('Router throw when passing routeInformationProvider without routeInformationParser', (WidgetTester tester) async { + testWidgets('Router throw when passing routeInformationProvider without routeInformationParser', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -227,7 +227,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('PopNavigatorRouterDelegateMixin works', (WidgetTester tester) async { + testWidgets('PopNavigatorRouterDelegateMixin works', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -283,7 +283,7 @@ void main() { expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('Nested routers back button dispatcher works', (WidgetTester tester) async { + testWidgets('Nested routers back button dispatcher works', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -339,7 +339,7 @@ void main() { expect(find.text('popped inner'), findsOneWidget); }); - testWidgetsWithLeakTracking('Nested router back button dispatcher works for multiple children', (WidgetTester tester) async { + testWidgets('Nested router back button dispatcher works for multiple children', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -433,7 +433,7 @@ void main() { expect(find.text('popped inner2'), findsOneWidget); }); - testWidgetsWithLeakTracking('ChildBackButtonDispatcher can be replaced without calling the takePriority', (WidgetTester tester) async { + testWidgets('ChildBackButtonDispatcher can be replaced without calling the takePriority', (WidgetTester tester) async { final BackButtonDispatcher outerDispatcher = RootBackButtonDispatcher(); BackButtonDispatcher innerDispatcher = ChildBackButtonDispatcher(outerDispatcher); final SimpleRouterDelegate outerDelegate1 = SimpleRouterDelegate( @@ -502,7 +502,7 @@ void main() { expect(tester.takeException(), isNull); }); -testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively', (WidgetTester tester) async { +testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester tester) async { final BackButtonDispatcher outerDispatcher = RootBackButtonDispatcher(); final BackButtonDispatcher innerDispatcher1 = ChildBackButtonDispatcher(outerDispatcher); final BackButtonDispatcher innerDispatcher2 = ChildBackButtonDispatcher(innerDispatcher1); @@ -562,7 +562,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(isPopped, isTrue); }); - testWidgetsWithLeakTracking('router does report URL change correctly', (WidgetTester tester) async { + testWidgets('router does report URL change correctly', (WidgetTester tester) async { RouteInformation? reportedRouteInformation; RouteInformationReportingType? reportedType; final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider( @@ -640,7 +640,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(reportedType, RouteInformationReportingType.none); }); - testWidgetsWithLeakTracking('router can be forced to recognize or ignore navigating events', (WidgetTester tester) async { + testWidgets('router can be forced to recognize or ignore navigating events', (WidgetTester tester) async { RouteInformation? reportedRouteInformation; RouteInformationReportingType? reportedType; bool isNavigating = false; @@ -720,7 +720,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively reportedRouteInformation = null; }); - testWidgetsWithLeakTracking('router ignore navigating events updates RouteInformationProvider', (WidgetTester tester) async { + testWidgets('router ignore navigating events updates RouteInformationProvider', (WidgetTester tester) async { RouteInformation? updatedRouteInformation; late RouteInformation nextRouteInformation; RouteInformationReportingType? reportingType; @@ -777,7 +777,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(reportingType, RouteInformationReportingType.neglect); }); - testWidgetsWithLeakTracking('state change without location changes updates RouteInformationProvider', (WidgetTester tester) async { + testWidgets('state change without location changes updates RouteInformationProvider', (WidgetTester tester) async { RouteInformation? updatedRouteInformation; late RouteInformation nextRouteInformation; RouteInformationReportingType? reportingType; @@ -832,7 +832,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(reportingType, RouteInformationReportingType.none); }); - testWidgetsWithLeakTracking('PlatformRouteInformationProvider works', (WidgetTester tester) async { + testWidgets('PlatformRouteInformationProvider works', (WidgetTester tester) async { final PlatformRouteInformationProvider provider = PlatformRouteInformationProvider( initialRouteInformation: RouteInformation( uri: Uri.parse('initial'), @@ -885,7 +885,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('newTestRouteName'), findsOneWidget); }); - testWidgetsWithLeakTracking('PlatformRouteInformationProvider updates route information', (WidgetTester tester) async { + testWidgets('PlatformRouteInformationProvider updates route information', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger @@ -933,7 +933,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively ]); }); - testWidgetsWithLeakTracking('PlatformRouteInformationProvider does not push new entry if query parameters are semantically the same', (WidgetTester tester) async { + testWidgets('PlatformRouteInformationProvider does not push new entry if query parameters are semantically the same', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger @@ -1004,7 +1004,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively log.clear(); }); - testWidgetsWithLeakTracking('RootBackButtonDispatcher works', (WidgetTester tester) async { + testWidgets('RootBackButtonDispatcher works', (WidgetTester tester) async { final BackButtonDispatcher outerDispatcher = RootBackButtonDispatcher(); final PlatformRouteInformationProvider provider = PlatformRouteInformationProvider( initialRouteInformation: RouteInformation( @@ -1041,7 +1041,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('popped'), findsOneWidget); }); - testWidgetsWithLeakTracking('BackButtonListener takes priority over root back dispatcher', (WidgetTester tester) async { + testWidgets('BackButtonListener takes priority over root back dispatcher', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1092,7 +1092,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('popped inner1'), findsOneWidget); }); - testWidgetsWithLeakTracking('BackButtonListener updates callback if it has been changed', (WidgetTester tester) async { + testWidgets('BackButtonListener updates callback if it has been changed', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1173,7 +1173,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('second callback'), findsOneWidget); }); - testWidgetsWithLeakTracking('BackButtonListener clears callback if it is disposed', (WidgetTester tester) async { + testWidgets('BackButtonListener clears callback if it is disposed', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1245,7 +1245,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('popped outer'), findsOneWidget); }); - testWidgetsWithLeakTracking('Nested backButtonListener should take priority', (WidgetTester tester) async { + testWidgets('Nested backButtonListener should take priority', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1304,7 +1304,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('popped inner2'), findsOneWidget); }); - testWidgetsWithLeakTracking('Nested backButtonListener that returns false should call next on the line', (WidgetTester tester) async { + testWidgets('Nested backButtonListener that returns false should call next on the line', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1363,7 +1363,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('popped inner1'), findsOneWidget); }); - testWidgetsWithLeakTracking('`didUpdateWidget` test', (WidgetTester tester) async { + testWidgets('`didUpdateWidget` test', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1423,7 +1423,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(find.text('second callback'), findsOneWidget); }); - testWidgetsWithLeakTracking('Router reports location if it is different from location given by OS', (WidgetTester tester) async { + testWidgets('Router reports location if it is different from location given by OS', (WidgetTester tester) async { final List<RouteInformation> reportedRouteInformation = <RouteInformation>[]; final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider( onRouterReport: (RouteInformation info, RouteInformationReportingType type) => reportedRouteInformation.add(info), @@ -1455,7 +1455,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(reportedRouteInformation[1].uri.toString(), '/404'); }); - testWidgetsWithLeakTracking('RouterInformationParser can look up dependencies and reparse', (WidgetTester tester) async { + testWidgets('RouterInformationParser can look up dependencies and reparse', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1511,7 +1511,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(parserCalled, isTrue); }); - testWidgetsWithLeakTracking('RouterInformationParser can look up dependencies without reparsing', (WidgetTester tester) async { + testWidgets('RouterInformationParser can look up dependencies without reparsing', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1569,7 +1569,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(parserCalled, isFalse); }); - testWidgetsWithLeakTracking('Looks up dependencies in RouterDelegate does not trigger re-parsing', (WidgetTester tester) async { + testWidgets('Looks up dependencies in RouterDelegate does not trigger re-parsing', (WidgetTester tester) async { final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); provider.value = RouteInformation( @@ -1626,7 +1626,7 @@ testWidgetsWithLeakTracking('ChildBackButtonDispatcher take priority recursively expect(parserCalled, isFalse); }); - testWidgetsWithLeakTracking('Router can initialize with RouterConfig', (WidgetTester tester) async { + testWidgets('Router can initialize with RouterConfig', (WidgetTester tester) async { const String expected = 'text'; final SimpleRouteInformationProvider provider = SimpleRouteInformationProvider(); addTearDown(provider.dispose); diff --git a/packages/flutter/test/widgets/routes_test.dart b/packages/flutter/test/widgets/routes_test.dart index a309a51368e..9d1023a2c5f 100644 --- a/packages/flutter/test/widgets/routes_test.dart +++ b/packages/flutter/test/widgets/routes_test.dart @@ -8,7 +8,6 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -117,12 +116,12 @@ Future<void> runNavigatorTest( } void main() { - testWidgetsWithLeakTracking('Route settings', (WidgetTester tester) async { + testWidgets('Route settings', (WidgetTester tester) async { const RouteSettings settings = RouteSettings(name: 'A'); expect(settings, hasOneLineDescription); }); - testWidgetsWithLeakTracking('Route settings arguments', (WidgetTester tester) async { + testWidgets('Route settings arguments', (WidgetTester tester) async { const RouteSettings settings = RouteSettings(name: 'A'); expect(settings.arguments, isNull); @@ -131,7 +130,7 @@ void main() { expect(settings2.arguments, same(arguments)); }); - testWidgetsWithLeakTracking('Route management - push, replace, pop sequence', (WidgetTester tester) async { + testWidgets('Route management - push, replace, pop sequence', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( Directionality( @@ -218,7 +217,7 @@ void main() { results.clear(); }); - testWidgetsWithLeakTracking('Route management - push, remove, pop', (WidgetTester tester) async { + testWidgets('Route management - push, remove, pop', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( Directionality( @@ -333,7 +332,7 @@ void main() { results.clear(); }); - testWidgetsWithLeakTracking('Route management - push, replace, popUntil', (WidgetTester tester) async { + testWidgets('Route management - push, replace, popUntil', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget( Directionality( @@ -410,7 +409,7 @@ void main() { results.clear(); }); - testWidgetsWithLeakTracking('Route localHistory - popUntil', (WidgetTester tester) async { + testWidgets('Route localHistory - popUntil', (WidgetTester tester) async { final TestRoute routeA = TestRoute('A'); routeA.addLocalHistoryEntry(LocalHistoryEntry( onRemove: () { routeA.log('onRemove 0'); }, @@ -547,7 +546,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can autofocus a TextField nested in a Focus in a route.', (WidgetTester tester) async { + testWidgets('Can autofocus a TextField nested in a Focus in a route.', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); @@ -580,7 +579,7 @@ void main() { }); group('PageRouteBuilder', () { - testWidgetsWithLeakTracking('reverseTransitionDuration defaults to 300ms', (WidgetTester tester) async { + testWidgets('reverseTransitionDuration defaults to 300ms', (WidgetTester tester) async { // Default PageRouteBuilder reverse transition duration should be 300ms. await tester.pumpWidget( MaterialApp( @@ -631,7 +630,7 @@ void main() { expect(find.text('Open page'), findsOneWidget); }); - testWidgetsWithLeakTracking('reverseTransitionDuration can be customized', (WidgetTester tester) async { + testWidgets('reverseTransitionDuration can be customized', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute<dynamic>( @@ -683,7 +682,7 @@ void main() { }); group('TransitionRoute', () { - testWidgetsWithLeakTracking('secondary animation is kDismissed when next route finishes pop', (WidgetTester tester) async { + testWidgets('secondary animation is kDismissed when next route finishes pop', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -741,7 +740,7 @@ void main() { expect(secondaryAnimationPageOne.parent, kAlwaysDismissedAnimation); }); - testWidgetsWithLeakTracking('secondary animation is kDismissed when next route is removed', (WidgetTester tester) async { + testWidgets('secondary animation is kDismissed when next route is removed', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -796,7 +795,7 @@ void main() { expect(secondaryAnimationPageOne.parent, kAlwaysDismissedAnimation); }); - testWidgetsWithLeakTracking('secondary animation is kDismissed after train hopping finishes and pop', (WidgetTester tester) async { + testWidgets('secondary animation is kDismissed after train hopping finishes and pop', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -868,7 +867,7 @@ void main() { expect(secondaryAnimationPageOne.parent, kAlwaysDismissedAnimation); }); - testWidgetsWithLeakTracking('secondary animation is kDismissed when train hopping is interrupted', (WidgetTester tester) async { + testWidgets('secondary animation is kDismissed when train hopping is interrupted', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); await tester.pumpWidget( MaterialApp( @@ -937,7 +936,7 @@ void main() { expect(trainHopper2.currentTrain, isNull); // Has been disposed. }); - testWidgetsWithLeakTracking('secondary animation is triggered when pop initial route', (WidgetTester tester) async { + testWidgets('secondary animation is triggered when pop initial route', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>(); late Animation<double> secondaryAnimationOfRouteOne; late Animation<double> primaryAnimationOfRouteTwo; @@ -975,7 +974,7 @@ void main() { expect(secondaryAnimationOfRouteOne.value, primaryAnimationOfRouteTwo.value); }); - testWidgetsWithLeakTracking('showGeneralDialog handles transparent barrier color', (WidgetTester tester) async { + testWidgets('showGeneralDialog handles transparent barrier color', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Builder( builder: (BuildContext context) { @@ -1009,7 +1008,7 @@ void main() { expect(find.byType(ModalBarrier), findsNWidgets(1)); }); - testWidgetsWithLeakTracking('showGeneralDialog adds non-dismissible barrier when barrierDismissible is false', (WidgetTester tester) async { + testWidgets('showGeneralDialog adds non-dismissible barrier when barrierDismissible is false', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Builder( builder: (BuildContext context) { @@ -1044,7 +1043,7 @@ void main() { expect(find.byType(ModalBarrier), findsNWidgets(1)); }); - testWidgetsWithLeakTracking('showGeneralDialog uses null as a barrierLabel by default', (WidgetTester tester) async { + testWidgets('showGeneralDialog uses null as a barrierLabel by default', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Builder( builder: (BuildContext context) { @@ -1079,7 +1078,7 @@ void main() { expect(find.byType(ModalBarrier), findsNWidgets(1)); }); - testWidgetsWithLeakTracking('showGeneralDialog uses root navigator by default', (WidgetTester tester) async { + testWidgets('showGeneralDialog uses root navigator by default', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); final DialogObserver nestedObserver = DialogObserver(); @@ -1115,7 +1114,7 @@ void main() { expect(nestedObserver.dialogCount, 0); }); - testWidgetsWithLeakTracking('showGeneralDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { + testWidgets('showGeneralDialog uses nested navigator if useRootNavigator is false', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); final DialogObserver nestedObserver = DialogObserver(); @@ -1152,7 +1151,7 @@ void main() { expect(nestedObserver.dialogCount, 1); }); - testWidgetsWithLeakTracking('showGeneralDialog default argument values', (WidgetTester tester) async { + testWidgets('showGeneralDialog default argument values', (WidgetTester tester) async { final DialogObserver rootObserver = DialogObserver(); await tester.pumpWidget(MaterialApp( @@ -1188,7 +1187,7 @@ void main() { }); group('showGeneralDialog avoids overlapping display features', () { - testWidgetsWithLeakTracking('positioning with anchorPoint', (WidgetTester tester) async { + testWidgets('positioning with anchorPoint', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1226,7 +1225,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning with Directionality', (WidgetTester tester) async { + testWidgets('positioning with Directionality', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1266,7 +1265,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('positioning by default', (WidgetTester tester) async { + testWidgets('positioning by default', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( builder: (BuildContext context, Widget? child) { @@ -1304,7 +1303,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('reverseTransitionDuration defaults to transitionDuration', (WidgetTester tester) async { + testWidgets('reverseTransitionDuration defaults to transitionDuration', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); // Default MaterialPageRoute transition duration should be 300ms. @@ -1356,7 +1355,7 @@ void main() { expect(find.byKey(containerKey), findsNothing); }); - testWidgetsWithLeakTracking('reverseTransitionDuration can be customized', (WidgetTester tester) async { + testWidgets('reverseTransitionDuration can be customized', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget(MaterialApp( onGenerateRoute: (RouteSettings settings) { @@ -1408,7 +1407,7 @@ void main() { expect(find.byKey(containerKey), findsNothing); }); - testWidgetsWithLeakTracking('custom reverseTransitionDuration does not result in interrupted animations', (WidgetTester tester) async { + testWidgets('custom reverseTransitionDuration does not result in interrupted animations', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget(MaterialApp( theme: ThemeData( @@ -1476,7 +1475,7 @@ void main() { }); group('ModalRoute', () { - testWidgetsWithLeakTracking('default barrierCurve', (WidgetTester tester) async { + testWidgets('default barrierCurve', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Builder( @@ -1538,7 +1537,7 @@ void main() { expect(modalBarrierAnimation.value, Colors.black); }); - testWidgetsWithLeakTracking('custom barrierCurve', (WidgetTester tester) async { + testWidgets('custom barrierCurve', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Builder( @@ -1601,7 +1600,7 @@ void main() { expect(modalBarrierAnimation.value, Colors.black); }); - testWidgetsWithLeakTracking('white barrierColor', (WidgetTester tester) async { + testWidgets('white barrierColor', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: Material( child: Builder( @@ -1664,7 +1663,7 @@ void main() { expect(modalBarrierAnimation.value, Colors.white); }); - testWidgetsWithLeakTracking('modal route semantics order', (WidgetTester tester) async { + testWidgets('modal route semantics order', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/46625. final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(MaterialApp( @@ -1737,7 +1736,7 @@ void main() { semantics.dispose(); }, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS})); - testWidgetsWithLeakTracking('focus traverse correct when pop multiple page simultaneously', (WidgetTester tester) async { + testWidgets('focus traverse correct when pop multiple page simultaneously', (WidgetTester tester) async { // Regression test: https://github.com/flutter/flutter/issues/48903 final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( @@ -1783,7 +1782,7 @@ void main() { expect(focusNodeOnPageOne.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('focus traversal is correct when popping multiple pages simultaneously - with focused children', (WidgetTester tester) async { + testWidgets('focus traversal is correct when popping multiple pages simultaneously - with focused children', (WidgetTester tester) async { // Regression test: https://github.com/flutter/flutter/issues/48903 final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( @@ -1835,7 +1834,7 @@ void main() { expect(focusNodeOnPageOne.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('child with local history can be disposed', (WidgetTester tester) async { + testWidgets('child with local history can be disposed', (WidgetTester tester) async { // Regression test: https://github.com/flutter/flutter/issues/52478 await tester.pumpWidget(const MaterialApp( home: WidgetWithLocalHistory(), @@ -1856,7 +1855,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('child with no local history can be disposed', (WidgetTester tester) async { + testWidgets('child with no local history can be disposed', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: WidgetWithNoLocalHistory(), )); @@ -1876,7 +1875,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('can be dismissed with escape keyboard shortcut', (WidgetTester tester) async { + testWidgets('can be dismissed with escape keyboard shortcut', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( navigatorKey: navigatorKey, @@ -1898,7 +1897,7 @@ void main() { expect(find.text('dialog1'), findsNothing); }); - testWidgetsWithLeakTracking('can not be dismissed with escape keyboard shortcut if barrier not dismissible', (WidgetTester tester) async { + testWidgets('can not be dismissed with escape keyboard shortcut if barrier not dismissible', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( navigatorKey: navigatorKey, @@ -1921,7 +1920,7 @@ void main() { expect(find.text('dialog1'), findsOneWidget); }); - testWidgetsWithLeakTracking('ModalRoute.of works for void routes', (WidgetTester tester) async { + testWidgets('ModalRoute.of works for void routes', (WidgetTester tester) async { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); await tester.pumpWidget(MaterialApp( navigatorKey: navigatorKey, @@ -1943,7 +1942,7 @@ void main() { expect(parentRoute, isA<MaterialPageRoute<void>>()); }); - testWidgetsWithLeakTracking('RawDialogRoute is state restorable', (WidgetTester tester) async { + testWidgets('RawDialogRoute is state restorable', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( restorationScopeId: 'app', diff --git a/packages/flutter/test/widgets/row_test.dart b/packages/flutter/test/widgets/row_test.dart index da7ee24981e..884dfbf288b 100644 --- a/packages/flutter/test/widgets/row_test.dart +++ b/packages/flutter/test/widgets/row_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class OrderPainter extends CustomPainter { const OrderPainter(this.index); @@ -29,7 +28,7 @@ Widget log(int index) => CustomPaint(painter: OrderPainter(index)); void main() { // NO DIRECTION - testWidgetsWithLeakTracking('Row with one Flexible child - no textDirection', (WidgetTester tester) async { + testWidgets('Row with one Flexible child - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -60,7 +59,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row with default main axis parameters - no textDirection', (WidgetTester tester) async { + testWidgets('Row with default main axis parameters - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -91,7 +90,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.center - no textDirection', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.center - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -121,7 +120,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.end - no textDirection', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.end - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -153,7 +152,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceBetween - no textDirection', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceBetween - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -185,7 +184,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceAround - no textDirection', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceAround - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -219,7 +218,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceEvenly - no textDirection', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceEvenly - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -251,7 +250,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row and MainAxisSize.min - no textDirection', (WidgetTester tester) async { + testWidgets('Row and MainAxisSize.min - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('rowKey'); const Key child0Key = Key('child0'); @@ -281,7 +280,7 @@ void main() { expect(OrderPainter.log, <int>[]); }); - testWidgetsWithLeakTracking('Row MainAxisSize.min layout at zero size - no textDirection', (WidgetTester tester) async { + testWidgets('Row MainAxisSize.min layout at zero size - no textDirection', (WidgetTester tester) async { OrderPainter.log.clear(); const Key childKey = Key('childKey'); @@ -309,7 +308,7 @@ void main() { // LTR - testWidgetsWithLeakTracking('Row with one Flexible child - LTR', (WidgetTester tester) async { + testWidgets('Row with one Flexible child - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -359,7 +358,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with default main axis parameters - LTR', (WidgetTester tester) async { + testWidgets('Row with default main axis parameters - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -409,7 +408,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.center - LTR', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.center - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -451,7 +450,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.end - LTR', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.end - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -501,7 +500,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceBetween - LTR', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceBetween - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -551,7 +550,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceAround - LTR', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceAround - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -609,7 +608,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3, 4]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceEvenly - LTR', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceEvenly - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -659,7 +658,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row and MainAxisSize.min - LTR', (WidgetTester tester) async { + testWidgets('Row and MainAxisSize.min - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('rowKey'); const Key child0Key = Key('child0'); @@ -701,7 +700,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2]); }); - testWidgetsWithLeakTracking('Row MainAxisSize.min layout at zero size - LTR', (WidgetTester tester) async { + testWidgets('Row MainAxisSize.min layout at zero size - LTR', (WidgetTester tester) async { OrderPainter.log.clear(); const Key childKey = Key('childKey'); @@ -730,7 +729,7 @@ void main() { // RTL - testWidgetsWithLeakTracking('Row with one Flexible child - RTL', (WidgetTester tester) async { + testWidgets('Row with one Flexible child - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -780,7 +779,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with default main axis parameters - RTL', (WidgetTester tester) async { + testWidgets('Row with default main axis parameters - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -830,7 +829,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.center - RTL', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.center - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -872,7 +871,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.end - RTL', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.end - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -922,7 +921,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceBetween - RTL', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceBetween - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -972,7 +971,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceAround - RTL', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceAround - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -1030,7 +1029,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3, 4]); }); - testWidgetsWithLeakTracking('Row with MainAxisAlignment.spaceEvenly - RTL', (WidgetTester tester) async { + testWidgets('Row with MainAxisAlignment.spaceEvenly - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('row'); const Key child0Key = Key('child0'); @@ -1080,7 +1079,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2, 3]); }); - testWidgetsWithLeakTracking('Row and MainAxisSize.min - RTL', (WidgetTester tester) async { + testWidgets('Row and MainAxisSize.min - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key rowKey = Key('rowKey'); const Key child0Key = Key('child0'); @@ -1122,7 +1121,7 @@ void main() { expect(OrderPainter.log, <int>[1, 2]); }); - testWidgetsWithLeakTracking('Row MainAxisSize.min layout at zero size - RTL', (WidgetTester tester) async { + testWidgets('Row MainAxisSize.min layout at zero size - RTL', (WidgetTester tester) async { OrderPainter.log.clear(); const Key childKey = Key('childKey'); diff --git a/packages/flutter/test/widgets/rtl_test.dart b/packages/flutter/test/widgets/rtl_test.dart index 810adc2d2ba..077be41cc26 100644 --- a/packages/flutter/test/widgets/rtl_test.dart +++ b/packages/flutter/test/widgets/rtl_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Padding RTL', (WidgetTester tester) async { + testWidgets('Padding RTL', (WidgetTester tester) async { const Widget child = Padding( padding: EdgeInsetsDirectional.only(start: 10.0), child: Placeholder(), @@ -44,7 +43,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Container padding/margin RTL', (WidgetTester tester) async { + testWidgets('Container padding/margin RTL', (WidgetTester tester) async { final Widget child = Container( padding: const EdgeInsetsDirectional.only(start: 6.0), margin: const EdgeInsetsDirectional.only(end: 20.0, start: 4.0), @@ -64,7 +63,7 @@ void main() { expect(tester.getTopRight(find.byType(Placeholder)), const Offset(790.0, 0.0)); }); - testWidgetsWithLeakTracking('Container padding/margin mixed RTL/absolute', (WidgetTester tester) async { + testWidgets('Container padding/margin mixed RTL/absolute', (WidgetTester tester) async { final Widget child = Container( padding: const EdgeInsets.only(left: 6.0), margin: const EdgeInsetsDirectional.only(end: 20.0, start: 4.0), @@ -84,7 +83,7 @@ void main() { expect(tester.getTopRight(find.byType(Placeholder)), const Offset(796.0, 0.0)); }); - testWidgetsWithLeakTracking('EdgeInsetsDirectional without Directionality', (WidgetTester tester) async { + testWidgets('EdgeInsetsDirectional without Directionality', (WidgetTester tester) async { await tester.pumpWidget(const Padding(padding: EdgeInsetsDirectional.zero)); expect(tester.takeException(), isAssertionError); }); diff --git a/packages/flutter/test/widgets/run_app_test.dart b/packages/flutter/test/widgets/run_app_test.dart index d48a75f7991..49c035999a1 100644 --- a/packages/flutter/test/widgets/run_app_test.dart +++ b/packages/flutter/test/widgets/run_app_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('runApp inside onPressed does not throw', (WidgetTester tester) async { + testWidgets('runApp inside onPressed does not throw', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/safe_area_test.dart b/packages/flutter/test/widgets/safe_area_test.dart index afe4c41b290..809d64e3365 100644 --- a/packages/flutter/test/widgets/safe_area_test.dart +++ b/packages/flutter/test/widgets/safe_area_test.dart @@ -5,11 +5,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('SafeArea', () { - testWidgetsWithLeakTracking('SafeArea - basic', (WidgetTester tester) async { + testWidgets('SafeArea - basic', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData(padding: EdgeInsets.all(20.0)), @@ -23,7 +22,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(780.0, 580.0)); }); - testWidgetsWithLeakTracking('SafeArea - with minimums', (WidgetTester tester) async { + testWidgets('SafeArea - with minimums', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData(padding: EdgeInsets.all(20.0)), @@ -38,7 +37,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(780.0, 570.0)); }); - testWidgetsWithLeakTracking('SafeArea - nested', (WidgetTester tester) async { + testWidgets('SafeArea - nested', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData(padding: EdgeInsets.all(20.0)), @@ -55,7 +54,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(780.0, 580.0)); }); - testWidgetsWithLeakTracking('SafeArea - changing', (WidgetTester tester) async { + testWidgets('SafeArea - changing', (WidgetTester tester) async { const Widget child = SafeArea( bottom: false, child: SafeArea( @@ -86,7 +85,7 @@ void main() { expect(tester.getBottomRight(find.byType(Placeholder)), const Offset(800.0, 600.0)); }); - testWidgetsWithLeakTracking('SafeArea - properties', (WidgetTester tester) async { + testWidgets('SafeArea - properties', (WidgetTester tester) async { final SafeArea child = SafeArea( right: false, bottom: false, @@ -113,7 +112,7 @@ void main() { ); } - testWidgetsWithLeakTracking('SafeArea alone.', (WidgetTester tester) async { + testWidgets('SafeArea alone.', (WidgetTester tester) async { final Widget child = boilerplate(const SafeArea( maintainBottomViewPadding: true, child: Column( @@ -148,7 +147,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('SafeArea alone - partial ViewInsets consume Padding', (WidgetTester tester) async { + testWidgets('SafeArea alone - partial ViewInsets consume Padding', (WidgetTester tester) async { final Widget child = boilerplate(const SafeArea( maintainBottomViewPadding: true, child: Column( @@ -181,7 +180,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('SafeArea with nested Scaffold', (WidgetTester tester) async { + testWidgets('SafeArea with nested Scaffold', (WidgetTester tester) async { final Widget child = boilerplate(const SafeArea( maintainBottomViewPadding: true, child: Scaffold( @@ -219,7 +218,7 @@ void main() { expect(initialPoint, finalPoint); }); - testWidgetsWithLeakTracking('SafeArea with nested Scaffold - partial ViewInsets consume Padding', (WidgetTester tester) async { + testWidgets('SafeArea with nested Scaffold - partial ViewInsets consume Padding', (WidgetTester tester) async { final Widget child = boilerplate(const SafeArea( maintainBottomViewPadding: true, child: Scaffold( @@ -289,7 +288,7 @@ void main() { expect(testAnswers, equals(expectedRects)); } - testWidgetsWithLeakTracking('SliverSafeArea - basic', (WidgetTester tester) async { + testWidgets('SliverSafeArea - basic', (WidgetTester tester) async { await tester.pumpWidget( buildWidget( const EdgeInsets.all(20.0), @@ -306,7 +305,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('SliverSafeArea - basic', (WidgetTester tester) async { + testWidgets('SliverSafeArea - basic', (WidgetTester tester) async { await tester.pumpWidget( buildWidget( const EdgeInsets.all(20.0), @@ -324,7 +323,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('SliverSafeArea - nested', (WidgetTester tester) async { + testWidgets('SliverSafeArea - nested', (WidgetTester tester) async { await tester.pumpWidget( buildWidget( const EdgeInsets.all(20.0), @@ -344,7 +343,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('SliverSafeArea - changing', (WidgetTester tester) async { + testWidgets('SliverSafeArea - changing', (WidgetTester tester) async { const Widget sliver = SliverSafeArea( bottom: false, sliver: SliverSafeArea( @@ -383,7 +382,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('SliverSafeArea - properties', (WidgetTester tester) async { + testWidgets('SliverSafeArea - properties', (WidgetTester tester) async { const SliverSafeArea child = SliverSafeArea( right: false, bottom: false, diff --git a/packages/flutter/test/widgets/scroll_activity_test.dart b/packages/flutter/test/widgets/scroll_activity_test.dart index 2c5af1fb8df..569cea911c7 100644 --- a/packages/flutter/test/widgets/scroll_activity_test.dart +++ b/packages/flutter/test/widgets/scroll_activity_test.dart @@ -15,7 +15,7 @@ List<Widget> children(int n) { } void main() { - testWidgetsWithLeakTracking('Scrolling with list view changes, leaving the overscroll', (WidgetTester tester) async { + testWidgets('Scrolling with list view changes, leaving the overscroll', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp(home: ListView(controller: controller, children: children(30)))); @@ -30,7 +30,7 @@ void main() { expect(controller.position.pixels, thirty + 100.0); // and ends up at the end }); - testWidgetsWithLeakTracking('Scrolling with list view changes, remaining overscrolled', (WidgetTester tester) async { + testWidgets('Scrolling with list view changes, remaining overscrolled', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp(home: ListView(controller: controller, children: children(30)))); @@ -45,7 +45,7 @@ void main() { expect(controller.position.pixels, thirty + 100.0); // and ends up at the end }); - testWidgetsWithLeakTracking('Ability to keep a PageView at the end manually (issue 62209)', (WidgetTester tester) async { + testWidgets('Ability to keep a PageView at the end manually (issue 62209)', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: PageView62209())); expect(find.text('Page 1'), findsOneWidget); expect(find.text('Page 100'), findsNothing); @@ -132,7 +132,7 @@ void main() { expect(find.text('Page 9'), findsOneWidget); }); - testWidgetsWithLeakTracking('Pointer is not ignored during trackpad scrolling.', (WidgetTester tester) async { + testWidgets('Pointer is not ignored during trackpad scrolling.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); int? lastTapped; diff --git a/packages/flutter/test/widgets/scroll_aware_image_provider_test.dart b/packages/flutter/test/widgets/scroll_aware_image_provider_test.dart index 926484b5993..7579cafb562 100644 --- a/packages/flutter/test/widgets/scroll_aware_image_provider_test.dart +++ b/packages/flutter/test/widgets/scroll_aware_image_provider_test.dart @@ -6,7 +6,6 @@ import 'dart:ui' as ui show Image; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../painting/image_test_utils.dart'; @@ -34,7 +33,7 @@ void main() { return Scrollable.of(find.byType(TestWidget).evaluate().first).position; } - testWidgetsWithLeakTracking('ScrollAwareImageProvider does not delay if widget is not in scrollable', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider does not delay if widget is not in scrollable', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); await tester.pumpWidget(TestWidget(key)); @@ -62,7 +61,7 @@ void main() { expect(imageCache.currentSize, 1); }); - testWidgetsWithLeakTracking('ScrollAwareImageProvider does not delay if in scrollable that is not scrolling', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider does not delay if in scrollable that is not scrolling', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -99,7 +98,7 @@ void main() { expect(findPhysics<RecordingPhysics>(tester).velocities, <double>[0]); }); - testWidgetsWithLeakTracking('ScrollAwareImageProvider does not delay if in scrollable that is scrolling slowly', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider does not delay if in scrollable that is scrolling slowly', (WidgetTester tester) async { final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[]; final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -158,7 +157,7 @@ void main() { expect(imageCache.currentSize, 1); }); - testWidgetsWithLeakTracking('ScrollAwareImageProvider delays if in scrollable that is scrolling fast', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider delays if in scrollable that is scrolling fast', (WidgetTester tester) async { final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[]; final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -227,7 +226,7 @@ void main() { expect(imageCache.currentSize, 1); }); - testWidgetsWithLeakTracking('ScrollAwareImageProvider delays if in scrollable that is scrolling fast and fizzles if disposed', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider delays if in scrollable that is scrolling fast and fizzles if disposed', (WidgetTester tester) async { final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[]; final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -298,7 +297,7 @@ void main() { expect(imageCache.currentSize, 0); }); - testWidgetsWithLeakTracking('ScrollAwareImageProvider resolves from ImageCache and does not set completer twice', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider resolves from ImageCache and does not set completer twice', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -348,7 +347,7 @@ void main() { expect(stream.completer, null); }); - testWidgetsWithLeakTracking('ScrollAwareImageProvider does not block LRU updates to image cache', (WidgetTester tester) async { + testWidgets('ScrollAwareImageProvider does not block LRU updates to image cache', (WidgetTester tester) async { final int oldSize = imageCache.maximumSize; imageCache.maximumSize = 1; diff --git a/packages/flutter/test/widgets/scroll_behavior_test.dart b/packages/flutter/test/widgets/scroll_behavior_test.dart index e2674bb9bb8..9a34537e123 100644 --- a/packages/flutter/test/widgets/scroll_behavior_test.dart +++ b/packages/flutter/test/widgets/scroll_behavior_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; late GestureVelocityTrackerBuilder lastCreatedBuilder; class TestScrollBehavior extends ScrollBehavior { @@ -34,7 +33,7 @@ class TestScrollBehavior extends ScrollBehavior { } void main() { - testWidgetsWithLeakTracking('Assert in buildScrollbar that controller != null when using it', (WidgetTester tester) async { + testWidgets('Assert in buildScrollbar that controller != null when using it', (WidgetTester tester) async { const ScrollBehavior defaultBehavior = ScrollBehavior(); late BuildContext capturedContext; @@ -76,14 +75,14 @@ void main() { }, variant: TargetPlatformVariant.all()); // Regression test for https://github.com/flutter/flutter/issues/89681 - testWidgetsWithLeakTracking('_WrappedScrollBehavior shouldNotify test', (WidgetTester tester) async { + testWidgets('_WrappedScrollBehavior shouldNotify test', (WidgetTester tester) async { final ScrollBehavior behavior1 = const ScrollBehavior().copyWith(); final ScrollBehavior behavior2 = const ScrollBehavior().copyWith(); expect(behavior1.shouldNotify(behavior2), false); }); - testWidgetsWithLeakTracking('Inherited ScrollConfiguration changed', (WidgetTester tester) async { + testWidgets('Inherited ScrollConfiguration changed', (WidgetTester tester) async { final GlobalKey key = GlobalKey(debugLabel: 'scrollable'); TestScrollBehavior? behavior; late ScrollPositionWithSingleContext position; @@ -132,7 +131,7 @@ void main() { expect(metrics.viewportDimension, equals(600.0)); }); - testWidgetsWithLeakTracking('ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { + testWidgets('ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -155,7 +154,7 @@ void main() { expect(find.byType(GlowingOverscrollIndicator), findsOneWidget); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); - testWidgetsWithLeakTracking('ScrollBehavior multitouchDragStrategy test', (WidgetTester tester) async { + testWidgets('ScrollBehavior multitouchDragStrategy test', (WidgetTester tester) async { const ScrollBehavior behavior1 = ScrollBehavior(); final ScrollBehavior behavior2 = const ScrollBehavior().copyWith( multitouchDragStrategy: MultitouchDragStrategy.sumAllPointers @@ -220,7 +219,7 @@ void main() { }, variant: TargetPlatformVariant.all()); group('ScrollBehavior configuration is maintained over multiple copies', () { - testWidgetsWithLeakTracking('dragDevices', (WidgetTester tester) async { + testWidgets('dragDevices', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 const ScrollBehavior defaultBehavior = ScrollBehavior(); expect(defaultBehavior.dragDevices, <PointerDeviceKind>{ @@ -242,7 +241,7 @@ void main() { expect(twiceCopiedBehavior.dragDevices, PointerDeviceKind.values.toSet()); }); - testWidgetsWithLeakTracking('physics', (WidgetTester tester) async { + testWidgets('physics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 late ScrollPhysics defaultPhysics; late ScrollPhysics onceCopiedPhysics; @@ -284,7 +283,7 @@ void main() { expect(twiceCopiedPhysics, const BouncingScrollPhysics()); }); - testWidgetsWithLeakTracking('platform', (WidgetTester tester) async { + testWidgets('platform', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 late TargetPlatform defaultPlatform; late TargetPlatform onceCopiedPlatform; @@ -341,7 +340,7 @@ void main() { ); } - testWidgetsWithLeakTracking('scrollbar', (WidgetTester tester) async { + testWidgets('scrollbar', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 const ScrollBehavior defaultBehavior = ScrollBehavior(); await tester.pumpWidget(wrap(defaultBehavior)); @@ -361,7 +360,7 @@ void main() { // For default scrollbars }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('overscroll', (WidgetTester tester) async { + testWidgets('overscroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 const ScrollBehavior defaultBehavior = ScrollBehavior(); await tester.pumpWidget(wrap(defaultBehavior)); diff --git a/packages/flutter/test/widgets/scroll_controller_test.dart b/packages/flutter/test/widgets/scroll_controller_test.dart index 3b1682ac524..eeadbc0f65c 100644 --- a/packages/flutter/test/widgets/scroll_controller_test.dart +++ b/packages/flutter/test/widgets/scroll_controller_test.dart @@ -11,7 +11,7 @@ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'states.dart'; void main() { - testWidgetsWithLeakTracking('ScrollController control test', (WidgetTester tester) async { + testWidgets('ScrollController control test', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -134,7 +134,7 @@ void main() { expect(realOffset(), equals(controller2.offset)); }); - testWidgetsWithLeakTracking('ScrollController control test', (WidgetTester tester) async { + testWidgets('ScrollController control test', (WidgetTester tester) async { final ScrollController controller = ScrollController( initialScrollOffset: 209.0, ); @@ -180,7 +180,7 @@ void main() { expect(realOffset(), equals(controller.offset)); }); - testWidgetsWithLeakTracking('DrivenScrollActivity ending after dispose', (WidgetTester tester) async { + testWidgets('DrivenScrollActivity ending after dispose', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -202,14 +202,14 @@ void main() { await tester.pumpWidget(Container(), const Duration(seconds: 2)); }); - testWidgetsWithLeakTracking('Read operations on ScrollControllers with no positions fail', (WidgetTester tester) async { + testWidgets('Read operations on ScrollControllers with no positions fail', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); expect(() => controller.offset, throwsAssertionError); expect(() => controller.position, throwsAssertionError); }); - testWidgetsWithLeakTracking('Read operations on ScrollControllers with more than one position fail', (WidgetTester tester) async { + testWidgets('Read operations on ScrollControllers with more than one position fail', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -245,14 +245,14 @@ void main() { expect(() => controller.position, throwsAssertionError); }); - testWidgetsWithLeakTracking('Write operations on ScrollControllers with no positions fail', (WidgetTester tester) async { + testWidgets('Write operations on ScrollControllers with no positions fail', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); expect(() => controller.animateTo(1.0, duration: const Duration(seconds: 1), curve: Curves.linear), throwsAssertionError); expect(() => controller.jumpTo(1.0), throwsAssertionError); }); - testWidgetsWithLeakTracking('Write operations on ScrollControllers with more than one position do not throw', (WidgetTester tester) async { + testWidgets('Write operations on ScrollControllers with more than one position do not throw', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -289,7 +289,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Scroll controllers notify when the position changes', (WidgetTester tester) async { + testWidgets('Scroll controllers notify when the position changes', (WidgetTester tester) async { final ScrollController controller = ScrollController(); final List<double> log = <double>[]; @@ -323,7 +323,7 @@ void main() { expect(log, isEmpty); }); - testWidgetsWithLeakTracking('keepScrollOffset', (WidgetTester tester) async { + testWidgets('keepScrollOffset', (WidgetTester tester) async { final PageStorageBucket bucket = PageStorageBucket(); Widget buildFrame(ScrollController controller) { @@ -379,7 +379,7 @@ void main() { }); - testWidgetsWithLeakTracking('isScrollingNotifier works with pointer scroll', (WidgetTester tester) async { + testWidgets('isScrollingNotifier works with pointer scroll', (WidgetTester tester) async { Widget buildFrame(ScrollController controller) { return Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/scroll_events_test.dart b/packages/flutter/test/widgets/scroll_events_test.dart index f7087418f63..397eb5b9524 100644 --- a/packages/flutter/test/widgets/scroll_events_test.dart +++ b/packages/flutter/test/widgets/scroll_events_test.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Widget _buildScroller({ required List<String> log }) { return NotificationListener<ScrollNotification>( @@ -39,7 +38,7 @@ void main() { scrollable.position.jumpTo(newScrollOffset); } - testWidgetsWithLeakTracking('Scroll event drag', (WidgetTester tester) async { + testWidgets('Scroll event drag', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -58,7 +57,7 @@ void main() { expect(log, equals(<String>['scroll-start', 'scroll-update', 'scroll-end'])); }); - testWidgetsWithLeakTracking('Scroll animateTo', (WidgetTester tester) async { + testWidgets('Scroll animateTo', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -75,7 +74,7 @@ void main() { expect(completer.isCompleted, isTrue); }); - testWidgetsWithLeakTracking('Scroll jumpTo', (WidgetTester tester) async { + testWidgets('Scroll jumpTo', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -86,7 +85,7 @@ void main() { expect(log, equals(<String>['scroll-start', 'scroll-update', 'scroll-end'])); }); - testWidgetsWithLeakTracking('Scroll jumpTo during animation', (WidgetTester tester) async { + testWidgets('Scroll jumpTo during animation', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -111,7 +110,7 @@ void main() { expect(completer.isCompleted, isTrue); }); - testWidgetsWithLeakTracking('Scroll scrollTo during animation', (WidgetTester tester) async { + testWidgets('Scroll scrollTo during animation', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -135,7 +134,7 @@ void main() { expect(completer.isCompleted, isTrue); }); - testWidgetsWithLeakTracking('fling, fling generates two start/end pairs', (WidgetTester tester) async { + testWidgets('fling, fling generates two start/end pairs', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -158,7 +157,7 @@ void main() { expect(log, equals(<String>['scroll-start', 'scroll-end', 'scroll-start', 'scroll-end'])); }); - testWidgetsWithLeakTracking('fling, pause, fling generates two start/end pairs', (WidgetTester tester) async { + testWidgets('fling, pause, fling generates two start/end pairs', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); @@ -177,7 +176,7 @@ void main() { expect(log, equals(<String>['scroll-start', 'scroll-end', 'scroll-start', 'scroll-end'])); }); - testWidgetsWithLeakTracking('fling up ends', (WidgetTester tester) async { + testWidgets('fling up ends', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(_buildScroller(log: log)); diff --git a/packages/flutter/test/widgets/scroll_interaction_test.dart b/packages/flutter/test/widgets/scroll_interaction_test.dart index 06a1735d06e..f0dd0c3b0a9 100644 --- a/packages/flutter/test/widgets/scroll_interaction_test.dart +++ b/packages/flutter/test/widgets/scroll_interaction_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Scroll flings twice in a row does not crash', (WidgetTester tester) async { + testWidgets('Scroll flings twice in a row does not crash', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/scroll_notification_test.dart b/packages/flutter/test/widgets/scroll_notification_test.dart index 4b33d4d5d1c..e9ea132a45b 100644 --- a/packages/flutter/test/widgets/scroll_notification_test.dart +++ b/packages/flutter/test/widgets/scroll_notification_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('ScrollMetricsNotification test', (WidgetTester tester) async { + testWidgets('ScrollMetricsNotification test', (WidgetTester tester) async { final List<Notification> events = <Notification>[]; Widget buildFrame(double height) { return NotificationListener<Notification>( @@ -71,7 +70,7 @@ void main() { expect(events.length, 0); }); - testWidgetsWithLeakTracking('Scroll notification basics', (WidgetTester tester) async { + testWidgets('Scroll notification basics', (WidgetTester tester) async { late ScrollNotification notification; await tester.pumpWidget(NotificationListener<ScrollNotification>( @@ -112,7 +111,7 @@ void main() { expect(end.dragDetails!.velocity, equals(Velocity.zero)); }); - testWidgetsWithLeakTracking('Scroll notification depth', (WidgetTester tester) async { + testWidgets('Scroll notification depth', (WidgetTester tester) async { final List<Type> depth0Types = <Type>[]; final List<Type> depth1Types = <Type>[]; final List<int> depth0Values = <int>[]; @@ -167,7 +166,7 @@ void main() { expect(depth1Values, equals(<int>[1, 1, 1, 1, 1])); }); - testWidgetsWithLeakTracking('ScrollNotifications bubble past Scaffold Material', (WidgetTester tester) async { + testWidgets('ScrollNotifications bubble past Scaffold Material', (WidgetTester tester) async { final List<Type> notificationTypes = <Type>[]; await tester.pumpWidget( @@ -215,7 +214,7 @@ void main() { expect(notificationTypes, equals(types)); }); - testWidgetsWithLeakTracking('ScrollNotificationObserver', (WidgetTester tester) async { + testWidgets('ScrollNotificationObserver', (WidgetTester tester) async { late ScrollNotificationObserverState observer; ScrollNotification? notification; diff --git a/packages/flutter/test/widgets/scroll_physics_test.dart b/packages/flutter/test/widgets/scroll_physics_test.dart index 6185ff15e71..6f209bc12bf 100644 --- a/packages/flutter/test/widgets/scroll_physics_test.dart +++ b/packages/flutter/test/widgets/scroll_physics_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestScrollPhysics extends ScrollPhysics { const TestScrollPhysics({ @@ -340,7 +339,7 @@ FlutterError } }); - testWidgetsWithLeakTracking('PageScrollPhysics work with NestedScrollView', (WidgetTester tester) async { + testWidgets('PageScrollPhysics work with NestedScrollView', (WidgetTester tester) async { // Regression test for: https://github.com/flutter/flutter/issues/47850 await tester.pumpWidget(Material( child: Directionality( diff --git a/packages/flutter/test/widgets/scroll_position_test.dart b/packages/flutter/test/widgets/scroll_position_test.dart index 8d6f0648329..673f3eb3230 100644 --- a/packages/flutter/test/widgets/scroll_position_test.dart +++ b/packages/flutter/test/widgets/scroll_position_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; ScrollController _controller = ScrollController( initialScrollOffset: 110.0, @@ -141,7 +140,7 @@ Future<void> performTest(WidgetTester tester, bool maintainState) async { } void main() { - testWidgetsWithLeakTracking("ScrollPosition jumpTo() doesn't call notifyListeners twice", (WidgetTester tester) async { + testWidgets("ScrollPosition jumpTo() doesn't call notifyListeners twice", (WidgetTester tester) async { int count = 0; await tester.pumpWidget(MaterialApp( home: ListView.builder( @@ -160,12 +159,12 @@ void main() { expect(count, 1); }); - testWidgetsWithLeakTracking('whether we remember our scroll position', (WidgetTester tester) async { + testWidgets('whether we remember our scroll position', (WidgetTester tester) async { await performTest(tester, true); await performTest(tester, false); }); - testWidgetsWithLeakTracking('scroll alignment is honored by ensureVisible', (WidgetTester tester) async { + testWidgets('scroll alignment is honored by ensureVisible', (WidgetTester tester) async { final List<int> items = List<int>.generate(11, (int index) => index).toList(); final List<FocusNode> nodes = List<FocusNode>.generate(11, (int index) => FocusNode(debugLabel: 'Item ${index + 1}')).toList(); addTearDown(() { @@ -234,7 +233,7 @@ void main() { expect(controller.position.pixels, equals(0.0)); }); - testWidgetsWithLeakTracking('jumpTo recommends deferred loading', (WidgetTester tester) async { + testWidgets('jumpTo recommends deferred loading', (WidgetTester tester) async { int loadedWithDeferral = 0; int buildCount = 0; const double height = 500; diff --git a/packages/flutter/test/widgets/scroll_view_test.dart b/packages/flutter/test/widgets/scroll_view_test.dart index a957e715609..984b25c5834 100644 --- a/packages/flutter/test/widgets/scroll_view_test.dart +++ b/packages/flutter/test/widgets/scroll_view_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/services.dart' show LogicalKeyboardKey; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'states.dart'; @@ -69,7 +68,7 @@ Widget primaryScrollControllerBoilerplate({ required Widget child, required Scro } void main() { - testWidgetsWithLeakTracking('ListView control test', (WidgetTester tester) async { + testWidgets('ListView control test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -111,7 +110,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('ListView dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('ListView dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -149,7 +148,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('GridView.builder supports null items', (WidgetTester tester) async { + testWidgets('GridView.builder supports null items', (WidgetTester tester) async { await tester.pumpWidget(textFieldBoilerplate( child: GridView.builder( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( @@ -169,7 +168,7 @@ void main() { expect(find.text('item'), findsNWidgets(5)); }); - testWidgetsWithLeakTracking('ListView.builder supports null items', (WidgetTester tester) async { + testWidgets('ListView.builder supports null items', (WidgetTester tester) async { await tester.pumpWidget(textFieldBoilerplate( child: ListView.builder( itemCount: 42, @@ -186,7 +185,7 @@ void main() { expect(find.text('item'), findsNWidgets(5)); }); - testWidgetsWithLeakTracking('PageView supports null items in itemBuilder', (WidgetTester tester) async { + testWidgets('PageView supports null items in itemBuilder', (WidgetTester tester) async { final PageController controller = PageController(viewportFraction: 1 / 5); addTearDown(controller.dispose); @@ -207,7 +206,7 @@ void main() { expect(find.text('item'), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('ListView.separated supports null items in itemBuilder', (WidgetTester tester) async { + testWidgets('ListView.separated supports null items in itemBuilder', (WidgetTester tester) async { await tester.pumpWidget(textFieldBoilerplate( child: ListView.separated( itemCount: 42, @@ -228,7 +227,7 @@ void main() { expect(find.text('separator'), findsNWidgets(5)); }); - testWidgetsWithLeakTracking('ListView.builder dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('ListView.builder dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -267,7 +266,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('ListView.custom dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('ListView.custom dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -308,7 +307,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('ListView.separated dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('ListView.separated dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -348,7 +347,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('GridView dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('GridView dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -387,7 +386,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('GridView.builder dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('GridView.builder dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -427,7 +426,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('GridView.count dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('GridView.count dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -466,7 +465,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('GridView.extent dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('GridView.extent dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -505,7 +504,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('GridView.custom dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('GridView.custom dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -547,7 +546,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('ListView dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('ListView dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -584,7 +583,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('ListView.builder dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('ListView.builder dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -622,7 +621,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('ListView.custom dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('ListView.custom dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -662,7 +661,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('ListView.separated dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('ListView.separated dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -701,7 +700,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('GridView dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('GridView dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -739,7 +738,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('GridView.builder dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('GridView.builder dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -778,7 +777,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('GridView.count dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('GridView.count dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -816,7 +815,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('GridView.extent dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('GridView.extent dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -854,7 +853,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('GridView.custom dismiss keyboard manual test', (WidgetTester tester) async { + testWidgets('GridView.custom dismiss keyboard manual test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -895,7 +894,7 @@ void main() { expect(textField.focusNode!.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('ListView restart ballistic activity out of range', (WidgetTester tester) async { + testWidgets('ListView restart ballistic activity out of range', (WidgetTester tester) async { Widget buildListView(int n) { return Directionality( textDirection: TextDirection.ltr, @@ -925,7 +924,7 @@ void main() { expect(viewport.offset.pixels, equals(2400.0)); }); - testWidgetsWithLeakTracking('CustomScrollView control test', (WidgetTester tester) async { + testWidgets('CustomScrollView control test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -973,7 +972,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('CustomScrollView dismiss keyboard onDrag test', (WidgetTester tester) async { + testWidgets('CustomScrollView dismiss keyboard onDrag test', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { @@ -1017,7 +1016,7 @@ void main() { expect(textField.focusNode!.hasFocus, isFalse); }); - testWidgetsWithLeakTracking('Can jumpTo during drag', (WidgetTester tester) async { + testWidgets('Can jumpTo during drag', (WidgetTester tester) async { final List<Type> log = <Type>[]; final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -1089,12 +1088,12 @@ void main() { ); }); - testWidgetsWithLeakTracking('Vertical CustomScrollViews are not primary by default', (WidgetTester tester) async { + testWidgets('Vertical CustomScrollViews are not primary by default', (WidgetTester tester) async { const CustomScrollView view = CustomScrollView(); expect(view.primary, isNull); }); - testWidgetsWithLeakTracking('Vertical CustomScrollViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { + testWidgets('Vertical CustomScrollViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -1104,7 +1103,7 @@ void main() { expect(controller.hasClients, isTrue); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking("Vertical CustomScrollViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { + testWidgets("Vertical CustomScrollViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -1114,12 +1113,12 @@ void main() { expect(controller.hasClients, isFalse); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Vertical ListViews are not primary by default', (WidgetTester tester) async { + testWidgets('Vertical ListViews are not primary by default', (WidgetTester tester) async { final ListView view = ListView(); expect(view.primary, isNull); }); - testWidgetsWithLeakTracking('Vertical ListViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { + testWidgets('Vertical ListViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -1129,7 +1128,7 @@ void main() { expect(controller.hasClients, isTrue); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking("Vertical ListViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { + testWidgets("Vertical ListViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -1139,12 +1138,12 @@ void main() { expect(controller.hasClients, isFalse); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Vertical GridViews are not primary by default', (WidgetTester tester) async { + testWidgets('Vertical GridViews are not primary by default', (WidgetTester tester) async { final GridView view = GridView.count(crossAxisCount: 1); expect(view.primary, isNull); }); - testWidgetsWithLeakTracking('Vertical GridViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { + testWidgets('Vertical GridViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -1154,7 +1153,7 @@ void main() { expect(controller.hasClients, isTrue); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking("Vertical GridViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { + testWidgets("Vertical GridViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -1164,7 +1163,7 @@ void main() { expect(controller.hasClients, isFalse); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Horizontal CustomScrollViews are non-primary by default', (WidgetTester tester) async { + testWidgets('Horizontal CustomScrollViews are non-primary by default', (WidgetTester tester) async { final ScrollController controller1 = ScrollController(); addTearDown(controller1.dispose); final ScrollController controller2 = ScrollController(); @@ -1179,7 +1178,7 @@ void main() { expect(controller1.hasClients, isFalse); }); - testWidgetsWithLeakTracking('Horizontal ListViews are non-primary by default', (WidgetTester tester) async { + testWidgets('Horizontal ListViews are non-primary by default', (WidgetTester tester) async { final ScrollController controller1 = ScrollController(); addTearDown(controller1.dispose); final ScrollController controller2 = ScrollController(); @@ -1194,7 +1193,7 @@ void main() { expect(controller1.hasClients, isFalse); }); - testWidgetsWithLeakTracking('Horizontal GridViews are non-primary by default', (WidgetTester tester) async { + testWidgets('Horizontal GridViews are non-primary by default', (WidgetTester tester) async { final ScrollController controller1 = ScrollController(); addTearDown(controller1.dispose); final ScrollController controller2 = ScrollController(); @@ -1210,7 +1209,7 @@ void main() { expect(controller1.hasClients, isFalse); }); - testWidgetsWithLeakTracking('CustomScrollViews with controllers are non-primary by default', (WidgetTester tester) async { + testWidgets('CustomScrollViews with controllers are non-primary by default', (WidgetTester tester) async { final ScrollController controller1 = ScrollController(); addTearDown(controller1.dispose); final ScrollController controller2 = ScrollController(); @@ -1224,7 +1223,7 @@ void main() { expect(controller1.hasClients, isFalse); }); - testWidgetsWithLeakTracking('ListViews with controllers are non-primary by default', (WidgetTester tester) async { + testWidgets('ListViews with controllers are non-primary by default', (WidgetTester tester) async { final ScrollController controller1 = ScrollController(); addTearDown(controller1.dispose); final ScrollController controller2 = ScrollController(); @@ -1238,7 +1237,7 @@ void main() { expect(controller1.hasClients, isFalse); }); - testWidgetsWithLeakTracking('GridViews with controllers are non-primary by default', (WidgetTester tester) async { + testWidgets('GridViews with controllers are non-primary by default', (WidgetTester tester) async { final ScrollController controller1 = ScrollController(); addTearDown(controller1.dispose); final ScrollController controller2 = ScrollController(); @@ -1253,7 +1252,7 @@ void main() { expect(controller1.hasClients, isFalse); }); - testWidgetsWithLeakTracking('CustomScrollView sets PrimaryScrollController when primary', (WidgetTester tester) async { + testWidgets('CustomScrollView sets PrimaryScrollController when primary', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); await tester.pumpWidget( @@ -1269,7 +1268,7 @@ void main() { expect(scrollable.controller, primaryScrollController); }); - testWidgetsWithLeakTracking('ListView sets PrimaryScrollController when primary', (WidgetTester tester) async { + testWidgets('ListView sets PrimaryScrollController when primary', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); await tester.pumpWidget( @@ -1285,7 +1284,7 @@ void main() { expect(scrollable.controller, primaryScrollController); }); - testWidgetsWithLeakTracking('GridView sets PrimaryScrollController when primary', (WidgetTester tester) async { + testWidgets('GridView sets PrimaryScrollController when primary', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); await tester.pumpWidget( @@ -1301,7 +1300,7 @@ void main() { expect(scrollable.controller, primaryScrollController); }); - testWidgetsWithLeakTracking('Nested scrollables have a null PrimaryScrollController', (WidgetTester tester) async { + testWidgets('Nested scrollables have a null PrimaryScrollController', (WidgetTester tester) async { const Key innerKey = Key('inner'); final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); @@ -1332,27 +1331,27 @@ void main() { expect(innerScrollable.controller, isNull); }); - testWidgetsWithLeakTracking('Primary ListViews are always scrollable', (WidgetTester tester) async { + testWidgets('Primary ListViews are always scrollable', (WidgetTester tester) async { final ListView view = ListView(primary: true); expect(view.physics, isA<AlwaysScrollableScrollPhysics>()); }); - testWidgetsWithLeakTracking('Non-primary ListViews are not always scrollable', (WidgetTester tester) async { + testWidgets('Non-primary ListViews are not always scrollable', (WidgetTester tester) async { final ListView view = ListView(primary: false); expect(view.physics, isNot(isA<AlwaysScrollableScrollPhysics>())); }); - testWidgetsWithLeakTracking('Defaulting-to-primary ListViews are always scrollable', (WidgetTester tester) async { + testWidgets('Defaulting-to-primary ListViews are always scrollable', (WidgetTester tester) async { final ListView view = ListView(); expect(view.physics, isA<AlwaysScrollableScrollPhysics>()); }); - testWidgetsWithLeakTracking('Defaulting-to-not-primary ListViews are not always scrollable', (WidgetTester tester) async { + testWidgets('Defaulting-to-not-primary ListViews are not always scrollable', (WidgetTester tester) async { final ListView view = ListView(scrollDirection: Axis.horizontal); expect(view.physics, isNot(isA<AlwaysScrollableScrollPhysics>())); }); - testWidgetsWithLeakTracking('primary:true leads to scrolling', (WidgetTester tester) async { + testWidgets('primary:true leads to scrolling', (WidgetTester tester) async { bool scrolled = false; await tester.pumpWidget( Directionality( @@ -1372,7 +1371,7 @@ void main() { expect(scrolled, isTrue); }); - testWidgetsWithLeakTracking('primary:false leads to no scrolling', (WidgetTester tester) async { + testWidgets('primary:false leads to no scrolling', (WidgetTester tester) async { bool scrolled = false; await tester.pumpWidget( Directionality( @@ -1392,7 +1391,7 @@ void main() { expect(scrolled, isFalse); }); - testWidgetsWithLeakTracking('physics:AlwaysScrollableScrollPhysics actually overrides primary:false default behavior', (WidgetTester tester) async { + testWidgets('physics:AlwaysScrollableScrollPhysics actually overrides primary:false default behavior', (WidgetTester tester) async { bool scrolled = false; await tester.pumpWidget( Directionality( @@ -1413,7 +1412,7 @@ void main() { expect(scrolled, isTrue); }); - testWidgetsWithLeakTracking('physics:ScrollPhysics actually overrides primary:true default behavior', (WidgetTester tester) async { + testWidgets('physics:ScrollPhysics actually overrides primary:true default behavior', (WidgetTester tester) async { bool scrolled = false; await tester.pumpWidget( Directionality( @@ -1434,7 +1433,7 @@ void main() { expect(scrolled, isFalse); }); - testWidgetsWithLeakTracking('separatorBuilder must return something', (WidgetTester tester) async { + testWidgets('separatorBuilder must return something', (WidgetTester tester) async { const List<String> listOfValues = <String>['ALPHA', 'BETA', 'GAMMA', 'DELTA']; Widget buildFrame(Widget firstSeparator) { @@ -1462,7 +1461,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('when itemBuilder throws, creates Error Widget', (WidgetTester tester) async { + testWidgets('when itemBuilder throws, creates Error Widget', (WidgetTester tester) async { const List<String> listOfValues = <String>['ALPHA', 'BETA', 'GAMMA', 'DELTA']; Widget buildFrame(bool throwOnFirstItem) { @@ -1493,7 +1492,7 @@ void main() { expect(finder, findsOneWidget); }); - testWidgetsWithLeakTracking('when separatorBuilder throws, creates ErrorWidget', (WidgetTester tester) async { + testWidgets('when separatorBuilder throws, creates ErrorWidget', (WidgetTester tester) async { const List<String> listOfValues = <String>['ALPHA', 'BETA', 'GAMMA', 'DELTA']; const Key key = Key('list'); @@ -1529,14 +1528,14 @@ void main() { expect(finder, findsOneWidget); }); - testWidgetsWithLeakTracking('ListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('ListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { expect(() => ListView( itemExtent: 100, prototypeItem: const SizedBox(), ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ListView.builder asserts on negative childCount', (WidgetTester tester) async { + testWidgets('ListView.builder asserts on negative childCount', (WidgetTester tester) async { expect(() => ListView.builder( itemBuilder: (BuildContext context, int index) { return const SizedBox(); @@ -1545,7 +1544,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ListView.builder asserts on negative semanticChildCount', (WidgetTester tester) async { + testWidgets('ListView.builder asserts on negative semanticChildCount', (WidgetTester tester) async { expect(() => ListView.builder( itemBuilder: (BuildContext context, int index) { return const SizedBox(); @@ -1555,7 +1554,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ListView.builder asserts on nonsensical childCount/semanticChildCount', (WidgetTester tester) async { + testWidgets('ListView.builder asserts on nonsensical childCount/semanticChildCount', (WidgetTester tester) async { expect(() => ListView.builder( itemBuilder: (BuildContext context, int index) { return const SizedBox(); @@ -1565,7 +1564,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ListView.builder asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('ListView.builder asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { expect(() => ListView.builder( itemBuilder: (BuildContext context, int index) { return const SizedBox(); @@ -1575,7 +1574,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('ListView.custom asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { + testWidgets('ListView.custom asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { expect(() => ListView.custom( childrenDelegate: SliverChildBuilderDelegate( (BuildContext context, int index) { @@ -1587,7 +1586,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('PrimaryScrollController provides fallback ScrollActions', (WidgetTester tester) async { + testWidgets('PrimaryScrollController provides fallback ScrollActions', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: CustomScrollView( @@ -1631,7 +1630,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Fallback ScrollActions handle too many positions with error message', (WidgetTester tester) async { + testWidgets('Fallback ScrollActions handle too many positions with error message', (WidgetTester tester) async { Widget getScrollView() { return SizedBox( width: 400.0, @@ -1680,7 +1679,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('if itemExtent is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { + testWidgets('if itemExtent is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; await tester.pumpWidget( @@ -1718,7 +1717,7 @@ void main() { expect(item2Height, 30.0); }); - testWidgetsWithLeakTracking('if prototypeItem is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { + testWidgets('if prototypeItem is non-null, children have same extent in the scroll direction', (WidgetTester tester) async { final List<int> numbers = <int>[0,1,2]; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/scrollable_animations_test.dart b/packages/flutter/test/widgets/scrollable_animations_test.dart index 041d2496561..28d9d5183ba 100644 --- a/packages/flutter/test/widgets/scrollable_animations_test.dart +++ b/packages/flutter/test/widgets/scrollable_animations_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Does not animate if already at target position', (WidgetTester tester) async { + testWidgets('Does not animate if already at target position', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -29,7 +28,7 @@ void main() { expect(controller.position.pixels, currentPosition); }); - testWidgetsWithLeakTracking('Does not animate if already at target position within tolerance', (WidgetTester tester) async { + testWidgets('Does not animate if already at target position within tolerance', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -53,7 +52,7 @@ void main() { expect(controller.position.pixels, targetPosition); }); - testWidgetsWithLeakTracking('Animates if going to a position outside of tolerance', (WidgetTester tester) async { + testWidgets('Animates if going to a position outside of tolerance', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/scrollable_dispose_test.dart b/packages/flutter/test/widgets/scrollable_dispose_test.dart index 9daef2712a0..382d5ebe25f 100644 --- a/packages/flutter/test/widgets/scrollable_dispose_test.dart +++ b/packages/flutter/test/widgets/scrollable_dispose_test.dart @@ -4,12 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; void main() { - testWidgetsWithLeakTracking('simultaneously dispose a widget and end the scroll animation', (WidgetTester tester) async { + testWidgets('simultaneously dispose a widget and end the scroll animation', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -27,7 +26,7 @@ void main() { await tester.pump(const Duration(hours: 5)); }); - testWidgetsWithLeakTracking('Disposing a (nested) Scrollable while holding in overscroll does not crash', (WidgetTester tester) async { + testWidgets('Disposing a (nested) Scrollable while holding in overscroll does not crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/27707. final ScrollController controller = ScrollController(); diff --git a/packages/flutter/test/widgets/scrollable_fling_test.dart b/packages/flutter/test/widgets/scrollable_fling_test.dart index 29dc51b0933..3d521377007 100644 --- a/packages/flutter/test/widgets/scrollable_fling_test.dart +++ b/packages/flutter/test/widgets/scrollable_fling_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const TextStyle testFont = TextStyle( color: Color(0xFF00FF00), @@ -32,7 +31,7 @@ Future<void> pumpTest(WidgetTester tester, TargetPlatform platform) async { const double dragOffset = 213.82; void main() { - testWidgetsWithLeakTracking('Flings on different platforms', (WidgetTester tester) async { + testWidgets('Flings on different platforms', (WidgetTester tester) async { double getCurrentOffset() { return tester.state<ScrollableState>(find.byType(Scrollable)).position.pixels; } @@ -97,7 +96,7 @@ void main() { expect(linuxResult, equals(androidResult)); }); - testWidgetsWithLeakTracking('fling and tap to stop', (WidgetTester tester) async { + testWidgets('fling and tap to stop', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( Directionality( @@ -127,7 +126,7 @@ void main() { expect(log, equals(<String>['tap 21', 'tap 35'])); }); - testWidgetsWithLeakTracking('fling and wait and tap', (WidgetTester tester) async { + testWidgets('fling and wait and tap', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/widgets/scrollable_grid_test.dart b/packages/flutter/test/widgets/scrollable_grid_test.dart index 0f404f4188b..86c4dfaeb20 100644 --- a/packages/flutter/test/widgets/scrollable_grid_test.dart +++ b/packages/flutter/test/widgets/scrollable_grid_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('GridView default control', (WidgetTester tester) async { + testWidgets('GridView default control', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -21,7 +20,7 @@ void main() { }); // Tests https://github.com/flutter/flutter/issues/5522 - testWidgetsWithLeakTracking('GridView displays correct children with nonzero padding', (WidgetTester tester) async { + testWidgets('GridView displays correct children with nonzero padding', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.fromLTRB(0.0, 100.0, 0.0, 0.0); final Widget testWidget = Directionality( @@ -77,7 +76,7 @@ void main() { expect(find.text('4'), findsNothing); }); - testWidgetsWithLeakTracking('GridView.count() fixed itemExtent, scroll to end, append, scroll', (WidgetTester tester) async { + testWidgets('GridView.count() fixed itemExtent, scroll to end, append, scroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/9506 Widget buildFrame(int itemCount) { return Directionality( diff --git a/packages/flutter/test/widgets/scrollable_helpers_test.dart b/packages/flutter/test/widgets/scrollable_helpers_test.dart index 85770cc231a..d687567709b 100644 --- a/packages/flutter/test/widgets/scrollable_helpers_test.dart +++ b/packages/flutter/test/widgets/scrollable_helpers_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; final LogicalKeyboardKey modifierKey = defaultTargetPlatform == TargetPlatform.macOS ? LogicalKeyboardKey.metaLeft @@ -90,7 +89,7 @@ void main() { }); }); - testWidgetsWithLeakTracking("Keyboard scrolling doesn't happen if scroll physics are set to NeverScrollableScrollPhysics", (WidgetTester tester) async { + testWidgets("Keyboard scrolling doesn't happen if scroll physics are set to NeverScrollableScrollPhysics", (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -158,7 +157,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Vertical scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { + testWidgets('Vertical scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -231,7 +230,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Horizontal scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { + testWidgets('Horizontal scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -293,7 +292,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Horizontal scrollables are scrolled the correct direction in RTL locales.', (WidgetTester tester) async { + testWidgets('Horizontal scrollables are scrolled the correct direction in RTL locales.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -358,7 +357,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Reversed vertical scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { + testWidgets('Reversed vertical scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final FocusNode focusNode = FocusNode(debugLabel: 'SizedBox'); @@ -435,7 +434,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Reversed horizontal scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { + testWidgets('Reversed horizontal scrollables are scrolled when activated via keyboard.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final FocusNode focusNode = FocusNode(debugLabel: 'SizedBox'); @@ -497,7 +496,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Custom scrollables with a center sliver are scrolled when activated via keyboard.', (WidgetTester tester) async { + testWidgets('Custom scrollables with a center sliver are scrolled when activated via keyboard.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final List<String> items = List<String>.generate(20, (int index) => 'Item $index'); @@ -570,7 +569,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Can scroll using intents only', (WidgetTester tester) async { + testWidgets('Can scroll using intents only', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: ListView( diff --git a/packages/flutter/test/widgets/scrollable_in_overlay_test.dart b/packages/flutter/test/widgets/scrollable_in_overlay_test.dart index 2207c762bcf..505efa37cf2 100644 --- a/packages/flutter/test/widgets/scrollable_in_overlay_test.dart +++ b/packages/flutter/test/widgets/scrollable_in_overlay_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { test('Can dispose ScrollPosition when hasPixels is false', () { @@ -19,7 +18,7 @@ void main() { position.dispose(); // Should not throw/assert. }); - testWidgetsWithLeakTracking('scrollable in hidden overlay does not crash when unhidden', (WidgetTester tester) async { + testWidgets('scrollable in hidden overlay does not crash when unhidden', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/44269. final TabController controller = TabController(vsync: const TestVSync(), length: 1); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart b/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart index 15bef69c25d..e956f34bd9a 100644 --- a/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart +++ b/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const List<int> items = <int>[0, 1, 2, 3, 4, 5]; void main() { - testWidgetsWithLeakTracking('Tap item after scroll - horizontal', (WidgetTester tester) async { + testWidgets('Tap item after scroll - horizontal', (WidgetTester tester) async { final List<int> tapped = <int>[]; await tester.pumpWidget( Directionality( @@ -52,7 +51,7 @@ void main() { expect(tapped, equals(<int>[2])); }); - testWidgetsWithLeakTracking('Tap item after scroll - vertical', (WidgetTester tester) async { + testWidgets('Tap item after scroll - vertical', (WidgetTester tester) async { final List<int> tapped = <int>[]; await tester.pumpWidget( Directionality( @@ -95,7 +94,7 @@ void main() { expect(tapped, equals(<int>[1])); // the center of the third item is off-screen so it shouldn't get hit }); - testWidgetsWithLeakTracking('Padding scroll anchor start', (WidgetTester tester) async { + testWidgets('Padding scroll anchor start', (WidgetTester tester) async { final List<int> tapped = <int>[]; await tester.pumpWidget( @@ -127,7 +126,7 @@ void main() { expect(tapped, equals(<int>[0, 1, 1])); }); - testWidgetsWithLeakTracking('Padding scroll anchor end', (WidgetTester tester) async { + testWidgets('Padding scroll anchor end', (WidgetTester tester) async { final List<int> tapped = <int>[]; await tester.pumpWidget( @@ -160,7 +159,7 @@ void main() { expect(tapped, equals(<int>[0, 1, 1])); }); - testWidgetsWithLeakTracking('Tap immediately following clamped overscroll', (WidgetTester tester) async { + testWidgets('Tap immediately following clamped overscroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/5709 final List<int> tapped = <int>[]; diff --git a/packages/flutter/test/widgets/scrollable_of_test.dart b/packages/flutter/test/widgets/scrollable_of_test.dart index 7c8d5a6735d..1b7c20702c1 100644 --- a/packages/flutter/test/widgets/scrollable_of_test.dart +++ b/packages/flutter/test/widgets/scrollable_of_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class ScrollPositionListener extends StatefulWidget { const ScrollPositionListener({ super.key, required this.child, required this.log}); @@ -124,7 +123,7 @@ class TestChildState extends State<TestChild> { } void main() { - testWidgetsWithLeakTracking('Scrollable.of() dependent rebuilds when Scrollable position changes', (WidgetTester tester) async { + testWidgets('Scrollable.of() dependent rebuilds when Scrollable position changes', (WidgetTester tester) async { late String logValue; final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -165,7 +164,7 @@ void main() { expect(logValue, 'listener 400.0'); }); - testWidgetsWithLeakTracking('Scrollable.of() is possible using ScrollNotification context', (WidgetTester tester) async { + testWidgets('Scrollable.of() is possible using ScrollNotification context', (WidgetTester tester) async { late ScrollNotification notification; await tester.pumpWidget(NotificationListener<ScrollNotification>( @@ -189,7 +188,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Static Scrollable methods can target a specific axis', (WidgetTester tester) async { + testWidgets('Static Scrollable methods can target a specific axis', (WidgetTester tester) async { final TestScrollController horizontalController = TestScrollController(deferLoading: true); addTearDown(horizontalController.dispose); final TestScrollController verticalController = TestScrollController(deferLoading: false); @@ -226,7 +225,7 @@ void main() { expect(foundRecommendation, isTrue); }); - testWidgetsWithLeakTracking('Axis targeting scrollables establishes the correct dependencies', (WidgetTester tester) async { + testWidgets('Axis targeting scrollables establishes the correct dependencies', (WidgetTester tester) async { final GlobalKey<TestScrollableState> verticalKey = GlobalKey<TestScrollableState>(); final GlobalKey<TestChildState> childKey = GlobalKey<TestChildState>(); diff --git a/packages/flutter/test/widgets/scrollable_restoration_test.dart b/packages/flutter/test/widgets/scrollable_restoration_test.dart index 2aac5a4148e..fb5e251941d 100644 --- a/packages/flutter/test/widgets/scrollable_restoration_test.dart +++ b/packages/flutter/test/widgets/scrollable_restoration_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('CustomScrollView restoration', (WidgetTester tester) async { + testWidgets('CustomScrollView restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: CustomScrollView( @@ -34,7 +33,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('ListView restoration', (WidgetTester tester) async { + testWidgets('ListView restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListView( @@ -54,7 +53,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('ListView.builder restoration', (WidgetTester tester) async { + testWidgets('ListView.builder restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListView.builder( @@ -71,7 +70,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('ListView.separated restoration', (WidgetTester tester) async { + testWidgets('ListView.separated restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListView.separated( @@ -90,7 +89,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('ListView.custom restoration', (WidgetTester tester) async { + testWidgets('ListView.custom restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListView.custom( @@ -112,7 +111,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('GridView restoration', (WidgetTester tester) async { + testWidgets('GridView restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: GridView( @@ -133,7 +132,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('GridView.builder restoration', (WidgetTester tester) async { + testWidgets('GridView.builder restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: GridView.builder( @@ -151,7 +150,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('GridView.custom restoration', (WidgetTester tester) async { + testWidgets('GridView.custom restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: GridView.custom( @@ -174,7 +173,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('GridView.count restoration', (WidgetTester tester) async { + testWidgets('GridView.count restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: GridView.count( @@ -195,7 +194,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('GridView.extent restoration', (WidgetTester tester) async { + testWidgets('GridView.extent restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: GridView.extent( @@ -216,7 +215,7 @@ void main() { await restoreScrollAndVerify(tester); }); - testWidgetsWithLeakTracking('SingleChildScrollView restoration', (WidgetTester tester) async { + testWidgets('SingleChildScrollView restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: SingleChildScrollView( @@ -263,7 +262,7 @@ void main() { expect(tester.getTopLeft(find.text('Tile 1')), const Offset(0, -475)); }); - testWidgetsWithLeakTracking('PageView restoration', (WidgetTester tester) async { + testWidgets('PageView restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: PageView( @@ -279,7 +278,7 @@ void main() { await pageViewScrollAndRestore(tester); }); - testWidgetsWithLeakTracking('PageView.builder restoration', (WidgetTester tester) async { + testWidgets('PageView.builder restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: PageView.builder( @@ -295,7 +294,7 @@ void main() { await pageViewScrollAndRestore(tester); }); - testWidgetsWithLeakTracking('PageView.custom restoration', (WidgetTester tester) async { + testWidgets('PageView.custom restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: PageView.custom( @@ -316,7 +315,7 @@ void main() { await pageViewScrollAndRestore(tester); }); - testWidgetsWithLeakTracking('ListWheelScrollView restoration', (WidgetTester tester) async { + testWidgets('ListWheelScrollView restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListWheelScrollView( @@ -333,7 +332,7 @@ void main() { await restoreScrollAndVerify(tester, secondOffset: 542); }); - testWidgetsWithLeakTracking('ListWheelScrollView.useDelegate restoration', (WidgetTester tester) async { + testWidgets('ListWheelScrollView.useDelegate restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListWheelScrollView.useDelegate( @@ -355,7 +354,7 @@ void main() { await restoreScrollAndVerify(tester, secondOffset: 542); }); - testWidgetsWithLeakTracking('NestedScrollView restoration', (WidgetTester tester) async { + testWidgets('NestedScrollView restoration', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: TestHarness( @@ -423,7 +422,7 @@ void main() { expect(find.text('Tile 10'), findsOneWidget); }); - testWidgetsWithLeakTracking('RestorationData is flushed even if no frame is scheduled', (WidgetTester tester) async { + testWidgets('RestorationData is flushed even if no frame is scheduled', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: ListView( diff --git a/packages/flutter/test/widgets/scrollable_selection_test.dart b/packages/flutter/test/widgets/scrollable_selection_test.dart index 043b484bff9..5f50551ed43 100644 --- a/packages/flutter/test/widgets/scrollable_selection_test.dart +++ b/packages/flutter/test/widgets/scrollable_selection_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'clipboard_utils.dart'; import 'keyboard_utils.dart'; @@ -37,7 +36,7 @@ void main() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, null); }); - testWidgetsWithLeakTracking('mouse can select multiple widgets', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: SelectionArea( selectionControls: materialTextSelectionControls, @@ -75,7 +74,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('mouse can select multiple widgets - horizontal', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets - horizontal', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: SelectionArea( selectionControls: materialTextSelectionControls, @@ -108,7 +107,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('mouse can select multiple widgets on double-click drag', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets on double-click drag', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: SelectionArea( selectionControls: materialTextSelectionControls, @@ -152,7 +151,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582. - testWidgetsWithLeakTracking('mouse can select multiple widgets on double-click drag - horizontal', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets on double-click drag - horizontal', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: SelectionArea( selectionControls: materialTextSelectionControls, @@ -191,7 +190,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582. - testWidgetsWithLeakTracking('select to scroll forward', (WidgetTester tester) async { + testWidgets('select to scroll forward', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -241,7 +240,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('select to scroll works for small scrollable', (WidgetTester tester) async { + testWidgets('select to scroll works for small scrollable', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -288,7 +287,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('select to scroll backward', (WidgetTester tester) async { + testWidgets('select to scroll backward', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -337,7 +336,7 @@ void main() { expect(paragraph3.selections[0], const TextSelection(baseOffset: 6, extentOffset: 0)); }); - testWidgetsWithLeakTracking('select to scroll forward - horizontal', (WidgetTester tester) async { + testWidgets('select to scroll forward - horizontal', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -386,7 +385,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('select to scroll backward - horizontal', (WidgetTester tester) async { + testWidgets('select to scroll backward - horizontal', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -436,7 +435,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('preserve selection when out of view.', (WidgetTester tester) async { + testWidgets('preserve selection when out of view.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -484,7 +483,7 @@ void main() { expect(paragraph50.selections[0], const TextSelection(baseOffset: 2, extentOffset: 4)); }); - testWidgetsWithLeakTracking('can select all non-Apple', (WidgetTester tester) async { + testWidgets('can select all non-Apple', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); await tester.pumpWidget(MaterialApp( @@ -511,7 +510,7 @@ void main() { expect(find.text('Item 13'), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.windows, TargetPlatform.linux, TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('can select all - Apple', (WidgetTester tester) async { + testWidgets('can select all - Apple', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); await tester.pumpWidget(MaterialApp( @@ -538,7 +537,7 @@ void main() { expect(find.text('Item 13'), findsNothing); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('select to scroll by dragging selection handles forward', (WidgetTester tester) async { + testWidgets('select to scroll by dragging selection handles forward', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -597,7 +596,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('select to scroll by dragging start selection handle stops scroll when released', (WidgetTester tester) async { + testWidgets('select to scroll by dragging start selection handle stops scroll when released', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -653,7 +652,7 @@ void main() { expect(controller.offset, previousOffset); }); - testWidgetsWithLeakTracking('select to scroll by dragging end selection handle stops scroll when released', (WidgetTester tester) async { + testWidgets('select to scroll by dragging end selection handle stops scroll when released', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -708,7 +707,7 @@ void main() { expect(controller.offset, previousOffset); }); - testWidgetsWithLeakTracking('keyboard selection should auto scroll - vertical', (WidgetTester tester) async { + testWidgets('keyboard selection should auto scroll - vertical', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); final ScrollController controller = ScrollController(); @@ -773,7 +772,7 @@ void main() { expect(controller.offset, 72.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('keyboard selection should auto scroll - vertical reversed', (WidgetTester tester) async { + testWidgets('keyboard selection should auto scroll - vertical reversed', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); final ScrollController controller = ScrollController(); @@ -839,7 +838,7 @@ void main() { expect(controller.offset, 72.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('keyboard selection should auto scroll - horizontal', (WidgetTester tester) async { + testWidgets('keyboard selection should auto scroll - horizontal', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); final ScrollController controller = ScrollController(); @@ -887,7 +886,7 @@ void main() { expect(controller.offset, 352.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('keyboard selection should auto scroll - horizontal reversed', (WidgetTester tester) async { + testWidgets('keyboard selection should auto scroll - horizontal reversed', (WidgetTester tester) async { final FocusNode node = FocusNode(); addTearDown(node.dispose); final ScrollController controller = ScrollController(); @@ -945,7 +944,7 @@ void main() { }, variant: TargetPlatformVariant.all()); group('Complex cases', () { - testWidgetsWithLeakTracking('selection starts outside of the scrollable', (WidgetTester tester) async { + testWidgets('selection starts outside of the scrollable', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(MaterialApp( @@ -990,7 +989,7 @@ void main() { expect(controller.offset, 1000.0); }); - testWidgetsWithLeakTracking('nested scrollables keep selection alive', (WidgetTester tester) async { + testWidgets('nested scrollables keep selection alive', (WidgetTester tester) async { final ScrollController outerController = ScrollController(); addTearDown(outerController.dispose); final ScrollController innerController = ScrollController(); @@ -1056,7 +1055,7 @@ void main() { expect(innerParagraph24.selections[0], const TextSelection(baseOffset: 0, extentOffset: 2)); }); - testWidgetsWithLeakTracking('can copy off screen selection - Apple', (WidgetTester tester) async { + testWidgets('can copy off screen selection - Apple', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final FocusNode focusNode = FocusNode(); @@ -1099,7 +1098,7 @@ void main() { expect(clipboardData['text'], 'em 0It'); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('can copy off screen selection - non-Apple', (WidgetTester tester) async { + testWidgets('can copy off screen selection - non-Apple', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final FocusNode focusNode = FocusNode(); diff --git a/packages/flutter/test/widgets/scrollable_semantics_test.dart b/packages/flutter/test/widgets/scrollable_semantics_test.dart index f9e2d1679e8..c8486ff97ad 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -17,7 +16,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('scrollable exposes the correct semantic actions', (WidgetTester tester) async { + testWidgets('scrollable exposes the correct semantic actions', (WidgetTester tester) async { semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( @@ -43,7 +42,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('showOnScreen works in scrollable', (WidgetTester tester) async { + testWidgets('showOnScreen works in scrollable', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation const double kItemHeight = 40.0; @@ -82,7 +81,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('showOnScreen works with pinned app bar and sliver list', (WidgetTester tester) async { + testWidgets('showOnScreen works with pinned app bar and sliver list', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation const double kItemHeight = 100.0; @@ -145,7 +144,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('showOnScreen works with pinned app bar and individual slivers', (WidgetTester tester) async { + testWidgets('showOnScreen works with pinned app bar and individual slivers', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation const double kItemHeight = 100.0; @@ -214,7 +213,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('correct scrollProgress', (WidgetTester tester) async { + testWidgets('correct scrollProgress', (WidgetTester tester) async { semantics = SemanticsTester(tester); await tester.pumpWidget(Directionality( @@ -257,7 +256,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('correct scrollProgress for unbound', (WidgetTester tester) async { + testWidgets('correct scrollProgress for unbound', (WidgetTester tester) async { semantics = SemanticsTester(tester); await tester.pumpWidget(Directionality( @@ -307,7 +306,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics tree is populated mid-scroll', (WidgetTester tester) async { + testWidgets('Semantics tree is populated mid-scroll', (WidgetTester tester) async { semantics = SemanticsTester(tester); final List<Widget> children = List<Widget>.generate(80, (int i) => SizedBox( @@ -332,7 +331,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Can toggle semantics on, off, on without crash', (WidgetTester tester) async { + testWidgets('Can toggle semantics on, off, on without crash', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -438,7 +437,7 @@ void main() { }); - testWidgetsWithLeakTracking('brings item above leading edge to leading edge', (WidgetTester tester) async { + testWidgets('brings item above leading edge to leading edge', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation await tester.pumpWidget(widgetUnderTest); @@ -454,7 +453,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('brings item below trailing edge to trailing edge', (WidgetTester tester) async { + testWidgets('brings item below trailing edge to trailing edge', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation await tester.pumpWidget(widgetUnderTest); @@ -470,7 +469,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('does not change position of items already fully on-screen', (WidgetTester tester) async { + testWidgets('does not change position of items already fully on-screen', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation await tester.pumpWidget(widgetUnderTest); @@ -546,7 +545,7 @@ void main() { scrollController.dispose(); }); - testWidgetsWithLeakTracking('brings item above leading edge to leading edge', (WidgetTester tester) async { + testWidgets('brings item above leading edge to leading edge', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation await tester.pumpWidget(widgetUnderTest); @@ -562,7 +561,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('brings item below trailing edge to trailing edge', (WidgetTester tester) async { + testWidgets('brings item below trailing edge to trailing edge', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation await tester.pumpWidget(widgetUnderTest); @@ -578,7 +577,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('does not change position of items already fully on-screen', (WidgetTester tester) async { + testWidgets('does not change position of items already fully on-screen', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation await tester.pumpWidget(widgetUnderTest); @@ -596,7 +595,7 @@ void main() { }); - testWidgetsWithLeakTracking('transform of inner node from useTwoPaneSemantics scrolls correctly with nested scrollables', (WidgetTester tester) async { + testWidgets('transform of inner node from useTwoPaneSemantics scrolls correctly with nested scrollables', (WidgetTester tester) async { semantics = SemanticsTester(tester); // enables semantics tree generation // Context: https://github.com/flutter/flutter/issues/61631 diff --git a/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart b/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart index 8e35b357982..96a41661f15 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Traversal Order of SliverList', (WidgetTester tester) async { + testWidgets('Traversal Order of SliverList', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 3000.0); @@ -186,7 +185,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Traversal Order of SliverFixedExtentList', (WidgetTester tester) async { + testWidgets('Traversal Order of SliverFixedExtentList', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 3000.0); @@ -328,7 +327,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Traversal Order of SliverGrid', (WidgetTester tester) async { + testWidgets('Traversal Order of SliverGrid', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 1600.0); @@ -459,7 +458,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Traversal Order of List of individual slivers', (WidgetTester tester) async { + testWidgets('Traversal Order of List of individual slivers', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 3000.0); @@ -598,7 +597,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Traversal Order of in a SingleChildScrollView', (WidgetTester tester) async { + testWidgets('Traversal Order of in a SingleChildScrollView', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 3000.0); @@ -687,7 +686,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Traversal Order with center child', (WidgetTester tester) async { + testWidgets('Traversal Order with center child', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Semantics( diff --git a/packages/flutter/test/widgets/scrollable_test.dart b/packages/flutter/test/widgets/scrollable_test.dart index 5d5d8f08266..f6a73381793 100644 --- a/packages/flutter/test/widgets/scrollable_test.dart +++ b/packages/flutter/test/widgets/scrollable_test.dart @@ -10,7 +10,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -110,7 +109,7 @@ void resetScrollOffset(WidgetTester tester) { } void main() { - testWidgetsWithLeakTracking('Flings on different platforms', (WidgetTester tester) async { + testWidgets('Flings on different platforms', (WidgetTester tester) async { await pumpTest(tester, TargetPlatform.android); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); expect(getScrollOffset(tester), dragOffset); @@ -146,7 +145,7 @@ void main() { expect(macOSResult, lessThan(iOSResult)); // iOS is slipperier than macOS }); - testWidgetsWithLeakTracking('Holding scroll', (WidgetTester tester) async { + testWidgets('Holding scroll', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); await tester.drag(find.byType(Scrollable), const Offset(0.0, 200.0), touchSlopY: 0.0); expect(getScrollOffset(tester), -200.0); @@ -165,7 +164,7 @@ void main() { expect(getScrollOffset(tester), 0.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Repeated flings builds momentum', (WidgetTester tester) async { + testWidgets('Repeated flings builds momentum', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); await tester.pump(); // trigger fling @@ -178,7 +177,7 @@ void main() { expect(getScrollVelocity(tester), greaterThan(1100.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Repeated flings do not build momentum on Android', (WidgetTester tester) async { + testWidgets('Repeated flings do not build momentum on Android', (WidgetTester tester) async { await pumpTest(tester, TargetPlatform.android); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); await tester.pump(); // trigger fling @@ -191,7 +190,7 @@ void main() { expect(getScrollVelocity(tester), moreOrLessEquals(1000.0)); }); - testWidgetsWithLeakTracking('A slower final fling does not apply carried momentum', (WidgetTester tester) async { + testWidgets('A slower final fling does not apply carried momentum', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); await tester.pump(); // trigger fling @@ -208,7 +207,7 @@ void main() { expect(getScrollVelocity(tester), lessThan(200.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('No iOS/macOS momentum build with flings in opposite directions', (WidgetTester tester) async { + testWidgets('No iOS/macOS momentum build with flings in opposite directions', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); await tester.pump(); // trigger fling @@ -221,7 +220,7 @@ void main() { expect(getScrollVelocity(tester), -1000.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('No iOS/macOS momentum kept on hold gestures', (WidgetTester tester) async { + testWidgets('No iOS/macOS momentum kept on hold gestures', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); await tester.pump(); // trigger fling @@ -234,7 +233,7 @@ void main() { expect(getScrollVelocity(tester), 0.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Drags creeping unaffected on Android', (WidgetTester tester) async { + testWidgets('Drags creeping unaffected on Android', (WidgetTester tester) async { await pumpTest(tester, TargetPlatform.android); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true)); await gesture.moveBy(const Offset(0.0, -0.5)); @@ -245,7 +244,7 @@ void main() { expect(getScrollOffset(tester), 1.5); }); - testWidgetsWithLeakTracking('Drags creeping must break threshold on iOS/macOS', (WidgetTester tester) async { + testWidgets('Drags creeping must break threshold on iOS/macOS', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true)); await gesture.moveBy(const Offset(0.0, -0.5)); @@ -265,7 +264,7 @@ void main() { expect(getScrollOffset(tester), 0.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Big drag over threshold magnitude preserved on iOS/macOS', (WidgetTester tester) async { + testWidgets('Big drag over threshold magnitude preserved on iOS/macOS', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true)); await gesture.moveBy(const Offset(0.0, -30.0)); @@ -273,7 +272,7 @@ void main() { expect(getScrollOffset(tester), 30.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Slow threshold breaks are attenuated on iOS/macOS', (WidgetTester tester) async { + testWidgets('Slow threshold breaks are attenuated on iOS/macOS', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true)); // This is a typical 'hesitant' iOS scroll start. @@ -284,7 +283,7 @@ void main() { expect(getScrollOffset(tester), moreOrLessEquals(11.16666666666666673)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Small continuing motion preserved on iOS/macOS', (WidgetTester tester) async { + testWidgets('Small continuing motion preserved on iOS/macOS', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true)); await gesture.moveBy(const Offset(0.0, -30.0)); // Break threshold. @@ -297,7 +296,7 @@ void main() { expect(getScrollOffset(tester), 31.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Motion stop resets threshold on iOS/macOS', (WidgetTester tester) async { + testWidgets('Motion stop resets threshold on iOS/macOS', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true)); await gesture.moveBy(const Offset(0.0, -30.0)); // Break threshold. @@ -320,7 +319,7 @@ void main() { expect(getScrollOffset(tester), 32.5); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Scroll pointer signals are handled on Fuchsia', (WidgetTester tester) async { + testWidgets('Scroll pointer signals are handled on Fuchsia', (WidgetTester tester) async { await pumpTest(tester, TargetPlatform.fuchsia); final Offset scrollEventLocation = tester.getCenter(find.byType(Viewport)); final TestPointer testPointer = TestPointer(1, ui.PointerDeviceKind.mouse); @@ -333,7 +332,7 @@ void main() { expect(getScrollOffset(tester), 0.0); }); - testWidgetsWithLeakTracking('Scroll pointer signals are handled when there is competition', (WidgetTester tester) async { + testWidgets('Scroll pointer signals are handled when there is competition', (WidgetTester tester) async { // This is a regression test. When there are multiple scrollables listening // to the same event, for example when scrollables are nested, there used // to be exceptions at scrolling events. @@ -350,7 +349,7 @@ void main() { expect(getScrollOffset(tester), 0.0); }); - testWidgetsWithLeakTracking('Scroll pointer signals are ignored when scrolling is disabled', (WidgetTester tester) async { + testWidgets('Scroll pointer signals are ignored when scrolling is disabled', (WidgetTester tester) async { await pumpTest(tester, TargetPlatform.fuchsia, scrollable: false); final Offset scrollEventLocation = tester.getCenter(find.byType(Viewport)); final TestPointer testPointer = TestPointer(1, ui.PointerDeviceKind.mouse); @@ -360,7 +359,7 @@ void main() { expect(getScrollOffset(tester), 0.0); }); - testWidgetsWithLeakTracking('Holding scroll and Scroll pointer signal will update ScrollDirection.forward / ScrollDirection.reverse', (WidgetTester tester) async { + testWidgets('Holding scroll and Scroll pointer signal will update ScrollDirection.forward / ScrollDirection.reverse', (WidgetTester tester) async { ScrollDirection? lastUserScrollingDirection; final ScrollController controller = ScrollController(); @@ -396,7 +395,7 @@ void main() { }); - testWidgetsWithLeakTracking('Scrolls in correct direction when scroll axis is reversed', (WidgetTester tester) async { + testWidgets('Scrolls in correct direction when scroll axis is reversed', (WidgetTester tester) async { await pumpTest(tester, TargetPlatform.fuchsia, reverse: true); final Offset scrollEventLocation = tester.getCenter(find.byType(Viewport)); @@ -408,7 +407,7 @@ void main() { expect(getScrollOffset(tester), 20.0); }); - testWidgetsWithLeakTracking('Scrolls horizontally when shift is pressed by default', (WidgetTester tester) async { + testWidgets('Scrolls horizontally when shift is pressed by default', (WidgetTester tester) async { await pumpTest( tester, debugDefaultTargetPlatformOverride, @@ -435,7 +434,7 @@ void main() { expect(getScrollOffset(tester), 20.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Scroll axis is not flipped for trackpad', (WidgetTester tester) async { + testWidgets('Scroll axis is not flipped for trackpad', (WidgetTester tester) async { await pumpTest( tester, debugDefaultTargetPlatformOverride, @@ -462,7 +461,7 @@ void main() { expect(getScrollOffset(tester), 0.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Scrolls horizontally when custom key is pressed', (WidgetTester tester) async { + testWidgets('Scrolls horizontally when custom key is pressed', (WidgetTester tester) async { await pumpTest( tester, debugDefaultTargetPlatformOverride, @@ -490,7 +489,7 @@ void main() { expect(getScrollOffset(tester), 20.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Still scrolls horizontally when other keys are pressed at the same time', (WidgetTester tester) async { + testWidgets('Still scrolls horizontally when other keys are pressed at the same time', (WidgetTester tester) async { await pumpTest( tester, debugDefaultTargetPlatformOverride, @@ -539,7 +538,7 @@ void main() { ); } - testWidgetsWithLeakTracking('Hold does not disable user interaction', (WidgetTester tester) async { + testWidgets('Hold does not disable user interaction', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66816. await pumpTestWidget(tester, canDrag: true); final RenderIgnorePointer renderIgnorePointer = tester.renderObject<RenderIgnorePointer>( @@ -558,7 +557,7 @@ void main() { expect(renderIgnorePointer.ignoring, false); }); - testWidgetsWithLeakTracking('Drag disables user interaction when recognized', (WidgetTester tester) async { + testWidgets('Drag disables user interaction when recognized', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66816. await pumpTestWidget(tester, canDrag: true); final RenderIgnorePointer renderIgnorePointer = tester.renderObject<RenderIgnorePointer>( @@ -580,7 +579,7 @@ void main() { expect(renderIgnorePointer.ignoring, false); }); - testWidgetsWithLeakTracking('Ballistic disables user interaction until it stops', (WidgetTester tester) async { + testWidgets('Ballistic disables user interaction until it stops', (WidgetTester tester) async { await pumpTestWidget(tester, canDrag: true); final RenderIgnorePointer renderIgnorePointer = tester.renderObject<RenderIgnorePointer>( find.descendant(of: find.byType(CustomScrollView), matching: find.byType(IgnorePointer)), @@ -598,7 +597,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Can recommendDeferredLoadingForContext - animation', (WidgetTester tester) async { + testWidgets('Can recommendDeferredLoadingForContext - animation', (WidgetTester tester) async { final List<String> widgetTracker = <String>[]; int cheapWidgets = 0; int expensiveWidgets = 0; @@ -655,7 +654,7 @@ void main() { expect(widgetTracker.skip(17).skip(25).skip(70).every((String type) => type == 'expensive'), true); }); - testWidgetsWithLeakTracking('Can recommendDeferredLoadingForContext - ballistics', (WidgetTester tester) async { + testWidgets('Can recommendDeferredLoadingForContext - ballistics', (WidgetTester tester) async { int cheapWidgets = 0; int expensiveWidgets = 0; await tester.pumpWidget(Directionality( @@ -692,7 +691,7 @@ void main() { expect(cheapWidgets, 21); }); - testWidgetsWithLeakTracking('Can recommendDeferredLoadingForContext - override heuristic', (WidgetTester tester) async { + testWidgets('Can recommendDeferredLoadingForContext - override heuristic', (WidgetTester tester) async { int cheapWidgets = 0; int expensiveWidgets = 0; await tester.pumpWidget(Directionality( @@ -736,7 +735,7 @@ void main() { expect(physics.count, 44 + 17); }); - testWidgetsWithLeakTracking('Can recommendDeferredLoadingForContext - override heuristic and always return true', (WidgetTester tester) async { + testWidgets('Can recommendDeferredLoadingForContext - override heuristic and always return true', (WidgetTester tester) async { int cheapWidgets = 0; int expensiveWidgets = 0; await tester.pumpWidget(Directionality( @@ -777,7 +776,7 @@ void main() { expect(cheapWidgets, 61); }); - testWidgetsWithLeakTracking('ensureVisible does not move PageViews', (WidgetTester tester) async { + testWidgets('ensureVisible does not move PageViews', (WidgetTester tester) async { final PageController controller = PageController(); addTearDown(controller.dispose); @@ -861,7 +860,7 @@ void main() { expect(targetMidLeftPage1, findsOneWidget); }); - testWidgetsWithLeakTracking('ensureVisible does not move TabViews', (WidgetTester tester) async { + testWidgets('ensureVisible does not move TabViews', (WidgetTester tester) async { final TickerProvider vsync = TestTickerProvider(); final TabController controller = TabController( length: 3, @@ -949,7 +948,7 @@ void main() { expect(targetMidLeftPage1, findsOneWidget); }); - testWidgetsWithLeakTracking('PointerScroll on nested NeverScrollable ListView goes to outer Scrollable.', (WidgetTester tester) async { + testWidgets('PointerScroll on nested NeverScrollable ListView goes to outer Scrollable.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/70948 final ScrollController outerController = ScrollController(); addTearDown(outerController.dispose); @@ -1009,7 +1008,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/71949 - testWidgetsWithLeakTracking('Zero offset pointer scroll should not trigger an assertion.', (WidgetTester tester) async { + testWidgets('Zero offset pointer scroll should not trigger an assertion.', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -1051,7 +1050,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Accepts drag with unknown device kind by default', (WidgetTester tester) async { + testWidgets('Accepts drag with unknown device kind by default', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/90912. await tester.pumpWidget( const MaterialApp( @@ -1080,7 +1079,7 @@ void main() { await tester.pump(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android })); - testWidgetsWithLeakTracking('Does not scroll with mouse pointer drag when behavior is configured to ignore them', (WidgetTester tester) async { + testWidgets('Does not scroll with mouse pointer drag when behavior is configured to ignore them', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride, enableMouseDrag: false); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true), kind: ui.PointerDeviceKind.mouse); @@ -1100,7 +1099,7 @@ void main() { await tester.pump(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android })); - testWidgetsWithLeakTracking("Support updating 'ScrollBehavior.dragDevices' at runtime", (WidgetTester tester) async { + testWidgets("Support updating 'ScrollBehavior.dragDevices' at runtime", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/111716 Widget buildFrame(Set<ui.PointerDeviceKind>? dragDevices) { return MaterialApp( @@ -1134,7 +1133,7 @@ void main() { expect(getScrollOffset(tester), 200.0); }); - testWidgetsWithLeakTracking('Does scroll with mouse pointer drag when behavior is not configured to ignore them', (WidgetTester tester) async { + testWidgets('Does scroll with mouse pointer drag when behavior is not configured to ignore them', (WidgetTester tester) async { await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true), kind: ui.PointerDeviceKind.mouse); @@ -1154,7 +1153,7 @@ void main() { await tester.pump(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android })); - testWidgetsWithLeakTracking('Updated content dimensions correctly reflect in semantics', (WidgetTester tester) async { + testWidgets('Updated content dimensions correctly reflect in semantics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/40419. final SemanticsHandle handle = tester.ensureSemantics(); final UniqueKey listView = UniqueKey(); @@ -1212,7 +1211,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Two panel semantics is added to the sibling nodes of direct children', (WidgetTester tester) async { + testWidgets('Two panel semantics is added to the sibling nodes of direct children', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final UniqueKey key = UniqueKey(); await tester.pumpWidget(MaterialApp( @@ -1257,7 +1256,7 @@ void main() { handle.dispose(); }); - testWidgetsWithLeakTracking('Scroll inertia cancel event', (WidgetTester tester) async { + testWidgets('Scroll inertia cancel event', (WidgetTester tester) async { await pumpTest(tester, null); await tester.fling(find.byType(Scrollable), const Offset(0.0, -dragOffset), 1000.0); expect(getScrollOffset(tester), dragOffset); @@ -1273,7 +1272,7 @@ void main() { expect(getScrollOffset(tester), closeTo(344.0642, 0.0001)); }); - testWidgetsWithLeakTracking('Swapping viewports in a scrollable does not crash', (WidgetTester tester) async { + testWidgets('Swapping viewports in a scrollable does not crash', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey key = GlobalKey(); final GlobalKey key1 = GlobalKey(); @@ -1320,7 +1319,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('deltaToScrollOrigin getter', (WidgetTester tester) async { + testWidgets('deltaToScrollOrigin getter', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: CustomScrollView( @@ -1341,7 +1340,7 @@ void main() { expect(scrollable.deltaToScrollOrigin, const Offset(0.0, 200)); }); - testWidgetsWithLeakTracking('resolvedPhysics getter', (WidgetTester tester) async { + testWidgets('resolvedPhysics getter', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData.light().copyWith( @@ -1371,7 +1370,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('dragDevices change updates widget', (WidgetTester tester) async { + testWidgets('dragDevices change updates widget', (WidgetTester tester) async { bool enable = false; await tester.pumpWidget( @@ -1424,7 +1423,7 @@ void main() { expect(getScrollOffset(tester), 200); }); - testWidgetsWithLeakTracking('dragDevices change updates widget when oldWidget scrollBehavior is null', (WidgetTester tester) async { + testWidgets('dragDevices change updates widget when oldWidget scrollBehavior is null', (WidgetTester tester) async { ScrollBehavior? scrollBehavior; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/scrollbar_test.dart b/packages/flutter/test/widgets/scrollbar_test.dart index c518dccc8f6..746d2e146ad 100644 --- a/packages/flutter/test/widgets/scrollbar_test.dart +++ b/packages/flutter/test/widgets/scrollbar_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/src/physics/utils.dart' show nearEqual; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Color _kScrollbarColor = Color(0xFF123456); const double _kThickness = 2.5; @@ -385,7 +384,7 @@ void main() { scrollMetrics: metrics, ); - testWidgetsWithLeakTracking('down', (WidgetTester tester) async { + testWidgets('down', (WidgetTester tester) async { painter.update( metrics.copyWith( viewportDimension: size.height, @@ -415,7 +414,7 @@ void main() { expect(size.width - rect1.right, padding.right); }); - testWidgetsWithLeakTracking('up', (WidgetTester tester) async { + testWidgets('up', (WidgetTester tester) async { painter.update( metrics.copyWith( viewportDimension: size.height, @@ -447,7 +446,7 @@ void main() { expect(size.width - rect1.right, padding.right); }); - testWidgetsWithLeakTracking('left', (WidgetTester tester) async { + testWidgets('left', (WidgetTester tester) async { painter.update( metrics.copyWith( viewportDimension: size.width, @@ -479,7 +478,7 @@ void main() { expect(rect1.left, padding.left); }); - testWidgetsWithLeakTracking('right', (WidgetTester tester) async { + testWidgets('right', (WidgetTester tester) async { painter.update( metrics.copyWith( viewportDimension: size.width, @@ -512,7 +511,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('thumb resizes gradually on overscroll', (WidgetTester tester) async { + testWidgets('thumb resizes gradually on overscroll', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.fromLTRB(1, 2, 3, 4); const Size size = Size(60, 300); final double scrollExtent = size.height * 10; @@ -665,7 +664,7 @@ void main() { expect(trackRRect.trRadius, const Radius.circular(2.0)); }); - testWidgetsWithLeakTracking('ScrollbarPainter asserts if no TextDirection has been provided', (WidgetTester tester) async { + testWidgets('ScrollbarPainter asserts if no TextDirection has been provided', (WidgetTester tester) async { final ScrollbarPainter painter = ScrollbarPainter( color: _kScrollbarColor, fadeoutOpacityAnimation: kAlwaysCompleteAnimation, @@ -684,7 +683,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Tapping the track area pages the Scroll View', (WidgetTester tester) async { + testWidgets('Tapping the track area pages the Scroll View', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -747,7 +746,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar never goes away until finger lift', (WidgetTester tester) async { + testWidgets('Scrollbar never goes away until finger lift', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -805,7 +804,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar does not fade away while hovering', (WidgetTester tester) async { + testWidgets('Scrollbar does not fade away while hovering', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -852,7 +851,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar will fade back in when hovering over known track area', (WidgetTester tester) async { + testWidgets('Scrollbar will fade back in when hovering over known track area', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -913,7 +912,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar will show on hover without needing to scroll first for metrics', (WidgetTester tester) async { + testWidgets('Scrollbar will show on hover without needing to scroll first for metrics', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -948,7 +947,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1004,7 +1003,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar thumb cannot be dragged into overscroll if the physics do not allow', (WidgetTester tester) async { + testWidgets('Scrollbar thumb cannot be dragged into overscroll if the physics do not allow', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1057,7 +1056,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar thumb cannot be dragged into overscroll if the platform does not allow it', (WidgetTester tester) async { + testWidgets('Scrollbar thumb cannot be dragged into overscroll if the platform does not allow it', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1126,7 +1125,7 @@ void main() { TargetPlatform.fuchsia, })); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged into overscroll if the platform allows it', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged into overscroll if the platform allows it', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1194,7 +1193,7 @@ void main() { })); // Regression test for https://github.com/flutter/flutter/issues/66444 - testWidgetsWithLeakTracking("RawScrollbar doesn't show when scroll the inner scrollable widget", (WidgetTester tester) async { + testWidgets("RawScrollbar doesn't show when scroll the inner scrollable widget", (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); final GlobalKey outerKey = GlobalKey(); @@ -1256,7 +1255,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar hit test area adjusts for PointerDeviceKind', (WidgetTester tester) async { + testWidgets('Scrollbar hit test area adjusts for PointerDeviceKind', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1346,7 +1345,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('hit test', (WidgetTester tester) async { + testWidgets('hit test', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/99324 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1396,7 +1395,7 @@ void main() { expect(onTap, true); }); - testWidgetsWithLeakTracking('RawScrollbar.thumbVisibility asserts that a ScrollPosition is attached', (WidgetTester tester) async { + testWidgets('RawScrollbar.thumbVisibility asserts that a ScrollPosition is attached', (WidgetTester tester) async { final FlutterExceptionHandler? handler = FlutterError.onError; FlutterErrorDetails? error; FlutterError.onError = (FlutterErrorDetails details) { @@ -1436,7 +1435,7 @@ void main() { FlutterError.onError = handler; }); - testWidgetsWithLeakTracking('RawScrollbar.thumbVisibility asserts that a ScrollPosition is attached', (WidgetTester tester) async { + testWidgets('RawScrollbar.thumbVisibility asserts that a ScrollPosition is attached', (WidgetTester tester) async { final FlutterExceptionHandler? handler = FlutterError.onError; FlutterErrorDetails? error; FlutterError.onError = (FlutterErrorDetails details) { @@ -1476,7 +1475,7 @@ void main() { FlutterError.onError = handler; }); - testWidgetsWithLeakTracking('Interactive scrollbars should have a valid scroll controller', (WidgetTester tester) async { + testWidgets('Interactive scrollbars should have a valid scroll controller', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); final ScrollController scrollController = ScrollController(); @@ -1519,7 +1518,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Simultaneous dragging and pointer scrolling does not cause a crash', (WidgetTester tester) async { + testWidgets('Simultaneous dragging and pointer scrolling does not cause a crash', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/70105 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -1694,7 +1693,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged in reverse', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged in reverse', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1751,7 +1750,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('ScrollbarPainter asserts if scrollbarOrientation is used with wrong axisDirection', (WidgetTester tester) async { + testWidgets('ScrollbarPainter asserts if scrollbarOrientation is used with wrong axisDirection', (WidgetTester tester) async { final ScrollbarPainter painter = ScrollbarPainter( color: _kScrollbarColor, fadeoutOpacityAnimation: kAlwaysCompleteAnimation, @@ -1769,7 +1768,7 @@ void main() { expect(() => painter.paint(testCanvas, size), throwsA(isA<AssertionError>())); }); - testWidgetsWithLeakTracking('RawScrollbar mainAxisMargin property works properly', (WidgetTester tester) async { + testWidgets('RawScrollbar mainAxisMargin property works properly', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1800,7 +1799,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('shape property of RawScrollbar can draw a BeveledRectangleBorder', (WidgetTester tester) async { + testWidgets('shape property of RawScrollbar can draw a BeveledRectangleBorder', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1838,7 +1837,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('minThumbLength property of RawScrollbar is respected', (WidgetTester tester) async { + testWidgets('minThumbLength property of RawScrollbar is respected', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1865,7 +1864,7 @@ void main() { ..rect(rect: const Rect.fromLTRB(794.0, 0.0, 800.0, 21.0))); // thumb }); - testWidgetsWithLeakTracking('shape property of RawScrollbar can draw a CircleBorder', (WidgetTester tester) async { + testWidgets('shape property of RawScrollbar can draw a CircleBorder', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1902,7 +1901,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('crossAxisMargin property of RawScrollbar is respected', (WidgetTester tester) async { + testWidgets('crossAxisMargin property of RawScrollbar is respected', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1928,7 +1927,7 @@ void main() { ..rect(rect: const Rect.fromLTRB(764.0, 0.0, 770.0, 360.0))); }); - testWidgetsWithLeakTracking('shape property of RawScrollbar can draw a RoundedRectangleBorder', (WidgetTester tester) async { + testWidgets('shape property of RawScrollbar can draw a RoundedRectangleBorder', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1963,7 +1962,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('minOverscrollLength property of RawScrollbar is respected', (WidgetTester tester) async { + testWidgets('minOverscrollLength property of RawScrollbar is respected', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -1996,7 +1995,7 @@ void main() { ..rect(rect: const Rect.fromLTRB(794.0, 0.0, 800.0, 8.0))); }); - testWidgetsWithLeakTracking('not passing any shape or radius to RawScrollbar will draw the usual rectangular thumb', (WidgetTester tester) async { + testWidgets('not passing any shape or radius to RawScrollbar will draw the usual rectangular thumb', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -2023,7 +2022,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The bar can show or hide when the viewport size change', (WidgetTester tester) async { + testWidgets('The bar can show or hide when the viewport size change', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); Widget buildFrame(double height) { @@ -2055,7 +2054,7 @@ void main() { expect(find.byType(RawScrollbar), isNot(paints..rect())); // Hide the bar. }); - testWidgetsWithLeakTracking('The bar can show or hide when the view size change', (WidgetTester tester) async { + testWidgets('The bar can show or hide when the view size change', (WidgetTester tester) async { addTearDown(tester.view.reset); final ScrollController scrollController = ScrollController(); @@ -2098,7 +2097,7 @@ void main() { expect(find.byType(RawScrollbar), isNot(paints..rect())); // Not shown. }); - testWidgetsWithLeakTracking('Scrollbar will not flip axes based on notification is there is a scroll controller', (WidgetTester tester) async { + testWidgets('Scrollbar will not flip axes based on notification is there is a scroll controller', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/87697 final ScrollController verticalScrollController = ScrollController(); addTearDown(verticalScrollController.dispose); @@ -2161,7 +2160,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('notificationPredicate depth test.', (WidgetTester tester) async { + testWidgets('notificationPredicate depth test.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); final List<int> depths = <int>[]; @@ -2196,7 +2195,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/92262 - testWidgetsWithLeakTracking('Do not crash when resize from scrollable to non-scrollable.', (WidgetTester tester) async { + testWidgets('Do not crash when resize from scrollable to non-scrollable.', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); Widget buildFrame(double height) { @@ -2233,7 +2232,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged when the scrollable widget has a negative minScrollExtent - desktop', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged when the scrollable widget has a negative minScrollExtent - desktop', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/95840 final ScrollController scrollController = ScrollController(); @@ -2316,7 +2315,7 @@ void main() { ); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Scrollbar thumb can be dragged when the scrollable widget has a negative minScrollExtent - mobile', (WidgetTester tester) async { + testWidgets('Scrollbar thumb can be dragged when the scrollable widget has a negative minScrollExtent - mobile', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/95840 final ScrollController scrollController = ScrollController(); @@ -2453,7 +2452,7 @@ void main() { expect(painter.shouldRepaint(createPainter(scrollbarOrientation: ScrollbarOrientation.bottom)), true); }); - testWidgetsWithLeakTracking('Scrollbar track can be drawn', (WidgetTester tester) async { + testWidgets('Scrollbar track can be drawn', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -2497,7 +2496,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RawScrollbar correctly assigns colors', (WidgetTester tester) async { + testWidgets('RawScrollbar correctly assigns colors', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -2544,7 +2543,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('trackRadius and radius properties of RawScrollbar can draw RoundedRectangularRect', (WidgetTester tester) async { + testWidgets('trackRadius and radius properties of RawScrollbar can draw RoundedRectangularRect', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -2584,7 +2583,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Scrollbar asserts that a visible track has a visible thumb', (WidgetTester tester) async { + testWidgets('Scrollbar asserts that a visible track has a visible thumb', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); Widget buildApp() { @@ -2609,7 +2608,7 @@ void main() { expect(() => tester.pumpWidget(buildApp()), throwsAssertionError); }); - testWidgetsWithLeakTracking('Skip the ScrollPosition check if the bar was unmounted', (WidgetTester tester) async { + testWidgets('Skip the ScrollPosition check if the bar was unmounted', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/103939 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -2648,7 +2647,7 @@ void main() { // Go without throw. }); - testWidgetsWithLeakTracking('Track offset respects MediaQuery padding', (WidgetTester tester) async { + testWidgets('Track offset respects MediaQuery padding', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/106834 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -2681,7 +2680,7 @@ void main() { ); // thumb }); - testWidgetsWithLeakTracking('RawScrollbar.padding replaces MediaQueryData.padding', (WidgetTester tester) async { + testWidgets('RawScrollbar.padding replaces MediaQueryData.padding', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -2714,7 +2713,7 @@ void main() { ); // thumb }); - testWidgetsWithLeakTracking('Scrollbar respect the NeverScrollableScrollPhysics physics', (WidgetTester tester) async { + testWidgets('Scrollbar respect the NeverScrollableScrollPhysics physics', (WidgetTester tester) async { final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); await tester.pumpWidget( @@ -2757,7 +2756,7 @@ void main() { expect(scrollController.offset, 0.0); }); - testWidgetsWithLeakTracking('The thumb should follow the pointer when the scroll metrics changed during dragging', (WidgetTester tester) async { + testWidgets('The thumb should follow the pointer when the scroll metrics changed during dragging', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/112072 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -2828,7 +2827,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('The scrollable should not stutter when the scroll metrics shrink during dragging', (WidgetTester tester) async { + testWidgets('The scrollable should not stutter when the scroll metrics shrink during dragging', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/121574 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); @@ -2893,7 +2892,7 @@ void main() { expect(scrollController.offset, greaterThan(lastPosition)); }); - testWidgetsWithLeakTracking('The bar support mouse wheel event', (WidgetTester tester) async { + testWidgets('The bar support mouse wheel event', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/109659 final ScrollController scrollController = ScrollController(); addTearDown(scrollController.dispose); diff --git a/packages/flutter/test/widgets/selectable_region_context_menu_test.dart b/packages/flutter/test/widgets/selectable_region_context_menu_test.dart index 344052e5617..e4f29d6b005 100644 --- a/packages/flutter/test/widgets/selectable_region_context_menu_test.dart +++ b/packages/flutter/test/widgets/selectable_region_context_menu_test.dart @@ -11,7 +11,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:web/web.dart' as web; extension on web.HTMLCollection { @@ -62,7 +61,7 @@ void main() { expect(foundStyle, isTrue); }); - testWidgetsWithLeakTracking('right click can trigger select word', (WidgetTester tester) async { + testWidgets('right click can trigger select word', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final UniqueKey spy = UniqueKey(); diff --git a/packages/flutter/test/widgets/selectable_region_test.dart b/packages/flutter/test/widgets/selectable_region_test.dart index ec8b5c2d029..6a2b295d7f3 100644 --- a/packages/flutter/test/widgets/selectable_region_test.dart +++ b/packages/flutter/test/widgets/selectable_region_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'clipboard_utils.dart'; import 'keyboard_utils.dart'; @@ -38,7 +37,7 @@ void main() { }); group('SelectableRegion', () { - testWidgetsWithLeakTracking('mouse selection single click sends correct events', (WidgetTester tester) async { + testWidgets('mouse selection single click sends correct events', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -79,7 +78,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/102410. - testWidgetsWithLeakTracking('mouse double click sends select-word event', (WidgetTester tester) async { + testWidgets('mouse double click sends select-word event', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -110,7 +109,7 @@ void main() { expect(selectionEvent.globalPosition, const Offset(200.0, 200.0)); }); - testWidgetsWithLeakTracking('Does not crash when using Navigator pages', (WidgetTester tester) async { + testWidgets('Does not crash when using Navigator pages', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/119776 final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -144,7 +143,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('can draw handles when they are at rect boundaries', (WidgetTester tester) async { + testWidgets('can draw handles when they are at rect boundaries', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -177,7 +176,7 @@ void main() { expect(renderSpy.endHandle, isNotNull); }); - testWidgetsWithLeakTracking('touch does not accept drag', (WidgetTester tester) async { + testWidgets('touch does not accept drag', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -203,7 +202,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('does not merge semantics node of the children', (WidgetTester tester) async { + testWidgets('does not merge semantics node of the children', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -310,7 +309,7 @@ void main() { expect((renderSelectionSpy.events[1] as SelectionEdgeUpdateEvent).type, SelectionEventType.endEdgeUpdate); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/102410. - testWidgetsWithLeakTracking('touch long press sends select-word event', (WidgetTester tester) async { + testWidgets('touch long press sends select-word event', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -338,7 +337,7 @@ void main() { expect(selectionEvent.globalPosition, const Offset(200.0, 200.0)); }); - testWidgetsWithLeakTracking('touch long press and drag sends correct events', (WidgetTester tester) async { + testWidgets('touch long press and drag sends correct events', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -374,7 +373,7 @@ void main() { expect(edgeEvent.granularity, TextGranularity.word); }); - testWidgetsWithLeakTracking( + testWidgets( 'touch long press cancel does not send ClearSelectionEvent', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); @@ -409,7 +408,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'scrolling after the selection does not send ClearSelectionEvent', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/128765 @@ -456,7 +455,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('mouse long press does not send select-word event', (WidgetTester tester) async { + testWidgets('mouse long press does not send select-word event', (WidgetTester tester) async { final UniqueKey spy = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -485,7 +484,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('dragging handle or selecting word triggers haptic feedback on Android', (WidgetTester tester) async { + testWidgets('dragging handle or selecting word triggers haptic feedback on Android', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { log.add(methodCall); @@ -599,7 +598,7 @@ void main() { await gesture.up(); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('mouse can select single text on mobile platforms', (WidgetTester tester) async { + testWidgets('mouse can select single text on mobile platforms', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -652,7 +651,7 @@ void main() { await gesture.up(); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking('mouse can select word-by-word on double click drag', (WidgetTester tester) async { + testWidgets('mouse can select word-by-word on double click drag', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -725,7 +724,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582. - testWidgetsWithLeakTracking('mouse can select multiple widgets on double click drag', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets on double click drag', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -774,7 +773,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582. - testWidgetsWithLeakTracking('mouse can select multiple widgets on double click drag and return to origin word', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets on double click drag and return to origin word', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -835,7 +834,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582. - testWidgetsWithLeakTracking('mouse can reverse selection across multiple widgets on double click drag', (WidgetTester tester) async { + testWidgets('mouse can reverse selection across multiple widgets on double click drag', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -883,7 +882,7 @@ void main() { await gesture.up(); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582. - testWidgetsWithLeakTracking('mouse can select multiple widgets', (WidgetTester tester) async { + testWidgets('mouse can select multiple widgets', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -926,7 +925,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('collapsing selection should clear selection of all other selectables', (WidgetTester tester) async { + testWidgets('collapsing selection should clear selection of all other selectables', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -972,7 +971,7 @@ void main() { expect(paragraph3.selections[0], const TextSelection.collapsed(offset: 13)); }); - testWidgetsWithLeakTracking('mouse can work with disabled container', (WidgetTester tester) async { + testWidgets('mouse can work with disabled container', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1016,7 +1015,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('mouse can reverse selection', (WidgetTester tester) async { + testWidgets('mouse can reverse selection', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1152,7 +1151,7 @@ void main() { skip: kIsWeb, // [intended] Web uses its native context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'single tap on the previous selection toggles the toolbar on iOS', (WidgetTester tester) async { Set<ContextMenuButtonType> buttonTypes = <ContextMenuButtonType>{}; @@ -1228,7 +1227,7 @@ void main() { skip: kIsWeb, // [intended] Web uses its native context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'right-click mouse can select word at position on Apple platforms', (WidgetTester tester) async { Set<ContextMenuButtonType> buttonTypes = <ContextMenuButtonType>{}; @@ -1311,7 +1310,7 @@ void main() { skip: kIsWeb, // [intended] Web uses its native context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'right-click mouse at the same position as previous right-click toggles the context menu on macOS', (WidgetTester tester) async { Set<ContextMenuButtonType> buttonTypes = <ContextMenuButtonType>{}; @@ -1418,7 +1417,7 @@ void main() { skip: kIsWeb, // [intended] Web uses its native context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'right-click mouse shows the context menu at position on Android, Fucshia, and Windows', (WidgetTester tester) async { Set<ContextMenuButtonType> buttonTypes = <ContextMenuButtonType>{}; @@ -1541,7 +1540,7 @@ void main() { skip: kIsWeb, // [intended] Web uses its native context menu. ); - testWidgetsWithLeakTracking( + testWidgets( 'right-click mouse toggles the context menu on Linux', (WidgetTester tester) async { Set<ContextMenuButtonType> buttonTypes = <ContextMenuButtonType>{}; @@ -1672,7 +1671,7 @@ void main() { skip: kIsWeb, // [intended] Web uses its native context menu. ); - testWidgetsWithLeakTracking('can copy a selection made with the mouse', (WidgetTester tester) async { + testWidgets('can copy a selection made with the mouse', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1708,7 +1707,7 @@ void main() { expect(clipboardData['text'], 'w are you?Good, and you?Fine, '); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.windows, TargetPlatform.linux, TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking( + testWidgets( 'does not override TextField keyboard shortcuts if the TextField is focused - non apple', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'I am fine, thank you.'); @@ -1765,7 +1764,7 @@ void main() { skip: kIsWeb, // [intended] the web handles this on its own. ); - testWidgetsWithLeakTracking( + testWidgets( 'does not override TextField keyboard shortcuts if the TextField is focused - apple', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'I am fine, thank you.'); @@ -1822,7 +1821,7 @@ void main() { skip: kIsWeb, // [intended] the web handles this on its own. ); - testWidgetsWithLeakTracking('select all', (WidgetTester tester) async { + testWidgets('select all', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1855,7 +1854,7 @@ void main() { expect(paragraph1.selections[0], const TextSelection(baseOffset: 0, extentOffset: 12)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.windows, TargetPlatform.linux, TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking( + testWidgets( 'mouse selection can handle widget span', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); final FocusNode focusNode = FocusNode(); @@ -1897,7 +1896,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'double click + drag mouse selection can handle widget span', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); final FocusNode focusNode = FocusNode(); @@ -1944,7 +1943,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'double click + drag mouse selection can handle widget span - multiline', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); final UniqueKey innerText = UniqueKey(); @@ -1995,7 +1994,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'select word event can select inline widget', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); final UniqueKey innerText = UniqueKey(); @@ -2043,7 +2042,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'select word event should not crash when its position is at an unselectable inline element', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); final UniqueKey flutterLogo = UniqueKey(); @@ -2089,7 +2088,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'can select word when a selectables rect is completely inside of another selectables rect', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/127076. final UniqueKey outerText = UniqueKey(); @@ -2140,7 +2139,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'can select word when selectable is broken up by an unselectable WidgetSpan', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); final FocusNode focusNode = FocusNode(); @@ -2190,7 +2189,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'widget span is ignored if it does not contain text - non Apple', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); @@ -2233,7 +2232,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking( + testWidgets( 'widget span is ignored if it does not contain text - Apple', (WidgetTester tester) async { final UniqueKey outerText = UniqueKey(); @@ -2276,7 +2275,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/61020 ); - testWidgetsWithLeakTracking('mouse can select across bidi text', (WidgetTester tester) async { + testWidgets('mouse can select across bidi text', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2320,7 +2319,7 @@ void main() { await gesture.up(); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/61020 - testWidgetsWithLeakTracking('long press and drag touch moves selection word by word', (WidgetTester tester) async { + testWidgets('long press and drag touch moves selection word by word', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2354,7 +2353,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('can drag end handle when not covering entire screen', (WidgetTester tester) async { + testWidgets('can drag end handle when not covering entire screen', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104620. final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2394,7 +2393,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('can drag start handle when not covering entire screen', (WidgetTester tester) async { + testWidgets('can drag start handle when not covering entire screen', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/104620. final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2433,7 +2432,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('can drag start selection handle', (WidgetTester tester) async { + testWidgets('can drag start selection handle', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2478,7 +2477,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('can drag start selection handle across end selection handle', (WidgetTester tester) async { + testWidgets('can drag start selection handle across end selection handle', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2518,7 +2517,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('can drag end selection handle across start selection handle', (WidgetTester tester) async { + testWidgets('can drag end selection handle across start selection handle', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2558,7 +2557,7 @@ void main() { await gesture.up(); }); - testWidgetsWithLeakTracking('can select all from toolbar', (WidgetTester tester) async { + testWidgets('can select all from toolbar', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2597,7 +2596,7 @@ void main() { expect(paragraph1.selections[0], const TextSelection(baseOffset: 0, extentOffset: 12)); }, skip: kIsWeb); // [intended] Web uses its native context menu. - testWidgetsWithLeakTracking('can copy from toolbar', (WidgetTester tester) async { + testWidgets('can copy from toolbar', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2640,7 +2639,7 @@ void main() { expect(clipboardData['text'], 'thank'); }, skip: kIsWeb); // [intended] Web uses its native context menu. - testWidgetsWithLeakTracking('can use keyboard to granularly extend selection - character', (WidgetTester tester) async { + testWidgets('can use keyboard to granularly extend selection - character', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2703,7 +2702,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('can use keyboard to granularly extend selection - word', (WidgetTester tester) async { + testWidgets('can use keyboard to granularly extend selection - word', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2818,7 +2817,7 @@ void main() { expect(paragraph2.selections[0].end, 0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('can use keyboard to granularly extend selection - line', (WidgetTester tester) async { + testWidgets('can use keyboard to granularly extend selection - line', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2912,7 +2911,7 @@ void main() { expect(paragraph1.selections[0].end, 2); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('can use keyboard to granularly extend selection - document', (WidgetTester tester) async { + testWidgets('can use keyboard to granularly extend selection - document', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -2995,7 +2994,7 @@ void main() { expect(paragraph3.selections[0].end, 0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('can use keyboard to directionally extend selection', (WidgetTester tester) async { + testWidgets('can use keyboard to directionally extend selection', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3097,7 +3096,7 @@ void main() { late ValueNotifier<MagnifierInfo> magnifierInfo; final Widget fakeMagnifier = Container(key: UniqueKey()); - testWidgetsWithLeakTracking('Can drag handles to show, unshow, and update magnifier', + testWidgets('Can drag handles to show, unshow, and update magnifier', (WidgetTester tester) async { const String text = 'Monkeys and rabbits in my soup'; final FocusNode focusNode = FocusNode(); @@ -3165,7 +3164,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('toolbar is hidden on mobile when orientation changes', (WidgetTester tester) async { + testWidgets('toolbar is hidden on mobile when orientation changes', (WidgetTester tester) async { addTearDown(tester.view.reset); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3212,7 +3211,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android }), ); - testWidgetsWithLeakTracking('the selection behavior when clicking `Copy` item in mobile platforms', (WidgetTester tester) async { + testWidgets('the selection behavior when clicking `Copy` item in mobile platforms', (WidgetTester tester) async { List<ContextMenuButtonItem> buttonItems = <ContextMenuButtonItem>[]; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3269,7 +3268,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('the handles do not disappear when clicking `Select all` item in mobile platforms', (WidgetTester tester) async { + testWidgets('the handles do not disappear when clicking `Select all` item in mobile platforms', (WidgetTester tester) async { List<ContextMenuButtonItem> buttonItems = <ContextMenuButtonItem>[]; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3325,7 +3324,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android, TargetPlatform.fuchsia }), ); - testWidgetsWithLeakTracking('builds the correct button items', (WidgetTester tester) async { + testWidgets('builds the correct button items', (WidgetTester tester) async { Set<ContextMenuButtonType> buttonTypes = <ContextMenuButtonType>{}; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3369,7 +3368,7 @@ void main() { skip: kIsWeb, // [intended] ); - testWidgetsWithLeakTracking('onSelectionChange is called when the selection changes through gestures', (WidgetTester tester) async { + testWidgets('onSelectionChange is called when the selection changes through gestures', (WidgetTester tester) async { SelectedContent? content; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3510,7 +3509,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('onSelectionChange is called when the selection changes through keyboard actions', (WidgetTester tester) async { + testWidgets('onSelectionChange is called when the selection changes through keyboard actions', (WidgetTester tester) async { SelectedContent? content; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3670,7 +3669,7 @@ void main() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.contextMenu, null); }); - testWidgetsWithLeakTracking('web can show flutter context menu when the browser context menu is disabled', (WidgetTester tester) async { + testWidgets('web can show flutter context menu when the browser context menu is disabled', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -3704,7 +3703,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Multiple selectables on a single line should be in screen order', (WidgetTester tester) async { + testWidgets('Multiple selectables on a single line should be in screen order', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/127942. final UniqueKey outerText = UniqueKey(); const TextStyle textStyle = TextStyle(fontSize: 10); diff --git a/packages/flutter/test/widgets/selectable_text_test.dart b/packages/flutter/test/widgets/selectable_text_test.dart index bd5e9a4b319..a63c4d02472 100644 --- a/packages/flutter/test/widgets/selectable_text_test.dart +++ b/packages/flutter/test/widgets/selectable_text_test.dart @@ -18,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../widgets/clipboard_utils.dart'; import '../widgets/editable_text_utils.dart' show textOffsetToPosition; @@ -251,7 +250,7 @@ void main() { expect(tester.takeException(), isNotNull); // side effect exception }); - testWidgetsWithLeakTracking('Do not crash when remove SelectableText during handle drag', (WidgetTester tester) async { + testWidgets('Do not crash when remove SelectableText during handle drag', (WidgetTester tester) async { // Regression test https://github.com/flutter/flutter/issues/108242 bool isShow = true; late StateSetter setter; @@ -319,7 +318,7 @@ void main() { await tester.pump(); }); - testWidgetsWithLeakTracking('has expected defaults', (WidgetTester tester) async { + testWidgets('has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: const SelectableText('selectable text'), @@ -335,7 +334,7 @@ void main() { expect(selectableText.enableInteractiveSelection, true); }); - testWidgetsWithLeakTracking('Rich selectable text has expected defaults', (WidgetTester tester) async { + testWidgets('Rich selectable text has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData(), @@ -380,7 +379,7 @@ void main() { expect(selectableText.enableInteractiveSelection, true); }); - testWidgetsWithLeakTracking('Rich selectable text supports WidgetSpan', (WidgetTester tester) async { + testWidgets('Rich selectable text supports WidgetSpan', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( data: MediaQueryData(), @@ -421,7 +420,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('no text keyboard when widget is focused', (WidgetTester tester) async { + testWidgets('no text keyboard when widget is focused', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText('selectable text'), @@ -432,7 +431,7 @@ void main() { expect(tester.testTextInput.hasAnyClients, false); }); - testWidgetsWithLeakTracking('uses DefaultSelectionStyle for selection and cursor colors if provided', (WidgetTester tester) async { + testWidgets('uses DefaultSelectionStyle for selection and cursor colors if provided', (WidgetTester tester) async { const Color selectionColor = Colors.orange; const Color cursorColor = Colors.red; @@ -453,7 +452,7 @@ void main() { expect(state.widget.cursorColor, cursorColor); }); - testWidgetsWithLeakTracking('Selectable Text has adaptive size', (WidgetTester tester) async { + testWidgets('Selectable Text has adaptive size', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: const SelectableText('s'), @@ -475,7 +474,7 @@ void main() { expect(longtextBox.size, const Size(199.0, 14.0)); }); - testWidgetsWithLeakTracking('can scale with textScaleFactor', (WidgetTester tester) async { + testWidgets('can scale with textScaleFactor', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: const SelectableText('selectable text'), @@ -498,7 +497,7 @@ void main() { expect(scaledBox.size.height, 27.0); }); - testWidgetsWithLeakTracking('can switch between textWidthBasis', (WidgetTester tester) async { + testWidgets('can switch between textWidthBasis', (WidgetTester tester) async { RenderBox findTextBox() => tester.renderObject(find.byType(SelectableText)); const String text = 'I can face roll keyboardkeyboardaszzaaaaszzaaaaszzaaaaszzaaaa'; await tester.pumpWidget( @@ -524,7 +523,7 @@ void main() { expect(textBox.size, const Size(633.0, 28.0)); }); - testWidgetsWithLeakTracking('can switch between textHeightBehavior', (WidgetTester tester) async { + testWidgets('can switch between textHeightBehavior', (WidgetTester tester) async { const String text = 'selectable text'; const TextHeightBehavior textHeightBehavior = TextHeightBehavior( applyHeightToFirstAscent: false, @@ -548,7 +547,7 @@ void main() { expect(findRenderEditable(tester).textHeightBehavior, textHeightBehavior); }); - testWidgetsWithLeakTracking('Cursor blinks when showCursor is true', (WidgetTester tester) async { + testWidgets('Cursor blinks when showCursor is true', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText( @@ -576,7 +575,7 @@ void main() { expect(editableText.cursorCurrentlyVisible, equals(initialShowCursor)); }); - testWidgetsWithLeakTracking('selectable text selection toolbar renders correctly inside opacity', (WidgetTester tester) async { + testWidgets('selectable text selection toolbar renders correctly inside opacity', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -607,7 +606,7 @@ void main() { expect(find.text('Select all'), findsOneWidget); }); - testWidgetsWithLeakTracking('Caret position is updated on tap', (WidgetTester tester) async { + testWidgets('Caret position is updated on tap', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText('abc def ghi'), @@ -627,7 +626,7 @@ void main() { expect(editableText.controller.selection.extentOffset, tapIndex); }); - testWidgetsWithLeakTracking('enableInteractiveSelection = false, tap', (WidgetTester tester) async { + testWidgets('enableInteractiveSelection = false, tap', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText( @@ -650,7 +649,7 @@ void main() { expect(editableText.controller.selection.extentOffset, -1); }); - testWidgetsWithLeakTracking('enableInteractiveSelection = false, long-press', (WidgetTester tester) async { + testWidgets('enableInteractiveSelection = false, long-press', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText( @@ -675,7 +674,7 @@ void main() { expect(editableText.controller.selection.extentOffset, -1); }); - testWidgetsWithLeakTracking('Can long press to select', (WidgetTester tester) async { + testWidgets('Can long press to select', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText('abc def ghi'), @@ -704,7 +703,7 @@ void main() { expect(editableText.controller.selection.baseOffset, 9); }); - testWidgetsWithLeakTracking("Slight movements in longpress don't hide/show handles", (WidgetTester tester) async { + testWidgets("Slight movements in longpress don't hide/show handles", (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText('abc def ghi'), @@ -731,7 +730,7 @@ void main() { expect(handle.opacity.value, equals(1.0)); }); - testWidgetsWithLeakTracking('Mouse long press is just like a tap', (WidgetTester tester) async { + testWidgets('Mouse long press is just like a tap', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText('abc def ghi'), @@ -753,7 +752,7 @@ void main() { expect(editableText.controller.selection.extentOffset, eIndex); }); - testWidgetsWithLeakTracking('selectable text basic', (WidgetTester tester) async { + testWidgets('selectable text basic', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText('selectable'), @@ -785,7 +784,7 @@ void main() { expect(find.text('Cut'), findsNothing); }); - testWidgetsWithLeakTracking('selectable text can disable toolbar options', (WidgetTester tester) async { + testWidgets('selectable text can disable toolbar options', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText( @@ -805,7 +804,7 @@ void main() { expect(find.text('Select all'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can select text by dragging with a mouse', (WidgetTester tester) async { + testWidgets('Can select text by dragging with a mouse', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -833,7 +832,7 @@ void main() { expect(controller.selection.extentOffset, 8); }); - testWidgetsWithLeakTracking('Continuous dragging does not cause flickering', (WidgetTester tester) async { + testWidgets('Continuous dragging does not cause flickering', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -885,7 +884,7 @@ void main() { expect(controller.selection.extentOffset, 9); }); - testWidgetsWithLeakTracking('Dragging in opposite direction also works', (WidgetTester tester) async { + testWidgets('Dragging in opposite direction also works', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -913,7 +912,7 @@ void main() { expect(controller.selection.extentOffset, 5); }); - testWidgetsWithLeakTracking('Slow mouse dragging also selects text', (WidgetTester tester) async { + testWidgets('Slow mouse dragging also selects text', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -940,7 +939,7 @@ void main() { expect(controller.selection.extentOffset,8); }); - testWidgetsWithLeakTracking('Can drag handles to change selection', (WidgetTester tester) async { + testWidgets('Can drag handles to change selection', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -1002,7 +1001,7 @@ void main() { expect(controller.selection.extentOffset, 11); }); - testWidgetsWithLeakTracking('Dragging handles calls onSelectionChanged', (WidgetTester tester) async { + testWidgets('Dragging handles calls onSelectionChanged', (WidgetTester tester) async { TextSelection? newSelection; await tester.pumpWidget( MaterialApp( @@ -1054,7 +1053,7 @@ void main() { expect(newSelection!.extentOffset, 9); }); - testWidgetsWithLeakTracking('Cannot drag one handle past the other', (WidgetTester tester) async { + testWidgets('Cannot drag one handle past the other', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -1112,7 +1111,7 @@ void main() { expect(controller.selection.extentOffset, 5); }); - testWidgetsWithLeakTracking('Can use selection toolbar', (WidgetTester tester) async { + testWidgets('Can use selection toolbar', (WidgetTester tester) async { const String testValue = 'abc def ghi'; await tester.pumpWidget( const MaterialApp( @@ -1154,7 +1153,7 @@ void main() { expect(controller.selection.isCollapsed, true); }); - testWidgetsWithLeakTracking('Selectable height with maxLine', (WidgetTester tester) async { + testWidgets('Selectable height with maxLine', (WidgetTester tester) async { await tester.pumpWidget(selectableTextBuilder()); RenderBox findTextBox() => tester.renderObject(find.byType(SelectableText)); @@ -1206,7 +1205,7 @@ void main() { expect(textBox.size.height, greaterThan(fourLineInputSize.height)); }); - testWidgetsWithLeakTracking('Can drag handles to change selection in multiline', (WidgetTester tester) async { + testWidgets('Can drag handles to change selection in multiline', (WidgetTester tester) async { const String testValue = kThreeLines; await tester.pumpWidget( overlay( @@ -1294,7 +1293,7 @@ void main() { expect(controller.selection.isCollapsed, true); }); - testWidgetsWithLeakTracking('Can scroll multiline input', (WidgetTester tester) async { + testWidgets('Can scroll multiline input', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText( @@ -1388,7 +1387,7 @@ void main() { expect(inputBox.hitTest(BoxHitTestResult(), position: inputBox.globalToLocal(newFourthPos)), isFalse); }); - testWidgetsWithLeakTracking('minLines cannot be greater than maxLines', (WidgetTester tester) async { + testWidgets('minLines cannot be greater than maxLines', (WidgetTester tester) async { expect( () async { await tester.pumpWidget( @@ -1412,7 +1411,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Selectable height with minLine', (WidgetTester tester) async { + testWidgets('Selectable height with minLine', (WidgetTester tester) async { await tester.pumpWidget(selectableTextBuilder()); RenderBox findTextBox() => tester.renderObject(find.byType(SelectableText)); @@ -1426,7 +1425,7 @@ void main() { expect(textBox.size.height, emptyInputSize.height * 2); }); - testWidgetsWithLeakTracking('Can align to center', (WidgetTester tester) async { + testWidgets('Can align to center', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SizedBox( @@ -1448,7 +1447,7 @@ void main() { expect(topLeft.dx, equals(399.0)); }); - testWidgetsWithLeakTracking('Can align to center within center', (WidgetTester tester) async { + testWidgets('Can align to center within center', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SizedBox( @@ -1472,7 +1471,7 @@ void main() { expect(topLeft.dx, equals(399.0)); }); - testWidgetsWithLeakTracking('Selectable text is skipped during focus traversal', (WidgetTester tester) async { + testWidgets('Selectable text is skipped during focus traversal', (WidgetTester tester) async { final FocusNode firstFieldFocus = FocusNode(); addTearDown(firstFieldFocus.dispose); final FocusNode lastFieldFocus = FocusNode(); @@ -1512,7 +1511,7 @@ void main() { expect(lastFieldFocus.hasFocus, isTrue); }); - testWidgetsWithLeakTracking('Selectable text identifies as text field in semantics', (WidgetTester tester) async { + testWidgets('Selectable text identifies as text field in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1539,7 +1538,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Selectable text rich text with spell out in semantics', (WidgetTester tester) async { + testWidgets('Selectable text rich text with spell out in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1572,7 +1571,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Selectable text rich text with locale in semantics', (WidgetTester tester) async { + testWidgets('Selectable text rich text with locale in semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -1605,7 +1604,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Selectable rich text with gesture recognizer has correct semantics', (WidgetTester tester) async { + testWidgets('Selectable rich text with gesture recognizer has correct semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -1683,7 +1682,7 @@ void main() { controller = editableTextWidget.controller; } - testWidgetsWithLeakTracking('Shift test 1', (WidgetTester tester) async { + testWidgets('Shift test 1', (WidgetTester tester) async { await setupWidget(tester, 'a big house'); await tester.sendKeyDownEvent(LogicalKeyboardKey.shift); @@ -1692,7 +1691,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Shift test 2', (WidgetTester tester) async { + testWidgets('Shift test 2', (WidgetTester tester) async { await setupWidget(tester, 'abcdefghi'); controller.selection = const TextSelection.collapsed(offset: 3); @@ -1705,7 +1704,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Control Shift test', (WidgetTester tester) async { + testWidgets('Control Shift test', (WidgetTester tester) async { await setupWidget(tester, 'their big house'); await tester.sendKeyDownEvent(LogicalKeyboardKey.control); @@ -1718,7 +1717,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Down and up test', (WidgetTester tester) async { + testWidgets('Down and up test', (WidgetTester tester) async { await setupWidget(tester, 'a big house'); await tester.sendKeyDownEvent(LogicalKeyboardKey.shift); @@ -1737,7 +1736,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Down and up test 2', (WidgetTester tester) async { + testWidgets('Down and up test 2', (WidgetTester tester) async { await setupWidget(tester, 'a big house\njumped over a mouse\nOne more line yay'); controller.selection = const TextSelection.collapsed(offset: 0); @@ -1790,7 +1789,7 @@ void main() { }, variant: KeySimulatorTransitModeVariant.all()); }); - testWidgetsWithLeakTracking('Copy test', (WidgetTester tester) async { + testWidgets('Copy test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1850,7 +1849,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Select all test', (WidgetTester tester) async { + testWidgets('Select all test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); const String testValue = 'a big house\njumped over a mouse'; @@ -1886,7 +1885,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('keyboard selection should call onSelectionChanged', (WidgetTester tester) async { + testWidgets('keyboard selection should call onSelectionChanged', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); TextSelection? newSelection; @@ -1934,7 +1933,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Changing positions of selectable text', (WidgetTester tester) async { + testWidgets('Changing positions of selectable text', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<KeyEvent> events = <KeyEvent>[]; @@ -2026,7 +2025,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Changing focus test', (WidgetTester tester) async { + testWidgets('Changing focus test', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<KeyEvent> events = <KeyEvent>[]; @@ -2097,7 +2096,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('Caret works when maxLines is null', (WidgetTester tester) async { + testWidgets('Caret works when maxLines is null', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SelectableText( @@ -2120,7 +2119,7 @@ void main() { expect(controller.selection.baseOffset, 0); }); - testWidgetsWithLeakTracking('SelectableText baseline alignment no-strut', (WidgetTester tester) async { + testWidgets('SelectableText baseline alignment no-strut', (WidgetTester tester) async { final Key keyA = UniqueKey(); final Key keyB = UniqueKey(); @@ -2169,7 +2168,7 @@ void main() { expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY); }); - testWidgetsWithLeakTracking('SelectableText baseline alignment', (WidgetTester tester) async { + testWidgets('SelectableText baseline alignment', (WidgetTester tester) async { final Key keyA = UniqueKey(); final Key keyB = UniqueKey(); @@ -2216,7 +2215,7 @@ void main() { expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY); }); - testWidgetsWithLeakTracking('SelectableText semantics', (WidgetTester tester) async { + testWidgets('SelectableText semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); @@ -2336,7 +2335,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SelectableText semantics, with semanticsLabel', (WidgetTester tester) async { + testWidgets('SelectableText semantics, with semanticsLabel', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); @@ -2363,7 +2362,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SelectableText semantics, enableInteractiveSelection = false', (WidgetTester tester) async { + testWidgets('SelectableText semantics, enableInteractiveSelection = false', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); @@ -2409,7 +2408,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SelectableText semantics for selections', (WidgetTester tester) async { + testWidgets('SelectableText semantics for selections', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final Key key = UniqueKey(); @@ -2505,7 +2504,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('semantic nodes of offscreen recognizers are marked hidden', (WidgetTester tester) async { + testWidgets('semantic nodes of offscreen recognizers are marked hidden', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/100395. final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(fontSize: 200); @@ -2602,7 +2601,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SelectableText change selection with semantics', (WidgetTester tester) async { + testWidgets('SelectableText change selection with semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final SemanticsOwner semanticsOwner = tester.binding.pipelineOwner.semanticsOwner!; final Key key = UniqueKey(); @@ -2701,7 +2700,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Can activate SelectableText with explicit controller via semantics', (WidgetTester tester) async { + testWidgets('Can activate SelectableText with explicit controller via semantics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/17801 const String testValue = 'Hello'; @@ -2775,7 +2774,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('onTap is called upon tap', (WidgetTester tester) async { + testWidgets('onTap is called upon tap', (WidgetTester tester) async { int tapCount = 0; await tester.pumpWidget( overlay( @@ -2799,7 +2798,7 @@ void main() { expect(tapCount, 3); }); - testWidgetsWithLeakTracking('SelectableText style is merged with default text style', (WidgetTester tester) async { + testWidgets('SelectableText style is merged with default text style', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/23994 final TextStyle defaultStyle = TextStyle( color: Colors.blue[500], @@ -2846,7 +2845,7 @@ void main() { expect(editableText.style.color, isNull); }); - testWidgetsWithLeakTracking('style enforces required fields', (WidgetTester tester) async { + testWidgets('style enforces required fields', (WidgetTester tester) async { Widget buildFrame(TextStyle style) { return MaterialApp( home: Material( @@ -2878,7 +2877,7 @@ void main() { expect(tester.takeException(), isNotNull); }); - testWidgetsWithLeakTracking( + testWidgets( 'tap moves cursor to the edge of the word it tapped', (WidgetTester tester) async { await tester.pumpWidget( @@ -2910,7 +2909,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'tap moves cursor to the position tapped (Android)', (WidgetTester tester) async { await tester.pumpWidget( @@ -2942,7 +2941,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'two slow taps do not trigger a word selection', (WidgetTester tester) async { await tester.pumpWidget( @@ -2977,7 +2976,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word and first tap of double tap moves cursor', (WidgetTester tester) async { await tester.pumpWidget( @@ -3022,7 +3021,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word and first tap of double tap moves cursor and shows toolbar (Android)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3066,7 +3065,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap on top of cursor also selects word (Android)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3114,7 +3113,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap hold selects word', (WidgetTester tester) async { await tester.pumpWidget( @@ -3160,7 +3159,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap selects word with semantics label', (WidgetTester tester) async { await tester.pumpWidget( @@ -3193,7 +3192,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'tap after a double tap select is not affected (iOS)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3240,7 +3239,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press selects word and shows toolbar (iOS)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3275,7 +3274,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press selects word and shows toolbar (Android)', (WidgetTester tester) async { @@ -3306,7 +3305,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'long press selects word and shows custom toolbar (Cupertino)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3345,7 +3344,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press selects word and shows custom toolbar (Material)', (WidgetTester tester) async { @@ -3382,7 +3381,7 @@ void main() { variant: TargetPlatformVariant.all(), ); - testWidgetsWithLeakTracking( + testWidgets( 'textSelectionControls is passed to EditableText', (WidgetTester tester) async { await tester.pumpWidget( @@ -3402,7 +3401,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'long press tap cannot initiate a double tap', (WidgetTester tester) async { await tester.pumpWidget( @@ -3444,7 +3443,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag extends the selection to the word under the drag and shows toolbar on lift on non-Apple platforms', (WidgetTester tester) async { await tester.pumpWidget( @@ -3520,7 +3519,7 @@ void main() { variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag extends the selection to the word under the drag and shows toolbar on lift (iOS)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3612,7 +3611,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long press drag moves the cursor under the drag and shows toolbar on lift (macOS)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3690,7 +3689,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('long press drag can edge scroll', (WidgetTester tester) async { + testWidgets('long press drag can edge scroll', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -3794,7 +3793,7 @@ void main() { skip: true, // https://github.com/flutter/flutter/issues/64059 ); - testWidgetsWithLeakTracking( + testWidgets( 'long tap still selects after a double tap select (iOS)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3839,7 +3838,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'long tap still selects after a double tap select (macOS)', (WidgetTester tester) async { await tester.pumpWidget( @@ -3883,7 +3882,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS }), ); //convert - testWidgetsWithLeakTracking( + testWidgets( 'double tap after a long tap is not affected', (WidgetTester tester) async { await tester.pumpWidget( @@ -3931,7 +3930,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking( + testWidgets( 'double tap chains work', (WidgetTester tester) async { await tester.pumpWidget( @@ -4005,7 +4004,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('force press does not select a word on (android)', (WidgetTester tester) async { + testWidgets('force press does not select a word on (android)', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4041,7 +4040,7 @@ void main() { expect(find.byType(TextButton), findsNothing); }); - testWidgetsWithLeakTracking('force press selects word', (WidgetTester tester) async { + testWidgets('force press selects word', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4082,7 +4081,7 @@ void main() { expectCupertinoSelectionToolbar(); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('tap on non-force-press-supported devices work', (WidgetTester tester) async { + testWidgets('tap on non-force-press-supported devices work', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4130,7 +4129,7 @@ void main() { // https://github.com/flutter/flutter/issues/43445 }, variant: TargetPlatformVariant.only(TargetPlatform.iOS)); - testWidgetsWithLeakTracking('default SelectableText debugFillProperties', (WidgetTester tester) async { + testWidgets('default SelectableText debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SelectableText('something').debugFillProperties(builder); @@ -4142,7 +4141,7 @@ void main() { expect(description, <String>['data: something']); }); - testWidgetsWithLeakTracking('SelectableText implements debugFillProperties', (WidgetTester tester) async { + testWidgets('SelectableText implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); // Not checking controller, inputFormatters, focusNode. @@ -4189,7 +4188,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking( + testWidgets( 'strut basic single line', (WidgetTester tester) async { await tester.pumpWidget( @@ -4212,7 +4211,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut TextStyle increases height', (WidgetTester tester) async { await tester.pumpWidget( @@ -4259,7 +4258,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut basic multi line', (WidgetTester tester) async { await tester.pumpWidget( @@ -4283,7 +4282,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut no force small strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -4315,7 +4314,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut no force large strut', (WidgetTester tester) async { await tester.pumpWidget( @@ -4344,7 +4343,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut height override', (WidgetTester tester) async { await tester.pumpWidget( @@ -4373,7 +4372,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'strut forces field taller', (WidgetTester tester) async { await tester.pumpWidget( @@ -4404,7 +4403,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Caret center position', (WidgetTester tester) async { + testWidgets('Caret center position', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SizedBox( @@ -4440,7 +4439,7 @@ void main() { expect(topLeft.dx, equals(385)); }); - testWidgetsWithLeakTracking('Caret indexes into trailing whitespace center align', (WidgetTester tester) async { + testWidgets('Caret indexes into trailing whitespace center align', (WidgetTester tester) async { await tester.pumpWidget( overlay( child: const SizedBox( @@ -4486,7 +4485,7 @@ void main() { expect(topLeft.dx, equals(385)); }); - testWidgetsWithLeakTracking('selection handles are rendered and not faded away', (WidgetTester tester) async { + testWidgets('selection handles are rendered and not faded away', (WidgetTester tester) async { const String testText = 'lorem ipsum'; await tester.pumpWidget( const MaterialApp( @@ -4516,7 +4515,7 @@ void main() { expect(right.opacity.value, equals(1.0)); }); - testWidgetsWithLeakTracking('selection handles are rendered and not faded away', (WidgetTester tester) async { + testWidgets('selection handles are rendered and not faded away', (WidgetTester tester) async { const String testText = 'lorem ipsum'; await tester.pumpWidget( @@ -4544,7 +4543,7 @@ void main() { expect(right.opacity.value, equals(1.0)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('Long press shows handles and toolbar', (WidgetTester tester) async { + testWidgets('Long press shows handles and toolbar', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4563,7 +4562,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isTrue); }); - testWidgetsWithLeakTracking('Double tap shows handles and toolbar', (WidgetTester tester) async { + testWidgets('Double tap shows handles and toolbar', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4584,7 +4583,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse tap does not show handles nor toolbar', (WidgetTester tester) async { await tester.pumpWidget( @@ -4612,7 +4611,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse long press does not show handles nor toolbar', (WidgetTester tester) async { await tester.pumpWidget( @@ -4640,7 +4639,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'Mouse double tap does not show handles nor toolbar', (WidgetTester tester) async { await tester.pumpWidget( @@ -4672,7 +4671,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('text span with tap gesture recognizer works in selectable rich text', (WidgetTester tester) async { + testWidgets('text span with tap gesture recognizer works in selectable rich text', (WidgetTester tester) async { int spyTaps = 0; final TapGestureRecognizer spyRecognizer = TapGestureRecognizer() ..onTap = () { @@ -4724,7 +4723,7 @@ void main() { expect(spyTaps, 1); }); - testWidgetsWithLeakTracking('text span with long press gesture recognizer works in selectable rich text', (WidgetTester tester) async { + testWidgets('text span with long press gesture recognizer works in selectable rich text', (WidgetTester tester) async { int spyLongPress = 0; final LongPressGestureRecognizer spyRecognizer = LongPressGestureRecognizer() ..onLongPress = () { @@ -4777,7 +4776,7 @@ void main() { expect(spyLongPress, 1); }); - testWidgetsWithLeakTracking('SelectableText changes mouse cursor when hovered', (WidgetTester tester) async { + testWidgets('SelectableText changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4796,7 +4795,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('The handles show after pressing Select All', (WidgetTester tester) async { + testWidgets('The handles show after pressing Select All', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4833,7 +4832,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('The Select All calls on selection changed', (WidgetTester tester) async { + testWidgets('The Select All calls on selection changed', (WidgetTester tester) async { TextSelection? newSelection; await tester.pumpWidget( MaterialApp( @@ -4869,7 +4868,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('The Select All calls on selection changed with a mouse on windows and linux', (WidgetTester tester) async { + testWidgets('The Select All calls on selection changed with a mouse on windows and linux', (WidgetTester tester) async { const String string = 'abc def ghi'; TextSelection? newSelection; await tester.pumpWidget( @@ -4911,7 +4910,7 @@ void main() { }), ); - testWidgetsWithLeakTracking('Does not show handles when updated from the web engine', (WidgetTester tester) async { + testWidgets('Does not show handles when updated from the web engine', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Material( @@ -4951,7 +4950,7 @@ void main() { } }); - testWidgetsWithLeakTracking('onSelectionChanged is called when selection changes', (WidgetTester tester) async { + testWidgets('onSelectionChanged is called when selection changes', (WidgetTester tester) async { int onSelectionChangedCallCount = 0; await tester.pumpWidget( @@ -4981,7 +4980,7 @@ void main() { expect(onSelectionChangedCallCount, equals(3)); }); - testWidgetsWithLeakTracking('selecting a space selects the previous word on mobile', (WidgetTester tester) async { + testWidgets('selecting a space selects the previous word on mobile', (WidgetTester tester) async { TextSelection? selection; await tester.pumpWidget( @@ -5082,7 +5081,7 @@ void main() { expect(selection!.extentOffset, 1); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux, TargetPlatform.fuchsia })); - testWidgetsWithLeakTracking('double tapping a space selects the previous word on mobile', (WidgetTester tester) async { + testWidgets('double tapping a space selects the previous word on mobile', (WidgetTester tester) async { TextSelection? selection; await tester.pumpWidget( @@ -5147,7 +5146,7 @@ void main() { expect(selection!.extentOffset, 14); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android })); - testWidgetsWithLeakTracking('text selection style 1', (WidgetTester tester) async { + testWidgets('text selection style 1', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -5200,7 +5199,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('text selection style 2', (WidgetTester tester) async { + testWidgets('text selection style 2', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -5252,7 +5251,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('keeps alive when has focus', (WidgetTester tester) async { + testWidgets('keeps alive when has focus', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -5344,7 +5343,7 @@ void main() { late ValueNotifier<MagnifierInfo> magnifierInfo; final Widget fakeMagnifier = Container(key: UniqueKey()); - testWidgetsWithLeakTracking( + testWidgets( 'Can drag handles to show, unshow, and update magnifier', (WidgetTester tester) async { const String testValue = 'abc def ghi'; @@ -5413,7 +5412,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('SelectableText text span style is merged with default text style', (WidgetTester tester) async { + testWidgets('SelectableText text span style is merged with default text style', (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/71389 const TextStyle textStyle = TextStyle(color: Color(0xff00ff00), fontSize: 12.0); @@ -5434,7 +5433,7 @@ void main() { expect(editableText.style.fontSize, textStyle.fontSize); }); - testWidgetsWithLeakTracking('SelectableText text span style is merged with default text style', (WidgetTester tester) async { + testWidgets('SelectableText text span style is merged with default text style', (WidgetTester tester) async { TextSelection? selection; int count = 0; @@ -5474,7 +5473,7 @@ void main() { expect(count, 1); // The `onSelectionChanged` will not be triggered. }); - testWidgetsWithLeakTracking("Off-screen selected text doesn't throw exception", (WidgetTester tester) async { + testWidgets("Off-screen selected text doesn't throw exception", (WidgetTester tester) async { // This is a regression test for https://github.com/flutter/flutter/issues/123527 TextSelection? selection; diff --git a/packages/flutter/test/widgets/selection_container_test.dart b/packages/flutter/test/widgets/selection_container_test.dart index c6ceebf7781..ae7b70a4802 100644 --- a/packages/flutter/test/widgets/selection_container_test.dart +++ b/packages/flutter/test/widgets/selection_container_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -21,7 +20,7 @@ void main() { ); } - testWidgetsWithLeakTracking('updates its registrar and delegate based on the number of selectables', (WidgetTester tester) async { + testWidgets('updates its registrar and delegate based on the number of selectables', (WidgetTester tester) async { final TestSelectionRegistrar registrar = TestSelectionRegistrar(); final TestContainerDelegate delegate = TestContainerDelegate(); addTearDown(delegate.dispose); @@ -45,7 +44,7 @@ void main() { expect(delegate.selectables.length, 3); }); - testWidgetsWithLeakTracking('disabled container', (WidgetTester tester) async { + testWidgets('disabled container', (WidgetTester tester) async { final TestSelectionRegistrar registrar = TestSelectionRegistrar(); final TestContainerDelegate delegate = TestContainerDelegate(); addTearDown(delegate.dispose); @@ -70,7 +69,7 @@ void main() { expect(delegate.selectables.length, 0); }); - testWidgetsWithLeakTracking('Swapping out container delegate does not crash', (WidgetTester tester) async { + testWidgets('Swapping out container delegate does not crash', (WidgetTester tester) async { final TestSelectionRegistrar registrar = TestSelectionRegistrar(); final TestContainerDelegate delegate = TestContainerDelegate(); addTearDown(delegate.dispose); @@ -122,7 +121,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Can update within one frame', (WidgetTester tester) async { + testWidgets('Can update within one frame', (WidgetTester tester) async { final TestSelectionRegistrar registrar = TestSelectionRegistrar(); final TestContainerDelegate delegate = TestContainerDelegate(); addTearDown(delegate.dispose); @@ -152,7 +151,7 @@ void main() { expect(delegate.value.hasContent, isTrue); }); - testWidgetsWithLeakTracking('selection container registers itself if there is a selectable child', (WidgetTester tester) async { + testWidgets('selection container registers itself if there is a selectable child', (WidgetTester tester) async { final TestSelectionRegistrar registrar = TestSelectionRegistrar(); final TestContainerDelegate delegate = TestContainerDelegate(); addTearDown(delegate.dispose); @@ -196,7 +195,7 @@ void main() { expect(registrar.selectables.length, 0); }); - testWidgetsWithLeakTracking('selection container gets registrar from context if not provided', (WidgetTester tester) async { + testWidgets('selection container gets registrar from context if not provided', (WidgetTester tester) async { final TestSelectionRegistrar registrar = TestSelectionRegistrar(); final TestContainerDelegate delegate = TestContainerDelegate(); addTearDown(delegate.dispose); diff --git a/packages/flutter/test/widgets/semantics_10_test.dart b/packages/flutter/test/widgets/semantics_10_test.dart index d550253e9bb..0ef416efd64 100644 --- a/packages/flutter/test/widgets/semantics_10_test.dart +++ b/packages/flutter/test/widgets/semantics_10_test.dart @@ -6,12 +6,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('can cease to be semantics boundary after markNeedsSemanticsUpdate() has already been called once', (WidgetTester tester) async { + testWidgets('can cease to be semantics boundary after markNeedsSemanticsUpdate() has already been called once', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/semantics_11_test.dart b/packages/flutter/test/widgets/semantics_11_test.dart index 05b1d572eda..7979f319d60 100644 --- a/packages/flutter/test/widgets/semantics_11_test.dart +++ b/packages/flutter/test/widgets/semantics_11_test.dart @@ -6,12 +6,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('markNeedsSemanticsUpdate() called on non-boundary with non-boundary parent', (WidgetTester tester) async { + testWidgets('markNeedsSemanticsUpdate() called on non-boundary with non-boundary parent', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/semantics_1_test.dart b/packages/flutter/test/widgets/semantics_1_test.dart index 3631f73d2b2..7d475627942 100644 --- a/packages/flutter/test/widgets/semantics_1_test.dart +++ b/packages/flutter/test/widgets/semantics_1_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 1', (WidgetTester tester) async { + testWidgets('Semantics 1', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // smoketest diff --git a/packages/flutter/test/widgets/semantics_2_test.dart b/packages/flutter/test/widgets/semantics_2_test.dart index e56248d3d82..2a0c69bf357 100644 --- a/packages/flutter/test/widgets/semantics_2_test.dart +++ b/packages/flutter/test/widgets/semantics_2_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 2', (WidgetTester tester) async { + testWidgets('Semantics 2', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // this test is the same as the test in Semantics 1, but diff --git a/packages/flutter/test/widgets/semantics_3_test.dart b/packages/flutter/test/widgets/semantics_3_test.dart index 11757f5d5fd..32c1ac218b1 100644 --- a/packages/flutter/test/widgets/semantics_3_test.dart +++ b/packages/flutter/test/widgets/semantics_3_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 3', (WidgetTester tester) async { + testWidgets('Semantics 3', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // implicit annotators diff --git a/packages/flutter/test/widgets/semantics_4_test.dart b/packages/flutter/test/widgets/semantics_4_test.dart index 34ee195838e..084e1d30a20 100644 --- a/packages/flutter/test/widgets/semantics_4_test.dart +++ b/packages/flutter/test/widgets/semantics_4_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 4', (WidgetTester tester) async { + testWidgets('Semantics 4', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // O diff --git a/packages/flutter/test/widgets/semantics_5_test.dart b/packages/flutter/test/widgets/semantics_5_test.dart index 160c54303d3..16859cb921c 100644 --- a/packages/flutter/test/widgets/semantics_5_test.dart +++ b/packages/flutter/test/widgets/semantics_5_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 5', (WidgetTester tester) async { + testWidgets('Semantics 5', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/semantics_6_test.dart b/packages/flutter/test/widgets/semantics_6_test.dart index 88bd11fc1fb..30c126126b7 100644 --- a/packages/flutter/test/widgets/semantics_6_test.dart +++ b/packages/flutter/test/widgets/semantics_6_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('can change semantics in a branch blocked by BlockSemantics', (WidgetTester tester) async { + testWidgets('can change semantics in a branch blocked by BlockSemantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TestSemantics expectedSemantics = TestSemantics.root( diff --git a/packages/flutter/test/widgets/semantics_7_test.dart b/packages/flutter/test/widgets/semantics_7_test.dart index 3f9af1cad84..2ad88a3c446 100644 --- a/packages/flutter/test/widgets/semantics_7_test.dart +++ b/packages/flutter/test/widgets/semantics_7_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 7 - Merging', (WidgetTester tester) async { + testWidgets('Semantics 7 - Merging', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); String label; diff --git a/packages/flutter/test/widgets/semantics_8_test.dart b/packages/flutter/test/widgets/semantics_8_test.dart index ffea309d169..4fe5cd885f1 100644 --- a/packages/flutter/test/widgets/semantics_8_test.dart +++ b/packages/flutter/test/widgets/semantics_8_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics 8 - Merging with reset', (WidgetTester tester) async { + testWidgets('Semantics 8 - Merging with reset', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/semantics_9_test.dart b/packages/flutter/test/widgets/semantics_9_test.dart index 9d2ac510ef4..9152a13fce0 100644 --- a/packages/flutter/test/widgets/semantics_9_test.dart +++ b/packages/flutter/test/widgets/semantics_9_test.dart @@ -6,13 +6,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { group('BlockSemantics', () { - testWidgetsWithLeakTracking('hides semantic nodes of siblings', (WidgetTester tester) async { + testWidgets('hides semantic nodes of siblings', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Stack( @@ -50,7 +49,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('does not hides semantic nodes of siblings outside the current semantic boundary', (WidgetTester tester) async { + testWidgets('does not hides semantic nodes of siblings outside the current semantic boundary', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Directionality(textDirection: TextDirection.ltr, child: Stack( @@ -104,7 +103,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('node is semantic boundary and blocking previously painted nodes', (WidgetTester tester) async { + testWidgets('node is semantic boundary and blocking previously painted nodes', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey stackKey = GlobalKey(); diff --git a/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart b/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart index b2e67726b1c..a562a53891d 100644 --- a/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart +++ b/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics can merge sibling group', (WidgetTester tester) async { + testWidgets('Semantics can merge sibling group', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const SemanticsTag first = SemanticsTag('1'); const SemanticsTag second = SemanticsTag('2'); @@ -75,7 +74,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics can drop semantics config', (WidgetTester tester) async { + testWidgets('Semantics can drop semantics config', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const SemanticsTag first = SemanticsTag('1'); const SemanticsTag second = SemanticsTag('2'); @@ -133,7 +132,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics throws when mark the same config twice case 1', (WidgetTester tester) async { + testWidgets('Semantics throws when mark the same config twice case 1', (WidgetTester tester) async { const SemanticsTag first = SemanticsTag('1'); const SemanticsTag second = SemanticsTag('2'); const SemanticsTag third = SemanticsTag('3'); @@ -179,7 +178,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('Semantics throws when mark the same config twice case 2', (WidgetTester tester) async { + testWidgets('Semantics throws when mark the same config twice case 2', (WidgetTester tester) async { const SemanticsTag first = SemanticsTag('1'); const SemanticsTag second = SemanticsTag('2'); const SemanticsTag third = SemanticsTag('3'); @@ -225,7 +224,7 @@ void main() { expect(tester.takeException(), isAssertionError); }); - testWidgetsWithLeakTracking('RenderObject with semantics child delegate will mark correct boundary dirty', (WidgetTester tester) async { + testWidgets('RenderObject with semantics child delegate will mark correct boundary dirty', (WidgetTester tester) async { final UniqueKey inner = UniqueKey(); final UniqueKey boundaryParent = UniqueKey(); final UniqueKey grandBoundaryParent = UniqueKey(); diff --git a/packages/flutter/test/widgets/semantics_clipping_test.dart b/packages/flutter/test/widgets/semantics_clipping_test.dart index 8b63e86a08d..73554422dce 100644 --- a/packages/flutter/test/widgets/semantics_clipping_test.dart +++ b/packages/flutter/test/widgets/semantics_clipping_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('SemanticNode.rect is clipped', (WidgetTester tester) async { + testWidgets('SemanticNode.rect is clipped', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const Directionality( @@ -68,7 +67,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SemanticsNode is not removed if out of bounds and merged into something within bounds', (WidgetTester tester) async { + testWidgets('SemanticsNode is not removed if out of bounds and merged into something within bounds', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(const Directionality( diff --git a/packages/flutter/test/widgets/semantics_debugger_test.dart b/packages/flutter/test/widgets/semantics_debugger_test.dart index 4c48e696645..d5985b933d9 100644 --- a/packages/flutter/test/widgets/semantics_debugger_test.dart +++ b/packages/flutter/test/widgets/semantics_debugger_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SemanticsDebugger will schedule a frame', (WidgetTester tester) async { + testWidgets('SemanticsDebugger will schedule a frame', (WidgetTester tester) async { await tester.pumpWidget( SemanticsDebugger( child: Container(), @@ -18,7 +17,7 @@ void main() { expect(tester.binding.hasScheduledFrame, isTrue); }); - testWidgetsWithLeakTracking('SemanticsDebugger smoke test', (WidgetTester tester) async { + testWidgets('SemanticsDebugger smoke test', (WidgetTester tester) async { // This is a smoketest to verify that adding a debugger doesn't crash. await tester.pumpWidget( @@ -62,7 +61,7 @@ void main() { expect(true, isTrue); // expect that we reach here without crashing }); - testWidgetsWithLeakTracking('SemanticsDebugger reparents subtree', (WidgetTester tester) async { + testWidgets('SemanticsDebugger reparents subtree', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( @@ -148,7 +147,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('SemanticsDebugger interaction test', (WidgetTester tester) async { + testWidgets('SemanticsDebugger interaction test', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -186,7 +185,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('SemanticsDebugger interaction test - negative', (WidgetTester tester) async { + testWidgets('SemanticsDebugger interaction test - negative', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( @@ -226,7 +225,7 @@ void main() { log.clear(); }); - testWidgetsWithLeakTracking('SemanticsDebugger scroll test', (WidgetTester tester) async { + testWidgets('SemanticsDebugger scroll test', (WidgetTester tester) async { final Key childKey = UniqueKey(); await tester.pumpWidget( @@ -269,7 +268,7 @@ void main() { expect(tester.getTopLeft(find.byKey(childKey)).dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SemanticsDebugger long press', (WidgetTester tester) async { + testWidgets('SemanticsDebugger long press', (WidgetTester tester) async { bool didLongPress = false; await tester.pumpWidget( @@ -291,7 +290,7 @@ void main() { expect(didLongPress, isTrue); }); - testWidgetsWithLeakTracking('SemanticsDebugger slider', (WidgetTester tester) async { + testWidgets('SemanticsDebugger slider', (WidgetTester tester) async { double value = 0.75; await tester.pumpWidget( @@ -338,7 +337,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('SemanticsDebugger checkbox', (WidgetTester tester) async { + testWidgets('SemanticsDebugger checkbox', (WidgetTester tester) async { final Key keyTop = UniqueKey(); final Key keyBottom = UniqueKey(); @@ -379,7 +378,7 @@ void main() { expect(valueTop, isFalse); }); - testWidgetsWithLeakTracking('SemanticsDebugger checkbox message', (WidgetTester tester) async { + testWidgets('SemanticsDebugger checkbox message', (WidgetTester tester) async { final Key checkbox = UniqueKey(); final Key checkboxUnchecked = UniqueKey(); final Key checkboxDisabled = UniqueKey(); @@ -451,7 +450,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SemanticsDebugger ignores duplicated label and tooltip for Android', (WidgetTester tester) async { + testWidgets('SemanticsDebugger ignores duplicated label and tooltip for Android', (WidgetTester tester) async { final Key child = UniqueKey(); final Key debugger = UniqueKey(); final bool isPlatformAndroid = defaultTargetPlatform == TargetPlatform.android; @@ -478,7 +477,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('SemanticsDebugger textfield', (WidgetTester tester) async { + testWidgets('SemanticsDebugger textfield', (WidgetTester tester) async { final UniqueKey textField = UniqueKey(); final UniqueKey debugger = UniqueKey(); @@ -505,7 +504,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SemanticsDebugger label style is used in the painter.', (WidgetTester tester) async { + testWidgets('SemanticsDebugger label style is used in the painter.', (WidgetTester tester) async { final UniqueKey debugger = UniqueKey(); const TextStyle labelStyle = TextStyle(color: Colors.amber); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart b/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart index 915b7fc6c64..64ccd4a383a 100644 --- a/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart +++ b/packages/flutter/test/widgets/semantics_keep_alive_offstage_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Un-layouted RenderObject in keep alive offstage area do not crash semantics compiler', (WidgetTester tester) async { + testWidgets('Un-layouted RenderObject in keep alive offstage area do not crash semantics compiler', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/20313. final SemanticsTester semantics = SemanticsTester(tester); diff --git a/packages/flutter/test/widgets/semantics_merge_test.dart b/packages/flutter/test/widgets/semantics_merge_test.dart index 82d3c8157aa..a4a997d37b9 100644 --- a/packages/flutter/test/widgets/semantics_merge_test.dart +++ b/packages/flutter/test/widgets/semantics_merge_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -15,7 +14,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('MergeSemantics', (WidgetTester tester) async { + testWidgets('MergeSemantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // not merged @@ -121,7 +120,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('MergeSemantics works if other nodes are implicitly merged into its node', (WidgetTester tester) async { + testWidgets('MergeSemantics works if other nodes are implicitly merged into its node', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/semantics_test.dart b/packages/flutter/test/widgets/semantics_test.dart index 8ec5e337994..8a95217212f 100644 --- a/packages/flutter/test/widgets/semantics_test.dart +++ b/packages/flutter/test/widgets/semantics_test.dart @@ -7,7 +7,6 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -16,7 +15,7 @@ void main() { debugResetSemanticsIdCounter(); }); - testWidgetsWithLeakTracking('Semantics shutdown and restart', (WidgetTester tester) async { + testWidgets('Semantics shutdown and restart', (WidgetTester tester) async { SemanticsTester? semantics = SemanticsTester(tester); final TestSemantics expectedSemantics = TestSemantics.root( @@ -60,7 +59,7 @@ void main() { semantics.dispose(); }, semanticsEnabled: false); - testWidgetsWithLeakTracking('Semantics tag only applies to immediate child', (WidgetTester tester) async { + testWidgets('Semantics tag only applies to immediate child', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -96,7 +95,7 @@ void main() { semantics.dispose(); }, semanticsEnabled: false); - testWidgetsWithLeakTracking('Semantics tooltip', (WidgetTester tester) async { + testWidgets('Semantics tooltip', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TestSemantics expectedSemantics = TestSemantics.root( @@ -124,7 +123,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Detach and reattach assert', (WidgetTester tester) async { + testWidgets('Detach and reattach assert', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final GlobalKey key = GlobalKey(); @@ -202,7 +201,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics and Directionality - RTL', (WidgetTester tester) async { + testWidgets('Semantics and Directionality - RTL', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -219,7 +218,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics and Directionality - LTR', (WidgetTester tester) async { + testWidgets('Semantics and Directionality - LTR', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -236,7 +235,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics and Directionality - cannot override RTL with LTR', (WidgetTester tester) async { + testWidgets('Semantics and Directionality - cannot override RTL with LTR', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TestSemantics expectedSemantics = TestSemantics.root( @@ -263,7 +262,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics and Directionality - cannot override LTR with RTL', (WidgetTester tester) async { + testWidgets('Semantics and Directionality - cannot override LTR with RTL', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TestSemantics expectedSemantics = TestSemantics.root( @@ -290,7 +289,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics label and hint', (WidgetTester tester) async { + testWidgets('Semantics label and hint', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -320,7 +319,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics hints can merge', (WidgetTester tester) async { + testWidgets('Semantics hints can merge', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -356,7 +355,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics values do not merge', (WidgetTester tester) async { + testWidgets('Semantics values do not merge', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -407,7 +406,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics value and hint can merge', (WidgetTester tester) async { + testWidgets('Semantics value and hint can merge', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -443,7 +442,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics tagForChildren works', (WidgetTester tester) async { + testWidgets('Semantics tagForChildren works', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -491,7 +490,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widget supports all actions', (WidgetTester tester) async { + testWidgets('Semantics widget supports all actions', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<SemanticsAction> performedActions = <SemanticsAction>[]; @@ -581,7 +580,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widget supports all flags', (WidgetTester tester) async { + testWidgets('Semantics widget supports all flags', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // Checked state and toggled state are mutually exclusive. await tester.pumpWidget( @@ -711,7 +710,7 @@ void main() { expect(semantics, hasSemantics(expectedSemantics, ignoreId: true)); }); - testWidgetsWithLeakTracking('Actions can be replaced without triggering semantics update', (WidgetTester tester) async { + testWidgets('Actions can be replaced without triggering semantics update', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int semanticsUpdateCount = 0; final SemanticsHandle handle = tester.binding.pipelineOwner.ensureSemantics( @@ -808,7 +807,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('onTapHint and onLongPressHint create custom actions', (WidgetTester tester) async { + testWidgets('onTapHint and onLongPressHint create custom actions', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); await tester.pumpWidget(Semantics( container: true, @@ -834,7 +833,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('CustomSemanticsActions can be added to a Semantics widget', (WidgetTester tester) async { + testWidgets('CustomSemanticsActions can be added to a Semantics widget', (WidgetTester tester) async { final SemanticsHandle semantics = tester.ensureSemantics(); await tester.pumpWidget(Semantics( container: true, @@ -853,7 +852,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Increased/decreased values are annotated', (WidgetTester tester) async { + testWidgets('Increased/decreased values are annotated', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -885,7 +884,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widgets built in a widget tree are sorted properly', (WidgetTester tester) async { + testWidgets('Semantics widgets built in a widget tree are sorted properly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int semanticsUpdateCount = 0; final SemanticsHandle handle = tester.binding.pipelineOwner.ensureSemantics( @@ -968,7 +967,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widgets built with explicit sort orders are sorted properly', (WidgetTester tester) async { + testWidgets('Semantics widgets built with explicit sort orders are sorted properly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int semanticsUpdateCount = 0; final SemanticsHandle handle = tester.binding.pipelineOwner.ensureSemantics( @@ -1026,7 +1025,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widgets without sort orders are sorted properly', (WidgetTester tester) async { + testWidgets('Semantics widgets without sort orders are sorted properly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int semanticsUpdateCount = 0; final SemanticsHandle handle = tester.binding.pipelineOwner.ensureSemantics( @@ -1087,7 +1086,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widgets that are transformed are sorted properly', (WidgetTester tester) async { + testWidgets('Semantics widgets that are transformed are sorted properly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int semanticsUpdateCount = 0; final SemanticsHandle handle = tester.binding.pipelineOwner.ensureSemantics( @@ -1151,7 +1150,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics widgets without sort orders are sorted properly when no Directionality is present', (WidgetTester tester) async { + testWidgets('Semantics widgets without sort orders are sorted properly when no Directionality is present', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); int semanticsUpdateCount = 0; final SemanticsHandle handle = tester.binding.pipelineOwner.ensureSemantics(listener: () { @@ -1252,7 +1251,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Semantics excludeSemantics ignores children', (WidgetTester tester) async { + testWidgets('Semantics excludeSemantics ignores children', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Semantics( label: 'label', @@ -1280,7 +1279,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Can change handlers', (WidgetTester tester) async { + testWidgets('Can change handlers', (WidgetTester tester) async { await tester.pumpWidget(Semantics( container: true, label: 'foo', @@ -1667,7 +1666,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Semantics with zero transform gets dropped', (WidgetTester tester) async { + testWidgets('Semantics with zero transform gets dropped', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/110671. // Construct a widget tree that will end up with a fitted box that applies // a zero transform because it does not actually draw its children. @@ -1694,7 +1693,7 @@ void main() { expect(node.childrenCount, 0); }); - testWidgetsWithLeakTracking('blocking user interaction works on explicit child node.', (WidgetTester tester) async { + testWidgets('blocking user interaction works on explicit child node.', (WidgetTester tester) async { final UniqueKey key1 = UniqueKey(); final UniqueKey key2 = UniqueKey(); await tester.pumpWidget( @@ -1737,7 +1736,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('blocking user interaction on a merged child', (WidgetTester tester) async { + testWidgets('blocking user interaction on a merged child', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( @@ -1772,7 +1771,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('does not merge conflicting actions even if one of them is blocked', (WidgetTester tester) async { + testWidgets('does not merge conflicting actions even if one of them is blocked', (WidgetTester tester) async { final UniqueKey key = UniqueKey(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart b/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart index 479f20e6319..1f7aec466cf 100644 --- a/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart +++ b/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart @@ -10,7 +10,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -53,7 +52,7 @@ void _tests() { // also update this code to reflect the new output. // // This test is flexible w.r.t. leading and trailing whitespace. - testWidgetsWithLeakTracking('generates code', (WidgetTester tester) async { + testWidgets('generates code', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await pumpTestWidget(tester); final String code = semantics @@ -92,7 +91,7 @@ void _tests() { expect('$code,', expectedCode); }); - testWidgetsWithLeakTracking('generated code is correct', (WidgetTester tester) async { + testWidgets('generated code is correct', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await pumpTestWidget(tester); expect( diff --git a/packages/flutter/test/widgets/semantics_tester_test.dart b/packages/flutter/test/widgets/semantics_tester_test.dart index ba50165cff2..4b5701a2fbe 100644 --- a/packages/flutter/test/widgets/semantics_tester_test.dart +++ b/packages/flutter/test/widgets/semantics_tester_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Semantics tester visits last child', (WidgetTester tester) async { + testWidgets('Semantics tester visits last child', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); diff --git a/packages/flutter/test/widgets/semantics_traversal_test.dart b/packages/flutter/test/widgets/semantics_traversal_test.dart index 23247ad6513..a509ab2d2cf 100644 --- a/packages/flutter/test/widgets/semantics_traversal_test.dart +++ b/packages/flutter/test/widgets/semantics_traversal_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -22,7 +21,7 @@ void main() { }); void testTraversal(String description, TraversalTestFunction testFunction) { - testWidgetsWithLeakTracking(description, (WidgetTester tester) async { + testWidgets(description, (WidgetTester tester) async { final TraversalTester traversalTester = TraversalTester(tester); await testFunction(traversalTester); traversalTester.dispose(); diff --git a/packages/flutter/test/widgets/semantics_zero_surface_size_test.dart b/packages/flutter/test/widgets/semantics_zero_surface_size_test.dart index 273c437cca4..07c58cdafa4 100644 --- a/packages/flutter/test/widgets/semantics_zero_surface_size_test.dart +++ b/packages/flutter/test/widgets/semantics_zero_surface_size_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('has only root node if surface size is 0x0', (WidgetTester tester) async { + testWidgets('has only root node if surface size is 0x0', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(Semantics( diff --git a/packages/flutter/test/widgets/set_state_1_test.dart b/packages/flutter/test/widgets/set_state_1_test.dart index dc85b46e470..ca29a40b26f 100644 --- a/packages/flutter/test/widgets/set_state_1_test.dart +++ b/packages/flutter/test/widgets/set_state_1_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Inside extends StatefulWidget { const Inside({ super.key }); @@ -66,7 +65,7 @@ class OutsideState extends State<Outside> { } void main() { - testWidgetsWithLeakTracking('setState() smoke test', (WidgetTester tester) async { + testWidgets('setState() smoke test', (WidgetTester tester) async { await tester.pumpWidget(const Outside()); final Offset location = tester.getCenter(find.text('INSIDE')); final TestGesture gesture = await tester.startGesture(location); diff --git a/packages/flutter/test/widgets/set_state_2_test.dart b/packages/flutter/test/widgets/set_state_2_test.dart index 1894cea871b..4df03006cff 100644 --- a/packages/flutter/test/widgets/set_state_2_test.dart +++ b/packages/flutter/test/widgets/set_state_2_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('setState() overbuild test', (WidgetTester tester) async { + testWidgets('setState() overbuild test', (WidgetTester tester) async { final List<String> log = <String>[]; final Builder inner = Builder( builder: (BuildContext context) { diff --git a/packages/flutter/test/widgets/set_state_3_test.dart b/packages/flutter/test/widgets/set_state_3_test.dart index 534d9cb9766..461746e98a1 100644 --- a/packages/flutter/test/widgets/set_state_3_test.dart +++ b/packages/flutter/test/widgets/set_state_3_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; late ChangerState changer; @@ -53,7 +52,7 @@ class LeafState extends State<Leaf> { } void main() { - testWidgetsWithLeakTracking('three-way setState() smoke test', (WidgetTester tester) async { + testWidgets('three-way setState() smoke test', (WidgetTester tester) async { await tester.pumpWidget(const Changer(Wrapper(Leaf()))); await tester.pumpWidget(const Changer(Wrapper(Leaf()))); changer.test(); diff --git a/packages/flutter/test/widgets/set_state_4_test.dart b/packages/flutter/test/widgets/set_state_4_test.dart index 2349f8151a3..e0fc2e7ee06 100644 --- a/packages/flutter/test/widgets/set_state_4_test.dart +++ b/packages/flutter/test/widgets/set_state_4_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Changer extends StatefulWidget { const Changer({ super.key }); @@ -22,7 +21,7 @@ class ChangerState extends State<Changer> { } void main() { - testWidgetsWithLeakTracking('setState() catches being used with an async callback', (WidgetTester tester) async { + testWidgets('setState() catches being used with an async callback', (WidgetTester tester) async { await tester.pumpWidget(const Changer()); final ChangerState s = tester.state(find.byType(Changer)); expect(s.test0, isNot(throwsFlutterError)); diff --git a/packages/flutter/test/widgets/set_state_5_test.dart b/packages/flutter/test/widgets/set_state_5_test.dart index 335d427d643..fd7bdaccd73 100644 --- a/packages/flutter/test/widgets/set_state_5_test.dart +++ b/packages/flutter/test/widgets/set_state_5_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class BadWidget extends StatefulWidget { const BadWidget({ super.key }); @@ -28,7 +27,7 @@ class BadWidgetState extends State<BadWidget> { } void main() { - testWidgetsWithLeakTracking('setState() catches being used inside a constructor', (WidgetTester tester) async { + testWidgets('setState() catches being used inside a constructor', (WidgetTester tester) async { await tester.pumpWidget(const BadWidget()); expect(tester.takeException(), isFlutterError); }); diff --git a/packages/flutter/test/widgets/shader_mask_test.dart b/packages/flutter/test/widgets/shader_mask_test.dart index 7b941c06d49..018950f20bc 100644 --- a/packages/flutter/test/widgets/shader_mask_test.dart +++ b/packages/flutter/test/widgets/shader_mask_test.dart @@ -9,7 +9,6 @@ library; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Shader createShader(Rect bounds) { return const LinearGradient( @@ -22,12 +21,12 @@ Shader createShader(Rect bounds) { void main() { - testWidgetsWithLeakTracking('Can be constructed', (WidgetTester tester) async { + testWidgets('Can be constructed', (WidgetTester tester) async { const Widget child = SizedBox(width: 100.0, height: 100.0); await tester.pumpWidget(const ShaderMask(shaderCallback: createShader, child: child)); }); - testWidgetsWithLeakTracking('Bounds rect includes offset', (WidgetTester tester) async { + testWidgets('Bounds rect includes offset', (WidgetTester tester) async { late Rect shaderBounds; Shader recordShaderBounds(Rect bounds) { shaderBounds = bounds; @@ -51,7 +50,7 @@ void main() { }); - testWidgetsWithLeakTracking('Bounds rect includes offset visual inspection', (WidgetTester tester) async { + testWidgets('Bounds rect includes offset visual inspection', (WidgetTester tester) async { final Widget widgetBottomRight = Container( width: 400, height: 400, diff --git a/packages/flutter/test/widgets/shadow_test.dart b/packages/flutter/test/widgets/shadow_test.dart index f2d5f93b429..eb97b9af2d9 100644 --- a/packages/flutter/test/widgets/shadow_test.dart +++ b/packages/flutter/test/widgets/shadow_test.dart @@ -9,14 +9,13 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { tearDown(() { debugDisableShadows = true; }); - testWidgetsWithLeakTracking('Shadows on BoxDecoration', (WidgetTester tester) async { + testWidgets('Shadows on BoxDecoration', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -62,7 +61,7 @@ void main() { ); } for (final int elevation in kElevationToShadow.keys) { - testWidgetsWithLeakTracking('elevation $elevation', (WidgetTester tester) async { + testWidgets('elevation $elevation', (WidgetTester tester) async { debugDisableShadows = false; await tester.pumpWidget(build(elevation)); await expectLater( @@ -74,7 +73,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Shadows with PhysicalLayer', (WidgetTester tester) async { + testWidgets('Shadows with PhysicalLayer', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -133,7 +132,7 @@ void main() { } for (final int elevation in kElevationToShadow.keys) { - testWidgetsWithLeakTracking('elevation $elevation', (WidgetTester tester) async { + testWidgets('elevation $elevation', (WidgetTester tester) async { debugDisableShadows = false; await tester.pumpWidget(build(elevation.toDouble())); await expectLater( diff --git a/packages/flutter/test/widgets/shape_decoration_test.dart b/packages/flutter/test/widgets/shape_decoration_test.dart index 0db118ad09d..1926745869c 100644 --- a/packages/flutter/test/widgets/shape_decoration_test.dart +++ b/packages/flutter/test/widgets/shape_decoration_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' as ui show Image; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import '../painting/mocks_for_image_cache.dart'; @@ -17,7 +16,7 @@ Future<void> main() async { AutomatedTestWidgetsFlutterBinding(); final ui.Image rawImage = await decodeImageFromList(Uint8List.fromList(kTransparentImage)); final ImageProvider image = TestImageProvider(0, 0, image: rawImage); - testWidgetsWithLeakTracking('ShapeDecoration.image', (WidgetTester tester) async { + testWidgets('ShapeDecoration.image', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: DecoratedBox( @@ -40,7 +39,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('ShapeDecoration.color', (WidgetTester tester) async { + testWidgets('ShapeDecoration.color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: DecoratedBox( @@ -69,7 +68,7 @@ Future<void> main() async { expect(decoration.padding, isA<EdgeInsetsDirectional>()); }); - testWidgetsWithLeakTracking('TestBorder and Directionality - 1', (WidgetTester tester) async { + testWidgets('TestBorder and Directionality - 1', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( MaterialApp( @@ -90,7 +89,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('TestBorder and Directionality - 2', (WidgetTester tester) async { + testWidgets('TestBorder and Directionality - 2', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget( Directionality( @@ -114,7 +113,7 @@ Future<void> main() async { ); }); - testWidgetsWithLeakTracking('Does not crash with directional gradient', (WidgetTester tester) async { + testWidgets('Does not crash with directional gradient', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/76967. await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/shared_app_data_test.dart b/packages/flutter/test/widgets/shared_app_data_test.dart index db9ec5d3a02..6d57734d4b1 100644 --- a/packages/flutter/test/widgets/shared_app_data_test.dart +++ b/packages/flutter/test/widgets/shared_app_data_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SharedAppData basics', (WidgetTester tester) async { + testWidgets('SharedAppData basics', (WidgetTester tester) async { int columnBuildCount = 0; int child1BuildCount = 0; int child2BuildCount = 0; @@ -117,7 +116,7 @@ void main() { expect(find.text('null').evaluate().length, 2); }); - testWidgetsWithLeakTracking('WidgetsApp SharedAppData ', (WidgetTester tester) async { + testWidgets('WidgetsApp SharedAppData ', (WidgetTester tester) async { int parentBuildCount = 0; int childBuildCount = 0; @@ -155,7 +154,7 @@ void main() { expect(find.text('child'), findsOneWidget); }); - testWidgetsWithLeakTracking('WidgetsApp SharedAppData Shadowing', (WidgetTester tester) async { + testWidgets('WidgetsApp SharedAppData Shadowing', (WidgetTester tester) async { int innerTapCount = 0; int outerTapCount = 0; diff --git a/packages/flutter/test/widgets/shortcuts_test.dart b/packages/flutter/test/widgets/shortcuts_test.dart index c536aaeabb5..3faa9424f9b 100644 --- a/packages/flutter/test/widgets/shortcuts_test.dart +++ b/packages/flutter/test/widgets/shortcuts_test.dart @@ -112,7 +112,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('handles two keys', (WidgetTester tester) async { + testWidgets('handles two keys', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( LogicalKeySet( @@ -211,7 +211,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('isActivatedBy works as expected', (WidgetTester tester) async { + testWidgets('isActivatedBy works as expected', (WidgetTester tester) async { // Collect some key events to use for testing. final List<KeyEvent> events = <KeyEvent>[]; await tester.pumpWidget( @@ -256,7 +256,7 @@ void main() { }); group(SingleActivator, () { - testWidgetsWithLeakTracking('handles Ctrl-C', (WidgetTester tester) async { + testWidgets('handles Ctrl-C', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const SingleActivator( @@ -356,7 +356,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('handles repeated events', (WidgetTester tester) async { + testWidgets('handles repeated events', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const SingleActivator( @@ -383,7 +383,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('rejects repeated events if requested', (WidgetTester tester) async { + testWidgets('rejects repeated events if requested', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const SingleActivator( @@ -411,7 +411,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('handles Shift-Ctrl-C', (WidgetTester tester) async { + testWidgets('handles Shift-Ctrl-C', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const SingleActivator( @@ -461,7 +461,7 @@ void main() { expect(HardwareKeyboard.instance.logicalKeysPressed, isEmpty); }); - testWidgetsWithLeakTracking('isActivatedBy works as expected', (WidgetTester tester) async { + testWidgets('isActivatedBy works as expected', (WidgetTester tester) async { // Collect some key events to use for testing. final List<KeyEvent> events = <KeyEvent>[]; await tester.pumpWidget( @@ -555,14 +555,14 @@ void main() { }); group(Shortcuts, () { - testWidgetsWithLeakTracking('Default constructed Shortcuts has empty shortcuts', (WidgetTester tester) async { + testWidgets('Default constructed Shortcuts has empty shortcuts', (WidgetTester tester) async { const Shortcuts shortcuts = Shortcuts(shortcuts: <LogicalKeySet, Intent>{}, child: SizedBox()); await tester.pumpWidget(shortcuts); expect(shortcuts.shortcuts, isNotNull); expect(shortcuts.shortcuts, isEmpty); }); - testWidgetsWithLeakTracking('Default constructed Shortcuts.manager has empty shortcuts', (WidgetTester tester) async { + testWidgets('Default constructed Shortcuts.manager has empty shortcuts', (WidgetTester tester) async { final ShortcutManager manager = ShortcutManager(); addTearDown(manager.dispose); expect(manager.shortcuts, isNotNull); @@ -573,7 +573,7 @@ void main() { expect(shortcuts.shortcuts, isEmpty); }); - testWidgetsWithLeakTracking('Shortcuts.manager passes on shortcuts', (WidgetTester tester) async { + testWidgets('Shortcuts.manager passes on shortcuts', (WidgetTester tester) async { final Map<LogicalKeySet, Intent> testShortcuts = <LogicalKeySet, Intent>{ LogicalKeySet(LogicalKeyboardKey.shift): const TestIntent(), }; @@ -587,7 +587,7 @@ void main() { expect(shortcuts.shortcuts, equals(testShortcuts)); }); - testWidgetsWithLeakTracking('ShortcutManager handles shortcuts', (WidgetTester tester) async { + testWidgets('ShortcutManager handles shortcuts', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -623,7 +623,7 @@ void main() { expect(pressedKeys, equals(<LogicalKeyboardKey>[LogicalKeyboardKey.shiftLeft])); }); - testWidgetsWithLeakTracking('Shortcuts.manager lets manager handle shortcuts', (WidgetTester tester) async { + testWidgets('Shortcuts.manager lets manager handle shortcuts', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -659,7 +659,7 @@ void main() { expect(pressedKeys, equals(<LogicalKeyboardKey>[LogicalKeyboardKey.shiftLeft])); }); - testWidgetsWithLeakTracking('ShortcutManager ignores key presses with no primary focus', (WidgetTester tester) async { + testWidgets('ShortcutManager ignores key presses with no primary focus', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -700,7 +700,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("Shortcuts passes to the next Shortcuts widget if it doesn't map the key", (WidgetTester tester) async { + testWidgets("Shortcuts passes to the next Shortcuts widget if it doesn't map the key", (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -741,7 +741,7 @@ void main() { expect(pressedKeys, equals(<LogicalKeyboardKey>[LogicalKeyboardKey.shiftLeft])); }); - testWidgetsWithLeakTracking('Shortcuts can disable a shortcut with Intent.doNothing', (WidgetTester tester) async { + testWidgets('Shortcuts can disable a shortcut with Intent.doNothing', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -784,7 +784,7 @@ void main() { expect(pressedKeys, isEmpty); }); - testWidgetsWithLeakTracking("Shortcuts that aren't bound to an action don't absorb keys meant for text fields", (WidgetTester tester) async { + testWidgets("Shortcuts that aren't bound to an action don't absorb keys meant for text fields", (WidgetTester tester) async { final GlobalKey textFieldKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -810,7 +810,7 @@ void main() { expect(pressedKeys, equals(<LogicalKeyboardKey>[LogicalKeyboardKey.keyA])); }); - testWidgetsWithLeakTracking('Shortcuts that are bound to an action do override text fields', (WidgetTester tester) async { + testWidgets('Shortcuts that are bound to an action do override text fields', (WidgetTester tester) async { final GlobalKey textFieldKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -848,7 +848,7 @@ void main() { expect(invoked, isTrue); }); - testWidgetsWithLeakTracking('Shortcuts can override intents that apply to text fields', (WidgetTester tester) async { + testWidgets('Shortcuts can override intents that apply to text fields', (WidgetTester tester) async { final GlobalKey textFieldKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -890,7 +890,7 @@ void main() { expect(invoked, isFalse); }); - testWidgetsWithLeakTracking('Shortcuts can override intents that apply to text fields with DoNothingAndStopPropagationIntent', (WidgetTester tester) async { + testWidgets('Shortcuts can override intents that apply to text fields with DoNothingAndStopPropagationIntent', (WidgetTester tester) async { final GlobalKey textFieldKey = GlobalKey(); final List<LogicalKeyboardKey> pressedKeys = <LogicalKeyboardKey>[]; final TestShortcutManager testManager = TestShortcutManager( @@ -1033,7 +1033,7 @@ void main() { expect(description[1], equalsIgnoringHashCodes('shortcuts: {{Key A + Key B}: ActivateIntent#00000}')); }); - testWidgetsWithLeakTracking('Shortcuts support multiple intents', (WidgetTester tester) async { + testWidgets('Shortcuts support multiple intents', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp() { @@ -1114,7 +1114,7 @@ void main() { expect(controller.position.pixels, 0.0); }); - testWidgetsWithLeakTracking('Shortcuts support activators that returns null in triggers', (WidgetTester tester) async { + testWidgets('Shortcuts support activators that returns null in triggers', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const DumbLogicalActivator(LogicalKeyboardKey.keyC), @@ -1156,7 +1156,7 @@ void main() { }); group('CharacterActivator', () { - testWidgetsWithLeakTracking('is triggered on events with correct character', (WidgetTester tester) async { + testWidgets('is triggered on events with correct character', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const CharacterActivator('?'), @@ -1175,7 +1175,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('handles repeated events', (WidgetTester tester) async { + testWidgets('handles repeated events', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const CharacterActivator('?'), @@ -1196,7 +1196,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('rejects repeated events if requested', (WidgetTester tester) async { + testWidgets('rejects repeated events if requested', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const CharacterActivator('?', includeRepeats: false), @@ -1217,7 +1217,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('handles Alt, Ctrl and Meta', (WidgetTester tester) async { + testWidgets('handles Alt, Ctrl and Meta', (WidgetTester tester) async { int invoked = 0; await tester.pumpWidget(activatorTester( const CharacterActivator('?', alt: true, meta: true, control: true), @@ -1264,7 +1264,7 @@ void main() { // ignore: deprecated_member_use }, variant: KeySimulatorTransitModeVariant.all()); - testWidgetsWithLeakTracking('isActivatedBy works as expected', (WidgetTester tester) async { + testWidgets('isActivatedBy works as expected', (WidgetTester tester) async { // Collect some key events to use for testing. final List<KeyEvent> events = <KeyEvent>[]; await tester.pumpWidget( @@ -1345,7 +1345,7 @@ void main() { }); group('CallbackShortcuts', () { - testWidgetsWithLeakTracking('trigger on key events', (WidgetTester tester) async { + testWidgets('trigger on key events', (WidgetTester tester) async { int invokedA = 0; int invokedB = 0; await tester.pumpWidget( @@ -1383,7 +1383,7 @@ void main() { expect(invokedB, equals(1)); }); - testWidgetsWithLeakTracking('nested CallbackShortcuts stop propagation', (WidgetTester tester) async { + testWidgets('nested CallbackShortcuts stop propagation', (WidgetTester tester) async { int invokedOuter = 0; int invokedInner = 0; await tester.pumpWidget( @@ -1416,7 +1416,7 @@ void main() { expect(invokedInner, equals(1)); }); - testWidgetsWithLeakTracking('non-overlapping nested CallbackShortcuts fire appropriately', (WidgetTester tester) async { + testWidgets('non-overlapping nested CallbackShortcuts fire appropriately', (WidgetTester tester) async { int invokedOuter = 0; int invokedInner = 0; await tester.pumpWidget( @@ -1453,7 +1453,7 @@ void main() { expect(invokedInner, equals(1)); }); - testWidgetsWithLeakTracking('Works correctly with Shortcuts too', (WidgetTester tester) async { + testWidgets('Works correctly with Shortcuts too', (WidgetTester tester) async { int invokedCallbackA = 0; int invokedCallbackB = 0; int invokedActionA = 0; @@ -1527,7 +1527,7 @@ void main() { }); group('ShortcutRegistrar', () { - testWidgetsWithLeakTracking('trigger ShortcutRegistrar on key events', (WidgetTester tester) async { + testWidgets('trigger ShortcutRegistrar on key events', (WidgetTester tester) async { int invokedA = 0; int invokedB = 0; await tester.pumpWidget( @@ -1572,7 +1572,7 @@ void main() { expect(invokedB, equals(1)); }); - testWidgetsWithLeakTracking('MaterialApp has a ShortcutRegistrar listening', (WidgetTester tester) async { + testWidgets('MaterialApp has a ShortcutRegistrar listening', (WidgetTester tester) async { int invokedA = 0; int invokedB = 0; await tester.pumpWidget( @@ -1617,7 +1617,7 @@ void main() { expect(invokedB, equals(1)); }); - testWidgetsWithLeakTracking("doesn't override text field shortcuts", (WidgetTester tester) async { + testWidgets("doesn't override text field shortcuts", (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MaterialApp( @@ -1649,7 +1649,7 @@ void main() { expect(controller.selection.extentOffset, equals(7)); }); - testWidgetsWithLeakTracking('nested ShortcutRegistrars stop propagation', (WidgetTester tester) async { + testWidgets('nested ShortcutRegistrars stop propagation', (WidgetTester tester) async { int invokedOuter = 0; int invokedInner = 0; await tester.pumpWidget( @@ -1690,7 +1690,7 @@ void main() { expect(invokedInner, equals(1)); }); - testWidgetsWithLeakTracking('non-overlapping nested ShortcutRegistrars fire appropriately', (WidgetTester tester) async { + testWidgets('non-overlapping nested ShortcutRegistrars fire appropriately', (WidgetTester tester) async { int invokedOuter = 0; int invokedInner = 0; await tester.pumpWidget( @@ -1736,7 +1736,7 @@ void main() { expect(invokedInner, equals(1)); }); - testWidgetsWithLeakTracking('Works correctly with Shortcuts too', (WidgetTester tester) async { + testWidgets('Works correctly with Shortcuts too', (WidgetTester tester) async { int invokedCallbackA = 0; int invokedCallbackB = 0; int invokedActionA = 0; @@ -1813,7 +1813,7 @@ void main() { await tester.sendKeyUpEvent(LogicalKeyboardKey.keyB); }); - testWidgetsWithLeakTracking('Updating shortcuts triggers dependency rebuild', (WidgetTester tester) async { + testWidgets('Updating shortcuts triggers dependency rebuild', (WidgetTester tester) async { final List<Map<ShortcutActivator, Intent>> shortcutsChanged = <Map<ShortcutActivator, Intent>>[]; void dependenciesUpdated(Map<ShortcutActivator, Intent> shortcuts) { shortcutsChanged.add(shortcuts); @@ -1887,7 +1887,7 @@ void main() { })); }); - testWidgetsWithLeakTracking('using a disposed token asserts', (WidgetTester tester) async { + testWidgets('using a disposed token asserts', (WidgetTester tester) async { final ShortcutRegistry registry = ShortcutRegistry(); addTearDown(registry.dispose); final ShortcutRegistryEntry token = registry.addAll(const <ShortcutActivator, Intent>{ @@ -1897,7 +1897,7 @@ void main() { expect(() {token.replaceAll(<ShortcutActivator, Intent>{}); }, throwsFlutterError); }); - testWidgetsWithLeakTracking('setting duplicate bindings asserts', (WidgetTester tester) async { + testWidgets('setting duplicate bindings asserts', (WidgetTester tester) async { final ShortcutRegistry registry = ShortcutRegistry(); addTearDown(registry.dispose); final ShortcutRegistryEntry token = registry.addAll(const <ShortcutActivator, Intent>{ diff --git a/packages/flutter/test/widgets/simple_semantics_test.dart b/packages/flutter/test/widgets/simple_semantics_test.dart index 34b0733a948..4b5729ea5d4 100644 --- a/packages/flutter/test/widgets/simple_semantics_test.dart +++ b/packages/flutter/test/widgets/simple_semantics_test.dart @@ -6,12 +6,11 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Simple tree is simple', (WidgetTester tester) async { + testWidgets('Simple tree is simple', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( @@ -35,7 +34,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Simple tree is simple - material', (WidgetTester tester) async { + testWidgets('Simple tree is simple - material', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // Not using Text widget because of https://github.com/flutter/flutter/issues/12357. diff --git a/packages/flutter/test/widgets/single_child_scroll_view_test.dart b/packages/flutter/test/widgets/single_child_scroll_view_test.dart index dfe67d39ff2..0256b3e7267 100644 --- a/packages/flutter/test/widgets/single_child_scroll_view_test.dart +++ b/packages/flutter/test/widgets/single_child_scroll_view_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart' show TestClipPaintingContext; import 'semantics_tester.dart'; @@ -145,7 +144,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SingleChildScrollView control test', (WidgetTester tester) async { + testWidgets('SingleChildScrollView control test', (WidgetTester tester) async { await tester.pumpWidget(SingleChildScrollView( child: Container( height: 2000.0, @@ -161,7 +160,7 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(const Offset(0.0, -200.0))); }); - testWidgetsWithLeakTracking('Changing controllers changes scroll position', (WidgetTester tester) async { + testWidgets('Changing controllers changes scroll position', (WidgetTester tester) async { final TestScrollController controller = TestScrollController(); addTearDown(controller.dispose); @@ -184,7 +183,7 @@ void main() { expect(scrollable.position, isA<TestScrollPosition>()); }); - testWidgetsWithLeakTracking('Sets PrimaryScrollController when primary', (WidgetTester tester) async { + testWidgets('Sets PrimaryScrollController when primary', (WidgetTester tester) async { final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); await tester.pumpWidget(PrimaryScrollController( @@ -203,7 +202,7 @@ void main() { }); - testWidgetsWithLeakTracking('Changing scroll controller inside dirty layout builder does not assert', (WidgetTester tester) async { + testWidgets('Changing scroll controller inside dirty layout builder does not assert', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -241,17 +240,17 @@ void main() { )); }); - testWidgetsWithLeakTracking('Vertical SingleChildScrollViews are not primary by default', (WidgetTester tester) async { + testWidgets('Vertical SingleChildScrollViews are not primary by default', (WidgetTester tester) async { const SingleChildScrollView view = SingleChildScrollView(); expect(view.primary, isNull); }); - testWidgetsWithLeakTracking('Horizontal SingleChildScrollViews are not primary by default', (WidgetTester tester) async { + testWidgets('Horizontal SingleChildScrollViews are not primary by default', (WidgetTester tester) async { const SingleChildScrollView view = SingleChildScrollView(scrollDirection: Axis.horizontal); expect(view.primary, isNull); }); - testWidgetsWithLeakTracking('SingleChildScrollViews with controllers are not primary by default', (WidgetTester tester) async { + testWidgets('SingleChildScrollViews with controllers are not primary by default', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final SingleChildScrollView view = SingleChildScrollView( @@ -260,7 +259,7 @@ void main() { expect(view.primary, isNull); }); - testWidgetsWithLeakTracking('Vertical SingleChildScrollViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { + testWidgets('Vertical SingleChildScrollViews use PrimaryScrollController by default on mobile', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -270,7 +269,7 @@ void main() { expect(controller.hasClients, isTrue); }, variant: TargetPlatformVariant.mobile()); - testWidgetsWithLeakTracking("Vertical SingleChildScrollViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { + testWidgets("Vertical SingleChildScrollViews don't use PrimaryScrollController by default on desktop", (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(primaryScrollControllerBoilerplate( @@ -280,7 +279,7 @@ void main() { expect(controller.hasClients, isFalse); }, variant: TargetPlatformVariant.desktop()); - testWidgetsWithLeakTracking('Nested scrollables have a null PrimaryScrollController', (WidgetTester tester) async { + testWidgets('Nested scrollables have a null PrimaryScrollController', (WidgetTester tester) async { const Key innerKey = Key('inner'); final ScrollController primaryScrollController = ScrollController(); addTearDown(primaryScrollController.dispose); @@ -309,7 +308,7 @@ void main() { expect(innerScrollable.controller, isNull); }); - testWidgetsWithLeakTracking('SingleChildScrollView semantics', (WidgetTester tester) async { + testWidgets('SingleChildScrollView semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -405,7 +404,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SingleChildScrollView semantics clips cover entire child vertical', (WidgetTester tester) async { + testWidgets('SingleChildScrollView semantics clips cover entire child vertical', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final UniqueKey scrollView = UniqueKey(); @@ -445,7 +444,7 @@ void main() { expect(semanticsClip.size.height, length); }); - testWidgetsWithLeakTracking('SingleChildScrollView semantics clips cover entire child', (WidgetTester tester) async { + testWidgets('SingleChildScrollView semantics clips cover entire child', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final UniqueKey scrollView = UniqueKey(); @@ -486,7 +485,7 @@ void main() { expect(semanticsClip.size.width, length); }); - testWidgetsWithLeakTracking('SingleChildScrollView getOffsetToReveal - will not assert on axis mismatch', (WidgetTester tester) async { + testWidgets('SingleChildScrollView getOffsetToReveal - will not assert on axis mismatch', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -520,7 +519,7 @@ void main() { viewport.getOffsetToReveal(target, 0.0, axis: Axis.horizontal); }); - testWidgetsWithLeakTracking('SingleChildScrollView getOffsetToReveal - down', (WidgetTester tester) async { + testWidgets('SingleChildScrollView getOffsetToReveal - down', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -568,7 +567,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(40.0, 190.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView getOffsetToReveal - up', (WidgetTester tester) async { + testWidgets('SingleChildScrollView getOffsetToReveal - up', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); final List<Widget> children = List<Widget>.generate(20, (int i) { @@ -617,7 +616,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(40.0, 0.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView getOffsetToReveal - right', (WidgetTester tester) async { + testWidgets('SingleChildScrollView getOffsetToReveal - right', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); List<Widget> children; @@ -667,7 +666,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(190.0, 40.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('SingleChildScrollView getOffsetToReveal - left', (WidgetTester tester) async { + testWidgets('SingleChildScrollView getOffsetToReveal - left', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); final List<Widget> children = List<Widget>.generate(20, (int i) { @@ -718,7 +717,7 @@ void main() { expect(revealed.rect, const Rect.fromLTWH(0.0, 40.0, 10.0, 10.0)); }); - testWidgetsWithLeakTracking('Nested SingleChildScrollView showOnScreen', (WidgetTester tester) async { + testWidgets('Nested SingleChildScrollView showOnScreen', (WidgetTester tester) async { final List<List<Widget>> children = List<List<Widget>>.generate(10, (int x) { return List<Widget>.generate(10, (int y) { return SizedBox( @@ -930,7 +929,7 @@ void main() { ); } - testWidgetsWithLeakTracking('in view in inner, but not in outer', (WidgetTester tester) async { + testWidgets('in view in inner, but not in outer', (WidgetTester tester) async { final ScrollController inner = ScrollController(); addTearDown(inner.dispose); final ScrollController outer = ScrollController(); @@ -949,7 +948,7 @@ void main() { expect(outer.offset, 100.0); }); - testWidgetsWithLeakTracking('not in view of neither inner nor outer', (WidgetTester tester) async { + testWidgets('not in view of neither inner nor outer', (WidgetTester tester) async { final ScrollController inner = ScrollController(); addTearDown(inner.dispose); final ScrollController outer = ScrollController(); @@ -968,7 +967,7 @@ void main() { expect(outer.offset, 200.0); }); - testWidgetsWithLeakTracking('in view in inner and outer', (WidgetTester tester) async { + testWidgets('in view in inner and outer', (WidgetTester tester) async { final ScrollController inner = ScrollController(initialScrollOffset: 200.0); addTearDown(inner.dispose); final ScrollController outer = ScrollController(initialScrollOffset: 200.0); @@ -987,7 +986,7 @@ void main() { expect(inner.offset, 200.0); }); - testWidgetsWithLeakTracking('inner shown in outer, but item not visible', (WidgetTester tester) async { + testWidgets('inner shown in outer, but item not visible', (WidgetTester tester) async { final ScrollController inner = ScrollController(initialScrollOffset: 200.0); addTearDown(inner.dispose); final ScrollController outer = ScrollController(initialScrollOffset: 200.0); @@ -1006,7 +1005,7 @@ void main() { expect(inner.offset, 400.0); }); - testWidgetsWithLeakTracking('inner half shown in outer, item only visible in inner', (WidgetTester tester) async { + testWidgets('inner half shown in outer, item only visible in inner', (WidgetTester tester) async { final ScrollController inner = ScrollController(); addTearDown(inner.dispose); final ScrollController outer = ScrollController(initialScrollOffset: 100.0); @@ -1026,7 +1025,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('keyboardDismissBehavior tests', (WidgetTester tester) async { + testWidgets('keyboardDismissBehavior tests', (WidgetTester tester) async { final List<FocusNode> focusNodes = List<FocusNode>.generate(50, (int i) => FocusNode()); addTearDown(() { for (final FocusNode node in focusNodes) { diff --git a/packages/flutter/test/widgets/size_changed_layout_notification_test.dart b/packages/flutter/test/widgets/size_changed_layout_notification_test.dart index f4b1e886205..6f8c8c83c17 100644 --- a/packages/flutter/test/widgets/size_changed_layout_notification_test.dart +++ b/packages/flutter/test/widgets/size_changed_layout_notification_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SizeChangedLayoutNotification test', (WidgetTester tester) async { + testWidgets('SizeChangedLayoutNotification test', (WidgetTester tester) async { bool notified = false; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/sized_box_test.dart b/packages/flutter/test/widgets/sized_box_test.dart index 60822a1e31b..4d1d5094e1a 100644 --- a/packages/flutter/test/widgets/sized_box_test.dart +++ b/packages/flutter/test/widgets/sized_box_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SizedBox constructors', (WidgetTester tester) async { + testWidgets('SizedBox constructors', (WidgetTester tester) async { const SizedBox a = SizedBox(); expect(a.width, isNull); expect(a.height, isNull); @@ -38,7 +37,7 @@ void main() { expect(g.height, 0.0); }); - testWidgetsWithLeakTracking('SizedBox - no child', (WidgetTester tester) async { + testWidgets('SizedBox - no child', (WidgetTester tester) async { final GlobalKey patient = GlobalKey(); await tester.pumpWidget( @@ -110,7 +109,7 @@ void main() { expect(patient.currentContext!.size, equals(Size.zero)); }); - testWidgetsWithLeakTracking('SizedBox - container child', (WidgetTester tester) async { + testWidgets('SizedBox - container child', (WidgetTester tester) async { final GlobalKey patient = GlobalKey(); await tester.pumpWidget( @@ -189,7 +188,7 @@ void main() { expect(patient.currentContext!.size, equals(Size.zero)); }); - testWidgetsWithLeakTracking('SizedBox.square tests', (WidgetTester tester) async { + testWidgets('SizedBox.square tests', (WidgetTester tester) async { await tester.pumpWidget( const SizedBox.square( dimension: 100, diff --git a/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart b/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart index 41d222c353c..4c898ef3c59 100644 --- a/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart +++ b/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('!pinned && !floating && !bottom ==> fade opacity', (WidgetTester tester) async { + testWidgets('!pinned && !floating && !bottom ==> fade opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -28,7 +27,7 @@ void main() { expect(render.text.style!.color!.opacity, 0.0); }); - testWidgetsWithLeakTracking('!pinned && !floating && bottom ==> fade opacity', (WidgetTester tester) async { + testWidgets('!pinned && !floating && bottom ==> fade opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -48,7 +47,7 @@ void main() { expect(render.text.style!.color!.opacity, 0.0); }); - testWidgetsWithLeakTracking('!pinned && floating && !bottom ==> fade opacity', (WidgetTester tester) async { + testWidgets('!pinned && floating && !bottom ==> fade opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -68,7 +67,7 @@ void main() { expect(render.text.style!.color!.opacity, 0.0); }); - testWidgetsWithLeakTracking('!pinned && floating && bottom ==> fade opacity', (WidgetTester tester) async { + testWidgets('!pinned && floating && bottom ==> fade opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -88,7 +87,7 @@ void main() { expect(render.text.style!.color!.opacity, 0.0); }); - testWidgetsWithLeakTracking('pinned && !floating && !bottom ==> 1.0 opacity', (WidgetTester tester) async { + testWidgets('pinned && !floating && !bottom ==> 1.0 opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -108,7 +107,7 @@ void main() { expect(render.text.style!.color!.opacity, 1.0); }); - testWidgetsWithLeakTracking('pinned && !floating && bottom ==> 1.0 opacity', (WidgetTester tester) async { + testWidgets('pinned && !floating && bottom ==> 1.0 opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -128,7 +127,7 @@ void main() { expect(render.text.style!.color!.opacity, 1.0); }); - testWidgetsWithLeakTracking('pinned && floating && !bottom ==> 1.0 opacity', (WidgetTester tester) async { + testWidgets('pinned && floating && !bottom ==> 1.0 opacity', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25000. final ScrollController controller = ScrollController(); @@ -150,7 +149,7 @@ void main() { expect(render.text.style!.color!.opacity, 1.0); }); - testWidgetsWithLeakTracking('pinned && floating && bottom && extraToolbarHeight == 0.0 ==> fade opacity', (WidgetTester tester) async { + testWidgets('pinned && floating && bottom && extraToolbarHeight == 0.0 ==> fade opacity', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/25993. final ScrollController controller = ScrollController(); @@ -172,7 +171,7 @@ void main() { expect(render.text.style!.color!.opacity, 0.0); }); - testWidgetsWithLeakTracking('pinned && floating && bottom && extraToolbarHeight != 0.0 ==> 1.0 opacity', (WidgetTester tester) async { + testWidgets('pinned && floating && bottom && extraToolbarHeight != 0.0 ==> 1.0 opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -193,7 +192,7 @@ void main() { expect(render.text.style!.color!.opacity, 1.0); }); - testWidgetsWithLeakTracking('!pinned && !floating && !bottom && extraToolbarHeight != 0.0 ==> fade opacity', (WidgetTester tester) async { + testWidgets('!pinned && !floating && !bottom && extraToolbarHeight != 0.0 ==> fade opacity', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); const double collapsedHeight = 100.0; diff --git a/packages/flutter/test/widgets/sliver_constrained_cross_axis_test.dart b/packages/flutter/test/widgets/sliver_constrained_cross_axis_test.dart index 6cf42bd9cb9..0fa6bf5eff4 100644 --- a/packages/flutter/test/widgets/sliver_constrained_cross_axis_test.dart +++ b/packages/flutter/test/widgets/sliver_constrained_cross_axis_test.dart @@ -5,13 +5,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const double VIEWPORT_HEIGHT = 500; const double VIEWPORT_WIDTH = 300; void main() { - testWidgetsWithLeakTracking('SliverConstrainedCrossAxis basic test', (WidgetTester tester) async { + testWidgets('SliverConstrainedCrossAxis basic test', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverConstrainedCrossAxis(maxExtent: 50)); final RenderBox box = tester.renderObject(find.byType(Container)); @@ -22,7 +21,7 @@ void main() { expect(sliver.geometry!.paintExtent, equals(100)); }); - testWidgetsWithLeakTracking('SliverConstrainedCrossAxis updates correctly', (WidgetTester tester) async { + testWidgets('SliverConstrainedCrossAxis updates correctly', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverConstrainedCrossAxis(maxExtent: 50)); final RenderBox box1 = tester.renderObject(find.byType(Container)); @@ -36,7 +35,7 @@ void main() { expect(box2.size.width, 80); }); - testWidgetsWithLeakTracking('SliverConstrainedCrossAxis uses parent extent if maxExtent is greater', (WidgetTester tester) async { + testWidgets('SliverConstrainedCrossAxis uses parent extent if maxExtent is greater', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverConstrainedCrossAxis(maxExtent: 400)); final RenderBox box = tester.renderObject(find.byType(Container)); @@ -44,7 +43,7 @@ void main() { expect(box.size.width, VIEWPORT_WIDTH); }); - testWidgetsWithLeakTracking('SliverConstrainedCrossAxis constrains the height when direction is horizontal', (WidgetTester tester) async { + testWidgets('SliverConstrainedCrossAxis constrains the height when direction is horizontal', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverConstrainedCrossAxis( maxExtent: 50, scrollDirection: Axis.horizontal, @@ -54,7 +53,7 @@ void main() { expect(box.size.height, 50); }); - testWidgetsWithLeakTracking('SliverConstrainedCrossAxis sets its own flex to 0', (WidgetTester tester) async { + testWidgets('SliverConstrainedCrossAxis sets its own flex to 0', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverConstrainedCrossAxis( maxExtent: 50, )); diff --git a/packages/flutter/test/widgets/sliver_constraints_test.dart b/packages/flutter/test/widgets/sliver_constraints_test.dart index e2ac47afe7d..56565b69ebb 100644 --- a/packages/flutter/test/widgets/sliver_constraints_test.dart +++ b/packages/flutter/test/widgets/sliver_constraints_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('precedingScrollExtent is reported as infinity for Sliver of unknown size', (WidgetTester tester) async { + testWidgets('precedingScrollExtent is reported as infinity for Sliver of unknown size', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: CustomScrollView( diff --git a/packages/flutter/test/widgets/sliver_cross_axis_group_test.dart b/packages/flutter/test/widgets/sliver_cross_axis_group_test.dart index 139077213f3..a238c14e915 100644 --- a/packages/flutter/test/widgets/sliver_cross_axis_group_test.dart +++ b/packages/flutter/test/widgets/sliver_cross_axis_group_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/sliver_utils.dart'; @@ -15,7 +14,7 @@ const double VIEWPORT_HEIGHT = 600; const double VIEWPORT_WIDTH = 300; void main() { - testWidgetsWithLeakTracking('SliverCrossAxisGroup is laid out properly', (WidgetTester tester) async { + testWidgets('SliverCrossAxisGroup is laid out properly', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -63,7 +62,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('SliverExpanded is laid out properly', (WidgetTester tester) async { + testWidgets('SliverExpanded is laid out properly', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( slivers: <Widget>[ @@ -101,7 +100,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('SliverConstrainedCrossAxis is laid out properly', (WidgetTester tester) async { + testWidgets('SliverConstrainedCrossAxis is laid out properly', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( slivers: <Widget>[ @@ -130,7 +129,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('Mix of slivers is laid out properly', (WidgetTester tester) async { + testWidgets('Mix of slivers is laid out properly', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( slivers: <Widget>[ @@ -163,7 +162,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('Mix of slivers is laid out properly when horizontal', (WidgetTester tester) async { + testWidgets('Mix of slivers is laid out properly when horizontal', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( scrollDirection: Axis.horizontal, @@ -218,7 +217,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('Mix of slivers is laid out properly when reversed horizontal', (WidgetTester tester) async { + testWidgets('Mix of slivers is laid out properly when reversed horizontal', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( scrollDirection: Axis.horizontal, @@ -274,7 +273,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('Mix of slivers is laid out properly when reversed vertical', (WidgetTester tester) async { + testWidgets('Mix of slivers is laid out properly when reversed vertical', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( reverse: true, @@ -357,7 +356,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Hit test works properly on various parts of SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('Hit test works properly on various parts of SliverCrossAxisGroup', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -429,7 +428,7 @@ void main() { expect(clickedTile, equals('Group 1 Tile 2')); }); - testWidgetsWithLeakTracking('Constrained sliver takes up remaining space', (WidgetTester tester) async { + testWidgets('Constrained sliver takes up remaining space', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); await tester.pumpWidget(_buildSliverCrossAxisGroup( slivers: <Widget>[ @@ -458,7 +457,7 @@ void main() { expect(renderGroup.geometry!.scrollExtent, equals(300 * 20)); }); - testWidgetsWithLeakTracking('Assertion error when constrained widget runs out of cross axis extent', (WidgetTester tester) async { + testWidgets('Assertion error when constrained widget runs out of cross axis extent', (WidgetTester tester) async { final List<FlutterErrorDetails> errors = <FlutterErrorDetails>[]; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails error) => errors.add(error); @@ -480,7 +479,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Assertion error when expanded widget runs out of cross axis extent', (WidgetTester tester) async { + testWidgets('Assertion error when expanded widget runs out of cross axis extent', (WidgetTester tester) async { final List<FlutterErrorDetails> errors = <FlutterErrorDetails>[]; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails error) => errors.add(error); @@ -503,7 +502,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('applyPaintTransform is implemented properly', (WidgetTester tester) async { + testWidgets('applyPaintTransform is implemented properly', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverCrossAxisGroup( slivers: <Widget>[ const SliverToBoxAdapter(child: Text('first box')), @@ -519,7 +518,7 @@ void main() { expect(second.localToGlobal(Offset.zero), const Offset(VIEWPORT_WIDTH / 2, 0)); }); - testWidgetsWithLeakTracking('SliverPinnedPersistentHeader is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('SliverPinnedPersistentHeader is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -545,7 +544,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(-20.0)); }); - testWidgetsWithLeakTracking('SliverFloatingPersistentHeader is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('SliverFloatingPersistentHeader is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -575,7 +574,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverPinnedPersistentHeader is painted within bounds of SliverCrossAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { + testWidgets('SliverPinnedPersistentHeader is painted within bounds of SliverCrossAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -606,7 +605,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverFloatingPersistentHeader is painted within bounds of SliverCrossAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { + testWidgets('SliverFloatingPersistentHeader is painted within bounds of SliverCrossAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -643,7 +642,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverPinnedFloatingPersistentHeader is painted within bounds of SliverCrossAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { + testWidgets('SliverPinnedFloatingPersistentHeader is painted within bounds of SliverCrossAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -681,7 +680,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverAppBar with floating: false, pinned: false, snap: false is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('SliverAppBar with floating: false, pinned: false, snap: false is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -711,7 +710,7 @@ void main() { expect(renderHeader.geometry!.paintExtent, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverAppBar with floating: true, pinned: false, snap: true is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('SliverAppBar with floating: true, pinned: false, snap: true is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -752,7 +751,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(-50.0)); }); - testWidgetsWithLeakTracking('SliverAppBar with floating: true, pinned: true, snap: true is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { + testWidgets('SliverAppBar with floating: true, pinned: true, snap: true is painted within bounds of SliverCrossAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -793,7 +792,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(-50.0)); }); - testWidgetsWithLeakTracking('SliverFloatingPersistentHeader scroll direction is not affected by controller.jumpTo', (WidgetTester tester) async { + testWidgets('SliverFloatingPersistentHeader scroll direction is not affected by controller.jumpTo', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(_buildSliverCrossAxisGroup( @@ -823,7 +822,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverCrossAxisGroup skips painting invisible children', (WidgetTester tester) async { + testWidgets('SliverCrossAxisGroup skips painting invisible children', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart index a1965c49f76..90692a69394 100644 --- a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart +++ b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart @@ -6,7 +6,6 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { @@ -40,7 +39,7 @@ void main() { group('SliverFillRemaining', () { group('hasScrollBody: true, default', () { - testWidgetsWithLeakTracking('no siblings', (WidgetTester tester) async { + testWidgets('no siblings', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -81,7 +80,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('one sibling', (WidgetTester tester) async { + testWidgets('one sibling', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget( @@ -123,7 +122,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('scrolls beyond viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('scrolls beyond viewportMainAxisExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final List<Widget> slivers = <Widget>[ @@ -143,7 +142,7 @@ void main() { }); group('hasScrollBody: false', () { - testWidgetsWithLeakTracking('does not extend past viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('does not extend past viewportMainAxisExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); final List<Widget> slivers = <Widget>[ @@ -163,7 +162,7 @@ void main() { expect(find.byType(Container), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('child without size is sized by extent', (WidgetTester tester) async { + testWidgets('child without size is sized by extent', (WidgetTester tester) async { final List<Widget> slivers = <Widget>[ sliverBox, SliverFillRemaining( @@ -184,7 +183,7 @@ void main() { expect(box.size.width, equals(650)); }); - testWidgetsWithLeakTracking('child with smaller size is sized by extent', (WidgetTester tester) async { + testWidgets('child with smaller size is sized by extent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<Widget> slivers = <Widget>[ sliverBox, @@ -225,7 +224,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('extent is overridden by child with larger size', (WidgetTester tester) async { + testWidgets('extent is overridden by child with larger size', (WidgetTester tester) async { final List<Widget> slivers = <Widget>[ sliverBox, SliverFillRemaining( @@ -249,7 +248,7 @@ void main() { expect(box.size.width, equals(1000)); }); - testWidgetsWithLeakTracking('extent is overridden by child size if precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('extent is overridden by child size if precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<Widget> slivers = <Widget>[ SliverFixedExtentList( @@ -290,7 +289,7 @@ void main() { expect(tester.getCenter(button).dx, equals(400.0)); }); - testWidgetsWithLeakTracking('alignment with a flexible works', (WidgetTester tester) async { + testWidgets('alignment with a flexible works', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<Widget> slivers = <Widget>[ sliverBox, @@ -359,7 +358,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); group('fillOverscroll: true, relevant platforms', () { - testWidgetsWithLeakTracking('child without size is sized by extent and overscroll', (WidgetTester tester) async { + testWidgets('child without size is sized by extent and overscroll', (WidgetTester tester) async { final List<Widget> slivers = <Widget>[ sliverBox, SliverFillRemaining( @@ -386,7 +385,7 @@ void main() { expect(box3.size.height, equals(450)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('child with smaller size is overridden and sized by extent and overscroll', (WidgetTester tester) async { + testWidgets('child with smaller size is overridden and sized by extent and overscroll', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<Widget> slivers = <Widget>[ sliverBox, @@ -433,7 +432,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('extent is overridden by child size and overscroll if precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('extent is overridden by child size and overscroll if precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -498,7 +497,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('fillOverscroll works when child has no size and precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('fillOverscroll works when child has no size and precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -561,7 +560,7 @@ void main() { ); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('alignment with a flexible works with fillOverscroll', (WidgetTester tester) async { + testWidgets('alignment with a flexible works with fillOverscroll', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<Widget> slivers = <Widget>[ sliverBox, @@ -655,7 +654,7 @@ void main() { group('fillOverscroll: true, is ignored on irrelevant platforms', () { // Android/Other scroll physics when hasScrollBody: false, ignores fillOverscroll: true - testWidgetsWithLeakTracking('child without size is sized by extent', (WidgetTester tester) async { + testWidgets('child without size is sized by extent', (WidgetTester tester) async { final List<Widget> slivers = <Widget>[ sliverBox, SliverFillRemaining( @@ -674,7 +673,7 @@ void main() { expect(box2.size.height, equals(450)); }); - testWidgetsWithLeakTracking('child with size is overridden and sized by extent', (WidgetTester tester) async { + testWidgets('child with size is overridden and sized by extent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List<Widget> slivers = <Widget>[ sliverBox, @@ -713,7 +712,7 @@ void main() { expect(tester.getCenter(button).dx, equals(400.0)); }); - testWidgetsWithLeakTracking('extent is overridden by child size if precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('extent is overridden by child size if precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -771,7 +770,7 @@ void main() { expect(tester.getCenter(button).dx, equals(400.0)); }); - testWidgetsWithLeakTracking('child has no size and precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { + testWidgets('child has no size and precedingScrollExtent > viewportMainAxisExtent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/sliver_fill_viewport_test.dart b/packages/flutter/test/widgets/sliver_fill_viewport_test.dart index a17abfb90a7..a08d235a979 100644 --- a/packages/flutter/test/widgets/sliver_fill_viewport_test.dart +++ b/packages/flutter/test/widgets/sliver_fill_viewport_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SliverFillViewport control test', (WidgetTester tester) async { + testWidgets('SliverFillViewport control test', (WidgetTester tester) async { final List<Widget> children = List<Widget>.generate(20, (int i) { return ColoredBox(color: Colors.green, child: Text('$i', textDirection: TextDirection.ltr)); }); @@ -159,7 +158,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SliverFillViewport padding test', (WidgetTester tester) async { + testWidgets('SliverFillViewport padding test', (WidgetTester tester) async { final SliverChildListDelegate delegate = SliverChildListDelegate( <Widget>[ const Text('0'), diff --git a/packages/flutter/test/widgets/sliver_list_test.dart b/packages/flutter/test/widgets/sliver_list_test.dart index bad587cdfa6..7f377fbcc94 100644 --- a/packages/flutter/test/widgets/sliver_list_test.dart +++ b/packages/flutter/test/widgets/sliver_list_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SliverList reverse children (with keys)', (WidgetTester tester) async { + testWidgets('SliverList reverse children (with keys)', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); const double itemHeight = 300.0; const double viewportHeight = 500.0; @@ -55,7 +54,7 @@ void main() { expect(find.text('Tile 0'), findsNothing); }); - testWidgetsWithLeakTracking('SliverList replace children (with keys)', (WidgetTester tester) async { + testWidgets('SliverList replace children (with keys)', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); const double itemHeight = 300.0; const double viewportHeight = 500.0; @@ -108,7 +107,7 @@ void main() { expect(find.text('Tile 119'), findsNothing); }); - testWidgetsWithLeakTracking('SliverList replace with shorter children list (with keys)', (WidgetTester tester) async { + testWidgets('SliverList replace with shorter children list (with keys)', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); const double itemHeight = 300.0; const double viewportHeight = 500.0; @@ -149,7 +148,7 @@ void main() { expect(find.text('Tile 19'), findsNothing); }); - testWidgetsWithLeakTracking('SliverList should layout first child in case of child reordering', (WidgetTester tester) async { + testWidgets('SliverList should layout first child in case of child reordering', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/35904. List<String> items = <String>['1', '2']; final ScrollController controller1 = ScrollController(); @@ -170,7 +169,7 @@ void main() { expect(find.text('Tile 2'), findsOneWidget); }); - testWidgetsWithLeakTracking('SliverList should recalculate inaccurate layout offset case 1', (WidgetTester tester) async { + testWidgets('SliverList should recalculate inaccurate layout offset case 1', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/42142. final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); @@ -232,7 +231,7 @@ void main() { }); - testWidgetsWithLeakTracking('SliverList should recalculate inaccurate layout offset case 2', (WidgetTester tester) async { + testWidgets('SliverList should recalculate inaccurate layout offset case 2', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/42142. final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); @@ -286,7 +285,7 @@ void main() { expect(find.text('Tile 3'), findsOneWidget); }); - testWidgetsWithLeakTracking('SliverList should start to perform layout from the initial child when there is no valid offset', (WidgetTester tester) async { + testWidgets('SliverList should start to perform layout from the initial child when there is no valid offset', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/66198. bool isShow = true; final ScrollController controller = ScrollController(); diff --git a/packages/flutter/test/widgets/sliver_main_axis_group_test.dart b/packages/flutter/test/widgets/sliver_main_axis_group_test.dart index 9ad4699af59..b0cf025e260 100644 --- a/packages/flutter/test/widgets/sliver_main_axis_group_test.dart +++ b/packages/flutter/test/widgets/sliver_main_axis_group_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/sliver_utils.dart'; @@ -14,7 +13,7 @@ const double VIEWPORT_HEIGHT = 600; const double VIEWPORT_WIDTH = 300; void main() { - testWidgetsWithLeakTracking('SliverMainAxisGroup is laid out properly', (WidgetTester tester) async { + testWidgets('SliverMainAxisGroup is laid out properly', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -66,7 +65,7 @@ void main() { expect(renderGroup.geometry!.hasVisualOverflow, isTrue); }); - testWidgetsWithLeakTracking('SliverMainAxisGroup is laid out properly when reversed', (WidgetTester tester) async { + testWidgets('SliverMainAxisGroup is laid out properly when reversed', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -119,7 +118,7 @@ void main() { expect(renderGroup.geometry!.hasVisualOverflow, isTrue); }); - testWidgetsWithLeakTracking('SliverMainAxisGroup is laid out properly when horizontal', (WidgetTester tester) async { + testWidgets('SliverMainAxisGroup is laid out properly when horizontal', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -177,7 +176,7 @@ void main() { expect(renderGroup.geometry!.hasVisualOverflow, isTrue); }); - testWidgetsWithLeakTracking('SliverMainAxisGroup is laid out properly when horizontal, reversed', (WidgetTester tester) async { + testWidgets('SliverMainAxisGroup is laid out properly when horizontal, reversed', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -236,7 +235,7 @@ void main() { expect(renderGroup.geometry!.hasVisualOverflow, isTrue); }); - testWidgetsWithLeakTracking('Hit test works properly on various parts of SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('Hit test works properly on various parts of SliverMainAxisGroup', (WidgetTester tester) async { final List<int> items = List<int>.generate(20, (int i) => i); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -309,7 +308,7 @@ void main() { expect(clickedTile, equals('Group 1 Tile 2')); }); - testWidgetsWithLeakTracking('applyPaintTransform is implemented properly', (WidgetTester tester) async { + testWidgets('applyPaintTransform is implemented properly', (WidgetTester tester) async { await tester.pumpWidget(_buildSliverMainAxisGroup( slivers: <Widget>[ const SliverToBoxAdapter(child: Text('first box')), @@ -325,7 +324,7 @@ void main() { expect(second.localToGlobal(Offset.zero), Offset(0, first.size.height)); }); - testWidgetsWithLeakTracking('visitChildrenForSemantics visits children in the correct order', (WidgetTester tester) async { + testWidgets('visitChildrenForSemantics visits children in the correct order', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -352,7 +351,7 @@ void main() { expect(visitedChildren[1].geometry!.scrollExtent, equals(500)); }); - testWidgetsWithLeakTracking('SliverPinnedPersistentHeader is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('SliverPinnedPersistentHeader is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -381,7 +380,7 @@ void main() { }); - testWidgetsWithLeakTracking('SliverFloatingPersistentHeader is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('SliverFloatingPersistentHeader is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -412,7 +411,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverPinnedPersistentHeader is painted within bounds of SliverMainAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { + testWidgets('SliverPinnedPersistentHeader is painted within bounds of SliverMainAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -443,7 +442,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverFloatingPersistentHeader is painted within bounds of SliverMainAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { + testWidgets('SliverFloatingPersistentHeader is painted within bounds of SliverMainAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -481,7 +480,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverPinnedFloatingPersistentHeader is painted within bounds of SliverMainAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { + testWidgets('SliverPinnedFloatingPersistentHeader is painted within bounds of SliverMainAxisGroup with different minExtent/maxExtent', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -520,7 +519,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverAppBar with floating: false, pinned: false, snap: false is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('SliverAppBar with floating: false, pinned: false, snap: false is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -552,7 +551,7 @@ void main() { expect(renderHeader.geometry!.layoutExtent, equals(0.0)); }); - testWidgetsWithLeakTracking('SliverAppBar with floating: true, pinned: false, snap: true is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('SliverAppBar with floating: true, pinned: false, snap: true is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -594,7 +593,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(-50.0)); }); - testWidgetsWithLeakTracking('SliverAppBar with floating: true, pinned: true, snap: true is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { + testWidgets('SliverAppBar with floating: true, pinned: true, snap: true is painted within bounds of SliverMainAxisGroup', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -636,7 +635,7 @@ void main() { expect((renderHeader.parentData! as SliverPhysicalParentData).paintOffset.dy, equals(-50.0)); }); - testWidgetsWithLeakTracking('SliverMainAxisGroup skips painting invisible children', (WidgetTester tester) async { + testWidgets('SliverMainAxisGroup skips painting invisible children', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/sliver_persistent_header_test.dart b/packages/flutter/test/widgets/sliver_persistent_header_test.dart index 26f8cb2f4ec..8fb239f7a52 100644 --- a/packages/flutter/test/widgets/sliver_persistent_header_test.dart +++ b/packages/flutter/test/widgets/sliver_persistent_header_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/src/rendering/sliver_persistent_header.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking( + testWidgets( '_SliverScrollingPersistentHeader should update stretchConfiguration', (WidgetTester tester) async { for (final double stretchTriggerOffset in <double>[10.0, 20.0]) { @@ -38,7 +37,7 @@ void main() { expect(render.stretchConfiguration?.stretchTriggerOffset, 20); }); - testWidgetsWithLeakTracking( + testWidgets( '_SliverPinnedPersistentHeader should update stretchConfiguration', (WidgetTester tester) async { for (final double stretchTriggerOffset in <double>[10.0, 20.0]) { @@ -69,7 +68,7 @@ void main() { expect(render.stretchConfiguration?.stretchTriggerOffset, 20); }); - testWidgetsWithLeakTracking( + testWidgets( '_SliverPinnedPersistentHeader should update showOnScreenConfiguration', (WidgetTester tester) async { for (final double maxShowOnScreenExtent in <double>[1000, 2000]) { diff --git a/packages/flutter/test/widgets/sliver_prototype_item_extent_test.dart b/packages/flutter/test/widgets/sliver_prototype_item_extent_test.dart index c7e9ff7409f..48b000f5eb4 100644 --- a/packages/flutter/test/widgets/sliver_prototype_item_extent_test.dart +++ b/packages/flutter/test/widgets/sliver_prototype_item_extent_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestItem extends StatelessWidget { const TestItem({ super.key, required this.item, this.width, this.height }); @@ -41,7 +40,7 @@ Widget buildFrame({ int? count, double? width, double? height, Axis? scrollDirec } void main() { - testWidgetsWithLeakTracking('SliverPrototypeExtentList.builder test', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList.builder test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -70,7 +69,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SliverPrototypeExtentList.builder test', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList.builder test', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( @@ -96,7 +95,7 @@ void main() { expect(find.text('Item 7'), findsNothing); }); - testWidgetsWithLeakTracking('SliverPrototypeExtentList vertical scrolling basics', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList vertical scrolling basics', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(count: 20, height: 100.0)); // The viewport is 600 pixels high, lazily created items are 100 pixels high. @@ -122,7 +121,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SliverPrototypeExtentList horizontal scrolling basics', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList horizontal scrolling basics', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(count: 20, width: 100.0, scrollDirection: Axis.horizontal)); // The viewport is 800 pixels wide, lazily created items are 100 pixels wide. @@ -148,7 +147,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SliverPrototypeExtentList change the prototype item', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList change the prototype item', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(count: 10, height: 60.0)); // The viewport is 600 pixels high, each of the 10 items is 60 pixels high @@ -174,7 +173,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SliverPrototypeExtentList first item is also the prototype', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList first item is also the prototype', (WidgetTester tester) async { final List<Widget> items = List<Widget>.generate(10, (int index) { return TestItem(key: ValueKey<int>(index), item: index, height: index == 0 ? 60.0 : null); }).toList(); @@ -204,7 +203,7 @@ void main() { } }); - testWidgetsWithLeakTracking('SliverPrototypeExtentList prototypeItem paint transform is zero.', (WidgetTester tester) async { + testWidgets('SliverPrototypeExtentList prototypeItem paint transform is zero.', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/67117 // This test ensures that the SliverPrototypeExtentList does not cause an // assertion error when calculating the paint transform of its prototypeItem. diff --git a/packages/flutter/test/widgets/sliver_semantics_test.dart b/packages/flutter/test/widgets/sliver_semantics_test.dart index 24e599281fd..c7d5981a8e1 100644 --- a/packages/flutter/test/widgets/sliver_semantics_test.dart +++ b/packages/flutter/test/widgets/sliver_semantics_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -20,7 +19,7 @@ void main() { } void _tests() { - testWidgetsWithLeakTracking('excludeFromScrollable works correctly', (WidgetTester tester) async { + testWidgets('excludeFromScrollable works correctly', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const double appBarExpandedHeight = 200.0; @@ -283,7 +282,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Offscreen sliver are hidden in semantics tree', (WidgetTester tester) async { + testWidgets('Offscreen sliver are hidden in semantics tree', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const double containerHeight = 200.0; @@ -376,7 +375,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SemanticsNodes of Slivers are in paint order', (WidgetTester tester) async { + testWidgets('SemanticsNodes of Slivers are in paint order', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<Widget> slivers = List<Widget>.generate(5, (int i) { @@ -456,7 +455,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SemanticsNodes of a sliver fully covered by another overlapping sliver are excluded', (WidgetTester tester) async { + testWidgets('SemanticsNodes of a sliver fully covered by another overlapping sliver are excluded', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<Widget> listChildren = List<Widget>.generate(10, (int i) { @@ -568,7 +567,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Slivers fully covered by another overlapping sliver are hidden', (WidgetTester tester) async { + testWidgets('Slivers fully covered by another overlapping sliver are hidden', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 280.0); @@ -680,7 +679,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('SemanticsNodes of a sliver fully covered by another overlapping sliver are excluded (reverse)', (WidgetTester tester) async { + testWidgets('SemanticsNodes of a sliver fully covered by another overlapping sliver are excluded (reverse)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<Widget> listChildren = List<Widget>.generate(10, (int i) { @@ -795,7 +794,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Slivers fully covered by another overlapping sliver are hidden (reverse)', (WidgetTester tester) async { + testWidgets('Slivers fully covered by another overlapping sliver are hidden (reverse)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 280.0); @@ -910,7 +909,7 @@ void _tests() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Slivers fully covered by another overlapping sliver are hidden (with center sliver)', (WidgetTester tester) async { + testWidgets('Slivers fully covered by another overlapping sliver are hidden (with center sliver)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final ScrollController controller = ScrollController(initialScrollOffset: 280.0); diff --git a/packages/flutter/test/widgets/sliver_visibility_test.dart b/packages/flutter/test/widgets/sliver_visibility_test.dart index af9148d5dca..841563452f4 100644 --- a/packages/flutter/test/widgets/sliver_visibility_test.dart +++ b/packages/flutter/test/widgets/sliver_visibility_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -30,7 +29,7 @@ class _TestStateState extends State<TestState> { } void main() { - testWidgetsWithLeakTracking('SliverVisibility', (WidgetTester tester) async { + testWidgets('SliverVisibility', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> log = <String>[]; const Key anchor = Key('drag'); diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart index 45c7922b55e..cab6bf787a5 100644 --- a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Sliver appBars - floating and pinned - correct elevation', (WidgetTester tester) async { + testWidgets('Sliver appBars - floating and pinned - correct elevation', (WidgetTester tester) async { await tester.pumpWidget(Localizations( locale: const Locale('en', 'us'), delegates: const <LocalizationsDelegate<dynamic>>[ @@ -47,7 +46,7 @@ void main() { expect(renderObject.elevation, 0.0); }); - testWidgetsWithLeakTracking('Sliver appbars - floating and pinned - correct semantics', (WidgetTester tester) async { + testWidgets('Sliver appbars - floating and pinned - correct semantics', (WidgetTester tester) async { await tester.pumpWidget( Localizations( locale: const Locale('en', 'us'), @@ -242,7 +241,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Sliver appbars - floating and pinned - second app bar stacks below', (WidgetTester tester) async { + testWidgets('Sliver appbars - floating and pinned - second app bar stacks below', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -295,7 +294,7 @@ void main() { expect(tester.getTopLeft(find.text('E')), Offset(0.0, 200.0 + 56.0 + cSize.height * 2.0 + 500.0 - 600.0)); }); - testWidgetsWithLeakTracking('Does not crash when there is less than minExtent remainingPaintExtent', (WidgetTester tester) async { + testWidgets('Does not crash when there is less than minExtent remainingPaintExtent', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/21887. final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -342,7 +341,7 @@ void main() { expect(render.geometry!.layoutExtent, 0.0); }); - testWidgetsWithLeakTracking('Pinned and floating SliverAppBar sticks to top the content is scroll down', (WidgetTester tester) async { + testWidgets('Pinned and floating SliverAppBar sticks to top the content is scroll down', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -376,7 +375,7 @@ void main() { expect(render.geometry!.paintOrigin, -scrollDistance); }); - testWidgetsWithLeakTracking('Floating SliverAppBar sticks to top the content is scroll down', (WidgetTester tester) async { + testWidgets('Floating SliverAppBar sticks to top the content is scroll down', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -409,7 +408,7 @@ void main() { expect(render.geometry!.paintOrigin, -scrollDistance); }); - testWidgetsWithLeakTracking('Pinned SliverAppBar sticks to top the content is scroll down', (WidgetTester tester) async { + testWidgets('Pinned SliverAppBar sticks to top the content is scroll down', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart index de3fb1b2b37..01e32544b36 100644 --- a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void verifyPaintPosition(GlobalKey key, Offset ideal, bool visible) { final RenderSliver target = key.currentContext!.findRenderObject()! as RenderSliver; @@ -26,7 +25,7 @@ void verifyActualBoxPosition(WidgetTester tester, Finder finder, int index, Rect } void main() { - testWidgetsWithLeakTracking("Sliver appbars - floating - scroll offset doesn't change", (WidgetTester tester) async { + testWidgets("Sliver appbars - floating - scroll offset doesn't change", (WidgetTester tester) async { const double bigHeight = 1000.0; await tester.pumpWidget( Directionality( @@ -54,7 +53,7 @@ void main() { expect(position.maxScrollExtent, max); }); - testWidgetsWithLeakTracking('Sliver appbars - floating - normal behavior works', (WidgetTester tester) async { + testWidgets('Sliver appbars - floating - normal behavior works', (WidgetTester tester) async { final TestDelegate delegate = TestDelegate(); const double bigHeight = 1000.0; GlobalKey key1, key2, key3; @@ -126,7 +125,7 @@ void main() { verifyPaintPosition(key3, Offset.zero, true); }); - testWidgetsWithLeakTracking('Sliver appbars - floating - no floating behavior when animating', (WidgetTester tester) async { + testWidgets('Sliver appbars - floating - no floating behavior when animating', (WidgetTester tester) async { final TestDelegate delegate = TestDelegate(); const double bigHeight = 1000.0; GlobalKey key1, key2, key3; @@ -161,7 +160,7 @@ void main() { verifyPaintPosition(key3, Offset.zero, true); }); - testWidgetsWithLeakTracking('Sliver appbars - floating - floating behavior when dragging down', (WidgetTester tester) async { + testWidgets('Sliver appbars - floating - floating behavior when dragging down', (WidgetTester tester) async { final TestDelegate delegate = TestDelegate(); const double bigHeight = 1000.0; GlobalKey key1, key2, key3; @@ -198,7 +197,7 @@ void main() { verifyPaintPosition(key3, Offset.zero, true); }); - testWidgetsWithLeakTracking('Sliver appbars - floating - overscroll gap is below header', (WidgetTester tester) async { + testWidgets('Sliver appbars - floating - overscroll gap is below header', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -259,7 +258,7 @@ void main() { expect(geometry.paintExtent, paintExtent); } - testWidgetsWithLeakTracking('SliverAppBar', (WidgetTester tester) async { + testWidgets('SliverAppBar', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildTest(SliverAppBar( key: appBarKey, @@ -313,7 +312,7 @@ void main() { verifyGeometry(key: appBarKey, paintExtent: 56.0, visible: true); }); - testWidgetsWithLeakTracking('SliverPersistentHeader', (WidgetTester tester) async { + testWidgets('SliverPersistentHeader', (WidgetTester tester) async { final GlobalKey headerKey = GlobalKey(); await tester.pumpWidget(buildTest(SliverPersistentHeader( key: headerKey, @@ -355,7 +354,7 @@ void main() { verifyGeometry(key: headerKey, paintExtent: 56.0, visible: true); }); - testWidgetsWithLeakTracking('and snapping SliverAppBar', (WidgetTester tester) async { + testWidgets('and snapping SliverAppBar', (WidgetTester tester) async { final GlobalKey appBarKey = GlobalKey(); await tester.pumpWidget(buildTest(SliverAppBar( key: appBarKey, diff --git a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart index 8c57dad28c3..2651ec271d3 100644 --- a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void verifyPaintPosition(GlobalKey key, Offset ideal, bool visible) { final RenderSliver target = key.currentContext!.findRenderObject()! as RenderSliver; @@ -24,7 +23,7 @@ void verifyActualBoxPosition(WidgetTester tester, Finder finder, int index, Rect } void main() { - testWidgetsWithLeakTracking('Sliver appbars - pinned', (WidgetTester tester) async { + testWidgets('Sliver appbars - pinned', (WidgetTester tester) async { const double bigHeight = 550.0; GlobalKey key1, key2, key3, key4, key5; await tester.pumpWidget( @@ -60,7 +59,7 @@ void main() { verifyPaintPosition(key5, const Offset(0.0, 50.0), true); }); - testWidgetsWithLeakTracking('Sliver appbars - toStringDeep of maxExtent that throws', (WidgetTester tester) async { + testWidgets('Sliver appbars - toStringDeep of maxExtent that throws', (WidgetTester tester) async { final TestDelegateThatCanThrow delegateThatCanThrow = TestDelegateThatCanThrow(); GlobalKey key; await tester.pumpWidget( @@ -122,7 +121,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Sliver appbars - pinned with slow scroll', (WidgetTester tester) async { + testWidgets('Sliver appbars - pinned with slow scroll', (WidgetTester tester) async { const double bigHeight = 550.0; GlobalKey key1, key2, key3, key4, key5; await tester.pumpWidget( @@ -215,7 +214,7 @@ void main() { verifyPaintPosition(key5, const Offset(0.0, 550.0), true); }); - testWidgetsWithLeakTracking('Sliver appbars - pinned with less overlap', (WidgetTester tester) async { + testWidgets('Sliver appbars - pinned with less overlap', (WidgetTester tester) async { const double bigHeight = 650.0; GlobalKey key1, key2, key3, key4, key5; await tester.pumpWidget( @@ -251,7 +250,7 @@ void main() { verifyPaintPosition(key5, Offset.zero, true); }); - testWidgetsWithLeakTracking('Sliver appbars - overscroll gap is below header', (WidgetTester tester) async { + testWidgets('Sliver appbars - overscroll gap is below header', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart b/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart index 5b2e7f77af6..9042575fc9b 100644 --- a/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void verifyPaintPosition(GlobalKey key, Offset ideal) { final RenderObject target = key.currentContext!.findRenderObject()!; @@ -16,7 +15,7 @@ void verifyPaintPosition(GlobalKey key, Offset ideal) { } void main() { - testWidgetsWithLeakTracking('Sliver appbars - scrolling', (WidgetTester tester) async { + testWidgets('Sliver appbars - scrolling', (WidgetTester tester) async { GlobalKey key1, key2, key3, key4, key5; await tester.pumpWidget( Directionality( @@ -51,7 +50,7 @@ void main() { verifyPaintPosition(key5, const Offset(0.0, 50.0)); }); - testWidgetsWithLeakTracking('Sliver appbars - scrolling off screen', (WidgetTester tester) async { + testWidgets('Sliver appbars - scrolling off screen', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TestDelegate delegate = TestDelegate(); await tester.pumpWidget( @@ -75,7 +74,7 @@ void main() { expect(rect, equals(const Rect.fromLTWH(0.0, -195.0, 800.0, 200.0))); }); - testWidgetsWithLeakTracking('Sliver appbars - scrolling - overscroll gap is below header', (WidgetTester tester) async { + testWidgets('Sliver appbars - scrolling - overscroll gap is below header', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -107,7 +106,7 @@ void main() { expect(tester.getTopLeft(find.text('X')), const Offset(0.0, 250.0)); }); - testWidgetsWithLeakTracking('Sliver appbars const child delegate - scrolling - overscroll gap is below header', (WidgetTester tester) async { + testWidgets('Sliver appbars const child delegate - scrolling - overscroll gap is below header', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/slivers_appbar_stretch_test.dart b/packages/flutter/test/widgets/slivers_appbar_stretch_test.dart index 6ffccf5e09e..74137bf0105 100644 --- a/packages/flutter/test/widgets/slivers_appbar_stretch_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_stretch_test.dart @@ -5,11 +5,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('SliverAppBar - Stretch', () { - testWidgetsWithLeakTracking('fills overscroll', (WidgetTester tester) async { + testWidgets('fills overscroll', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -44,7 +43,7 @@ void main() { expect(header.child!.size.height, equals(200.0)); }); - testWidgetsWithLeakTracking('fills overscroll after reverse direction input - scrolling header', (WidgetTester tester) async { + testWidgets('fills overscroll after reverse direction input - scrolling header', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -93,7 +92,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('fills overscroll after reverse direction input - floating header', (WidgetTester tester) async { + testWidgets('fills overscroll after reverse direction input - floating header', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -143,7 +142,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('does not stretch without overscroll physics', (WidgetTester tester) async { + testWidgets('does not stretch without overscroll physics', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -178,7 +177,7 @@ void main() { expect(header.child!.size.height, equals(100.0)); }); - testWidgetsWithLeakTracking('default trigger offset', (WidgetTester tester) async { + testWidgets('default trigger offset', (WidgetTester tester) async { bool didTrigger = false; const Key anchor = Key('drag'); await tester.pumpWidget( @@ -216,7 +215,7 @@ void main() { expect(didTrigger, isTrue); }); - testWidgetsWithLeakTracking('custom trigger offset', (WidgetTester tester) async { + testWidgets('custom trigger offset', (WidgetTester tester) async { bool didTrigger = false; const Key anchor = Key('drag'); await tester.pumpWidget( @@ -255,7 +254,7 @@ void main() { expect(didTrigger, isTrue); }); - testWidgetsWithLeakTracking('stretch callback not triggered without overscroll physics', (WidgetTester tester) async { + testWidgets('stretch callback not triggered without overscroll physics', (WidgetTester tester) async { bool didTrigger = false; const Key anchor = Key('drag'); await tester.pumpWidget( @@ -294,7 +293,7 @@ void main() { expect(didTrigger, isFalse); }); - testWidgetsWithLeakTracking('asserts reasonable trigger offset', (WidgetTester tester) async { + testWidgets('asserts reasonable trigger offset', (WidgetTester tester) async { expect( () { return MaterialApp( @@ -326,7 +325,7 @@ void main() { }); group('SliverAppBar - Stretch, Pinned', () { - testWidgetsWithLeakTracking('fills overscroll', (WidgetTester tester) async { + testWidgets('fills overscroll', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -361,7 +360,7 @@ void main() { expect(header.child!.size.height, equals(200.0)); }); - testWidgetsWithLeakTracking('does not stretch without overscroll physics', (WidgetTester tester) async { + testWidgets('does not stretch without overscroll physics', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -398,7 +397,7 @@ void main() { }); group('SliverAppBar - Stretch, Floating', () { - testWidgetsWithLeakTracking('fills overscroll', (WidgetTester tester) async { + testWidgets('fills overscroll', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -433,7 +432,7 @@ void main() { expect(header.child!.size.height, equals(200.0)); }); - testWidgetsWithLeakTracking('does not fill overscroll without proper physics', (WidgetTester tester) async { + testWidgets('does not fill overscroll without proper physics', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -470,7 +469,7 @@ void main() { }); group('SliverAppBar - Stretch, Floating, Pinned', () { - testWidgetsWithLeakTracking('fills overscroll', (WidgetTester tester) async { + testWidgets('fills overscroll', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( @@ -506,7 +505,7 @@ void main() { expect(header.child!.size.height, equals(200.0)); }); - testWidgetsWithLeakTracking('does not fill overscroll without proper physics', (WidgetTester tester) async { + testWidgets('does not fill overscroll without proper physics', (WidgetTester tester) async { const Key anchor = Key('drag'); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/widgets/slivers_block_global_key_test.dart b/packages/flutter/test/widgets/slivers_block_global_key_test.dart index 495d8c211d7..b7e5695adf1 100644 --- a/packages/flutter/test/widgets/slivers_block_global_key_test.dart +++ b/packages/flutter/test/widgets/slivers_block_global_key_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; int globalGeneration = 0; @@ -62,7 +61,7 @@ void verify(WidgetTester tester, List<Offset> answerKey, String text) { } void main() { - testWidgetsWithLeakTracking('Viewport+SliverBlock with GlobalKey reparenting', (WidgetTester tester) async { + testWidgets('Viewport+SliverBlock with GlobalKey reparenting', (WidgetTester tester) async { await test(tester, 0.0, <int>[1,2,3,4,5,6,7,8,9]); verify(tester, <Offset>[ Offset.zero, diff --git a/packages/flutter/test/widgets/slivers_block_test.dart b/packages/flutter/test/widgets/slivers_block_test.dart index b4b75211cc1..d052e181a85 100644 --- a/packages/flutter/test/widgets/slivers_block_test.dart +++ b/packages/flutter/test/widgets/slivers_block_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Future<void> test(WidgetTester tester, double offset) { final ViewportOffset viewportOffset = ViewportOffset.fixed(offset); @@ -68,7 +67,7 @@ void verify(WidgetTester tester, List<Offset> answerKey, String text) { } void main() { - testWidgetsWithLeakTracking('Viewport+SliverBlock basic test', (WidgetTester tester) async { + testWidgets('Viewport+SliverBlock basic test', (WidgetTester tester) async { await test(tester, 0.0); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); verify(tester, <Offset>[ @@ -101,7 +100,7 @@ void main() { ], 'ab'); }); - testWidgetsWithLeakTracking('Viewport+SliverBlock basic test with constant SliverChildListDelegate', (WidgetTester tester) async { + testWidgets('Viewport+SliverBlock basic test with constant SliverChildListDelegate', (WidgetTester tester) async { await testWithConstChildDelegate(tester, 0.0); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); verify(tester, <Offset>[ @@ -134,7 +133,7 @@ void main() { ], 'ab'); }); - testWidgetsWithLeakTracking('Viewport with GlobalKey reparenting', (WidgetTester tester) async { + testWidgets('Viewport with GlobalKey reparenting', (WidgetTester tester) async { final Key key1 = GlobalKey(); final ViewportOffset offset = ViewportOffset.zero(); addTearDown(offset.dispose); @@ -248,7 +247,7 @@ void main() { ], 'acb'); }); - testWidgetsWithLeakTracking('Viewport overflow clipping of SliverToBoxAdapter', (WidgetTester tester) async { + testWidgets('Viewport overflow clipping of SliverToBoxAdapter', (WidgetTester tester) async { final ViewportOffset offset1 = ViewportOffset.zero(); addTearDown(offset1.dispose); @@ -326,7 +325,7 @@ void main() { expect(find.byType(Viewport), paints..clipRect()); }); - testWidgetsWithLeakTracking('Viewport overflow clipping of SliverBlock', (WidgetTester tester) async { + testWidgets('Viewport overflow clipping of SliverBlock', (WidgetTester tester) async { final ViewportOffset offset1 = ViewportOffset.zero(); addTearDown(offset1.dispose); diff --git a/packages/flutter/test/widgets/slivers_evil_test.dart b/packages/flutter/test/widgets/slivers_evil_test.dart index d821c969ff4..2c9aa0ef353 100644 --- a/packages/flutter/test/widgets/slivers_evil_test.dart +++ b/packages/flutter/test/widgets/slivers_evil_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate { TestSliverPersistentHeaderDelegate(this._maxExtent); @@ -58,7 +57,7 @@ class TestScrollPhysics extends ClampingScrollPhysics { } void main() { - testWidgetsWithLeakTracking('Evil test of sliver features - 1', (WidgetTester tester) async { + testWidgets('Evil test of sliver features - 1', (WidgetTester tester) async { final GlobalKey centerKey = GlobalKey(); await tester.pumpWidget( MediaQuery( @@ -185,7 +184,7 @@ void main() { }); - testWidgetsWithLeakTracking('Removing offscreen items above and rescrolling does not crash', (WidgetTester tester) async { + testWidgets('Removing offscreen items above and rescrolling does not crash', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: CustomScrollView( cacheExtent: 0.0, diff --git a/packages/flutter/test/widgets/slivers_keepalive_test.dart b/packages/flutter/test/widgets/slivers_keepalive_test.dart index b75c5c405bc..ae7dc37c4cc 100644 --- a/packages/flutter/test/widgets/slivers_keepalive_test.dart +++ b/packages/flutter/test/widgets/slivers_keepalive_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Sliver with keep alive without key - should dispose after reordering', (WidgetTester tester) async { + testWidgets('Sliver with keep alive without key - should dispose after reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ const WidgetTest0(text: 'child 0', keepAlive: true), const WidgetTest1(text: 'child 1', keepAlive: true), @@ -30,7 +29,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('Sliver without keep alive without key - should dispose after reordering', (WidgetTester tester) async { + testWidgets('Sliver without keep alive without key - should dispose after reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ const WidgetTest0(text: 'child 0'), const WidgetTest1(text: 'child 1'), @@ -53,7 +52,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('Sliver without keep alive with key - should dispose after reordering', (WidgetTester tester) async { + testWidgets('Sliver without keep alive with key - should dispose after reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: GlobalKey()), WidgetTest1(text: 'child 1', key: GlobalKey()), @@ -76,7 +75,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('Sliver with keep alive with key - should not dispose after reordering', (WidgetTester tester) async { + testWidgets('Sliver with keep alive with key - should not dispose after reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: GlobalKey(), keepAlive: true), WidgetTest1(text: 'child 1', key: GlobalKey(), keepAlive: true), @@ -98,7 +97,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('Sliver with keep alive with Unique key - should not dispose after reordering', (WidgetTester tester) async { + testWidgets('Sliver with keep alive with Unique key - should not dispose after reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: UniqueKey(), keepAlive: true), WidgetTest1(text: 'child 1', key: UniqueKey(), keepAlive: true), @@ -120,7 +119,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('Sliver with keep alive with Value key - should not dispose after reordering', (WidgetTester tester) async { + testWidgets('Sliver with keep alive with Value key - should not dispose after reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ const WidgetTest0(text: 'child 0', key: ValueKey<int>(0), keepAlive: true), const WidgetTest1(text: 'child 1', key: ValueKey<int>(1), keepAlive: true), @@ -142,7 +141,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('Sliver complex case 1', (WidgetTester tester) async { + testWidgets('Sliver complex case 1', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: GlobalKey(), keepAlive: true), WidgetTest1(text: 'child 1', key: GlobalKey(), keepAlive: true), @@ -186,7 +185,7 @@ void main() { expect(state2.hasBeenDisposed, true); }); - testWidgetsWithLeakTracking('Sliver complex case 2', (WidgetTester tester) async { + testWidgets('Sliver complex case 2', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: GlobalKey(), keepAlive: true), WidgetTest1(text: 'child 1', key: UniqueKey()), @@ -229,7 +228,7 @@ void main() { expect(state2.hasBeenDisposed, true); }); - testWidgetsWithLeakTracking('Sliver with SliverChildBuilderDelegate', (WidgetTester tester) async { + testWidgets('Sliver with SliverChildBuilderDelegate', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: UniqueKey(), keepAlive: true), WidgetTest1(text: 'child 1', key: GlobalKey()), @@ -272,7 +271,7 @@ void main() { expect(state2.hasBeenDisposed, true); }); - testWidgetsWithLeakTracking('SliverFillViewport should not dispose widget with key during in screen reordering', (WidgetTester tester) async { + testWidgets('SliverFillViewport should not dispose widget with key during in screen reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: UniqueKey(), keepAlive: true), WidgetTest1(text: 'child 1', key: UniqueKey()), @@ -313,7 +312,7 @@ void main() { expect(state2.hasBeenDisposed, true); }); - testWidgetsWithLeakTracking('SliverList should not dispose widget with key during in screen reordering', (WidgetTester tester) async { + testWidgets('SliverList should not dispose widget with key during in screen reordering', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: UniqueKey(), keepAlive: true), const WidgetTest1(text: 'child 1', keepAlive: true), @@ -363,7 +362,7 @@ void main() { expect(state2.hasBeenDisposed, false); }); - testWidgetsWithLeakTracking('SliverList remove child from child list', (WidgetTester tester) async { + testWidgets('SliverList remove child from child list', (WidgetTester tester) async { List<Widget> childList= <Widget>[ WidgetTest0(text: 'child 0', key: UniqueKey(), keepAlive: true), const WidgetTest1(text: 'child 1', keepAlive: true), diff --git a/packages/flutter/test/widgets/slivers_padding_test.dart b/packages/flutter/test/widgets/slivers_padding_test.dart index 8886cca1391..29cfe106922 100644 --- a/packages/flutter/test/widgets/slivers_padding_test.dart +++ b/packages/flutter/test/widgets/slivers_padding_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class _MockRenderSliver extends RenderSliver { @override @@ -53,7 +52,7 @@ void verify(WidgetTester tester, List<Rect> answerKey) { } void main() { - testWidgetsWithLeakTracking('Viewport+SliverPadding basic test (VISUAL)', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding basic test (VISUAL)', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.fromLTRB(25.0, 20.0, 15.0, 35.0); await test(tester, 0.0, padding, AxisDirection.down, TextDirection.ltr); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -92,7 +91,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding basic test (LTR)', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding basic test (LTR)', (WidgetTester tester) async { const EdgeInsetsDirectional padding = EdgeInsetsDirectional.fromSTEB(25.0, 20.0, 15.0, 35.0); await test(tester, 0.0, padding, AxisDirection.down, TextDirection.ltr); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -131,7 +130,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding basic test (RTL)', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding basic test (RTL)', (WidgetTester tester) async { const EdgeInsetsDirectional padding = EdgeInsetsDirectional.fromSTEB(25.0, 20.0, 15.0, 35.0); await test(tester, 0.0, padding, AxisDirection.down, TextDirection.rtl); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -170,7 +169,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding hit testing', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding hit testing', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.all(30.0); await test(tester, 350.0, padding, AxisDirection.down, TextDirection.ltr); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -192,7 +191,7 @@ void main() { expectIsTextSpan(result.path.first.target, 'after'); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding hit testing up', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding hit testing up', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.all(30.0); await test(tester, 350.0, padding, AxisDirection.up, TextDirection.ltr); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -214,7 +213,7 @@ void main() { expectIsTextSpan(result.path.first.target, 'after'); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding hit testing left', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding hit testing left', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.all(30.0); await test(tester, 350.0, padding, AxisDirection.left, TextDirection.ltr); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -236,7 +235,7 @@ void main() { expectIsTextSpan(result.path.first.target, 'after'); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding hit testing right', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding hit testing right', (WidgetTester tester) async { const EdgeInsets padding = EdgeInsets.all(30.0); await test(tester, 350.0, padding, AxisDirection.right, TextDirection.ltr); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); @@ -258,7 +257,7 @@ void main() { expectIsTextSpan(result.path.first.target, 'after'); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding no child', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding no child', (WidgetTester tester) async { final ViewportOffset offset = ViewportOffset.fixed(0.0); addTearDown(offset.dispose); @@ -277,7 +276,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.text('x')).localToGlobal(Offset.zero), const Offset(0.0, 200.0)); }); - testWidgetsWithLeakTracking('SliverPadding with no child reports correct geometry as scroll offset changes', (WidgetTester tester) async { + testWidgets('SliverPadding with no child reports correct geometry as scroll offset changes', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/64506 final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -306,7 +305,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding changing padding', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding changing padding', (WidgetTester tester) async { final ViewportOffset offset1 = ViewportOffset.fixed(0.0); addTearDown(offset1.dispose); @@ -346,7 +345,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.text('x')).localToGlobal(Offset.zero), const Offset(409.0, 0.0)); }); - testWidgetsWithLeakTracking('Viewport+SliverPadding changing direction', (WidgetTester tester) async { + testWidgets('Viewport+SliverPadding changing direction', (WidgetTester tester) async { final ViewportOffset offset1 = ViewportOffset.fixed(0.0); addTearDown(offset1.dispose); @@ -437,7 +436,7 @@ void main() { expect(tester.renderObject<RenderSliverPadding>(find.byType(SliverPadding, skipOffstage: false)).afterPadding, 1.0); }); - testWidgetsWithLeakTracking('SliverPadding propagates geometry offset corrections', (WidgetTester tester) async { + testWidgets('SliverPadding propagates geometry offset corrections', (WidgetTester tester) async { Widget listBuilder(IndexedWidgetBuilder sliverChildBuilder) { return Directionality( textDirection: TextDirection.ltr, @@ -503,7 +502,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('SliverPadding includes preceding padding in the precedingScrollExtent provided to child', (WidgetTester tester) async { + testWidgets('SliverPadding includes preceding padding in the precedingScrollExtent provided to child', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/49195 final UniqueKey key = UniqueKey(); await tester.pumpWidget(Directionality( @@ -536,7 +535,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("SliverPadding consumes only its padding from the overlap of its parent's constraints", (WidgetTester tester) async { + testWidgets("SliverPadding consumes only its padding from the overlap of its parent's constraints", (WidgetTester tester) async { final _MockRenderSliver mock = _MockRenderSliver(); addTearDown(mock.dispose); final RenderSliverPadding renderObject = RenderSliverPadding( @@ -563,7 +562,7 @@ void main() { expect(mock.constraints.overlap, 80.0); }); - testWidgetsWithLeakTracking("SliverPadding passes the overlap to the child if it's negative", (WidgetTester tester) async { + testWidgets("SliverPadding passes the overlap to the child if it's negative", (WidgetTester tester) async { final _MockRenderSliver mock = _MockRenderSliver(); addTearDown(mock.dispose); final RenderSliverPadding renderObject = RenderSliverPadding( @@ -590,7 +589,7 @@ void main() { expect(mock.constraints.overlap, -100.0); }); - testWidgetsWithLeakTracking('SliverPadding passes the paintOrigin of the child on', (WidgetTester tester) async { + testWidgets('SliverPadding passes the paintOrigin of the child on', (WidgetTester tester) async { final _MockRenderSliver mock = _MockRenderSliver(); addTearDown(mock.dispose); final RenderSliverPadding renderObject = RenderSliverPadding( diff --git a/packages/flutter/test/widgets/slivers_protocol_test.dart b/packages/flutter/test/widgets/slivers_protocol_test.dart index c93c93daacd..6758b7dd0e4 100644 --- a/packages/flutter/test/widgets/slivers_protocol_test.dart +++ b/packages/flutter/test/widgets/slivers_protocol_test.dart @@ -7,7 +7,6 @@ import 'dart:math' as math; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void verifyPaintPosition(GlobalKey key, Offset ideal) { final RenderObject target = key.currentContext!.findRenderObject()!; @@ -18,7 +17,7 @@ void verifyPaintPosition(GlobalKey key, Offset ideal) { } void main() { - testWidgetsWithLeakTracking('Sliver protocol', (WidgetTester tester) async { + testWidgets('Sliver protocol', (WidgetTester tester) async { GlobalKey key1, key2, key3, key4, key5; await tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/widgets/slivers_test.dart b/packages/flutter/test/widgets/slivers_test.dart index f0f3d72fbd1..63868ff77fd 100644 --- a/packages/flutter/test/widgets/slivers_test.dart +++ b/packages/flutter/test/widgets/slivers_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -73,7 +72,7 @@ void verify(WidgetTester tester, List<Offset> idealPositions, List<bool> idealVi } void main() { - testWidgetsWithLeakTracking('Viewport basic test', (WidgetTester tester) async { + testWidgets('Viewport basic test', (WidgetTester tester) async { await test(tester, 0.0); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); verify(tester, <Offset>[ @@ -112,7 +111,7 @@ void main() { ], <bool>[false, false, true, true, false]); }); - testWidgetsWithLeakTracking('Viewport anchor test', (WidgetTester tester) async { + testWidgets('Viewport anchor test', (WidgetTester tester) async { await test(tester, 0.0, anchor: 100.0); expect(tester.renderObject<RenderBox>(find.byType(Viewport)).size, equals(const Size(800.0, 600.0))); verify(tester, <Offset>[ @@ -151,7 +150,7 @@ void main() { ], <bool>[false, false, true, true, false]); }); - testWidgetsWithLeakTracking('Multiple grids and lists', (WidgetTester tester) async { + testWidgets('Multiple grids and lists', (WidgetTester tester) async { await tester.pumpWidget( Center( child: SizedBox( @@ -232,7 +231,7 @@ void main() { expect(find.text('BOTTOM'), findsOneWidget); }); - testWidgetsWithLeakTracking('Sliver grid can replace intermediate items', (WidgetTester tester) async { + testWidgets('Sliver grid can replace intermediate items', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/138749. // The bug happens when items in between first and last item changed while // the sliver layout only display a item in the middle of the list. @@ -295,7 +294,7 @@ void main() { expect(find.text('item 4'), findsNothing); }); - testWidgetsWithLeakTracking('SliverFixedExtentList correctly clears garbage', (WidgetTester tester) async { + testWidgets('SliverFixedExtentList correctly clears garbage', (WidgetTester tester) async { final List<String> items = <String>['1', '2', '3', '4', '5', '6']; await testSliverFixedExtentList(tester, items); // Keep alive widgets require 1 frame to notify their parents. Pumps in between @@ -336,7 +335,7 @@ void main() { expect(find.text('4'), findsOneWidget); }); - testWidgetsWithLeakTracking('SliverFixedExtentList handles underflow when its children changes', (WidgetTester tester) async { + testWidgets('SliverFixedExtentList handles underflow when its children changes', (WidgetTester tester) async { final List<String> items = <String>['1', '2', '3', '4', '5', '6']; final List<String> initializedChild = <String>[]; List<Widget> children = <Widget>[]; @@ -403,7 +402,7 @@ void main() { expect(listEquals<String>(initializedChild, <String>['6']), isTrue); }); - testWidgetsWithLeakTracking( + testWidgets( 'SliverGrid Correctly layout children after rearranging', (WidgetTester tester) async { await tester.pumpWidget(const TestSliverGrid( @@ -436,7 +435,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'SliverGrid negative usableCrossAxisExtent', (WidgetTester tester) async { await tester.pumpWidget( @@ -474,7 +473,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'SliverList can handle inaccurate scroll offset due to changes in children list', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/pull/59888. @@ -578,7 +577,7 @@ void main() { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'SliverFixedExtentList Correctly layout children after rearranging', (WidgetTester tester) async { await tester.pumpWidget(const TestSliverFixedExtentList( @@ -616,7 +615,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Can override ErrorWidget.build', (WidgetTester tester) async { + testWidgets('Can override ErrorWidget.build', (WidgetTester tester) async { const Text errorText = Text('error'); final ErrorWidgetBuilder oldBuilder = ErrorWidget.builder; ErrorWidget.builder = (FlutterErrorDetails details) => errorText; @@ -632,7 +631,7 @@ void main() { ErrorWidget.builder = oldBuilder; }); - testWidgetsWithLeakTracking('SliverFixedExtentList with SliverChildBuilderDelegate auto-correct scroll offset - super fast', (WidgetTester tester) async { + testWidgets('SliverFixedExtentList with SliverChildBuilderDelegate auto-correct scroll offset - super fast', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 600); addTearDown(controller.dispose); @@ -681,7 +680,7 @@ void main() { expect(controller.offset, 800.0); }); - testWidgetsWithLeakTracking('SliverFixedExtentList with SliverChildBuilderDelegate auto-correct scroll offset - reasonable', (WidgetTester tester) async { + testWidgets('SliverFixedExtentList with SliverChildBuilderDelegate auto-correct scroll offset - reasonable', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 600); addTearDown(controller.dispose); @@ -733,7 +732,7 @@ void main() { } group('SliverOffstage - ', () { - testWidgetsWithLeakTracking('offstage true', (WidgetTester tester) async { + testWidgets('offstage true', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(boilerPlate( const SliverOffstage( @@ -752,7 +751,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('offstage false', (WidgetTester tester) async { + testWidgets('offstage false', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(boilerPlate( const SliverOffstage( @@ -774,7 +773,7 @@ void main() { }); group('SliverOpacity - ', () { - testWidgetsWithLeakTracking('painting & semantics', (WidgetTester tester) async { + testWidgets('painting & semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // Opacity 1.0: Semantics and painting @@ -896,7 +895,7 @@ void main() { }); group('SliverIgnorePointer - ', () { - testWidgetsWithLeakTracking('ignores pointer events', (WidgetTester tester) async { + testWidgets('ignores pointer events', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> events = <String>[]; await tester.pumpWidget(boilerPlate( @@ -918,7 +917,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ignores semantics', (WidgetTester tester) async { + testWidgets('ignores semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> events = <String>[]; await tester.pumpWidget(boilerPlate( @@ -941,7 +940,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ignoring only block semantics actions', (WidgetTester tester) async { + testWidgets('ignoring only block semantics actions', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(boilerPlate( SliverIgnorePointer( @@ -957,7 +956,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ignores pointer events & semantics', (WidgetTester tester) async { + testWidgets('ignores pointer events & semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> events = <String>[]; await tester.pumpWidget(boilerPlate( @@ -979,7 +978,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('ignores nothing', (WidgetTester tester) async { + testWidgets('ignores nothing', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> events = <String>[]; await tester.pumpWidget(boilerPlate( @@ -1003,7 +1002,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('SliverList handles 0 scrollOffsetCorrection', (WidgetTester tester) async { + testWidgets('SliverList handles 0 scrollOffsetCorrection', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/62198 await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -1028,7 +1027,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('SliverGrid children can be arbitrarily placed', (WidgetTester tester) async { + testWidgets('SliverGrid children can be arbitrarily placed', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/64006 int firstTapped = 0; int secondTapped = 0; @@ -1086,7 +1085,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverList.builder can build children', (WidgetTester tester) async { + testWidgets('SliverList.builder can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1124,7 +1123,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverList.builder can build children', (WidgetTester tester) async { + testWidgets('SliverList.builder can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1162,7 +1161,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverList.separated can build children', (WidgetTester tester) async { + testWidgets('SliverList.separated can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1201,7 +1200,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverList.separated has correct number of children', (WidgetTester tester) async { + testWidgets('SliverList.separated has correct number of children', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget(MaterialApp( home: Scaffold( @@ -1221,7 +1220,7 @@ void main() { expect(find.text('separator'), findsNWidgets(1)); }); - testWidgetsWithLeakTracking('SliverList.list can build children', (WidgetTester tester) async { + testWidgets('SliverList.list can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1263,7 +1262,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverFixedExtentList.builder can build children', (WidgetTester tester) async { + testWidgets('SliverFixedExtentList.builder can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1301,7 +1300,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverList.list can build children', (WidgetTester tester) async { + testWidgets('SliverList.list can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1344,7 +1343,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverGrid.builder can build children', (WidgetTester tester) async { + testWidgets('SliverGrid.builder can build children', (WidgetTester tester) async { int firstTapped = 0; int secondTapped = 0; final Key key = UniqueKey(); @@ -1383,7 +1382,7 @@ void main() { expect(secondTapped, 1); }); - testWidgetsWithLeakTracking('SliverGridRegularTileLayout.computeMaxScrollOffset handles 0 children', (WidgetTester tester) async { + testWidgets('SliverGridRegularTileLayout.computeMaxScrollOffset handles 0 children', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/59663 final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/slotted_render_object_widget_test.dart b/packages/flutter/test/widgets/slotted_render_object_widget_test.dart index 925684b5f24..55b222b24fb 100644 --- a/packages/flutter/test/widgets/slotted_render_object_widget_test.dart +++ b/packages/flutter/test/widgets/slotted_render_object_widget_test.dart @@ -7,13 +7,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; const Color green = Color(0xFF00FF00); const Color yellow = Color(0xFFFFFF00); void main() { - testWidgetsWithLeakTracking('SlottedRenderObjectWidget test', (WidgetTester tester) async { + testWidgets('SlottedRenderObjectWidget test', (WidgetTester tester) async { await tester.pumpWidget(buildWidget( topLeft: Container( height: 100, @@ -138,7 +137,7 @@ void main() { expect(_RenderTest().publicNameForSlot(slot), slot.toString()); }); - testWidgetsWithLeakTracking('key reparenting', (WidgetTester tester) async { + testWidgets('key reparenting', (WidgetTester tester) async { const Widget widget1 = SizedBox(key: ValueKey<String>('smol'), height: 10, width: 10); const Widget widget2 = SizedBox(key: ValueKey<String>('big'), height: 100, width: 100); const Widget nullWidget = SizedBox(key: ValueKey<String>('null'), height: 50, width: 50); @@ -204,7 +203,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('debugDescribeChildren', (WidgetTester tester) async { + testWidgets('debugDescribeChildren', (WidgetTester tester) async { await tester.pumpWidget(buildWidget( topLeft: const SizedBox( height: 100, diff --git a/packages/flutter/test/widgets/snapshot_widget_test.dart b/packages/flutter/test/widgets/snapshot_widget_test.dart index 7d6df8b23fe..f2e35095d88 100644 --- a/packages/flutter/test/widgets/snapshot_widget_test.dart +++ b/packages/flutter/test/widgets/snapshot_widget_test.dart @@ -16,7 +16,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SnapshotWidget can rasterize child', (WidgetTester tester) async { + testWidgets('SnapshotWidget can rasterize child', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); final Key key = UniqueKey(); @@ -59,7 +59,7 @@ void main() { await expectLater(find.byKey(key), matchesGoldenFile('raster_widget.red.png')); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('Changing devicePixelRatio does not repaint if snapshotting is not enabled', (WidgetTester tester) async { + testWidgets('Changing devicePixelRatio does not repaint if snapshotting is not enabled', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(); addTearDown(controller.dispose); final TestPainter painter = TestPainter(); @@ -94,7 +94,7 @@ void main() { expect(painter.count, 1); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('Changing devicePixelRatio forces raster regeneration', (WidgetTester tester) async { + testWidgets('Changing devicePixelRatio forces raster regeneration', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); final TestPainter painter = TestPainter(); @@ -133,7 +133,7 @@ void main() { expect(raster, isNot(newRaster)); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('SnapshotWidget paints its child as a single picture layer', (WidgetTester tester) async { + testWidgets('SnapshotWidget paints its child as a single picture layer', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); @@ -162,7 +162,7 @@ void main() { expect(tester.layers.last, isA<PictureLayer>()); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('SnapshotWidget can update the painter type', (WidgetTester tester) async { + testWidgets('SnapshotWidget can update the painter type', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); final TestPainter painter1 = TestPainter(); @@ -198,7 +198,7 @@ void main() { expect(tester.takeException(), isNull); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('RenderSnapshotWidget does not error on rasterization of child with empty size', (WidgetTester tester) async { + testWidgets('RenderSnapshotWidget does not error on rasterization of child with empty size', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); @@ -217,7 +217,7 @@ void main() { }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('RenderSnapshotWidget throws assertion if platform view is encountered', (WidgetTester tester) async { + testWidgets('RenderSnapshotWidget throws assertion if platform view is encountered', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); @@ -240,7 +240,7 @@ void main() { .having((FlutterError error) => error.message, 'message', contains('SnapshotWidget used with a child that contains a PlatformView'))); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('RenderSnapshotWidget does not assert if SnapshotMode.forced', (WidgetTester tester) async { + testWidgets('RenderSnapshotWidget does not assert if SnapshotMode.forced', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); @@ -263,7 +263,7 @@ void main() { expect(tester.takeException(), isNull); }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('RenderSnapshotWidget does not take a snapshot if a platform view is encountered with SnapshotMode.permissive', (WidgetTester tester) async { + testWidgets('RenderSnapshotWidget does not take a snapshot if a platform view is encountered with SnapshotMode.permissive', (WidgetTester tester) async { final SnapshotController controller = SnapshotController(allowSnapshotting: true); addTearDown(controller.dispose); @@ -288,7 +288,7 @@ void main() { }, skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689 - testWidgetsWithLeakTracking('SnapshotWidget should have same result when enabled', (WidgetTester tester) async { + testWidgets('SnapshotWidget should have same result when enabled', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view diff --git a/packages/flutter/test/widgets/spacer_test.dart b/packages/flutter/test/widgets/spacer_test.dart index 47ee53b3c06..06fbda26d24 100644 --- a/packages/flutter/test/widgets/spacer_test.dart +++ b/packages/flutter/test/widgets/spacer_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Spacer takes up space.', (WidgetTester tester) async { + testWidgets('Spacer takes up space.', (WidgetTester tester) async { await tester.pumpWidget(const Column( children: <Widget>[ SizedBox(width: 10.0, height: 10.0), @@ -20,7 +19,7 @@ void main() { expect(spacerRect.topLeft, const Offset(400.0, 10.0)); }); - testWidgetsWithLeakTracking('Spacer takes up space proportional to flex.', (WidgetTester tester) async { + testWidgets('Spacer takes up space proportional to flex.', (WidgetTester tester) async { const Spacer spacer1 = Spacer(); const Spacer spacer2 = Spacer(); const Spacer spacer3 = Spacer(flex: 2); @@ -54,7 +53,7 @@ void main() { expect(spacer4Rect.left, moreOrLessEquals(10.0, epsilon: 0.1)); }); - testWidgetsWithLeakTracking('Spacer takes up space.', (WidgetTester tester) async { + testWidgets('Spacer takes up space.', (WidgetTester tester) async { await tester.pumpWidget(const UnconstrainedBox( constrainedAxis: Axis.vertical, child: Column( diff --git a/packages/flutter/test/widgets/spell_check_test.dart b/packages/flutter/test/widgets/spell_check_test.dart index 131f5e9b044..f9b89dcde36 100644 --- a/packages/flutter/test/widgets/spell_check_test.dart +++ b/packages/flutter/test/widgets/spell_check_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; late TextStyle composingStyle; late TextStyle misspelledTextStyle; @@ -18,7 +17,7 @@ void main() { misspelledTextStyle = TextField.materialMisspelledTextStyle; }); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions ignores composing region when composing region out of range', (WidgetTester tester) async { const String text = 'Hello, wrold! Hey'; @@ -47,7 +46,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions, isolated misspelled word with separate composing region example', (WidgetTester tester) async { const String text = 'Hello, wrold! Hey'; @@ -78,7 +77,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions, composing region and misspelled words overlap example', (WidgetTester tester) async { const String text = 'Right worng worng right'; @@ -112,7 +111,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions, consecutive misspelled words example', (WidgetTester tester) async { const String text = 'Right worng worng right'; @@ -145,7 +144,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions corrects results when they lag, results text shorter than actual text example', (WidgetTester tester) async { const String text = 'Hello, wrold! Hey'; @@ -175,7 +174,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions corrects results when they lag, results text longer with more misspelled words than actual text example', (WidgetTester tester) async { const String text = 'Hello, wrold! Hey'; @@ -207,7 +206,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions corrects results when they lag, results text mismatched example', (WidgetTester tester) async { const String text = 'Hello, wrold! Hey'; @@ -234,7 +233,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions corrects results when they lag, results shifted forward example', (WidgetTester tester) async { const String text = 'Hello, there wrold! Hey'; @@ -264,7 +263,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions corrects results when they lag, results shifted backwards example', (WidgetTester tester) async { const String text = 'Hello, wrold! Hey'; @@ -294,7 +293,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions corrects results when they lag, results shifted backwards and forwards example', (WidgetTester tester) async { const String text = 'Hello, wrold! And Hye!'; @@ -327,7 +326,7 @@ void main() { expect(textSpanTree, equals(expectedTextSpanTree)); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.iOS })); - testWidgetsWithLeakTracking( + testWidgets( 'buildTextSpanWithSpellCheckSuggestions discards result when additions are made to misspelled word example', (WidgetTester tester) async { const String text = 'Hello, wroldd!'; diff --git a/packages/flutter/test/widgets/stack_test.dart b/packages/flutter/test/widgets/stack_test.dart index 039b8c25679..cd3174f5037 100644 --- a/packages/flutter/test/widgets/stack_test.dart +++ b/packages/flutter/test/widgets/stack_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../rendering/rendering_tester.dart' show TestCallbackPainter; @@ -19,7 +18,7 @@ class TestPaintingContext implements PaintingContext { } void main() { - testWidgetsWithLeakTracking('Can construct an empty Stack', (WidgetTester tester) async { + testWidgets('Can construct an empty Stack', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -28,7 +27,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can construct an empty Centered Stack', (WidgetTester tester) async { + testWidgets('Can construct an empty Centered Stack', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -37,7 +36,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can change position data', (WidgetTester tester) async { + testWidgets('Can change position data', (WidgetTester tester) async { const Key key = Key('container'); await tester.pumpWidget( @@ -94,7 +93,7 @@ void main() { expect(parentData.height, isNull); }); - testWidgetsWithLeakTracking('Can remove parent data', (WidgetTester tester) async { + testWidgets('Can remove parent data', (WidgetTester tester) async { const Key key = Key('container'); const SizedBox sizedBox = SizedBox(key: key, width: 10.0, height: 10.0); @@ -132,7 +131,7 @@ void main() { expect(parentData.height, isNull); }); - testWidgetsWithLeakTracking('Can align non-positioned children (LTR)', (WidgetTester tester) async { + testWidgets('Can align non-positioned children (LTR)', (WidgetTester tester) async { const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -178,7 +177,7 @@ void main() { expect(child1RenderObjectParentData.offset, equals(const Offset(10.0, 10.0))); }); - testWidgetsWithLeakTracking('Can align non-positioned children (RTL)', (WidgetTester tester) async { + testWidgets('Can align non-positioned children (RTL)', (WidgetTester tester) async { const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); @@ -224,7 +223,7 @@ void main() { expect(child1RenderObjectParentData.offset, equals(const Offset(0.0, 10.0))); }); - testWidgetsWithLeakTracking('Can construct an empty IndexedStack', (WidgetTester tester) async { + testWidgets('Can construct an empty IndexedStack', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -233,7 +232,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can construct an empty Centered IndexedStack', (WidgetTester tester) async { + testWidgets('Can construct an empty Centered IndexedStack', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -242,7 +241,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can construct an IndexedStack', (WidgetTester tester) async { + testWidgets('Can construct an IndexedStack', (WidgetTester tester) async { const int itemCount = 3; late List<int> itemsPainted; @@ -290,7 +289,7 @@ void main() { expect(itemsPainted, equals(<int>[2])); }); - testWidgetsWithLeakTracking('Can hit test an IndexedStack', (WidgetTester tester) async { + testWidgets('Can hit test an IndexedStack', (WidgetTester tester) async { const Key key = Key('indexedStack'); const int itemCount = 3; late List<int> itemsTapped; @@ -321,7 +320,7 @@ void main() { expect(itemsTapped, <int>[2]); }); - testWidgetsWithLeakTracking('IndexedStack sets non-selected indexes to visible=false', (WidgetTester tester) async { + testWidgets('IndexedStack sets non-selected indexes to visible=false', (WidgetTester tester) async { Widget buildStack({required int itemCount, required int? selectedIndex}) { final List<Widget> children = List<Widget>.generate(itemCount, (int i) { return _ShowVisibility(index: i); @@ -356,7 +355,7 @@ void main() { expect(find.text('index 2 is visible ? true', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('Can set width and height', (WidgetTester tester) async { + testWidgets('Can set width and height', (WidgetTester tester) async { const Key key = Key('container'); const BoxDecoration kBoxDecoration = BoxDecoration( @@ -424,7 +423,7 @@ void main() { expect(renderBox.size.height, equals(12.0)); }); - testWidgetsWithLeakTracking('Can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('Can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(const Stack(textDirection: TextDirection.ltr)); final RenderStack renderObject = tester.allRenderObjects.whereType<RenderStack>().first; expect(renderObject.clipBehavior, equals(Clip.hardEdge)); @@ -433,7 +432,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.hardEdge)); }); - testWidgetsWithLeakTracking('Clip.none is respected by describeApproximateClip', (WidgetTester tester) async { + testWidgets('Clip.none is respected by describeApproximateClip', (WidgetTester tester) async { await tester.pumpWidget(const Stack( textDirection: TextDirection.ltr, children: <Widget>[Positioned(left: 1000, right: 2000, child: SizedBox(width: 2000, height: 2000))], @@ -456,7 +455,7 @@ void main() { expect(visited, true); }); - testWidgetsWithLeakTracking('IndexedStack with null index', (WidgetTester tester) async { + testWidgets('IndexedStack with null index', (WidgetTester tester) async { bool? tapped; await tester.pumpWidget( @@ -486,7 +485,7 @@ void main() { expect(tapped, isNull); }); - testWidgetsWithLeakTracking('IndexedStack reports hidden children as offstage', (WidgetTester tester) async { + testWidgets('IndexedStack reports hidden children as offstage', (WidgetTester tester) async { final List<Widget> children = <Widget>[ for (int i = 0; i < 5; i++) Text('child $i'), ]; @@ -520,7 +519,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Stack clip test', (WidgetTester tester) async { + testWidgets('Stack clip test', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -581,7 +580,7 @@ void main() { expect(context.invocations.first.memberName, equals(#paintChild)); }); - testWidgetsWithLeakTracking('Stack sizing: default', (WidgetTester tester) async { + testWidgets('Stack sizing: default', (WidgetTester tester) async { final List<String> logs = <String>[]; await tester.pumpWidget( Directionality( @@ -611,7 +610,7 @@ void main() { expect(logs, <String>['BoxConstraints(0.0<=w<=3.0, 0.0<=h<=7.0)']); }); - testWidgetsWithLeakTracking('Stack sizing: explicit', (WidgetTester tester) async { + testWidgets('Stack sizing: explicit', (WidgetTester tester) async { final List<String> logs = <String>[]; Widget buildStack(StackFit sizing) { return Directionality( @@ -653,7 +652,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Positioned.directional control test', (WidgetTester tester) async { + testWidgets('Positioned.directional control test', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Directionality( @@ -690,7 +689,7 @@ void main() { expect(tester.getTopLeft(find.byKey(key)), const Offset(50.0, 0.0)); }); - testWidgetsWithLeakTracking('PositionedDirectional control test', (WidgetTester tester) async { + testWidgets('PositionedDirectional control test', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Directionality( @@ -725,7 +724,7 @@ void main() { expect(tester.getTopLeft(find.byKey(key)), const Offset(50.0, 0.0)); }); - testWidgetsWithLeakTracking('Can change the text direction of a Stack', (WidgetTester tester) async { + testWidgets('Can change the text direction of a Stack', (WidgetTester tester) async { await tester.pumpWidget( const Stack( alignment: Alignment.center, @@ -743,7 +742,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Alignment with partially-positioned children', (WidgetTester tester) async { + testWidgets('Alignment with partially-positioned children', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.rtl, @@ -888,7 +887,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Can update clipBehavior of IndexedStack', + testWidgets('Can update clipBehavior of IndexedStack', (WidgetTester tester) async { await tester.pumpWidget(const IndexedStack(textDirection: TextDirection.ltr)); final RenderIndexedStack renderObject = @@ -906,7 +905,7 @@ void main() { expect(renderIndexedObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('IndexedStack sizing: explicit', (WidgetTester tester) async { + testWidgets('IndexedStack sizing: explicit', (WidgetTester tester) async { final List<String> logs = <String>[]; Widget buildIndexedStack(StackFit sizing) { return Directionality( diff --git a/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart b/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart index c9ddff09179..06a7dfd890a 100644 --- a/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart +++ b/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class Foo extends StatefulWidget { const Foo({ super.key }); @@ -88,7 +87,7 @@ class FooScrollBehavior extends ScrollBehavior { } void main() { - testWidgetsWithLeakTracking('Can animate scroll after setState', (WidgetTester tester) async { + testWidgets('Can animate scroll after setState', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/stateful_component_test.dart b/packages/flutter/test/widgets/stateful_component_test.dart index 3db736a1331..078e30f0cd6 100644 --- a/packages/flutter/test/widgets/stateful_component_test.dart +++ b/packages/flutter/test/widgets/stateful_component_test.dart @@ -5,12 +5,11 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'test_widgets.dart'; void main() { - testWidgetsWithLeakTracking('Stateful widget smoke test', (WidgetTester tester) async { + testWidgets('Stateful widget smoke test', (WidgetTester tester) async { void checkTree(BoxDecoration expectedDecoration) { final SingleChildRenderObjectElement element = tester.element( find.byElementPredicate((Element element) => element is SingleChildRenderObjectElement && element.renderObject is! RenderView), @@ -55,7 +54,7 @@ void main() { checkTree(kBoxDecorationB); }); - testWidgetsWithLeakTracking("Don't rebuild subwidgets", (WidgetTester tester) async { + testWidgets("Don't rebuild subwidgets", (WidgetTester tester) async { await tester.pumpWidget( const FlipWidget( key: Key('rebuild test'), diff --git a/packages/flutter/test/widgets/stateful_components_test.dart b/packages/flutter/test/widgets/stateful_components_test.dart index 168d7424a8d..13f5a6ac7fd 100644 --- a/packages/flutter/test/widgets/stateful_components_test.dart +++ b/packages/flutter/test/widgets/stateful_components_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class InnerWidget extends StatefulWidget { const InnerWidget({ super.key }); @@ -45,7 +44,7 @@ class OuterContainerState extends State<OuterContainer> { } void main() { - testWidgetsWithLeakTracking('resync stateful widget', (WidgetTester tester) async { + testWidgets('resync stateful widget', (WidgetTester tester) async { const Key innerKey = Key('inner'); const Key outerKey = Key('outer'); diff --git a/packages/flutter/test/widgets/status_transitions_test.dart b/packages/flutter/test/widgets/status_transitions_test.dart index c12fcd8f17c..581bfd15ac3 100644 --- a/packages/flutter/test/widgets/status_transitions_test.dart +++ b/packages/flutter/test/widgets/status_transitions_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestStatusTransitionWidget extends StatusTransitionWidget { const TestStatusTransitionWidget({ @@ -20,7 +19,7 @@ class TestStatusTransitionWidget extends StatusTransitionWidget { } void main() { - testWidgetsWithLeakTracking('Status transition control test', (WidgetTester tester) async { + testWidgets('Status transition control test', (WidgetTester tester) async { bool didBuild = false; final AnimationController controller = AnimationController( duration: const Duration(seconds: 1), diff --git a/packages/flutter/test/widgets/syncing_test.dart b/packages/flutter/test/widgets/syncing_test.dart index ff514d6ae31..84745ca07cd 100644 --- a/packages/flutter/test/widgets/syncing_test.dart +++ b/packages/flutter/test/widgets/syncing_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestWidget extends StatefulWidget { const TestWidget({ @@ -49,7 +48,7 @@ class TestWidgetState extends State<TestWidget> { void main() { - testWidgetsWithLeakTracking('no change', (WidgetTester tester) async { + testWidgets('no change', (WidgetTester tester) async { await tester.pumpWidget( ColoredBox( color: Colors.blue, @@ -89,7 +88,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('remove one', (WidgetTester tester) async { + testWidgets('remove one', (WidgetTester tester) async { await tester.pumpWidget( ColoredBox( color: Colors.blue, @@ -128,7 +127,7 @@ void main() { await tester.pumpWidget(Container()); }); - testWidgetsWithLeakTracking('swap instances around', (WidgetTester tester) async { + testWidgets('swap instances around', (WidgetTester tester) async { const Widget a = TestWidget(persistentState: 0x61, syncedState: 0x41, child: Text('apple', textDirection: TextDirection.ltr)); const Widget b = TestWidget(persistentState: 0x62, syncedState: 0x42, child: Text('banana', textDirection: TextDirection.ltr)); await tester.pumpWidget(const Column()); diff --git a/packages/flutter/test/widgets/table_test.dart b/packages/flutter/test/widgets/table_test.dart index d09aaa915b1..3e7d813cfcb 100644 --- a/packages/flutter/test/widgets/table_test.dart +++ b/packages/flutter/test/widgets/table_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestStatefulWidget extends StatefulWidget { const TestStatefulWidget({ super.key }); @@ -38,7 +37,7 @@ class TestChildState extends State<TestChildWidget> { } void main() { - testWidgetsWithLeakTracking('Table widget - empty', (WidgetTester tester) async { + testWidgets('Table widget - empty', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -47,7 +46,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Table widget - control test', (WidgetTester tester) async { + testWidgets('Table widget - control test', (WidgetTester tester) async { Future<void> run(TextDirection textDirection) async { await tester.pumpWidget( Directionality( @@ -87,7 +86,7 @@ void main() { await run(TextDirection.rtl); }); - testWidgetsWithLeakTracking('Table widget can be detached and re-attached', (WidgetTester tester) async { + testWidgets('Table widget can be detached and re-attached', (WidgetTester tester) async { final Widget table = Table( key: GlobalKey(), children: const <TableRow>[ @@ -122,7 +121,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Table widget - column offset (LTR)', (WidgetTester tester) async { + testWidgets('Table widget - column offset (LTR)', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -192,7 +191,7 @@ void main() { expect(c3.left, equals(c1.left)); }); - testWidgetsWithLeakTracking('Table widget - column offset (RTL)', (WidgetTester tester) async { + testWidgets('Table widget - column offset (RTL)', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, @@ -262,7 +261,7 @@ void main() { expect(c3.right, equals(c1.right)); }); - testWidgetsWithLeakTracking('Table border - smoke test', (WidgetTester tester) async { + testWidgets('Table border - smoke test', (WidgetTester tester) async { Future<void> run(TextDirection textDirection) async { await tester.pumpWidget( Directionality( @@ -296,7 +295,7 @@ void main() { await run(TextDirection.rtl); }); - testWidgetsWithLeakTracking('Table widget - changing table dimensions', (WidgetTester tester) async { + testWidgets('Table widget - changing table dimensions', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -352,7 +351,7 @@ void main() { expect(boxG1, isNot(equals(boxG2))); }); - testWidgetsWithLeakTracking('Really small deficit double precision error', (WidgetTester tester) async { + testWidgets('Really small deficit double precision error', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/27083 const SizedBox cell = SizedBox(width: 16, height: 16); await tester.pumpWidget( @@ -377,7 +376,7 @@ void main() { // If the above bug is present this test will never terminate. }); - testWidgetsWithLeakTracking('Calculating flex columns with small width deficit', (WidgetTester tester) async { + testWidgets('Calculating flex columns with small width deficit', (WidgetTester tester) async { const SizedBox cell = SizedBox(width: 1, height: 1); // If the error is present, pumpWidget() will fail due to an unsatisfied // assertion during the layout phase. @@ -407,7 +406,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('Table widget - repump test', (WidgetTester tester) async { + testWidgets('Table widget - repump test', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -465,7 +464,7 @@ void main() { expect(boxA.size, equals(boxB.size)); }); - testWidgetsWithLeakTracking('Table widget - intrinsic sizing test', (WidgetTester tester) async { + testWidgets('Table widget - intrinsic sizing test', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -501,7 +500,7 @@ void main() { expect(boxA.size.height, equals(boxB.size.height)); }); - testWidgetsWithLeakTracking('Table widget - intrinsic sizing test, resizing', (WidgetTester tester) async { + testWidgets('Table widget - intrinsic sizing test, resizing', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -562,7 +561,7 @@ void main() { expect(boxA.size.height, equals(boxB.size.height)); }); - testWidgetsWithLeakTracking('Table widget - intrinsic sizing test, changing column widths', (WidgetTester tester) async { + testWidgets('Table widget - intrinsic sizing test, changing column widths', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -622,7 +621,7 @@ void main() { expect(boxA.size.height, equals(boxB.size.height)); }); - testWidgetsWithLeakTracking('Table widget - moving test', (WidgetTester tester) async { + testWidgets('Table widget - moving test', (WidgetTester tester) async { final List<BuildContext> contexts = <BuildContext>[]; await tester.pumpWidget( Directionality( @@ -678,7 +677,7 @@ void main() { expect(contexts[0], equals(contexts[1])); }); - testWidgetsWithLeakTracking('Table widget - keyed rows', (WidgetTester tester) async { + testWidgets('Table widget - keyed rows', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -736,7 +735,7 @@ void main() { expect(state22.mounted, isTrue); }); - testWidgetsWithLeakTracking('Table widget - global key reparenting', (WidgetTester tester) async { + testWidgets('Table widget - global key reparenting', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final Key tableKey = UniqueKey(); @@ -849,7 +848,7 @@ void main() { expect(table.row(0).length, 2); }); - testWidgetsWithLeakTracking('Table widget diagnostics', (WidgetTester tester) async { + testWidgets('Table widget diagnostics', (WidgetTester tester) async { GlobalKey key0; final Widget table = Directionality( textDirection: TextDirection.ltr, @@ -905,7 +904,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/31473. - testWidgetsWithLeakTracking( + testWidgets( 'Does not crash if a child RenderObject is replaced by another RenderObject of a different type', (WidgetTester tester) async { await tester.pumpWidget( @@ -931,7 +930,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Table widget - Default textBaseline is null', (WidgetTester tester) async { + testWidgets('Table widget - Default textBaseline is null', (WidgetTester tester) async { expect( () => Table(defaultVerticalAlignment: TableCellVerticalAlignment.baseline), throwsA( @@ -941,7 +940,7 @@ void main() { ); }); - testWidgetsWithLeakTracking( + testWidgets( 'Table widget requires all TableRows to have same number of children', (WidgetTester tester) async { FlutterError? error; @@ -966,7 +965,7 @@ void main() { }, ); - testWidgetsWithLeakTracking('Can replace child with a different RenderObject type', (WidgetTester tester) async { + testWidgets('Can replace child with a different RenderObject type', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/69395. await tester.pumpWidget( Directionality( @@ -1002,7 +1001,7 @@ void main() { expect(table.column(2).last.runtimeType, isNot(toBeReplaced)); }); - testWidgetsWithLeakTracking('Do not crash if a child that has not been layed out in a previous build is removed', (WidgetTester tester) async { + testWidgets('Do not crash if a child that has not been layed out in a previous build is removed', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/60488. Widget buildTable(Key key) { return Directionality( @@ -1035,7 +1034,7 @@ void main() { expect(find.text('Hello'), findsOneWidget); }); - testWidgetsWithLeakTracking('TableRow with no children throws an error message', (WidgetTester tester) async { + testWidgets('TableRow with no children throws an error message', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/119541. String result = 'no exception'; diff --git a/packages/flutter/test/widgets/tap_region_test.dart b/packages/flutter/test/widgets/tap_region_test.dart index c53983b7788..8dfbd9f93be 100644 --- a/packages/flutter/test/widgets/tap_region_test.dart +++ b/packages/flutter/test/widgets/tap_region_test.dart @@ -7,10 +7,9 @@ import 'dart:ui'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('TapRegionSurface detects outside taps', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects outside taps', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; await tester.pumpWidget( Directionality( @@ -102,7 +101,7 @@ void main() { expect(tappedOutside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface consumes outside taps when asked', (WidgetTester tester) async { + testWidgets('TapRegionSurface consumes outside taps when asked', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; int propagatedTaps = 0; await tester.pumpWidget( @@ -207,7 +206,7 @@ void main() { expect(tappedOutside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface detects inside taps', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects inside taps', (WidgetTester tester) async { final Set<String> tappedInside = <String>{}; await tester.pumpWidget( Directionality( @@ -294,7 +293,7 @@ void main() { expect(tappedInside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface detects inside taps correctly with behavior', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects inside taps correctly with behavior', (WidgetTester tester) async { final Set<String> tappedInside = <String>{}; const ValueKey<String> noGroupKey = ValueKey<String>('No Group'); const ValueKey<String> group1AKey = ValueKey<String>('Group 1 A'); @@ -380,7 +379,7 @@ void main() { tappedInside.clear(); }); - testWidgetsWithLeakTracking('Setting the group updates the registration', (WidgetTester tester) async { + testWidgets('Setting the group updates the registration', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; await tester.pumpWidget( Directionality( @@ -481,7 +480,7 @@ void main() { tappedOutside.clear(); }); - testWidgetsWithLeakTracking('TapRegionSurface detects outside right click', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects outside right click', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; await tester.pumpWidget( Directionality( @@ -574,7 +573,7 @@ void main() { expect(tappedOutside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface detects outside middle click', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects outside middle click', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; await tester.pumpWidget( Directionality( @@ -667,7 +666,7 @@ void main() { expect(tappedOutside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface consumes outside right click when asked', (WidgetTester tester) async { + testWidgets('TapRegionSurface consumes outside right click when asked', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; int propagatedTaps = 0; await tester.pumpWidget( @@ -773,7 +772,7 @@ void main() { expect(tappedOutside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface consumes outside middle click when asked', (WidgetTester tester) async { + testWidgets('TapRegionSurface consumes outside middle click when asked', (WidgetTester tester) async { final Set<String> tappedOutside = <String>{}; int propagatedTaps = 0; await tester.pumpWidget( @@ -879,7 +878,7 @@ void main() { expect(tappedOutside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface detects inside right click', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects inside right click', (WidgetTester tester) async { final Set<String> tappedInside = <String>{}; await tester.pumpWidget( Directionality( @@ -967,7 +966,7 @@ void main() { expect(tappedInside, isEmpty); }); - testWidgetsWithLeakTracking('TapRegionSurface detects inside middle click', (WidgetTester tester) async { + testWidgets('TapRegionSurface detects inside middle click', (WidgetTester tester) async { final Set<String> tappedInside = <String>{}; await tester.pumpWidget( Directionality( diff --git a/packages/flutter/test/widgets/text_golden_test.dart b/packages/flutter/test/widgets/text_golden_test.dart index 35a2afc0a2f..4267da2d79a 100644 --- a/packages/flutter/test/widgets/text_golden_test.dart +++ b/packages/flutter/test/widgets/text_golden_test.dart @@ -10,10 +10,9 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Centered text', (WidgetTester tester) async { + testWidgets('Centered text', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -64,7 +63,7 @@ void main() { }); - testWidgetsWithLeakTracking('Text Foreground', (WidgetTester tester) async { + testWidgets('Text Foreground', (WidgetTester tester) async { const Color black = Color(0xFF000000); const Color red = Color(0xFFFF0000); const Color blue = Color(0xFF0000FF); @@ -142,7 +141,7 @@ void main() { // TODO(garyq): This test requires an update when the background // drawing from the beginning of the line bug is fixed. The current // tested version is not completely correct. - testWidgetsWithLeakTracking('Text Background', (WidgetTester tester) async { + testWidgets('Text Background', (WidgetTester tester) async { const Color red = Colors.red; const Color blue = Colors.blue; const Color translucentGreen = Color(0x5000F000); @@ -189,7 +188,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Fade', (WidgetTester tester) async { + testWidgets('Text Fade', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( theme: ThemeData(useMaterial3: false), @@ -226,7 +225,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Default Strut text', (WidgetTester tester) async { + testWidgets('Default Strut text', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -251,7 +250,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Strut text 1', (WidgetTester tester) async { + testWidgets('Strut text 1', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -278,7 +277,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Strut text 2', (WidgetTester tester) async { + testWidgets('Strut text 2', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -306,7 +305,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Strut text rich', (WidgetTester tester) async { + testWidgets('Strut text rich', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -357,7 +356,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Strut text font fallback', (WidgetTester tester) async { + testWidgets('Strut text font fallback', (WidgetTester tester) async { // Font Fallback await tester.pumpWidget( Center( @@ -392,7 +391,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Strut text rich forceStrutHeight', (WidgetTester tester) async { + testWidgets('Strut text rich forceStrutHeight', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( @@ -443,7 +442,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Decoration thickness', (WidgetTester tester) async { + testWidgets('Decoration thickness', (WidgetTester tester) async { final TextDecoration allDecorations = TextDecoration.combine( <TextDecoration>[ TextDecoration.underline, @@ -481,7 +480,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Decoration thickness', (WidgetTester tester) async { + testWidgets('Decoration thickness', (WidgetTester tester) async { final TextDecoration allDecorations = TextDecoration.combine( <TextDecoration>[ TextDecoration.underline, @@ -520,7 +519,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget', (WidgetTester tester) async { + testWidgets('Text Inline widget', (WidgetTester tester) async { await tester.pumpWidget( Theme(data: ThemeData(useMaterial3: false), child: Center( child: RepaintBoundary( @@ -614,7 +613,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget textfield', (WidgetTester tester) async { + testWidgets('Text Inline widget textfield', (WidgetTester tester) async { await tester.pumpWidget( Center( child: MaterialApp( @@ -661,7 +660,7 @@ void main() { }); // This tests if multiple Text.rich widgets are able to inline nest within each other. - testWidgetsWithLeakTracking('Text Inline widget nesting', (WidgetTester tester) async { + testWidgets('Text Inline widget nesting', (WidgetTester tester) async { await tester.pumpWidget( Center( child: MaterialApp( @@ -790,7 +789,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget baseline', (WidgetTester tester) async { + testWidgets('Text Inline widget baseline', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -900,7 +899,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget aboveBaseline', (WidgetTester tester) async { + testWidgets('Text Inline widget aboveBaseline', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -1010,7 +1009,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget belowBaseline', (WidgetTester tester) async { + testWidgets('Text Inline widget belowBaseline', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -1120,7 +1119,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget top', (WidgetTester tester) async { + testWidgets('Text Inline widget top', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -1230,7 +1229,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text Inline widget middle', (WidgetTester tester) async { + testWidgets('Text Inline widget middle', (WidgetTester tester) async { await tester.pumpWidget( Theme( data: ThemeData(useMaterial3: false), @@ -1340,7 +1339,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text TextHeightBehavior', (WidgetTester tester) async { + testWidgets('Text TextHeightBehavior', (WidgetTester tester) async { await tester.pumpWidget( Center( child: RepaintBoundary( diff --git a/packages/flutter/test/widgets/text_scaler_backward_compatibility_test.dart b/packages/flutter/test/widgets/text_scaler_backward_compatibility_test.dart index 724fcbdb7f2..49d62b27623 100644 --- a/packages/flutter/test/widgets/text_scaler_backward_compatibility_test.dart +++ b/packages/flutter/test/widgets/text_scaler_backward_compatibility_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { group('TextStyle', () { @@ -65,7 +64,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('MediaQuery.textScaleFactorOf overriding compatibility', (WidgetTester tester) async { + testWidgets('MediaQuery.textScaleFactorOf overriding compatibility', (WidgetTester tester) async { late final double outsideTextScaleFactor; late final TextScaler outsideTextScaler; late final double insideTextScaleFactor; @@ -104,7 +103,7 @@ void main() { expect(insideTextScaler, const TextScaler.linear(4.0)); }); - testWidgetsWithLeakTracking('textScaleFactor overriding backward compatibility', (WidgetTester tester) async { + testWidgets('textScaleFactor overriding backward compatibility', (WidgetTester tester) async { late final double outsideTextScaleFactor; late final TextScaler outsideTextScaler; late final double insideTextScaleFactor; @@ -184,7 +183,7 @@ void main() { }); group('Widgets backward compatibility', () { - testWidgetsWithLeakTracking('RichText', (WidgetTester tester) async { + testWidgets('RichText', (WidgetTester tester) async { await tester.pumpWidget( RichText( textDirection: TextDirection.ltr, @@ -200,7 +199,7 @@ void main() { expect(tester.renderObject<RenderParagraph>(find.byType(RichText)).textScaleFactor, 2.0); }); - testWidgetsWithLeakTracking('Text', (WidgetTester tester) async { + testWidgets('Text', (WidgetTester tester) async { await tester.pumpWidget( const Text( 'text', @@ -215,7 +214,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('EditableText', (WidgetTester tester) async { + testWidgets('EditableText', (WidgetTester tester) async { final TextEditingController controller = TextEditingController(); addTearDown(controller.dispose); final FocusNode focusNode = FocusNode(debugLabel: 'EditableText Node'); diff --git a/packages/flutter/test/widgets/text_selection_test.dart b/packages/flutter/test/widgets/text_selection_test.dart index c03e1ce1e05..f0a08da5f6d 100644 --- a/packages/flutter/test/widgets/text_selection_test.dart +++ b/packages/flutter/test/widgets/text_selection_test.dart @@ -108,7 +108,7 @@ void main() { ); } - testWidgetsWithLeakTracking('a series of taps all call onTaps', (WidgetTester tester) async { + testWidgets('a series of taps all call onTaps', (WidgetTester tester) async { await pumpGestureDetector(tester); await tester.tapAt(const Offset(200, 200)); await tester.pump(const Duration(milliseconds: 150)); @@ -124,7 +124,7 @@ void main() { expect(tapCount, 6); }); - testWidgetsWithLeakTracking('in a series of rapid taps, onTapDown, onDoubleTapDown, and onTripleTapDown alternate', (WidgetTester tester) async { + testWidgets('in a series of rapid taps, onTapDown, onDoubleTapDown, and onTripleTapDown alternate', (WidgetTester tester) async { await pumpGestureDetector(tester); await tester.tapAt(const Offset(200, 200)); await tester.pump(const Duration(milliseconds: 50)); @@ -160,7 +160,7 @@ void main() { expect(tapCount, 7); }); - testWidgetsWithLeakTracking('quick tap-tap-hold is a double tap down', (WidgetTester tester) async { + testWidgets('quick tap-tap-hold is a double tap down', (WidgetTester tester) async { await pumpGestureDetector(tester); await tester.tapAt(const Offset(200, 200)); await tester.pump(const Duration(milliseconds: 50)); @@ -186,7 +186,7 @@ void main() { expect(singleLongTapStartCount, 0); }); - testWidgetsWithLeakTracking('a very quick swipe is ignored', (WidgetTester tester) async { + testWidgets('a very quick swipe is ignored', (WidgetTester tester) async { await pumpGestureDetector(tester); final TestGesture gesture = await tester.startGesture(const Offset(200, 200)); await tester.pump(const Duration(milliseconds: 20)); @@ -212,7 +212,7 @@ void main() { expect(singleLongTapStartCount, 0); }); - testWidgetsWithLeakTracking('a slower swipe has a tap down and a canceled tap', (WidgetTester tester) async { + testWidgets('a slower swipe has a tap down and a canceled tap', (WidgetTester tester) async { await pumpGestureDetector(tester); final TestGesture gesture = await tester.startGesture(const Offset(200, 200)); await tester.pump(const Duration(milliseconds: 120)); @@ -225,7 +225,7 @@ void main() { expect(singleLongTapStartCount, 0); }); - testWidgetsWithLeakTracking('a force press initiates a force press', (WidgetTester tester) async { + testWidgets('a force press initiates a force press', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -307,7 +307,7 @@ void main() { expect(forcePressStartCount, 4); }); - testWidgetsWithLeakTracking('a tap and then force press initiates a force press and not a double tap', (WidgetTester tester) async { + testWidgets('a tap and then force press initiates a force press and not a double tap', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -360,7 +360,7 @@ void main() { expect(doubleTapDownCount, 0); }); - testWidgetsWithLeakTracking('a long press from a touch device is recognized as a long single tap', (WidgetTester tester) async { + testWidgets('a long press from a touch device is recognized as a long single tap', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -377,7 +377,7 @@ void main() { expect(singleLongTapStartCount, 1); }); - testWidgetsWithLeakTracking('a long press from a mouse is just a tap', (WidgetTester tester) async { + testWidgets('a long press from a mouse is just a tap', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -395,7 +395,7 @@ void main() { expect(singleLongTapStartCount, 0); }); - testWidgetsWithLeakTracking('a touch drag is recognized for text selection', (WidgetTester tester) async { + testWidgets('a touch drag is recognized for text selection', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -417,7 +417,7 @@ void main() { expect(dragEndCount, 1); }); - testWidgetsWithLeakTracking('a mouse drag is recognized for text selection', (WidgetTester tester) async { + testWidgets('a mouse drag is recognized for text selection', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -442,7 +442,7 @@ void main() { expect(dragEndCount, 1); }); - testWidgetsWithLeakTracking('a slow mouse drag is still recognized for text selection', (WidgetTester tester) async { + testWidgets('a slow mouse drag is still recognized for text selection', (WidgetTester tester) async { await pumpGestureDetector(tester); final int pointerValue = tester.nextPointer; @@ -467,7 +467,7 @@ void main() { expect(dragEndCount, 1); }); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder long press on Apple Platforms - focused renderEditable', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder long press on Apple Platforms - focused renderEditable', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final FakeEditableTextState state = tester.state(find.byType(FakeEditableText)); final FakeRenderEditable renderEditable = tester.renderObject(find.byType(FakeEditable)); @@ -486,7 +486,7 @@ void main() { expect(renderEditable.lastCause, SelectionChangedCause.longPress); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder long press on iOS - renderEditable not focused', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder long press on iOS - renderEditable not focused', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final FakeEditableTextState state = tester.state(find.byType(FakeEditableText)); final FakeRenderEditable renderEditable = tester.renderObject(find.byType(FakeEditable)); @@ -504,7 +504,7 @@ void main() { expect(renderEditable.lastCause, SelectionChangedCause.longPress); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder long press on non-Apple Platforms', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder long press on non-Apple Platforms', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), @@ -521,7 +521,7 @@ void main() { expect(renderEditable.lastCause, SelectionChangedCause.longPress); }, variant: TargetPlatformVariant.all(excluding: <TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); - testWidgetsWithLeakTracking('TextSelectionGestureDetectorBuilder right click Apple platforms', (WidgetTester tester) async { + testWidgets('TextSelectionGestureDetectorBuilder right click Apple platforms', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/80119 await pumpTextSelectionGestureDetectorBuilder(tester); @@ -566,7 +566,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }), ); - testWidgetsWithLeakTracking('TextSelectionGestureDetectorBuilder right click non-Apple platforms', (WidgetTester tester) async { + testWidgets('TextSelectionGestureDetectorBuilder right click non-Apple platforms', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/80119 await pumpTextSelectionGestureDetectorBuilder(tester); @@ -616,7 +616,7 @@ void main() { variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.linux, TargetPlatform.windows }), ); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder tap', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder tap', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), @@ -643,7 +643,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder toggles toolbar on single tap on previous selection iOS', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder toggles toolbar on single tap on previous selection iOS', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final FakeEditableTextState state = tester.state(find.byType(FakeEditableText)); @@ -675,7 +675,7 @@ void main() { }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder shows spell check toolbar on single tap on Android', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder shows spell check toolbar on single tap on Android', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final FakeEditableTextState state = tester.state(find.byType(FakeEditableText)); @@ -695,7 +695,7 @@ void main() { }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android })); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder shows spell check toolbar on single tap on iOS if word misspelled and text selection toolbar on additonal taps', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder shows spell check toolbar on single tap on iOS if word misspelled and text selection toolbar on additonal taps', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final FakeEditableTextState state = tester.state(find.byType(FakeEditableText)); final FakeRenderEditable renderEditable = tester.renderObject(find.byType(FakeEditable)); @@ -736,7 +736,7 @@ void main() { expect(state.toggleToolbarCalled, isTrue); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS })); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder double tap', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder double tap', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), @@ -756,7 +756,7 @@ void main() { expect(renderEditable.lastCause, SelectionChangedCause.doubleTap); }); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder forcePress enabled', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder forcePress enabled', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final TestGesture gesture = await tester.createGesture(); await gesture.downWithCustomEvent( @@ -783,7 +783,7 @@ void main() { expect(renderEditable.selectWordsInRangeCalled, isTrue); }); - testWidgetsWithLeakTracking('Mouse drag does not show handles nor toolbar', (WidgetTester tester) async { + testWidgets('Mouse drag does not show handles nor toolbar', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/69001 await tester.pumpWidget( const MaterialApp( @@ -807,7 +807,7 @@ void main() { expect(editableText.selectionOverlay!.toolbarIsVisible, isFalse); }); - testWidgetsWithLeakTracking('Mouse drag selects and cannot drag cursor', (WidgetTester tester) async { + testWidgets('Mouse drag selects and cannot drag cursor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102928 final TextEditingController controller = TextEditingController( text: 'I love flutter!', @@ -873,7 +873,7 @@ void main() { expect(controller.selection.extentOffset, 10); }); - testWidgetsWithLeakTracking('Touch drag moves the cursor', (WidgetTester tester) async { + testWidgets('Touch drag moves the cursor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102928 final TextEditingController controller = TextEditingController( text: 'I love flutter!', @@ -932,7 +932,7 @@ void main() { expect(controller.selection.baseOffset, 10); }); - testWidgetsWithLeakTracking('Stylus drag moves the cursor', (WidgetTester tester) async { + testWidgets('Stylus drag moves the cursor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102928 final TextEditingController controller = TextEditingController( text: 'I love flutter!', @@ -991,7 +991,7 @@ void main() { expect(controller.selection.baseOffset, 10); }); - testWidgetsWithLeakTracking('Drag of unknown type moves the cursor', (WidgetTester tester) async { + testWidgets('Drag of unknown type moves the cursor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102928 final TextEditingController controller = TextEditingController( text: 'I love flutter!', @@ -1050,7 +1050,7 @@ void main() { expect(controller.selection.baseOffset, 10); }); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder drag with RenderEditable viewport offset change', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder drag with RenderEditable viewport offset change', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester); final FakeRenderEditable renderEditable = tester.renderObject(find.byType(FakeEditable)); @@ -1091,7 +1091,7 @@ void main() { expect(renderEditable.selectPositionAtTo, const Offset(300.0, 400.0)); }); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder selection disabled', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder selection disabled', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester, selectionEnabled: false); final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), @@ -1107,7 +1107,7 @@ void main() { expect(renderEditable.selectWordsInRangeCalled, isFalse); }); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder mouse drag disabled', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder mouse drag disabled', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester, selectionEnabled: false); final TestGesture gesture = await tester.startGesture( Offset.zero, @@ -1123,7 +1123,7 @@ void main() { expect(renderEditable.selectPositionAtCalled, isFalse); }); - testWidgetsWithLeakTracking('test TextSelectionGestureDetectorBuilder forcePress disabled', (WidgetTester tester) async { + testWidgets('test TextSelectionGestureDetectorBuilder forcePress disabled', (WidgetTester tester) async { await pumpTextSelectionGestureDetectorBuilder(tester, forcePressEnabled: false); final TestGesture gesture = await tester.createGesture(); await gesture.downWithCustomEvent( @@ -1145,7 +1145,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/37032. - testWidgetsWithLeakTracking("selection handle's GestureDetector should not cover the entire screen", (WidgetTester tester) async { + testWidgets("selection handle's GestureDetector should not cover the entire screen", (WidgetTester tester) async { final TextEditingController controller = TextEditingController(text: 'a'); addTearDown(controller.dispose); @@ -1242,7 +1242,7 @@ void main() { ); } - testWidgetsWithLeakTracking('dispatches memory events', (WidgetTester tester) async { + testWidgets('dispatches memory events', (WidgetTester tester) async { await expectLater( await memoryEvents( () async { @@ -1255,7 +1255,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('can show and hide handles', (WidgetTester tester) async { + testWidgets('can show and hide handles', (WidgetTester tester) async { final TextSelectionControlsSpy spy = TextSelectionControlsSpy(); final SelectionOverlay selectionOverlay = await pumpApp( tester, @@ -1303,7 +1303,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('only paints one collapsed handle', (WidgetTester tester) async { + testWidgets('only paints one collapsed handle', (WidgetTester tester) async { final TextSelectionControlsSpy spy = TextSelectionControlsSpy(); final SelectionOverlay selectionOverlay = await pumpApp( tester, @@ -1326,7 +1326,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('can change handle parameter', (WidgetTester tester) async { + testWidgets('can change handle parameter', (WidgetTester tester) async { final TextSelectionControlsSpy spy = TextSelectionControlsSpy(); final SelectionOverlay selectionOverlay = await pumpApp( tester, @@ -1363,7 +1363,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('can trigger selection handle onTap', (WidgetTester tester) async { + testWidgets('can trigger selection handle onTap', (WidgetTester tester) async { bool selectionHandleTapped = false; void handleTapped() => selectionHandleTapped = true; final TextSelectionControlsSpy spy = TextSelectionControlsSpy(); @@ -1398,7 +1398,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('can trigger selection handle drag', (WidgetTester tester) async { + testWidgets('can trigger selection handle drag', (WidgetTester tester) async { DragStartDetails? startDragStartDetails; DragUpdateDetails? startDragUpdateDetails; DragEndDetails? startDragEndDetails; @@ -1472,7 +1472,7 @@ void main() { await tester.pumpAndSettle(); }); - testWidgetsWithLeakTracking('can show magnifier when no handles exist', (WidgetTester tester) async { + testWidgets('can show magnifier when no handles exist', (WidgetTester tester) async { final GlobalKey magnifierKey = GlobalKey(); final SelectionOverlay selectionOverlay = await pumpApp( tester, @@ -1555,7 +1555,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Mouse edge scrolling works in an outer scrollable', (WidgetTester tester) async { + testWidgets('Mouse edge scrolling works in an outer scrollable', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102484 final TextEditingController controller = TextEditingController( text: 'I love flutter!\n' * 8, @@ -1636,7 +1636,7 @@ void main() { expect(scrollController.position.pixels, scrollController.position.maxScrollExtent); }); - testWidgetsWithLeakTracking('Mouse edge scrolling works with both an outer scrollable and scrolling in the EditableText', (WidgetTester tester) async { + testWidgets('Mouse edge scrolling works with both an outer scrollable and scrolling in the EditableText', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/102484 final TextEditingController controller = TextEditingController( text: 'I love flutter!\n' * 8, @@ -1768,7 +1768,7 @@ void main() { ); } - testWidgetsWithLeakTracking('dispatches memory events', (WidgetTester tester) async { + testWidgets('dispatches memory events', (WidgetTester tester) async { await expectLater( await memoryEvents( () async { diff --git a/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart b/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart index 9ccec43ba8b..1fc67c761d6 100644 --- a/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart +++ b/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('positions itself at anchorAbove if it fits', (WidgetTester tester) async { + testWidgets('positions itself at anchorAbove if it fits', (WidgetTester tester) async { late StateSetter setState; const double height = 43.0; const double anchorBelowY = 500.0; diff --git a/packages/flutter/test/widgets/text_semantics_test.dart b/packages/flutter/test/widgets/text_semantics_test.dart index abb34ac7ba7..c3a94c65a29 100644 --- a/packages/flutter/test/widgets/text_semantics_test.dart +++ b/packages/flutter/test/widgets/text_semantics_test.dart @@ -6,12 +6,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('SemanticsNode ids are stable', (WidgetTester tester) async { + testWidgets('SemanticsNode ids are stable', (WidgetTester tester) async { // Regression test for b/151732341. final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer1 = TapGestureRecognizer(); diff --git a/packages/flutter/test/widgets/text_test.dart b/packages/flutter/test/widgets/text_test.dart index c7e69e4f25a..bd891575b54 100644 --- a/packages/flutter/test/widgets/text_test.dart +++ b/packages/flutter/test/widgets/text_test.dart @@ -9,12 +9,11 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; void main() { - testWidgetsWithLeakTracking('Text respects media query', (WidgetTester tester) async { + testWidgets('Text respects media query', (WidgetTester tester) async { await tester.pumpWidget(const MediaQuery( data: MediaQueryData(textScaleFactor: 1.3), child: Center( @@ -35,7 +34,7 @@ void main() { expect(text.textScaler, TextScaler.noScaling); }); - testWidgetsWithLeakTracking('Text respects textScaleFactor with default font size', (WidgetTester tester) async { + testWidgets('Text respects textScaleFactor with default font size', (WidgetTester tester) async { await tester.pumpWidget( const Center(child: Text('Hello', textDirection: TextDirection.ltr)), ); @@ -63,7 +62,7 @@ void main() { expect(largeSize.height, equals(21.0)); }); - testWidgetsWithLeakTracking('Text respects textScaleFactor with explicit font size', (WidgetTester tester) async { + testWidgets('Text respects textScaleFactor with explicit font size', (WidgetTester tester) async { await tester.pumpWidget(const Center( child: Text( 'Hello', @@ -103,7 +102,7 @@ void main() { expect(message, contains(' Text ')); }); - testWidgetsWithLeakTracking('Text can be created from TextSpans and uses defaultTextStyle', (WidgetTester tester) async { + testWidgets('Text can be created from TextSpans and uses defaultTextStyle', (WidgetTester tester) async { await tester.pumpWidget( const DefaultTextStyle( style: TextStyle( @@ -133,7 +132,7 @@ void main() { expect(text.text.style!.fontSize, 20.0); }); - testWidgetsWithLeakTracking('inline widgets works with ellipsis', (WidgetTester tester) async { + testWidgets('inline widgets works with ellipsis', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/35869 const TextStyle textStyle = TextStyle(); await tester.pumpWidget( @@ -166,7 +165,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('inline widgets hitTest works with ellipsis', (WidgetTester tester) async { + testWidgets('inline widgets hitTest works with ellipsis', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/68559 const TextStyle textStyle = TextStyle(); await tester.pumpWidget( @@ -202,7 +201,7 @@ void main() { expect(tester.takeException(), null); }); - testWidgetsWithLeakTracking('inline widgets works with textScaleFactor', (WidgetTester tester) async { + testWidgets('inline widgets works with textScaleFactor', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/59316 final UniqueKey key = UniqueKey(); double textScaleFactor = 1.0; @@ -266,7 +265,7 @@ void main() { expect(renderText.size.height, singleLineHeight * textScaleFactor * 3); }); - testWidgetsWithLeakTracking("Inline widgets' scaled sizes are constrained", (WidgetTester tester) async { + testWidgets("Inline widgets' scaled sizes are constrained", (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/130588 await tester.pumpWidget( const Directionality( @@ -283,7 +282,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('semanticsLabel can override text label', (WidgetTester tester) async { + testWidgets('semanticsLabel can override text label', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( const Text( @@ -329,7 +328,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('semantics label is in order when uses widget span', (WidgetTester tester) async { + testWidgets('semantics label is in order when uses widget span', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -364,7 +363,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('semantics can handle some widget spans without semantics', (WidgetTester tester) async { + testWidgets('semantics can handle some widget spans without semantics', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -406,7 +405,7 @@ void main() { matchesSemantics(label: 'before \n mid\nfoo\n after')); }); - testWidgetsWithLeakTracking('semantics can handle all widget spans without semantics', (WidgetTester tester) async { + testWidgets('semantics can handle all widget spans without semantics', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -448,7 +447,7 @@ void main() { matchesSemantics(label: 'before \n mid\n after')); }); - testWidgetsWithLeakTracking('semantics can handle widget spans with explicit semantics node', (WidgetTester tester) async { + testWidgets('semantics can handle widget spans with explicit semantics node', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -483,7 +482,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('semanticsLabel can be shorter than text', (WidgetTester tester) async { + testWidgets('semanticsLabel can be shorter than text', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -534,7 +533,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('recognizers split semantic node', (WidgetTester tester) async { + testWidgets('recognizers split semantic node', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); @@ -591,7 +590,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('semantic nodes of offscreen recognizers are marked hidden', (WidgetTester tester) async { + testWidgets('semantic nodes of offscreen recognizers are marked hidden', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/100395. final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(fontSize: 200); @@ -664,7 +663,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('recognizers split semantic node when TextSpan overflows', (WidgetTester tester) async { + testWidgets('recognizers split semantic node when TextSpan overflows', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); @@ -718,7 +717,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('recognizers split semantic nodes with text span labels', (WidgetTester tester) async { + testWidgets('recognizers split semantic nodes with text span labels', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); @@ -779,7 +778,7 @@ void main() { }); - testWidgetsWithLeakTracking('recognizers split semantic node - bidi', (WidgetTester tester) async { + testWidgets('recognizers split semantic node - bidi', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final LongPressGestureRecognizer recognizer1 = LongPressGestureRecognizer(); @@ -865,7 +864,7 @@ void main() { semantics.dispose(); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/62945 - testWidgetsWithLeakTracking('TapGesture recognizers contribute link semantics', (WidgetTester tester) async { + testWidgets('TapGesture recognizers contribute link semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); @@ -908,7 +907,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('inline widgets generate semantic nodes', (WidgetTester tester) async { + testWidgets('inline widgets generate semantic nodes', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); @@ -985,7 +984,7 @@ void main() { semantics.dispose(); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/62945 - testWidgetsWithLeakTracking('inline widgets semantic nodes scale', (WidgetTester tester) async { + testWidgets('inline widgets semantic nodes scale', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); const TextStyle textStyle = TextStyle(); final TapGestureRecognizer recognizer = TapGestureRecognizer(); @@ -1068,7 +1067,7 @@ void main() { semantics.dispose(); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/62945 - testWidgetsWithLeakTracking('receives fontFamilyFallback and package from root ThemeData', (WidgetTester tester) async { + testWidgets('receives fontFamilyFallback and package from root ThemeData', (WidgetTester tester) async { const String fontFamily = 'fontFamily'; const String package = 'package_name'; final List<String> fontFamilyFallback = <String>['font', 'family', 'fallback']; @@ -1101,7 +1100,7 @@ void main() { } }); - testWidgetsWithLeakTracking('Overflow is clipping correctly - short text with overflow: clip', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - short text with overflow: clip', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.clip, @@ -1111,7 +1110,7 @@ void main() { expect(find.byType(Text), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('Overflow is clipping correctly - long text with overflow: ellipsis', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - long text with overflow: ellipsis', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.ellipsis, @@ -1124,7 +1123,7 @@ void main() { ); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87878 - testWidgetsWithLeakTracking('Overflow is clipping correctly - short text with overflow: ellipsis', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - short text with overflow: ellipsis', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.ellipsis, @@ -1134,7 +1133,7 @@ void main() { expect(find.byType(Text), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('Overflow is clipping correctly - long text with overflow: fade', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - long text with overflow: fade', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.fade, @@ -1147,7 +1146,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Overflow is clipping correctly - short text with overflow: fade', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - short text with overflow: fade', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.fade, @@ -1157,7 +1156,7 @@ void main() { expect(find.byType(Text), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('Overflow is clipping correctly - long text with overflow: visible', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - long text with overflow: visible', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.visible, @@ -1167,7 +1166,7 @@ void main() { expect(find.byType(Text), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('Overflow is clipping correctly - short text with overflow: visible', (WidgetTester tester) async { + testWidgets('Overflow is clipping correctly - short text with overflow: visible', (WidgetTester tester) async { await _pumpTextWidget( tester: tester, overflow: TextOverflow.visible, @@ -1177,7 +1176,7 @@ void main() { expect(find.byType(Text), isNot(paints..clipRect())); }); - testWidgetsWithLeakTracking('textWidthBasis affects the width of a Text widget', (WidgetTester tester) async { + testWidgets('textWidthBasis affects the width of a Text widget', (WidgetTester tester) async { Future<void> createText(TextWidthBasis textWidthBasis) { return tester.pumpWidget( MaterialApp( @@ -1214,7 +1213,7 @@ void main() { expect(textSizeLongestLine.height, equals(fontHeight * 2)); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/44020 - testWidgetsWithLeakTracking('textWidthBasis with textAlign still obeys parent alignment', (WidgetTester tester) async { + testWidgets('textWidthBasis with textAlign still obeys parent alignment', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp( home: Scaffold( @@ -1264,7 +1263,7 @@ void main() { expect(tester.getSize(find.text('RIGHT ALIGNED, LONGEST LINE')).width, equals(width)); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/44020 - testWidgetsWithLeakTracking( + testWidgets( 'textWidthBasis.longestLine confines the width of the paragraph ' 'when given loose constraints', (WidgetTester tester) async { @@ -1304,7 +1303,7 @@ void main() { skip: isBrowser, // https://github.com/flutter/flutter/issues/44020 ); - testWidgetsWithLeakTracking('Paragraph.getBoxesForRange returns nothing when selection range is zero length', (WidgetTester tester) async { + testWidgets('Paragraph.getBoxesForRange returns nothing when selection range is zero length', (WidgetTester tester) async { final ui.ParagraphBuilder builder = ui.ParagraphBuilder(ui.ParagraphStyle()); builder.addText('hello'); final ui.Paragraph paragraph = builder.build(); @@ -1314,7 +1313,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/65818 - testWidgetsWithLeakTracking('WidgetSpans with no semantic information are elided from semantics', (WidgetTester tester) async { + testWidgets('WidgetSpans with no semantic information are elided from semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -1364,7 +1363,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 // Regression test for https://github.com/flutter/flutter/issues/69787 - testWidgetsWithLeakTracking('WidgetSpans with no semantic information are elided from semantics - case 2', (WidgetTester tester) async { + testWidgets('WidgetSpans with no semantic information are elided from semantics - case 2', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -1418,7 +1417,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 // Regression test for https://github.com/flutter/flutter/issues/69787 - testWidgetsWithLeakTracking('WidgetSpans with no semantic information are elided from semantics - case 3', (WidgetTester tester) async { + testWidgets('WidgetSpans with no semantic information are elided from semantics - case 3', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -1484,7 +1483,7 @@ void main() { }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 // Regression test for https://github.com/flutter/flutter/issues/69787 - testWidgetsWithLeakTracking('WidgetSpans with no semantic information are elided from semantics - case 4', (WidgetTester tester) async { + testWidgets('WidgetSpans with no semantic information are elided from semantics - case 4', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); @@ -1557,7 +1556,7 @@ void main() { semantics.dispose(); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 - testWidgetsWithLeakTracking('RenderParagraph intrinsic width', (WidgetTester tester) async { + testWidgets('RenderParagraph intrinsic width', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1598,7 +1597,7 @@ void main() { expect(paragraph.getMinIntrinsicWidth(0.0), 200); }); - testWidgetsWithLeakTracking('can compute intrinsic width and height for widget span with text scaling', (WidgetTester tester) async { + testWidgets('can compute intrinsic width and height for widget span with text scaling', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/59316 const Key textKey = Key('RichText'); Widget textWithNestedInlineSpans({ required double textScaleFactor, required double screenWidth }) { @@ -1651,7 +1650,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Text uses TextStyle.overflow', (WidgetTester tester) async { + testWidgets('Text uses TextStyle.overflow', (WidgetTester tester) async { const TextOverflow overflow = TextOverflow.fade; await tester.pumpWidget(const Text( @@ -1666,7 +1665,7 @@ void main() { expect(richText.text.style!.overflow, overflow); }); - testWidgetsWithLeakTracking( + testWidgets( 'Text can be hit-tested without layout or paint being called in a frame', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/85108. @@ -1702,7 +1701,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('Mouse hovering over selectable Text uses SystemMouseCursor.text', (WidgetTester tester) async { + testWidgets('Mouse hovering over selectable Text uses SystemMouseCursor.text', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp( home: SelectionArea( child: Text('Flutter'), @@ -1717,7 +1716,7 @@ void main() { expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text); }); - testWidgetsWithLeakTracking('Mouse hovering over selectable Text uses default selection style mouse cursor', (WidgetTester tester) async { + testWidgets('Mouse hovering over selectable Text uses default selection style mouse cursor', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: SelectionArea( child: DefaultSelectionStyle.merge( diff --git a/packages/flutter/test/widgets/texture_test.dart b/packages/flutter/test/widgets/texture_test.dart index e0bf2dc09e9..e832ec021d1 100644 --- a/packages/flutter/test/widgets/texture_test.dart +++ b/packages/flutter/test/widgets/texture_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Texture with freeze set to true', (WidgetTester tester) async { + testWidgets('Texture with freeze set to true', (WidgetTester tester) async { await tester.pumpWidget( const Center(child: Texture(textureId: 1, freeze: true)), ); @@ -37,7 +36,7 @@ void main() { expect(textureLayer.freeze, true); }); - testWidgetsWithLeakTracking('Texture with default FilterQuality', (WidgetTester tester) async { + testWidgets('Texture with default FilterQuality', (WidgetTester tester) async { await tester.pumpWidget( const Center(child: Texture(textureId: 1)), ); @@ -67,7 +66,7 @@ void main() { }); - testWidgetsWithLeakTracking('Texture with FilterQuality.none', (WidgetTester tester) async { + testWidgets('Texture with FilterQuality.none', (WidgetTester tester) async { await tester.pumpWidget( const Center(child: Texture(textureId: 1, filterQuality: FilterQuality.none)), ); @@ -96,7 +95,7 @@ void main() { expect(textureLayer.filterQuality, FilterQuality.none); }); - testWidgetsWithLeakTracking('Texture with FilterQuality.low', (WidgetTester tester) async { + testWidgets('Texture with FilterQuality.low', (WidgetTester tester) async { await tester.pumpWidget( const Center(child: Texture(textureId: 1)), ); diff --git a/packages/flutter/test/widgets/ticker_mode_test.dart b/packages/flutter/test/widgets/ticker_mode_test.dart index 75ac25e8db4..aa09b8c9c2e 100644 --- a/packages/flutter/test/widgets/ticker_mode_test.dart +++ b/packages/flutter/test/widgets/ticker_mode_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Nested TickerMode cannot turn tickers back on', (WidgetTester tester) async { + testWidgets('Nested TickerMode cannot turn tickers back on', (WidgetTester tester) async { int outerTickCount = 0; int innerTickCount = 0; @@ -100,7 +99,7 @@ void main() { expect(innerTickCount, 0); }); - testWidgetsWithLeakTracking('Changing TickerMode does not rebuild widgets with SingleTickerProviderStateMixin', (WidgetTester tester) async { + testWidgets('Changing TickerMode does not rebuild widgets with SingleTickerProviderStateMixin', (WidgetTester tester) async { Widget widgetUnderTest({required bool tickerEnabled}) { return TickerMode( enabled: tickerEnabled, @@ -122,7 +121,7 @@ void main() { expect(state().buildCount, 1); }); - testWidgetsWithLeakTracking('Changing TickerMode does not rebuild widgets with TickerProviderStateMixin', (WidgetTester tester) async { + testWidgets('Changing TickerMode does not rebuild widgets with TickerProviderStateMixin', (WidgetTester tester) async { Widget widgetUnderTest({required bool tickerEnabled}) { return TickerMode( enabled: tickerEnabled, @@ -144,7 +143,7 @@ void main() { expect(state().buildCount, 1); }); - testWidgetsWithLeakTracking('Moving widgets with SingleTickerProviderStateMixin to a new TickerMode ancestor works', (WidgetTester tester) async { + testWidgets('Moving widgets with SingleTickerProviderStateMixin to a new TickerMode ancestor works', (WidgetTester tester) async { final GlobalKey tickingWidgetKey = GlobalKey(); Widget widgetUnderTest({required LocalKey tickerModeKey, required bool tickerEnabled}) { return TickerMode( @@ -165,7 +164,7 @@ void main() { expect(tickingState.ticker.isTicking, isFalse); }); - testWidgetsWithLeakTracking('Moving widgets with TickerProviderStateMixin to a new TickerMode ancestor works', (WidgetTester tester) async { + testWidgets('Moving widgets with TickerProviderStateMixin to a new TickerMode ancestor works', (WidgetTester tester) async { final GlobalKey tickingWidgetKey = GlobalKey(); Widget widgetUnderTest({required LocalKey tickerModeKey, required bool tickerEnabled}) { return TickerMode( @@ -186,7 +185,7 @@ void main() { expect(tickingState.ticker.isTicking, isFalse); }); - testWidgetsWithLeakTracking('Ticking widgets in old route do not rebuild when new route is pushed', (WidgetTester tester) async { + testWidgets('Ticking widgets in old route do not rebuild when new route is pushed', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( routes: <String, WidgetBuilder>{ '/foo' : (BuildContext context) => const Text('New route'), diff --git a/packages/flutter/test/widgets/ticker_provider_test.dart b/packages/flutter/test/widgets/ticker_provider_test.dart index 1f73c0bcffc..2f342dae0ba 100644 --- a/packages/flutter/test/widgets/ticker_provider_test.dart +++ b/packages/flutter/test/widgets/ticker_provider_test.dart @@ -6,10 +6,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('TickerMode', (WidgetTester tester) async { + testWidgets('TickerMode', (WidgetTester tester) async { const Widget widget = TickerMode( enabled: false, child: CircularProgressIndicator(), @@ -35,7 +34,7 @@ void main() { expect(tester.binding.transientCallbackCount, 0); }); - testWidgetsWithLeakTracking('Navigation with TickerMode', (WidgetTester tester) async { + testWidgets('Navigation with TickerMode', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( home: const LinearProgressIndicator(), routes: <String, WidgetBuilder>{ @@ -57,7 +56,7 @@ void main() { expect(tester.binding.transientCallbackCount, 1); }); - testWidgetsWithLeakTracking('SingleTickerProviderStateMixin can handle not being used', (WidgetTester tester) async { + testWidgets('SingleTickerProviderStateMixin can handle not being used', (WidgetTester tester) async { const Widget widget = BoringTickerTest(); expect(widget.toString, isNot(throwsException)); diff --git a/packages/flutter/test/widgets/title_test.dart b/packages/flutter/test/widgets/title_test.dart index e61a2a86ec3..71dbf6f9e1c 100644 --- a/packages/flutter/test/widgets/title_test.dart +++ b/packages/flutter/test/widgets/title_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('toString control test', (WidgetTester tester) async { + testWidgets('toString control test', (WidgetTester tester) async { final Widget widget = Title( color: const Color(0xFF00FF00), title: 'Awesome app', @@ -17,7 +16,7 @@ void main() { expect(widget.toString, isNot(throwsException)); }); - testWidgetsWithLeakTracking('should handle having no title', (WidgetTester tester) async { + testWidgets('should handle having no title', (WidgetTester tester) async { final Title widget = Title( color: const Color(0xFF00FF00), child: Container(), @@ -27,14 +26,14 @@ void main() { expect(widget.color, equals(const Color(0xFF00FF00))); }); - testWidgetsWithLeakTracking('should not allow non-opaque color', (WidgetTester tester) async { + testWidgets('should not allow non-opaque color', (WidgetTester tester) async { expect(() => Title( color: const Color(0x00000000), child: Container(), ), throwsAssertionError); }); - testWidgetsWithLeakTracking('should not pass "null" to setApplicationSwitcherDescription', (WidgetTester tester) async { + testWidgets('should not pass "null" to setApplicationSwitcherDescription', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { diff --git a/packages/flutter/test/widgets/tracking_scroll_controller_test.dart b/packages/flutter/test/widgets/tracking_scroll_controller_test.dart index f554696b856..884583e1139 100644 --- a/packages/flutter/test/widgets/tracking_scroll_controller_test.dart +++ b/packages/flutter/test/widgets/tracking_scroll_controller_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('TrackingScrollController saves offset', (WidgetTester tester) async { + testWidgets('TrackingScrollController saves offset', (WidgetTester tester) async { final TrackingScrollController controller = TrackingScrollController(); addTearDown(controller.dispose); const double listItemHeight = 100.0; @@ -61,7 +60,7 @@ void main() { expect(controller.initialScrollOffset, 0.0); }); - testWidgetsWithLeakTracking('TrackingScrollController saves offset', (WidgetTester tester) async { + testWidgets('TrackingScrollController saves offset', (WidgetTester tester) async { int attach = 0; int detach = 0; final TrackingScrollController controller = TrackingScrollController( diff --git a/packages/flutter/test/widgets/transform_test.dart b/packages/flutter/test/widgets/transform_test.dart index 4accf2b495e..c772678c236 100644 --- a/packages/flutter/test/widgets/transform_test.dart +++ b/packages/flutter/test/widgets/transform_test.dart @@ -13,11 +13,10 @@ import 'dart:ui' as ui; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'package:vector_math/vector_math_64.dart'; void main() { - testWidgetsWithLeakTracking('Transform origin', (WidgetTester tester) async { + testWidgets('Transform origin', (WidgetTester tester) async { bool didReceiveTap = false; await tester.pumpWidget( Directionality( @@ -65,7 +64,7 @@ void main() { expect(didReceiveTap, isTrue); }); - testWidgetsWithLeakTracking('Transform alignment', (WidgetTester tester) async { + testWidgets('Transform alignment', (WidgetTester tester) async { bool didReceiveTap = false; await tester.pumpWidget( Directionality( @@ -113,7 +112,7 @@ void main() { expect(didReceiveTap, isTrue); }); - testWidgetsWithLeakTracking('Transform AlignmentDirectional alignment', (WidgetTester tester) async { + testWidgets('Transform AlignmentDirectional alignment', (WidgetTester tester) async { bool didReceiveTap = false; Widget buildFrame(TextDirection textDirection, AlignmentGeometry alignment) { @@ -184,7 +183,7 @@ void main() { expect(didReceiveTap, isTrue); }); - testWidgetsWithLeakTracking('Transform offset + alignment', (WidgetTester tester) async { + testWidgets('Transform offset + alignment', (WidgetTester tester) async { bool didReceiveTap = false; await tester.pumpWidget( Directionality( @@ -233,7 +232,7 @@ void main() { expect(didReceiveTap, isTrue); }); - testWidgetsWithLeakTracking('Composited transform offset', (WidgetTester tester) async { + testWidgets('Composited transform offset', (WidgetTester tester) async { await tester.pumpWidget( Center( child: SizedBox( @@ -262,7 +261,7 @@ void main() { expect(transform.getTranslation(), equals(Vector3(100.0, 75.0, 0.0))); }); - testWidgetsWithLeakTracking('Transform.rotate', (WidgetTester tester) async { + testWidgets('Transform.rotate', (WidgetTester tester) async { await tester.pumpWidget( Transform.rotate( angle: math.pi / 2.0, @@ -284,7 +283,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('applyPaintTransform of Transform in Padding', (WidgetTester tester) async { + testWidgets('applyPaintTransform of Transform in Padding', (WidgetTester tester) async { await tester.pumpWidget( Padding( padding: const EdgeInsets.only( @@ -302,7 +301,7 @@ void main() { expect(tester.getTopLeft(find.byType(Placeholder)), const Offset(30.0, 20.0)); }); - testWidgetsWithLeakTracking('Transform.translate', (WidgetTester tester) async { + testWidgets('Transform.translate', (WidgetTester tester) async { await tester.pumpWidget( Transform.translate( offset: const Offset(100.0, 50.0), @@ -317,7 +316,7 @@ void main() { expect(tester.getTopLeft(find.byType(Container)), const Offset(100.0, 50.0)); }); - testWidgetsWithLeakTracking('Transform.scale', (WidgetTester tester) async { + testWidgets('Transform.scale', (WidgetTester tester) async { await tester.pumpWidget( Transform.scale( scale: 2.0, @@ -340,7 +339,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Transform with nan value short-circuits rendering', (WidgetTester tester) async { + testWidgets('Transform with nan value short-circuits rendering', (WidgetTester tester) async { await tester.pumpWidget( Transform( transform: Matrix4.identity() @@ -352,7 +351,7 @@ void main() { expect(tester.layers, hasLength(1)); }); - testWidgetsWithLeakTracking('Transform with inf value short-circuits rendering', (WidgetTester tester) async { + testWidgets('Transform with inf value short-circuits rendering', (WidgetTester tester) async { await tester.pumpWidget( Transform( transform: Matrix4.identity() @@ -364,7 +363,7 @@ void main() { expect(tester.layers, hasLength(1)); }); - testWidgetsWithLeakTracking('Transform with -inf value short-circuits rendering', (WidgetTester tester) async { + testWidgets('Transform with -inf value short-circuits rendering', (WidgetTester tester) async { await tester.pumpWidget( Transform( transform: Matrix4.identity() @@ -376,7 +375,7 @@ void main() { expect(tester.layers, hasLength(1)); }); - testWidgetsWithLeakTracking('Transform.rotate does not remove layers due to singular short-circuit', (WidgetTester tester) async { + testWidgets('Transform.rotate does not remove layers due to singular short-circuit', (WidgetTester tester) async { await tester.pumpWidget( Transform.rotate( angle: math.pi / 2, @@ -387,7 +386,7 @@ void main() { expect(tester.layers, hasLength(3)); }); - testWidgetsWithLeakTracking('Transform.rotate creates nice rotation matrices for 0, 90, 180, 270 degrees', (WidgetTester tester) async { + testWidgets('Transform.rotate creates nice rotation matrices for 0, 90, 180, 270 degrees', (WidgetTester tester) async { await tester.pumpWidget( Transform.rotate( angle: math.pi / 2, @@ -448,7 +447,7 @@ void main() { expect(tester.layers, hasLength(2)); }); - testWidgetsWithLeakTracking('Transform.scale with 0.0 does not paint child layers', (WidgetTester tester) async { + testWidgets('Transform.scale with 0.0 does not paint child layers', (WidgetTester tester) async { await tester.pumpWidget( Transform.scale( scale: 0.0, @@ -487,7 +486,7 @@ void main() { }); - testWidgetsWithLeakTracking('Translated child into translated box - hit test', (WidgetTester tester) async { + testWidgets('Translated child into translated box - hit test', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); bool pointerDown = false; await tester.pumpWidget( @@ -525,7 +524,7 @@ void main() { ); } - testWidgetsWithLeakTracking( + testWidgets( '3D transform renders the same with or without needsCompositing', (WidgetTester tester) async { for (double angle = 0; angle <= math.pi/4; angle += 0.01) { @@ -547,7 +546,7 @@ void main() { return numbers.map<double>((String str) => double.parse(str.trim())).toList(); } - testWidgetsWithLeakTracking('Transform.translate with FilterQuality produces filter layer', (WidgetTester tester) async { + testWidgets('Transform.translate with FilterQuality produces filter layer', (WidgetTester tester) async { await tester.pumpWidget( Transform.translate( offset: const Offset(25.0, 25.0), @@ -565,7 +564,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Transform.scale with FilterQuality produces filter layer', (WidgetTester tester) async { + testWidgets('Transform.scale with FilterQuality produces filter layer', (WidgetTester tester) async { await tester.pumpWidget( Transform.scale( scale: 3.14159, @@ -583,7 +582,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Transform.rotate with FilterQuality produces filter layer', (WidgetTester tester) async { + testWidgets('Transform.rotate with FilterQuality produces filter layer', (WidgetTester tester) async { await tester.pumpWidget( Transform.rotate( angle: math.pi / 4, @@ -601,7 +600,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Offset Transform.rotate with FilterQuality produces filter layer', (WidgetTester tester) async { + testWidgets('Offset Transform.rotate with FilterQuality produces filter layer', (WidgetTester tester) async { await tester.pumpWidget( SizedBox(width: 400, height: 400, child: Center( @@ -623,7 +622,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Transform layers update to match child and filterQuality', (WidgetTester tester) async { + testWidgets('Transform layers update to match child and filterQuality', (WidgetTester tester) async { await tester.pumpWidget( Transform.rotate( angle: math.pi / 4, @@ -659,7 +658,7 @@ void main() { expect(tester.layers.whereType<ImageFilterLayer>(), hasLength(1)); }); - testWidgetsWithLeakTracking('Transform layers with filterQuality golden', (WidgetTester tester) async { + testWidgets('Transform layers with filterQuality golden', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -703,7 +702,7 @@ void main() { ); }); - testWidgetsWithLeakTracking("Transform.scale() does not accept all three 'scale', 'scaleX' and 'scaleY' parameters to be non-null", (WidgetTester tester) async { + testWidgets("Transform.scale() does not accept all three 'scale', 'scaleX' and 'scaleY' parameters to be non-null", (WidgetTester tester) async { await expectLater(() { tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -721,7 +720,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking("Transform.scale() needs at least one of 'scale', 'scaleX' and 'scaleY' to be non-null, otherwise throws AssertionError", (WidgetTester tester) async { + testWidgets("Transform.scale() needs at least one of 'scale', 'scaleX' and 'scaleY' to be non-null, otherwise throws AssertionError", (WidgetTester tester) async { await expectLater(() { tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -736,7 +735,7 @@ void main() { }, throwsAssertionError); }); - testWidgetsWithLeakTracking("Transform.scale() scales widget uniformly with 'scale' parameter", (WidgetTester tester) async { + testWidgets("Transform.scale() scales widget uniformly with 'scale' parameter", (WidgetTester tester) async { const double scale = 1.5; const double height = 100; const double width = 150; @@ -762,7 +761,7 @@ void main() { expect(tester.getBottomRight(find.byType(Container)), target.bottomRight(tester.getTopLeft(find.byType(Container)))); }); - testWidgetsWithLeakTracking("Transform.scale() scales widget according to 'scaleX' and 'scaleY'", (WidgetTester tester) async { + testWidgets("Transform.scale() scales widget according to 'scaleX' and 'scaleY'", (WidgetTester tester) async { const double scaleX = 1.5; const double scaleY = 1.2; const double height = 100; @@ -790,7 +789,7 @@ void main() { expect(tester.getBottomRight(find.byType(Container)), target.bottomRight(tester.getTopLeft(find.byType(Container)))); }); - testWidgetsWithLeakTracking( + testWidgets( 'Transform.flip does flip child correctly', (WidgetTester tester) async { const Offset topRight = Offset(60, 20); diff --git a/packages/flutter/test/widgets/transformed_scrollable_test.dart b/packages/flutter/test/widgets/transformed_scrollable_test.dart index a11485de5d2..3c872353e2b 100644 --- a/packages/flutter/test/widgets/transformed_scrollable_test.dart +++ b/packages/flutter/test/widgets/transformed_scrollable_test.dart @@ -6,10 +6,9 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Scrollable scaled up', (WidgetTester tester) async { + testWidgets('Scrollable scaled up', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -55,7 +54,7 @@ void main() { expect(controller.offset, 42.5); // 85.0 - (85.0 / 2) }); - testWidgetsWithLeakTracking('Scrollable scaled down', (WidgetTester tester) async { + testWidgets('Scrollable scaled down', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -101,7 +100,7 @@ void main() { expect(controller.offset, 0.0); // 340.0 - (170.0 * 2) }); - testWidgetsWithLeakTracking('Scrollable rotated 90 degrees', (WidgetTester tester) async { + testWidgets('Scrollable rotated 90 degrees', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -143,7 +142,7 @@ void main() { expect(controller.offset, 30.0); // 100.0 - 70.0 }); - testWidgetsWithLeakTracking('Perspective transform on scrollable', (WidgetTester tester) async { + testWidgets('Perspective transform on scrollable', (WidgetTester tester) async { final ScrollController controller = ScrollController(); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/transitions_test.dart b/packages/flutter/test/widgets/transitions_test.dart index fa2017919f8..f1b39b50965 100644 --- a/packages/flutter/test/widgets/transitions_test.dart +++ b/packages/flutter/test/widgets/transitions_test.dart @@ -5,10 +5,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('toString control test', (WidgetTester tester) async { + testWidgets('toString control test', (WidgetTester tester) async { const Widget widget = FadeTransition( opacity: kAlwaysCompleteAnimation, child: Text('Ready', textDirection: TextDirection.ltr), @@ -48,7 +47,7 @@ void main() { controller = AnimationController(vsync: const TestVSync()); }); - testWidgetsWithLeakTracking('decoration test', (WidgetTester tester) async { + testWidgets('decoration test', (WidgetTester tester) async { final DecoratedBoxTransition transitionUnderTest = DecoratedBoxTransition( decoration: decorationTween.animate(controller), @@ -96,7 +95,7 @@ void main() { expect(actualDecoration.boxShadow, null); }); - testWidgetsWithLeakTracking('animations work with curves test', (WidgetTester tester) async { + testWidgets('animations work with curves test', (WidgetTester tester) async { final Animation<Decoration> curvedDecorationAnimation = decorationTween.animate(CurvedAnimation( parent: controller, @@ -145,7 +144,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('AlignTransition animates', (WidgetTester tester) async { + testWidgets('AlignTransition animates', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<Alignment> alignmentTween = AlignmentTween( @@ -170,7 +169,7 @@ void main() { expect(actualAlignment, const Alignment(0.0, 0.5)); }); - testWidgetsWithLeakTracking('RelativePositionedTransition animates', (WidgetTester tester) async { + testWidgets('RelativePositionedTransition animates', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<Rect?> rectTween = RectTween( @@ -217,7 +216,7 @@ void main() { expect(renderBox.size, equals(const Size(665, 420))); }); - testWidgetsWithLeakTracking('AlignTransition keeps width and height factors', (WidgetTester tester) async { + testWidgets('AlignTransition keeps width and height factors', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<Alignment> alignmentTween = AlignmentTween( @@ -239,7 +238,7 @@ void main() { expect(actualAlign.heightFactor, 0.4); }); - testWidgetsWithLeakTracking('SizeTransition clamps negative size factors - vertical axis', (WidgetTester tester) async { + testWidgets('SizeTransition clamps negative size factors - vertical axis', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: -1.0, end: 1.0).animate(controller); @@ -275,7 +274,7 @@ void main() { expect(actualPositionedBox.widthFactor, 2.0); }); - testWidgetsWithLeakTracking('SizeTransition clamps negative size factors - horizontal axis', (WidgetTester tester) async { + testWidgets('SizeTransition clamps negative size factors - horizontal axis', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: -1.0, end: 1.0).animate(controller); @@ -312,7 +311,7 @@ void main() { expect(actualPositionedBox.heightFactor, 1.0); }); - testWidgetsWithLeakTracking('SizeTransition with fixedCrossAxisSizeFactor should size its cross axis from its children - vertical axis', (WidgetTester tester) async { + testWidgets('SizeTransition with fixedCrossAxisSizeFactor should size its cross axis from its children - vertical axis', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0, end: 1.0).animate(controller); @@ -371,7 +370,7 @@ void main() { expect(tester.getSize(find.byKey(key)), const Size(100, 0)); }); - testWidgetsWithLeakTracking('SizeTransition with fixedCrossAxisSizeFactor should size its cross axis from its children - horizontal axis', (WidgetTester tester) async { + testWidgets('SizeTransition with fixedCrossAxisSizeFactor should size its cross axis from its children - horizontal axis', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller); @@ -431,7 +430,7 @@ void main() { expect(tester.getSize(find.byKey(key)), const Size(0, 100)); }); - testWidgetsWithLeakTracking('MatrixTransition animates', (WidgetTester tester) async { + testWidgets('MatrixTransition animates', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Widget widget = MatrixTransition( @@ -472,7 +471,7 @@ void main() { ])..transpose()); }); - testWidgetsWithLeakTracking('MatrixTransition maintains chosen alignment during animation', (WidgetTester tester) async { + testWidgets('MatrixTransition maintains chosen alignment during animation', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Widget widget = MatrixTransition( @@ -494,7 +493,7 @@ void main() { expect(actualAlignment, Alignment.topRight); }); - testWidgetsWithLeakTracking('RotationTransition animates', (WidgetTester tester) async { + testWidgets('RotationTransition animates', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Widget widget = RotationTransition( @@ -534,7 +533,7 @@ void main() { ])..transpose())); }); - testWidgetsWithLeakTracking('RotationTransition maintains chosen alignment during animation', (WidgetTester tester) async { + testWidgets('RotationTransition maintains chosen alignment during animation', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Widget widget = RotationTransition( @@ -565,7 +564,7 @@ void main() { ); return opacityWidget.opacity.value; } - testWidgetsWithLeakTracking('animates', (WidgetTester tester) async { + testWidgets('animates', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller); @@ -609,7 +608,7 @@ void main() { ); return opacityWidget.opacity.value; } - testWidgetsWithLeakTracking('animates', (WidgetTester tester) async { + testWidgets('animates', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller); @@ -660,7 +659,7 @@ void main() { }); group('MatrixTransition', () { - testWidgetsWithLeakTracking('uses ImageFilter when provided with FilterQuality argument', (WidgetTester tester) async { + testWidgets('uses ImageFilter when provided with FilterQuality argument', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller); @@ -724,7 +723,7 @@ void main() { }); group('ScaleTransition', () { - testWidgetsWithLeakTracking('uses ImageFilter when provided with FilterQuality argument', (WidgetTester tester) async { + testWidgets('uses ImageFilter when provided with FilterQuality argument', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller); @@ -778,7 +777,7 @@ void main() { }); group('RotationTransition', () { - testWidgetsWithLeakTracking('uses ImageFilter when provided with FilterQuality argument', (WidgetTester tester) async { + testWidgets('uses ImageFilter when provided with FilterQuality argument', (WidgetTester tester) async { final AnimationController controller = AnimationController(vsync: const TestVSync()); addTearDown(controller.dispose); final Animation<double> animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller); @@ -832,7 +831,7 @@ void main() { }); group('Builders', () { - testWidgetsWithLeakTracking('AnimatedBuilder rebuilds when changed', (WidgetTester tester) async { + testWidgets('AnimatedBuilder rebuilds when changed', (WidgetTester tester) async { final GlobalKey<RedrawCounterState> redrawKey = GlobalKey<RedrawCounterState>(); final ChangeNotifier notifier = ChangeNotifier(); addTearDown(notifier.dispose); @@ -862,7 +861,7 @@ void main() { expect(redrawKey.currentState!.redraws, equals(2)); }); - testWidgetsWithLeakTracking("AnimatedBuilder doesn't rebuild the child", (WidgetTester tester) async { + testWidgets("AnimatedBuilder doesn't rebuild the child", (WidgetTester tester) async { final GlobalKey<RedrawCounterState> redrawKey = GlobalKey<RedrawCounterState>(); final GlobalKey<RedrawCounterState> redrawKeyChild = GlobalKey<RedrawCounterState>(); final ChangeNotifier notifier = ChangeNotifier(); @@ -898,7 +897,7 @@ void main() { expect(redrawKeyChild.currentState!.redraws, equals(1)); }); - testWidgetsWithLeakTracking('ListenableBuilder rebuilds when changed', (WidgetTester tester) async { + testWidgets('ListenableBuilder rebuilds when changed', (WidgetTester tester) async { final GlobalKey<RedrawCounterState> redrawKey = GlobalKey<RedrawCounterState>(); final ChangeNotifier notifier = ChangeNotifier(); addTearDown(notifier.dispose); @@ -928,7 +927,7 @@ void main() { expect(redrawKey.currentState!.redraws, equals(2)); }); - testWidgetsWithLeakTracking("ListenableBuilder doesn't rebuild the child", (WidgetTester tester) async { + testWidgets("ListenableBuilder doesn't rebuild the child", (WidgetTester tester) async { final GlobalKey<RedrawCounterState> redrawKey = GlobalKey<RedrawCounterState>(); final GlobalKey<RedrawCounterState> redrawKeyChild = GlobalKey<RedrawCounterState>(); final ChangeNotifier notifier = ChangeNotifier(); diff --git a/packages/flutter/test/widgets/tree_shape_test.dart b/packages/flutter/test/widgets/tree_shape_test.dart index 986c8be3e79..a6ec05b62f8 100644 --- a/packages/flutter/test/widgets/tree_shape_test.dart +++ b/packages/flutter/test/widgets/tree_shape_test.dart @@ -7,12 +7,11 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'multi_view_testing.dart'; void main() { - testWidgetsWithLeakTracking('Providing a RenderObjectWidget directly to the RootWidget fails', (WidgetTester tester) async { + testWidgets('Providing a RenderObjectWidget directly to the RootWidget fails', (WidgetTester tester) async { // No render tree exists to attach the RenderObjectWidget to. await pumpWidgetWithoutViewWrapper( tester: tester, @@ -26,7 +25,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Moving a RenderObjectWidget to the RootWidget via GlobalKey fails', (WidgetTester tester) async { + testWidgets('Moving a RenderObjectWidget to the RootWidget via GlobalKey fails', (WidgetTester tester) async { final Widget globalKeyedWidget = ColoredBox( key: GlobalKey(), color: Colors.red, @@ -53,7 +52,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('A View cannot be a child of a render object widget', (WidgetTester tester) async { + testWidgets('A View cannot be a child of a render object widget', (WidgetTester tester) async { await tester.pumpWidget(Center( child: View( view: FakeView(tester.view), @@ -68,7 +67,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('The child of a ViewAnchor cannot be a View', (WidgetTester tester) async { + testWidgets('The child of a ViewAnchor cannot be a View', (WidgetTester tester) async { await tester.pumpWidget( ViewAnchor( child: View( @@ -85,7 +84,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('A View can not be moved via GlobalKey to be a child of a RenderObject', (WidgetTester tester) async { + testWidgets('A View can not be moved via GlobalKey to be a child of a RenderObject', (WidgetTester tester) async { final Widget globalKeyedView = View( key: GlobalKey(), view: FakeView(tester.view), @@ -113,7 +112,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('The view property of a ViewAnchor cannot be a render object widget', (WidgetTester tester) async { + testWidgets('The view property of a ViewAnchor cannot be a render object widget', (WidgetTester tester) async { await tester.pumpWidget( ViewAnchor( view: const ColoredBox(color: Colors.red), @@ -128,7 +127,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('A RenderObject cannot be moved into the view property of a ViewAnchor via GlobalKey', (WidgetTester tester) async { + testWidgets('A RenderObject cannot be moved into the view property of a ViewAnchor via GlobalKey', (WidgetTester tester) async { final Widget globalKeyedWidget = ColoredBox( key: GlobalKey(), color: Colors.red, @@ -155,7 +154,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('ViewAnchor cannot be used at the top of the widget tree (outside of View)', (WidgetTester tester) async { + testWidgets('ViewAnchor cannot be used at the top of the widget tree (outside of View)', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: const ViewAnchor( @@ -170,7 +169,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('ViewAnchor cannot be moved to the top of the widget tree (outside of View) via GlobalKey', (WidgetTester tester) async { + testWidgets('ViewAnchor cannot be moved to the top of the widget tree (outside of View) via GlobalKey', (WidgetTester tester) async { final Widget globalKeyedViewAnchor = ViewAnchor( key: GlobalKey(), child: const SizedBox(), @@ -197,7 +196,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('View can be used at the top of the widget tree', (WidgetTester tester) async { + testWidgets('View can be used at the top of the widget tree', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: View( @@ -209,7 +208,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('View can be moved to the top of the widget tree view GlobalKey', (WidgetTester tester) async { + testWidgets('View can be moved to the top of the widget tree view GlobalKey', (WidgetTester tester) async { final Widget globalKeyView = View( view: FakeView(tester.view), child: const ColoredBox(color: Colors.red), @@ -238,7 +237,7 @@ void main() { expect(find.byType(ColoredBox), findsOneWidget); }); - testWidgetsWithLeakTracking('ViewCollection can be used at the top of the widget tree', (WidgetTester tester) async { + testWidgets('ViewCollection can be used at the top of the widget tree', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: ViewCollection( @@ -254,7 +253,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('ViewCollection cannot be used inside a View', (WidgetTester tester) async { + testWidgets('ViewCollection cannot be used inside a View', (WidgetTester tester) async { await tester.pumpWidget( ViewCollection( views: <Widget>[ @@ -273,7 +272,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('ViewCollection can be used as ViewAnchor.view', (WidgetTester tester) async { + testWidgets('ViewCollection can be used as ViewAnchor.view', (WidgetTester tester) async { await tester.pumpWidget( ViewAnchor( view: ViewCollection( @@ -291,7 +290,7 @@ void main() { expect(tester.takeException(), isNull); }); - testWidgetsWithLeakTracking('ViewCollection cannot have render object widgets as children', (WidgetTester tester) async { + testWidgets('ViewCollection cannot have render object widgets as children', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: ViewCollection( @@ -308,7 +307,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Views can be moved in and out of ViewCollections via GlobalKey', (WidgetTester tester) async { + testWidgets('Views can be moved in and out of ViewCollections via GlobalKey', (WidgetTester tester) async { final Widget greenView = View( key: GlobalKey(debugLabel: 'green'), view: tester.view, @@ -353,7 +352,7 @@ void main() { expect(find.byType(ColoredBox), findsNWidgets(2)); }); - testWidgetsWithLeakTracking('Can move stuff between views via global key: viewA -> viewB', (WidgetTester tester) async { + testWidgets('Can move stuff between views via global key: viewA -> viewB', (WidgetTester tester) async { final FlutterView greenView = tester.view; final FlutterView redView = FakeView(tester.view); final Widget globalKeyChild = SizedBox( @@ -458,7 +457,7 @@ void main() { expect(leafRenderObject[redView.viewId], isA<RenderConstrainedBox>()); }); - testWidgetsWithLeakTracking('Can move stuff between views via global key: viewB -> viewA', (WidgetTester tester) async { + testWidgets('Can move stuff between views via global key: viewB -> viewA', (WidgetTester tester) async { final FlutterView greenView = tester.view; final FlutterView redView = FakeView(tester.view); final Widget globalKeyChild = SizedBox( @@ -563,7 +562,7 @@ void main() { expect(leafRenderObject[greenView.viewId], isA<RenderConstrainedBox>()); }); - testWidgetsWithLeakTracking('Can move stuff out of a view that is going away, viewA -> ViewB', (WidgetTester tester) async { + testWidgets('Can move stuff out of a view that is going away, viewA -> ViewB', (WidgetTester tester) async { final FlutterView greenView = tester.view; final Key greenKey = UniqueKey(); final FlutterView redView = FakeView(tester.view); @@ -644,7 +643,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can move stuff out of a view that is going away, viewB -> ViewA', (WidgetTester tester) async { + testWidgets('Can move stuff out of a view that is going away, viewB -> ViewA', (WidgetTester tester) async { final FlutterView greenView = tester.view; final Key greenKey = UniqueKey(); final FlutterView redView = FakeView(tester.view); @@ -725,7 +724,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Can move stuff out of a view that is moving itself, stuff ends up before view', (WidgetTester tester) async { + testWidgets('Can move stuff out of a view that is moving itself, stuff ends up before view', (WidgetTester tester) async { final Key key1 = UniqueKey(); final Key key2 = UniqueKey(); final Key key3 = UniqueKey(); @@ -811,7 +810,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Can move stuff out of a view that is moving itself, stuff ends up after view', (WidgetTester tester) async { + testWidgets('Can move stuff out of a view that is moving itself, stuff ends up after view', (WidgetTester tester) async { final Key key1 = UniqueKey(); final Key key2 = UniqueKey(); final Key key3 = UniqueKey(); @@ -899,7 +898,7 @@ void main() { )); }); - testWidgetsWithLeakTracking('Can globalkey move down the tree from a view that is going away', (WidgetTester tester) async { + testWidgets('Can globalkey move down the tree from a view that is going away', (WidgetTester tester) async { final FlutterView anchorView = FakeView(tester.view); final Widget globalKeyChild = SizedBox( key: GlobalKey(), @@ -976,7 +975,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('RenderObjects are disposed when a view goes away from a ViewAnchor', (WidgetTester tester) async { + testWidgets('RenderObjects are disposed when a view goes away from a ViewAnchor', (WidgetTester tester) async { final FlutterView anchorView = FakeView(tester.view); await tester.pumpWidget( @@ -1006,7 +1005,7 @@ void main() { expect(box.debugDisposed, isTrue); }); - testWidgetsWithLeakTracking('RenderObjects are disposed when a view goes away from a ViewCollection', (WidgetTester tester) async { + testWidgets('RenderObjects are disposed when a view goes away from a ViewCollection', (WidgetTester tester) async { final FlutterView redView = tester.view; final FlutterView greenView = FakeView(tester.view); @@ -1047,7 +1046,7 @@ void main() { expect(box.debugDisposed, isTrue); }); - testWidgetsWithLeakTracking('View can be wrapped and unwrapped', (WidgetTester tester) async { + testWidgets('View can be wrapped and unwrapped', (WidgetTester tester) async { final Widget view = View( view: tester.view, child: const SizedBox(), @@ -1080,7 +1079,7 @@ void main() { expect(tester.renderObject(find.byType(SizedBox)), same(renderSizedBox)); }); - testWidgetsWithLeakTracking('ViewAnchor with View can be wrapped and unwrapped', (WidgetTester tester) async { + testWidgets('ViewAnchor with View can be wrapped and unwrapped', (WidgetTester tester) async { final Widget viewAnchor = ViewAnchor( view: View( view: FakeView(tester.view), @@ -1105,7 +1104,7 @@ void main() { expect(tester.renderObject(find.byType(SizedBox)), same(renderSizedBox)); }); - testWidgetsWithLeakTracking('Moving a View keeps its semantics tree stable', (WidgetTester tester) async { + testWidgets('Moving a View keeps its semantics tree stable', (WidgetTester tester) async { final Widget view = View( // No explicit key, we rely on the implicit key of the underlying RawView. view: tester.view, diff --git a/packages/flutter/test/widgets/tween_animation_builder_test.dart b/packages/flutter/test/widgets/tween_animation_builder_test.dart index 4c19cda2dfc..afad96ecfe1 100644 --- a/packages/flutter/test/widgets/tween_animation_builder_test.dart +++ b/packages/flutter/test/widgets/tween_animation_builder_test.dart @@ -4,10 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('Animates forward when built', (WidgetTester tester) async { + testWidgets('Animates forward when built', (WidgetTester tester) async { final List<int> values = <int>[]; int endCount = 0; await tester.pumpWidget( @@ -38,7 +37,7 @@ void main() { expect(values, <int>[10, 60, 110]); }); - testWidgetsWithLeakTracking('No initial animation when begin=null', (WidgetTester tester) async { + testWidgets('No initial animation when begin=null', (WidgetTester tester) async { final List<int> values = <int>[]; int endCount = 0; await tester.pumpWidget( @@ -62,7 +61,7 @@ void main() { }); - testWidgetsWithLeakTracking('No initial animation when begin=end', (WidgetTester tester) async { + testWidgets('No initial animation when begin=end', (WidgetTester tester) async { final List<int> values = <int>[]; int endCount = 0; await tester.pumpWidget( @@ -85,7 +84,7 @@ void main() { expect(values, <int>[100]); }); - testWidgetsWithLeakTracking('Replace tween animates new tween', (WidgetTester tester) async { + testWidgets('Replace tween animates new tween', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween}) { return TweenAnimationBuilder<int>( @@ -113,7 +112,7 @@ void main() { expect(values, <int>[0, 100, 100, 150, 200]); }); - testWidgetsWithLeakTracking('Curve is respected', (WidgetTester tester) async { + testWidgets('Curve is respected', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween, required Curve curve}) { return TweenAnimationBuilder<int>( @@ -143,7 +142,7 @@ void main() { expect(values, <int>[100, 150]); }); - testWidgetsWithLeakTracking('Duration is respected', (WidgetTester tester) async { + testWidgets('Duration is respected', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween, required Duration duration}) { return TweenAnimationBuilder<int>( @@ -171,7 +170,7 @@ void main() { expect(values, <int>[100, 125]); }); - testWidgetsWithLeakTracking('Child is integrated into tree', (WidgetTester tester) async { + testWidgets('Child is integrated into tree', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -190,7 +189,7 @@ void main() { }); group('Change tween gapless while', () { - testWidgetsWithLeakTracking('running forward', (WidgetTester tester) async { + testWidgets('running forward', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween}) { return TweenAnimationBuilder<int>( @@ -225,7 +224,7 @@ void main() { values.clear(); }); - testWidgetsWithLeakTracking('running forward and then reverse with same tween instance', (WidgetTester tester) async { + testWidgets('running forward and then reverse with same tween instance', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween}) { return TweenAnimationBuilder<int>( @@ -255,7 +254,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('Changing tween while gapless tween change is in progress', (WidgetTester tester) async { + testWidgets('Changing tween while gapless tween change is in progress', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween}) { return TweenAnimationBuilder<int>( @@ -295,7 +294,7 @@ void main() { expect(values, <int>[175, 338, 501]); }); - testWidgetsWithLeakTracking('Changing curve while no animation is running does not trigger animation', (WidgetTester tester) async { + testWidgets('Changing curve while no animation is running does not trigger animation', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required Curve curve}) { return TweenAnimationBuilder<int>( @@ -324,7 +323,7 @@ void main() { expect(values, <int>[100]); }); - testWidgetsWithLeakTracking('Setting same tween and direction does not trigger animation', (WidgetTester tester) async { + testWidgets('Setting same tween and direction does not trigger animation', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween}) { return TweenAnimationBuilder<int>( @@ -353,7 +352,7 @@ void main() { expect(values, everyElement(100)); }); - testWidgetsWithLeakTracking('Setting same tween and direction while gapless animation is in progress works', (WidgetTester tester) async { + testWidgets('Setting same tween and direction while gapless animation is in progress works', (WidgetTester tester) async { final List<int> values = <int>[]; Widget buildWidget({required IntTween tween}) { return TweenAnimationBuilder<int>( @@ -389,7 +388,7 @@ void main() { expect(values, everyElement(300)); }); - testWidgetsWithLeakTracking('Works with nullable tweens', (WidgetTester tester) async { + testWidgets('Works with nullable tweens', (WidgetTester tester) async { final List<Size?> values = <Size?>[]; await tester.pumpWidget( TweenAnimationBuilder<Size?>( diff --git a/packages/flutter/test/widgets/two_dimensional_scroll_view_test.dart b/packages/flutter/test/widgets/two_dimensional_scroll_view_test.dart index 435e42c0585..1101b033b35 100644 --- a/packages/flutter/test/widgets/two_dimensional_scroll_view_test.dart +++ b/packages/flutter/test/widgets/two_dimensional_scroll_view_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/src/gestures/monodrag.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'two_dimensional_utils.dart'; @@ -20,7 +19,7 @@ Widget? _testChildBuilder(BuildContext context, ChildVicinity vicinity) { void main() { group('TwoDimensionalScrollView',() { - testWidgetsWithLeakTracking('asserts the axis directions do not conflict with one another', (WidgetTester tester) async { + testWidgets('asserts the axis directions do not conflict with one another', (WidgetTester tester) async { final List<Object> exceptions = <Object>[]; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails details) { @@ -67,7 +66,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('ScrollableDetails.controller can set initial scroll positions, modify within bounds', (WidgetTester tester) async { + testWidgets('ScrollableDetails.controller can set initial scroll positions, modify within bounds', (WidgetTester tester) async { final ScrollController verticalController = ScrollController(initialScrollOffset: 100); addTearDown(verticalController.dispose); final ScrollController horizontalController = ScrollController(initialScrollOffset: 50); @@ -110,7 +109,7 @@ void main() { expect(horizontalController.position.pixels, 19200); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Properly assigns the PrimaryScrollController to the main axis on the correct platform', (WidgetTester tester) async { + testWidgets('Properly assigns the PrimaryScrollController to the main axis on the correct platform', (WidgetTester tester) async { late ScrollController controller; Widget buildForPrimaryScrollController({ bool? explicitPrimary, @@ -308,7 +307,7 @@ void main() { FlutterError.onError = oldHandler; }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('TwoDimensionalScrollable receives the correct details from TwoDimensionalScrollView', (WidgetTester tester) async { + testWidgets('TwoDimensionalScrollable receives the correct details from TwoDimensionalScrollView', (WidgetTester tester) async { late BuildContext capturedContext; // Default late final TwoDimensionalChildBuilderDelegate delegate1; diff --git a/packages/flutter/test/widgets/two_dimensional_viewport_test.dart b/packages/flutter/test/widgets/two_dimensional_viewport_test.dart index 28f3bcac73b..fd1804b5d9d 100644 --- a/packages/flutter/test/widgets/two_dimensional_viewport_test.dart +++ b/packages/flutter/test/widgets/two_dimensional_viewport_test.dart @@ -7,14 +7,13 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'two_dimensional_utils.dart'; void main() { group('TwoDimensionalChildDelegate', () { group('TwoDimensionalChildBuilderDelegate', () { - testWidgetsWithLeakTracking('repaintBoundaries', (WidgetTester tester) async { + testWidgets('repaintBoundaries', (WidgetTester tester) async { // Default - adds repaint boundaries late final TwoDimensionalChildBuilderDelegate delegate1; addTearDown(() => delegate1.dispose()); @@ -77,7 +76,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('will return null from build for exceeding maxXIndex and maxYIndex', (WidgetTester tester) async { + testWidgets('will return null from build for exceeding maxXIndex and maxYIndex', (WidgetTester tester) async { late BuildContext capturedContext; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( // Only build 1 child @@ -192,7 +191,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('throws an error when builder throws', (WidgetTester tester) async { + testWidgets('throws an error when builder throws', (WidgetTester tester) async { final List<Object> exceptions = <Object>[]; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails details) { @@ -220,11 +219,11 @@ void main() { expect(exceptions[0] as String, contains('Builder error!')); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('shouldRebuild', (WidgetTester tester) async { + testWidgets('shouldRebuild', (WidgetTester tester) async { expect(builderDelegate.shouldRebuild(builderDelegate), isTrue); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('builder delegate supports automatic keep alive - default true', (WidgetTester tester) async { + testWidgets('builder delegate supports automatic keep alive - default true', (WidgetTester tester) async { const ChildVicinity firstCell = ChildVicinity(xIndex: 0, yIndex: 0); final ScrollController verticalController = ScrollController(); addTearDown(verticalController.dispose); @@ -426,7 +425,7 @@ void main() { expect(parentData.keepAlive, isTrue); }); - testWidgetsWithLeakTracking('builder delegate will not add automatic keep alives', (WidgetTester tester) async { + testWidgets('builder delegate will not add automatic keep alives', (WidgetTester tester) async { const ChildVicinity firstCell = ChildVicinity(xIndex: 0, yIndex: 0); final ScrollController verticalController = ScrollController(); addTearDown(verticalController.dispose); @@ -510,7 +509,7 @@ void main() { }); group('TwoDimensionalChildListDelegate', () { - testWidgetsWithLeakTracking('repaintBoundaries', (WidgetTester tester) async { + testWidgets('repaintBoundaries', (WidgetTester tester) async { final List<List<Widget>> children = <List<Widget>>[]; children.add(<Widget>[ const SizedBox( @@ -582,7 +581,7 @@ void main() { } }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('will return null for a ChildVicinity outside of list bounds', (WidgetTester tester) async { + testWidgets('will return null for a ChildVicinity outside of list bounds', (WidgetTester tester) async { final List<List<Widget>> children = <List<Widget>>[]; children.add(<Widget>[ const SizedBox( @@ -615,7 +614,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('shouldRebuild', (WidgetTester tester) async { + testWidgets('shouldRebuild', (WidgetTester tester) async { final List<List<Widget>> children = <List<Widget>>[]; children.add(<Widget>[ const SizedBox( @@ -641,7 +640,7 @@ void main() { }, variant: TargetPlatformVariant.all()); }); - testWidgetsWithLeakTracking('list delegate supports automatic keep alive - default true', (WidgetTester tester) async { + testWidgets('list delegate supports automatic keep alive - default true', (WidgetTester tester) async { final UniqueKey checkBoxKey = UniqueKey(); final Widget originCell = SizedBox.square( dimension: 200, @@ -730,7 +729,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('list delegate will not add automatic keep alives', (WidgetTester tester) async { + testWidgets('list delegate will not add automatic keep alives', (WidgetTester tester) async { final UniqueKey checkBoxKey = UniqueKey(); final Widget originCell = SizedBox.square( dimension: 200, @@ -815,7 +814,7 @@ void main() { }); group('TwoDimensionalScrollable', () { - testWidgetsWithLeakTracking('.of, .maybeOf', (WidgetTester tester) async { + testWidgets('.of, .maybeOf', (WidgetTester tester) async { late BuildContext capturedContext; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -854,7 +853,7 @@ void main() { expect(TwoDimensionalScrollable.maybeOf(capturedContext), isNull); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('horizontal and vertical getters', (WidgetTester tester) async { + testWidgets('horizontal and vertical getters', (WidgetTester tester) async { late BuildContext capturedContext; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -876,7 +875,7 @@ void main() { expect(scrollable.horizontalScrollable.position.pixels, 0.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('creates fallback ScrollControllers if not provided by ScrollableDetails', (WidgetTester tester) async { + testWidgets('creates fallback ScrollControllers if not provided by ScrollableDetails', (WidgetTester tester) async { late BuildContext capturedContext; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -901,7 +900,7 @@ void main() { expect(horizontal.widget.controller, isNotNull); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('asserts the axis directions do not conflict with one another', (WidgetTester tester) async { + testWidgets('asserts the axis directions do not conflict with one another', (WidgetTester tester) async { final List<Object> exceptions = <Object>[]; final FlutterExceptionHandler? oldHandler = FlutterError.onError; FlutterError.onError = (FlutterErrorDetails details) { @@ -942,7 +941,7 @@ void main() { FlutterError.onError = oldHandler; }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('correctly sets restorationIds', (WidgetTester tester) async { + testWidgets('correctly sets restorationIds', (WidgetTester tester) async { late BuildContext capturedContext; // with restorationID set await tester.pumpWidget(WidgetsApp( @@ -1012,7 +1011,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Restoration works', (WidgetTester tester) async { + testWidgets('Restoration works', (WidgetTester tester) async { await tester.pumpWidget(WidgetsApp( color: const Color(0xFFFFFFFF), restorationScopeId: 'Test ID', @@ -1037,7 +1036,7 @@ void main() { await restoreScrollAndVerify(tester); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Inner Scrollables receive the correct details from TwoDimensionalScrollable', (WidgetTester tester) async { + testWidgets('Inner Scrollables receive the correct details from TwoDimensionalScrollable', (WidgetTester tester) async { // Default late BuildContext capturedContext; await tester.pumpWidget(TwoDimensionalScrollable( @@ -1155,7 +1154,7 @@ void main() { }, variant: TargetPlatformVariant.all()); group('DiagonalDragBehavior', () { - testWidgetsWithLeakTracking('none (default)', (WidgetTester tester) async { + testWidgets('none (default)', (WidgetTester tester) async { // Vertical and horizontal axes are locked. final ScrollController verticalController = ScrollController(); addTearDown(verticalController.dispose); @@ -1207,7 +1206,7 @@ void main() { expect(horizontalController.position.pixels, 140.0); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('weightedEvent', (WidgetTester tester) async { + testWidgets('weightedEvent', (WidgetTester tester) async { // For weighted event, the winning axis is locked for the duration of // the gesture. final ScrollController verticalController = ScrollController(); @@ -1331,7 +1330,7 @@ void main() { await tester.pumpAndSettle(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('weightedContinuous', (WidgetTester tester) async { + testWidgets('weightedContinuous', (WidgetTester tester) async { // For weighted continuous, the winning axis can change if the axis // differential for the gesture exceeds kTouchSlop. So it can lock, and // remain locked, if the user maintains a generally straight gesture, @@ -1390,7 +1389,7 @@ void main() { await tester.pumpAndSettle(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('free', (WidgetTester tester) async { + testWidgets('free', (WidgetTester tester) async { // For free, anything goes. final ScrollController verticalController = ScrollController(); addTearDown(verticalController.dispose); @@ -1437,7 +1436,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('TwoDimensionalViewport asserts against axes mismatch', (WidgetTester tester) async { + testWidgets('TwoDimensionalViewport asserts against axes mismatch', (WidgetTester tester) async { // Horizontal mismatch expect( () { @@ -1642,7 +1641,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('getters', (WidgetTester tester) async { + testWidgets('getters', (WidgetTester tester) async { final UniqueKey childKey = UniqueKey(); final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -1701,7 +1700,7 @@ void main() { expect(viewport.viewportDimension, const Size(800.0, 600.0)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Children are organized according to mainAxis', (WidgetTester tester) async { + testWidgets('Children are organized according to mainAxis', (WidgetTester tester) async { final Map<ChildVicinity, UniqueKey> childKeys = <ChildVicinity, UniqueKey>{}; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 5, @@ -1788,7 +1787,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('sets up parent data', (WidgetTester tester) async { + testWidgets('sets up parent data', (WidgetTester tester) async { // Also tests computeAbsolutePaintOffsetFor & computeChildPaintExtent // Regression test for https://github.com/flutter/flutter/issues/128723 final Map<ChildVicinity, UniqueKey> childKeys = <ChildVicinity, UniqueKey>{}; @@ -1922,7 +1921,7 @@ void main() { expect(childParentData.layoutOffset, const Offset(-50.0, -50.0)); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('debugDescribeChildren', (WidgetTester tester) async { + testWidgets('debugDescribeChildren', (WidgetTester tester) async { final Map<ChildVicinity, UniqueKey> childKeys = <ChildVicinity, UniqueKey>{}; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 5, @@ -1994,7 +1993,7 @@ void main() { expect((exceptions[0] as FlutterError).message, contains('unbounded')); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('computeDryLayout asserts axes are bounded', (WidgetTester tester) async { + testWidgets('computeDryLayout asserts axes are bounded', (WidgetTester tester) async { final UniqueKey childKey = UniqueKey(); final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -2025,7 +2024,7 @@ void main() { ); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('correctly resizes dimensions', (WidgetTester tester) async { + testWidgets('correctly resizes dimensions', (WidgetTester tester) async { final UniqueKey childKey = UniqueKey(); final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -2057,7 +2056,7 @@ void main() { tester.view.resetDevicePixelRatio(); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('Rebuilds when delegate changes', (WidgetTester tester) async { + testWidgets('Rebuilds when delegate changes', (WidgetTester tester) async { final UniqueKey firstChildKey = UniqueKey(); final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 0, @@ -2096,7 +2095,7 @@ void main() { expect(viewport.firstChild, tester.renderObject<RenderBox>(find.byKey(newChildKey))); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('hitTestChildren', (WidgetTester tester) async { + testWidgets('hitTestChildren', (WidgetTester tester) async { final List<ChildVicinity> taps = <ChildVicinity>[]; final Map<ChildVicinity, UniqueKey> childKeys = <ChildVicinity, UniqueKey>{}; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( @@ -2166,7 +2165,7 @@ void main() { expect(taps.contains(const ChildVicinity(xIndex: 5, yIndex: 5)), isFalse); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('getChildFor', (WidgetTester tester) async { + testWidgets('getChildFor', (WidgetTester tester) async { final Map<ChildVicinity, UniqueKey> childKeys = <ChildVicinity, UniqueKey>{}; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 5, @@ -2257,7 +2256,7 @@ void main() { expect(error.message, contains('was not given content dimensions')); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('will not rebuild a child if it can be reused', (WidgetTester tester) async { + testWidgets('will not rebuild a child if it can be reused', (WidgetTester tester) async { final List<ChildVicinity> builtChildren = <ChildVicinity>[]; final ScrollController controller = ScrollController(); addTearDown(controller.dispose); @@ -2330,7 +2329,7 @@ void main() { expect(error.toString(), contains('child.hasSize')); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('does not support intrinsics', (WidgetTester tester) async { + testWidgets('does not support intrinsics', (WidgetTester tester) async { final Map<ChildVicinity, UniqueKey> childKeys = <ChildVicinity, UniqueKey>{}; final TwoDimensionalChildBuilderDelegate delegate = TwoDimensionalChildBuilderDelegate( maxXIndex: 5, diff --git a/packages/flutter/test/widgets/undo_history_test.dart b/packages/flutter/test/widgets/undo_history_test.dart index b5a80d09b4f..6cbb3a377c1 100644 --- a/packages/flutter/test/widgets/undo_history_test.dart +++ b/packages/flutter/test/widgets/undo_history_test.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'editable_text_utils.dart'; @@ -31,7 +30,7 @@ void main() { Future<void> sendUndo(WidgetTester tester) => sendUndoRedo(tester); Future<void> sendRedo(WidgetTester tester) => sendUndoRedo(tester, true); - testWidgetsWithLeakTracking('allows undo and redo to be called programmatically from the UndoHistoryController', (WidgetTester tester) async { + testWidgets('allows undo and redo to be called programmatically from the UndoHistoryController', (WidgetTester tester) async { final ValueNotifier<int> value = ValueNotifier<int>(0); addTearDown(value.dispose); final UndoHistoryController controller = UndoHistoryController(); @@ -123,7 +122,7 @@ void main() { expect(controller.value.canRedo, false); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('allows undo and redo to be called using the keyboard', (WidgetTester tester) async { + testWidgets('allows undo and redo to be called using the keyboard', (WidgetTester tester) async { final ValueNotifier<int> value = ValueNotifier<int>(0); addTearDown(value.dispose); final UndoHistoryController controller = UndoHistoryController(); @@ -218,7 +217,7 @@ void main() { expect(controller.value.canRedo, false); }, variant: TargetPlatformVariant.all(), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('duplicate changes do not affect the undo history', (WidgetTester tester) async { + testWidgets('duplicate changes do not affect the undo history', (WidgetTester tester) async { final ValueNotifier<int> value = ValueNotifier<int>(0); addTearDown(value.dispose); final UndoHistoryController controller = UndoHistoryController(); @@ -271,7 +270,7 @@ void main() { expect(controller.value.canRedo, true); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('ignores value changes pushed during onTriggered', (WidgetTester tester) async { + testWidgets('ignores value changes pushed during onTriggered', (WidgetTester tester) async { final ValueNotifier<int> value = ValueNotifier<int>(0); addTearDown(value.dispose); final UndoHistoryController controller = UndoHistoryController(); @@ -322,7 +321,7 @@ void main() { expect(() => key.currentState!.undo(), throwsAssertionError); }, variant: TargetPlatformVariant.all()); - testWidgetsWithLeakTracking('changes should send setUndoState to the UndoManagerConnection on iOS', (WidgetTester tester) async { + testWidgets('changes should send setUndoState to the UndoManagerConnection on iOS', (WidgetTester tester) async { final List<MethodCall> log = <MethodCall>[]; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.undoManager, (MethodCall methodCall) async { log.add(methodCall); @@ -395,7 +394,7 @@ void main() { expect(methodCall.arguments as Map<String, dynamic>, <String, bool>{'canUndo': false, 'canRedo': true}); }, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS}), skip: kIsWeb); // [intended] - testWidgetsWithLeakTracking('handlePlatformUndo should undo or redo appropriately on iOS', (WidgetTester tester) async { + testWidgets('handlePlatformUndo should undo or redo appropriately on iOS', (WidgetTester tester) async { final ValueNotifier<int> value = ValueNotifier<int>(0); addTearDown(value.dispose); final UndoHistoryController controller = UndoHistoryController(); @@ -485,7 +484,7 @@ void main() { }); group('UndoHistoryController', () { - testWidgetsWithLeakTracking('UndoHistoryController notifies onUndo listeners onUndo', (WidgetTester tester) async { + testWidgets('UndoHistoryController notifies onUndo listeners onUndo', (WidgetTester tester) async { int calls = 0; final UndoHistoryController controller = UndoHistoryController(); addTearDown(controller.dispose); @@ -503,7 +502,7 @@ void main() { expect(calls, 1); }); - testWidgetsWithLeakTracking('UndoHistoryController notifies onRedo listeners onRedo', (WidgetTester tester) async { + testWidgets('UndoHistoryController notifies onRedo listeners onRedo', (WidgetTester tester) async { int calls = 0; final UndoHistoryController controller = UndoHistoryController(); addTearDown(controller.dispose); @@ -521,7 +520,7 @@ void main() { expect(calls, 1); }); - testWidgetsWithLeakTracking('UndoHistoryController notifies listeners on value change', (WidgetTester tester) async { + testWidgets('UndoHistoryController notifies listeners on value change', (WidgetTester tester) async { int calls = 0; final UndoHistoryController controller = UndoHistoryController(value: const UndoHistoryValue(canUndo: true)); addTearDown(controller.dispose); diff --git a/packages/flutter/test/widgets/unique_widget_test.dart b/packages/flutter/test/widgets/unique_widget_test.dart index 8fa7b3f174d..be060bc0ee1 100644 --- a/packages/flutter/test/widgets/unique_widget_test.dart +++ b/packages/flutter/test/widgets/unique_widget_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; class TestUniqueWidget extends UniqueWidget<TestUniqueWidgetState> { const TestUniqueWidget({ required super.key }); @@ -19,7 +18,7 @@ class TestUniqueWidgetState extends State<TestUniqueWidget> { } void main() { - testWidgetsWithLeakTracking('Unique widget control test', (WidgetTester tester) async { + testWidgets('Unique widget control test', (WidgetTester tester) async { final TestUniqueWidget widget = TestUniqueWidget(key: GlobalKey<TestUniqueWidgetState>()); await tester.pumpWidget(widget); diff --git a/packages/flutter/test/widgets/value_listenable_builder_test.dart b/packages/flutter/test/widgets/value_listenable_builder_test.dart index 4354f0636e0..3961a80ba10 100644 --- a/packages/flutter/test/widgets/value_listenable_builder_test.dart +++ b/packages/flutter/test/widgets/value_listenable_builder_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { late SpyStringValueNotifier valueListenable; @@ -37,13 +36,13 @@ void main() { valueListenable.dispose(); }); - testWidgetsWithLeakTracking('Null value is ok', (WidgetTester tester) async { + testWidgets('Null value is ok', (WidgetTester tester) async { await tester.pumpWidget(textBuilderUnderTest); expect(find.byType(Placeholder), findsOneWidget); }); - testWidgetsWithLeakTracking('Widget builds with initial value', (WidgetTester tester) async { + testWidgets('Widget builds with initial value', (WidgetTester tester) async { final SpyStringValueNotifier valueListenable = SpyStringValueNotifier('Bachman'); addTearDown(valueListenable.dispose); @@ -52,7 +51,7 @@ void main() { expect(find.text('Bachman'), findsOneWidget); }); - testWidgetsWithLeakTracking('Widget updates when value changes', (WidgetTester tester) async { + testWidgets('Widget updates when value changes', (WidgetTester tester) async { await tester.pumpWidget(textBuilderUnderTest); valueListenable.value = 'Gilfoyle'; @@ -65,7 +64,7 @@ void main() { expect(find.text('Dinesh'), findsOneWidget); }); - testWidgetsWithLeakTracking('Can change listenable', (WidgetTester tester) async { + testWidgets('Can change listenable', (WidgetTester tester) async { await tester.pumpWidget(textBuilderUnderTest); valueListenable.value = 'Gilfoyle'; @@ -81,7 +80,7 @@ void main() { expect(find.text('Hendricks'), findsOneWidget); }); - testWidgetsWithLeakTracking('Stops listening to old listenable after changing listenable', (WidgetTester tester) async { + testWidgets('Stops listening to old listenable after changing listenable', (WidgetTester tester) async { await tester.pumpWidget(textBuilderUnderTest); valueListenable.value = 'Gilfoyle'; @@ -104,7 +103,7 @@ void main() { expect(find.text('Hendricks'), findsOneWidget); }); - testWidgetsWithLeakTracking('Self-cleans when removed', (WidgetTester tester) async { + testWidgets('Self-cleans when removed', (WidgetTester tester) async { await tester.pumpWidget(textBuilderUnderTest); valueListenable.value = 'Gilfoyle'; diff --git a/packages/flutter/test/widgets/view_test.dart b/packages/flutter/test/widgets/view_test.dart index 612ca66b81e..9a4ffc37a86 100644 --- a/packages/flutter/test/widgets/view_test.dart +++ b/packages/flutter/test/widgets/view_test.dart @@ -7,12 +7,11 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'multi_view_testing.dart'; void main() { - testWidgetsWithLeakTracking('Widgets running with runApp can find View', (WidgetTester tester) async { + testWidgets('Widgets running with runApp can find View', (WidgetTester tester) async { FlutterView? viewOf; FlutterView? viewMaybeOf; @@ -32,7 +31,7 @@ void main() { expect(viewMaybeOf, isA<FlutterView>()); }); - testWidgetsWithLeakTracking('Widgets running with pumpWidget can find View', (WidgetTester tester) async { + testWidgets('Widgets running with pumpWidget can find View', (WidgetTester tester) async { FlutterView? view; FlutterView? viewMaybeOf; @@ -52,7 +51,7 @@ void main() { expect(viewMaybeOf, isA<FlutterView>()); }); - testWidgetsWithLeakTracking('cannot find View behind a LookupBoundary', (WidgetTester tester) async { + testWidgets('cannot find View behind a LookupBoundary', (WidgetTester tester) async { await tester.pumpWidget( LookupBoundary( child: Container(), @@ -72,7 +71,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('child of view finds view, parentPipelineOwner, mediaQuery', (WidgetTester tester) async { + testWidgets('child of view finds view, parentPipelineOwner, mediaQuery', (WidgetTester tester) async { FlutterView? outsideView; FlutterView? insideView; PipelineOwner? outsideParent; @@ -114,7 +113,7 @@ void main() { expect(pipelineOwners.single, equals(insideParent)); }); - testWidgetsWithLeakTracking('cannot have multiple views with same FlutterView', (WidgetTester tester) async { + testWidgets('cannot have multiple views with same FlutterView', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: ViewCollection( @@ -141,11 +140,11 @@ void main() { ); }); - testWidgetsWithLeakTracking('ViewCollection must have one view', (WidgetTester tester) async { + testWidgets('ViewCollection must have one view', (WidgetTester tester) async { expect(() => ViewCollection(views: const <Widget>[]), throwsAssertionError); }); - testWidgetsWithLeakTracking('ViewAnchor.child does not see surrounding view', (WidgetTester tester) async { + testWidgets('ViewAnchor.child does not see surrounding view', (WidgetTester tester) async { FlutterView? inside; FlutterView? outside; await tester.pumpWidget( @@ -168,7 +167,7 @@ void main() { expect(outside, isNotNull); }); - testWidgetsWithLeakTracking('ViewAnchor layout order', (WidgetTester tester) async { + testWidgets('ViewAnchor layout order', (WidgetTester tester) async { Finder findSpyWidget(int label) { return find.byWidgetPredicate((Widget w) => w is SpyRenderWidget && w.label == label); } @@ -195,7 +194,7 @@ void main() { expect(log, <String>['layout 1', 'layout 3', 'layout 2']); }); - testWidgetsWithLeakTracking('visitChildren of ViewAnchor visits both children', (WidgetTester tester) async { + testWidgets('visitChildren of ViewAnchor visits both children', (WidgetTester tester) async { await tester.pumpWidget( ViewAnchor( view: View( @@ -224,7 +223,7 @@ void main() { expect(children, hasLength(1)); }); - testWidgetsWithLeakTracking('visitChildren of ViewCollection visits all children', (WidgetTester tester) async { + testWidgets('visitChildren of ViewCollection visits all children', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: ViewCollection( @@ -270,7 +269,7 @@ void main() { }); group('renderObject getter', () { - testWidgetsWithLeakTracking('ancestors of view see RenderView as renderObject', (WidgetTester tester) async { + testWidgets('ancestors of view see RenderView as renderObject', (WidgetTester tester) async { late BuildContext builderContext; await pumpWidgetWithoutViewWrapper( tester: tester, @@ -292,7 +291,7 @@ void main() { expect(tester.element(find.byType(Builder)).renderObject, renderObject); }); - testWidgetsWithLeakTracking('ancestors of ViewCollection get null for renderObject', (WidgetTester tester) async { + testWidgets('ancestors of ViewCollection get null for renderObject', (WidgetTester tester) async { late BuildContext builderContext; await pumpWidgetWithoutViewWrapper( tester: tester, @@ -320,7 +319,7 @@ void main() { expect(tester.element(find.byType(Builder)).renderObject, isNull); }); - testWidgetsWithLeakTracking('ancestors of a ViewAnchor see the right RenderObject', (WidgetTester tester) async { + testWidgets('ancestors of a ViewAnchor see the right RenderObject', (WidgetTester tester) async { late BuildContext builderContext; await tester.pumpWidget( Builder( @@ -345,7 +344,7 @@ void main() { }); }); - testWidgetsWithLeakTracking('correctly switches between view configurations', (WidgetTester tester) async { + testWidgets('correctly switches between view configurations', (WidgetTester tester) async { await pumpWidgetWithoutViewWrapper( tester: tester, widget: View( @@ -404,7 +403,7 @@ void main() { ), throwsAssertionError); }); - testWidgetsWithLeakTracking('attaches itself correctly', (WidgetTester tester) async { + testWidgets('attaches itself correctly', (WidgetTester tester) async { final Key viewKey = UniqueKey(); late final PipelineOwner parentPipelineOwner; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/visibility_test.dart b/packages/flutter/test/widgets/visibility_test.dart index 0b2b6330f30..cd11376111d 100644 --- a/packages/flutter/test/widgets/visibility_test.dart +++ b/packages/flutter/test/widgets/visibility_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'semantics_tester.dart'; @@ -30,7 +29,7 @@ class _TestStateState extends State<TestState> { } void main() { - testWidgetsWithLeakTracking('Visibility', (WidgetTester tester) async { + testWidgets('Visibility', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> log = <String>[]; @@ -440,7 +439,7 @@ void main() { semantics.dispose(); }); - testWidgetsWithLeakTracking('Visibility does not force compositing when visible and maintain*', (WidgetTester tester) async { + testWidgets('Visibility does not force compositing when visible and maintain*', (WidgetTester tester) async { await tester.pumpWidget( const Visibility( maintainSize: true, @@ -456,7 +455,7 @@ void main() { expect(tester.layers.last, isA<PictureLayer>()); }); - testWidgetsWithLeakTracking('SliverVisibility does not force compositing when visible and maintain*', (WidgetTester tester) async { + testWidgets('SliverVisibility does not force compositing when visible and maintain*', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -486,7 +485,7 @@ void main() { expect(tester.layers.last, isA<PictureLayer>()); }); - testWidgetsWithLeakTracking('Visibility.of returns correct value', (WidgetTester tester) async { + testWidgets('Visibility.of returns correct value', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -519,7 +518,7 @@ void main() { expect(find.text('is visible ? false', skipOffstage: false), findsOneWidget); }); - testWidgetsWithLeakTracking('Visibility.of works when multiple Visibility widgets are in hierarchy', (WidgetTester tester) async { + testWidgets('Visibility.of works when multiple Visibility widgets are in hierarchy', (WidgetTester tester) async { bool didChangeDependencies = false; void handleDidChangeDependencies() { didChangeDependencies = true; diff --git a/packages/flutter/test/widgets/widget_inspector_test.dart b/packages/flutter/test/widgets/widget_inspector_test.dart index b0da570651b..5ffd28045e5 100644 --- a/packages/flutter/test/widgets/widget_inspector_test.dart +++ b/packages/flutter/test/widgets/widget_inspector_test.dart @@ -20,7 +20,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker/leak_tracker.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import 'widget_inspector_test_utils.dart'; @@ -318,7 +317,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(ref.target, null); }); - testWidgetsWithLeakTracking('WidgetInspector smoke test', (WidgetTester tester) async { + testWidgets('WidgetInspector smoke test', (WidgetTester tester) async { // This is a smoke test to verify that adding the inspector doesn't crash. await tester.pumpWidget( const Directionality( @@ -352,7 +351,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(true, isTrue); // Expect that we reach here without crashing. }); - testWidgetsWithLeakTracking('WidgetInspector interaction test', (WidgetTester tester) async { + testWidgets('WidgetInspector interaction test', (WidgetTester tester) async { final List<String> log = <String>[]; final GlobalKey selectButtonKey = GlobalKey(); final GlobalKey inspectorKey = GlobalKey(); @@ -447,7 +446,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }); - testWidgetsWithLeakTracking('WidgetInspector non-invertible transform regression test', (WidgetTester tester) async { + testWidgets('WidgetInspector non-invertible transform regression test', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -472,7 +471,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(true, isTrue); // Expect that we reach here without crashing. }); - testWidgetsWithLeakTracking('WidgetInspector scroll test', (WidgetTester tester) async { + testWidgets('WidgetInspector scroll test', (WidgetTester tester) async { final Key childKey = UniqueKey(); final GlobalKey selectButtonKey = GlobalKey(); final GlobalKey inspectorKey = GlobalKey(); @@ -529,7 +528,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(tester.getTopLeft(find.byKey(childKey)).dy, equals(0.0)); }); - testWidgetsWithLeakTracking('WidgetInspector long press', (WidgetTester tester) async { + testWidgets('WidgetInspector long press', (WidgetTester tester) async { bool didLongPress = false; await tester.pumpWidget( @@ -553,7 +552,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(didLongPress, isFalse); }); - testWidgetsWithLeakTracking('WidgetInspector offstage', (WidgetTester tester) async { + testWidgets('WidgetInspector offstage', (WidgetTester tester) async { final GlobalKey inspectorKey = GlobalKey(); final GlobalKey clickTarget = GlobalKey(); @@ -626,7 +625,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }); - testWidgetsWithLeakTracking('WidgetInspector with Transform above', (WidgetTester tester) async { + testWidgets('WidgetInspector with Transform above', (WidgetTester tester) async { final GlobalKey childKey = GlobalKey(); final GlobalKey repaintBoundaryKey = GlobalKey(); @@ -673,7 +672,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }); - testWidgetsWithLeakTracking('Multiple widget inspectors', (WidgetTester tester) async { + testWidgets('Multiple widget inspectors', (WidgetTester tester) async { // This test verifies that interacting with different inspectors // works correctly. This use case may be an app that displays multiple // apps inside (i.e. a storyboard). @@ -835,7 +834,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { service.disposeGroup(group3); }); - testWidgetsWithLeakTracking('WidgetInspectorService maybeSetSelection', (WidgetTester tester) async { + testWidgets('WidgetInspectorService maybeSetSelection', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -882,7 +881,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(service.selection.currentElement, equals(elementA)); }); - testWidgetsWithLeakTracking('WidgetInspectorService defunct selection regression test', (WidgetTester tester) async { + testWidgets('WidgetInspectorService defunct selection regression test', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -935,7 +934,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(service.selection.current, equals(null)); }); - testWidgetsWithLeakTracking('WidgetInspectorService getParentChain', (WidgetTester tester) async { + testWidgets('WidgetInspectorService getParentChain', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -1003,7 +1002,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('WidgetInspectorService getChildren', (WidgetTester tester) async { + testWidgets('WidgetInspectorService getChildren', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -1031,7 +1030,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('WidgetInspectorService creationLocation', (WidgetTester tester) async { + testWidgets('WidgetInspectorService creationLocation', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, @@ -1093,7 +1092,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(columnC, equals(19)); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('WidgetInspectorService setSelection notifiers for an Element', + testWidgets('WidgetInspectorService setSelection notifiers for an Element', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( @@ -1138,7 +1137,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { skip: !WidgetInspectorService.instance.isWidgetCreationTracked(), // [intended] Test requires --track-widget-creation flag. ); - testWidgetsWithLeakTracking( + testWidgets( 'WidgetInspectorService setSelection notifiers for a RenderObject', (WidgetTester tester) async { await tester.pumpWidget( @@ -1184,7 +1183,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { skip: !WidgetInspectorService.instance.isWidgetCreationTracked(), // [intended] Test requires --track-widget-creation flag. ); - testWidgetsWithLeakTracking( + testWidgets( 'WidgetInspector selectButton inspection for tap', (WidgetTester tester) async { final GlobalKey selectButtonKey = GlobalKey(); @@ -1234,7 +1233,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { skip: !WidgetInspectorService.instance.isWidgetCreationTracked() // [intended] Test requires --track-widget-creation flag. ); - testWidgetsWithLeakTracking('test transformDebugCreator will re-order if after stack trace', (WidgetTester tester) async { + testWidgets('test transformDebugCreator will re-order if after stack trace', (WidgetTester tester) async { final bool widgetTracked = WidgetInspectorService.instance.isWidgetCreationTracked(); await tester.pumpWidget( const Directionality( @@ -1298,7 +1297,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(nodes[4].runtimeType, DiagnosticsStackTrace); }); - testWidgetsWithLeakTracking('test transformDebugCreator will not re-order if before stack trace', (WidgetTester tester) async { + testWidgets('test transformDebugCreator will not re-order if before stack trace', (WidgetTester tester) async { final bool widgetTracked = WidgetInspectorService.instance.isWidgetCreationTracked(); await tester.pumpWidget( const Directionality( @@ -1361,7 +1360,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(nodes[4].runtimeType, DiagnosticsStackTrace); }, skip: WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --no-track-widget-creation flag. - testWidgetsWithLeakTracking('test transformDebugCreator will add DevToolsDeepLinkProperty for overflow errors', (WidgetTester tester) async { + testWidgets('test transformDebugCreator will add DevToolsDeepLinkProperty for overflow errors', (WidgetTester tester) async { activeDevToolsServerAddress = 'http://127.0.0.1:9100'; connectedVmServiceUri = 'http://127.0.0.1:55269/798ay5al_FM=/'; @@ -1396,7 +1395,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(nodes[5].runtimeType, StringProperty); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('test transformDebugCreator will not add DevToolsDeepLinkProperty for non-overflow errors', (WidgetTester tester) async { + testWidgets('test transformDebugCreator will not add DevToolsDeepLinkProperty for non-overflow errors', (WidgetTester tester) async { activeDevToolsServerAddress = 'http://127.0.0.1:9100'; connectedVmServiceUri = 'http://127.0.0.1:55269/798ay5al_FM=/'; setupDefaultPubRootDirectory(service); @@ -1428,7 +1427,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(nodes[3].runtimeType, StringProperty); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('test transformDebugCreator will not add DevToolsDeepLinkProperty if devtoolsServerAddress is unavailable', (WidgetTester tester) async { + testWidgets('test transformDebugCreator will not add DevToolsDeepLinkProperty if devtoolsServerAddress is unavailable', (WidgetTester tester) async { activeDevToolsServerAddress = null; connectedVmServiceUri = 'http://127.0.0.1:55269/798ay5al_FM=/'; setupDefaultPubRootDirectory(service); @@ -1570,7 +1569,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }); group('addPubRootDirectories', () { - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject when there are no pubRootDirectories', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1600,7 +1599,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the element is part of the pubRootDirectory', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1626,7 +1625,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject when widget package directory is a suffix of a pubRootDirectory', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1651,7 +1650,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the pubRootDirectory is prefixed with file://', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1676,7 +1675,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject when thePubRootDirectory has a different suffix', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1701,7 +1700,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject even if another pubRootDirectory does not match', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1729,7 +1728,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'widget is part of core framework and is the child of a widget in the package pubRootDirectories', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1806,7 +1805,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { service.resetPubRootDirectories(); }); - testWidgetsWithLeakTracking( + testWidgets( 'reacts to add and removing pubRootDirectories', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1844,7 +1843,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not match when the package directory does not match', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1872,7 +1871,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the pubRootDirectory is prefixed with file://', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1897,7 +1896,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle consecutive calls to add', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1926,7 +1925,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle removing an unrelated pubRootDirectory', (WidgetTester tester) async { const Widget widget = Directionality( @@ -1962,7 +1961,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle parent widget being part of a separate package', (WidgetTester tester) async { const Widget widget = Directionality( @@ -2039,7 +2038,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); group('InspectorSelection', () { - testWidgetsWithLeakTracking('receives notifications when selection changes', + testWidgets('receives notifications when selection changes', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( @@ -2134,7 +2133,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(() => service.toObject(aId), throwsFlutterError); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.setSelection', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.setSelection', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -2184,7 +2183,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(service.selection.currentElement, equals(elementA)); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getParentChain', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getParentChain', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -2256,7 +2255,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getChildren', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getChildren', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -2286,7 +2285,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getChildrenDetailsSubtree', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getChildrenDetailsSubtree', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -2325,7 +2324,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('WidgetInspectorService getDetailsSubtree', (WidgetTester tester) async { + testWidgets('WidgetInspectorService getDetailsSubtree', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -2381,7 +2380,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('cyclic diagnostics regression test', (WidgetTester tester) async { + testWidgets('cyclic diagnostics regression test', (WidgetTester tester) async { const String group = 'test-group'; final CyclicDiagnostic a = CyclicDiagnostic('a'); final CyclicDiagnostic b = CyclicDiagnostic('b'); @@ -2417,7 +2416,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(nestedRelatedProperty, isNot(contains('children'))); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getRootWidgetSummaryTree', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getRootWidgetSummaryTree', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( const Directionality( @@ -2527,7 +2526,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(childJson['chidlren'], isNull); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('ext.flutter.inspector.getRootWidgetSummaryTreeWithPreviews', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getRootWidgetSummaryTreeWithPreviews', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -2618,7 +2617,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(childJson['textPreview'], equals('c')); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('ext.flutter.inspector.getSelectedSummaryWidget', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getSelectedSummaryWidget', (WidgetTester tester) async { const String group = 'test-group'; await tester.pumpWidget( @@ -2689,7 +2688,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(service.toObject(regularSelection['valueId']! as String), richTextDiagnostic.value); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('ext.flutter.inspector creationLocation', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector creationLocation', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, @@ -2751,7 +2750,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { service.resetPubRootDirectories(); }); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the widget is in the pubRootDirectory', (WidgetTester tester) async { await tester.pumpWidget( @@ -2784,7 +2783,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject if the prefix of the pubRootDirectory is different', (WidgetTester tester) async { await tester.pumpWidget( @@ -2817,7 +2816,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject if the pubRootDirectory is prefixed with file://', (WidgetTester tester) async { await tester.pumpWidget( @@ -2850,7 +2849,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject if the pubRootDirectory has a different suffix', (WidgetTester tester) async { await tester.pumpWidget( @@ -2883,7 +2882,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject if at least one of the pubRootDirectories matches', (WidgetTester tester) async { await tester.pumpWidget( @@ -2920,7 +2919,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'widget is part of core framework and is the child of a widget in the package pubRootDirectories', (WidgetTester tester) async { await tester.pumpWidget( @@ -3031,7 +3030,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { service.resetPubRootDirectories(); }); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the widget is in the pubRootDirectory', (WidgetTester tester) async { await tester.pumpWidget( @@ -3063,7 +3062,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject if the prefix of the pubRootDirectory is different', (WidgetTester tester) async { await tester.pumpWidget( @@ -3098,7 +3097,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject if the pubRootDirectory is prefixed with file://', (WidgetTester tester) async { await tester.pumpWidget( @@ -3130,7 +3129,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not have createdByLocalProject if the pubRootDirectory has a different suffix', (WidgetTester tester) async { await tester.pumpWidget( @@ -3165,7 +3164,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject if at least one of the pubRootDirectories matches', (WidgetTester tester) async { await tester.pumpWidget( @@ -3223,7 +3222,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { service.resetPubRootDirectories(); }); - testWidgetsWithLeakTracking( + testWidgets( 'reacts to add and removing pubRootDirectories', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3273,7 +3272,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not match when the package directory does not match', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3307,7 +3306,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the pubRootDirectory is prefixed with file://', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3338,7 +3337,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle consecutive calls to add', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3372,7 +3371,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle removing an unrelated pubRootDirectory', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3418,7 +3417,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle parent widget being part of a separate package', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3529,7 +3528,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { service.resetPubRootDirectories(); }); - testWidgetsWithLeakTracking( + testWidgets( 'reacts to add and removing pubRootDirectories', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3581,7 +3580,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'does not match when the package directory does not match', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3615,7 +3614,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'has createdByLocalProject when the pubRootDirectory is prefixed with file://', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3649,7 +3648,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle consecutive calls to add', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3689,7 +3688,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }, ); - testWidgetsWithLeakTracking( + testWidgets( 'can handle removing an unrelated pubRootDirectory', (WidgetTester tester) async { const Widget widget = Directionality( @@ -3748,7 +3747,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { skip: !WidgetInspectorService.instance.isWidgetCreationTracked(), // [intended] Test requires --track-widget-creation flag. ); - testWidgetsWithLeakTracking('ext.flutter.inspector.trackRebuildDirtyWidgets with tear-offs', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.trackRebuildDirtyWidgets with tear-offs', (WidgetTester tester) async { final Widget widget = Directionality( textDirection: TextDirection.ltr, child: WidgetInspector( @@ -3770,7 +3769,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { skip: !WidgetInspectorService.instance.isWidgetCreationTracked(), // [intended] Test requires --track-widget-creation flag. ); - testWidgetsWithLeakTracking('ext.flutter.inspector.trackRebuildDirtyWidgets', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.trackRebuildDirtyWidgets', (WidgetTester tester) async { service.rebuildCount = 0; await tester.pumpWidget(const ClockDemo()); @@ -3875,7 +3874,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { _CreationLocation location = knownLocations[id]!; expect(location.file, equals(file)); // ClockText widget. - expect(location.line, equals(57)); + expect(location.line, equals(56)); expect(location.column, equals(9)); expect(location.name, equals('ClockText')); expect(count, equals(1)); @@ -3885,7 +3884,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { location = knownLocations[id]!; expect(location.file, equals(file)); // Text widget in _ClockTextState build method. - expect(location.line, equals(95)); + expect(location.line, equals(94)); expect(location.column, equals(12)); expect(location.name, equals('Text')); expect(count, equals(1)); @@ -3912,7 +3911,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { location = knownLocations[id]!; expect(location.file, equals(file)); // ClockText widget. - expect(location.line, equals(57)); + expect(location.line, equals(56)); expect(location.column, equals(9)); expect(location.name, equals('ClockText')); expect(count, equals(3)); // 3 clock widget instances rebuilt. @@ -3922,7 +3921,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { location = knownLocations[id]!; expect(location.file, equals(file)); // Text widget in _ClockTextState build method. - expect(location.line, equals(95)); + expect(location.line, equals(94)); expect(location.column, equals(12)); expect(location.name, equals('Text')); expect(count, equals(3)); // 3 clock widget instances rebuilt. @@ -3989,7 +3988,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(rebuildEvents, isEmpty); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('ext.flutter.inspector.trackRepaintWidgets', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.trackRepaintWidgets', (WidgetTester tester) async { service.rebuildCount = 0; await tester.pumpWidget(const ClockDemo()); @@ -4112,7 +4111,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(repaintEvents, isEmpty); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('ext.flutter.inspector.show', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.show', (WidgetTester tester) async { final Iterable<Map<Object, Object?>> extensionChangedEvents = service.getServiceExtensionStateChangedEvents('ext.flutter.inspector.show'); Map<Object, Object?> extensionChangedEvent; int debugShowChangeCounter = 0; @@ -4203,7 +4202,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(WidgetsApp.debugShowWidgetInspectorOverride, isFalse); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.screenshot', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.screenshot', (WidgetTester tester) async { final GlobalKey outerContainerKey = GlobalKey(); final GlobalKey paddingKey = GlobalKey(); final GlobalKey redContainerKey = GlobalKey(); @@ -4586,7 +4585,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { await tester.pumpWidget(widget); } - testWidgetsWithLeakTracking('ext.flutter.inspector.getLayoutExplorerNode for RenderBox with BoxParentData',(WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getLayoutExplorerNode for RenderBox with BoxParentData',(WidgetTester tester) async { await pumpWidgetForLayoutExplorer(tester); final Element rowElement = tester.element(find.byType(Row)); @@ -4631,7 +4630,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(parentData['offsetY'], equals('293.0')); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getLayoutExplorerNode for RenderBox with FlexParentData',(WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getLayoutExplorerNode for RenderBox with FlexParentData',(WidgetTester tester) async { await pumpWidgetForLayoutExplorer(tester); final Element flexibleElement = tester.element(find.byType(Flexible).first); @@ -4673,7 +4672,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(result['parentData'], isNull); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getLayoutExplorerNode for RenderView',(WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getLayoutExplorerNode for RenderView',(WidgetTester tester) async { await pumpWidgetForLayoutExplorer(tester); final Element element = tester.element(find.byType(Directionality).first); @@ -4709,7 +4708,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(result['parentData'], isNull); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.setFlexFit', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.setFlexFit', (WidgetTester tester) async { await pumpWidgetForLayoutExplorer(tester); final Element childElement = tester.element(find.byType(Flexible).first); @@ -4739,7 +4738,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(result['flexFit'], equals('tight')); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.setFlexFactor', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.setFlexFactor', (WidgetTester tester) async { await pumpWidgetForLayoutExplorer(tester); final Element childElement = tester.element(find.byType(Flexible).first); @@ -4769,7 +4768,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(result['flexFactor'], equals(3)); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.setFlexProperties', (WidgetTester tester) async { + testWidgets('ext.flutter.inspector.setFlexProperties', (WidgetTester tester) async { await pumpWidgetForLayoutExplorer(tester); final Element rowElement = tester.element(find.byType(Row).first); @@ -4832,7 +4831,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(crossAxisAlignment, equals('start')); }); - testWidgetsWithLeakTracking('ext.flutter.inspector.getLayoutExplorerNode does not throw StackOverflowError',(WidgetTester tester) async { + testWidgets('ext.flutter.inspector.getLayoutExplorerNode does not throw StackOverflowError',(WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/115228 const Key leafKey = ValueKey<String>('ColoredBox'); await tester.pumpWidget( @@ -4862,7 +4861,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(error, isNull); }); - testWidgetsWithLeakTracking( + testWidgets( 'ext.flutter.inspector.getLayoutExplorerNode, on a ToolTip, does not throw StackOverflowError', (WidgetTester tester) async { // Regression test for https://github.com/flutter/devtools/issues/5946 @@ -4994,7 +4993,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { } }); - testWidgetsWithLeakTracking('Screenshot of composited transforms - only offsets', (WidgetTester tester) async { + testWidgets('Screenshot of composited transforms - only offsets', (WidgetTester tester) async { // Composited transforms are challenging to take screenshots of as the // LeaderLayer and FollowerLayer classes used by CompositedTransformTarget // and CompositedTransformFollower depend on traversing ancestors of the @@ -5101,7 +5100,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ); }); - testWidgetsWithLeakTracking('Screenshot composited transforms - with rotations', (WidgetTester tester) async { + testWidgets('Screenshot composited transforms - with rotations', (WidgetTester tester) async { final LayerLink link = LayerLink(); final GlobalKey key1 = GlobalKey(); final GlobalKey key2 = GlobalKey(); @@ -5216,7 +5215,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(box2.localToGlobal(Offset.zero), equals(position2)); }); - testWidgetsWithLeakTracking('getChildrenDetailsSubtree', (WidgetTester tester) async { + testWidgets('getChildrenDetailsSubtree', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( title: 'Hello, World', @@ -5276,7 +5275,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(appBars.single, isNot(contains('children'))); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('InspectorSerializationDelegate addAdditionalPropertiesCallback', (WidgetTester tester) async { + testWidgets('InspectorSerializationDelegate addAdditionalPropertiesCallback', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( title: 'Hello World!', @@ -5345,7 +5344,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(node.toJsonMap(emptyDelegate), node.toJsonMap(defaultDelegate)); }); - testWidgetsWithLeakTracking('debugIsLocalCreationLocation test', (WidgetTester tester) async { + testWidgets('debugIsLocalCreationLocation test', (WidgetTester tester) async { setupDefaultPubRootDirectory(service); final GlobalKey key = GlobalKey(); @@ -5374,7 +5373,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(debugIsLocalCreationLocation(paddingElement.widget), isFalse); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('debugIsWidgetLocalCreation test', (WidgetTester tester) async { + testWidgets('debugIsWidgetLocalCreation test', (WidgetTester tester) async { setupDefaultPubRootDirectory(service); final GlobalKey key = GlobalKey(); @@ -5397,7 +5396,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { expect(debugIsWidgetLocalCreation(paddingElement.widget), isFalse); }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. - testWidgetsWithLeakTracking('debugIsWidgetLocalCreation false test', (WidgetTester tester) async { + testWidgets('debugIsWidgetLocalCreation false test', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/wrap_test.dart b/packages/flutter/test/widgets/wrap_test.dart index 41165288f9b..1a132ef0255 100644 --- a/packages/flutter/test/widgets/wrap_test.dart +++ b/packages/flutter/test/widgets/wrap_test.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void verify(WidgetTester tester, List<Offset> answerKey) { final List<Offset> testAnswers = tester.renderObjectList<RenderBox>(find.byType(SizedBox)).map<Offset>( @@ -15,7 +14,7 @@ void verify(WidgetTester tester, List<Offset> answerKey) { } void main() { - testWidgetsWithLeakTracking('Basic Wrap test (LTR)', (WidgetTester tester) async { + testWidgets('Basic Wrap test (LTR)', (WidgetTester tester) async { await tester.pumpWidget( const Wrap( textDirection: TextDirection.ltr, @@ -130,7 +129,7 @@ void main() { }); - testWidgetsWithLeakTracking('Basic Wrap test (RTL)', (WidgetTester tester) async { + testWidgets('Basic Wrap test (RTL)', (WidgetTester tester) async { await tester.pumpWidget( const Wrap( textDirection: TextDirection.rtl, @@ -248,12 +247,12 @@ void main() { }); - testWidgetsWithLeakTracking('Empty wrap', (WidgetTester tester) async { + testWidgets('Empty wrap', (WidgetTester tester) async { await tester.pumpWidget(const Center(child: Wrap(alignment: WrapAlignment.center))); expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(Size.zero)); }); - testWidgetsWithLeakTracking('Wrap alignment (LTR)', (WidgetTester tester) async { + testWidgets('Wrap alignment (LTR)', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( alignment: WrapAlignment.center, spacing: 5.0, @@ -323,7 +322,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Wrap alignment (RTL)', (WidgetTester tester) async { + testWidgets('Wrap alignment (RTL)', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( alignment: WrapAlignment.center, spacing: 5.0, @@ -393,7 +392,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Wrap runAlignment (DOWN)', (WidgetTester tester) async { + testWidgets('Wrap runAlignment (DOWN)', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( runAlignment: WrapAlignment.center, runSpacing: 5.0, @@ -480,7 +479,7 @@ void main() { }); - testWidgetsWithLeakTracking('Wrap runAlignment (UP)', (WidgetTester tester) async { + testWidgets('Wrap runAlignment (UP)', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( runAlignment: WrapAlignment.center, runSpacing: 5.0, @@ -571,7 +570,7 @@ void main() { }); - testWidgetsWithLeakTracking('Shrink-wrapping Wrap test', (WidgetTester tester) async { + testWidgets('Shrink-wrapping Wrap test', (WidgetTester tester) async { await tester.pumpWidget( const Align( alignment: Alignment.topLeft, @@ -621,7 +620,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Wrap spacing test', (WidgetTester tester) async { + testWidgets('Wrap spacing test', (WidgetTester tester) async { await tester.pumpWidget( const Align( alignment: Alignment.topLeft, @@ -646,7 +645,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Vertical Wrap test with spacing', (WidgetTester tester) async { + testWidgets('Vertical Wrap test with spacing', (WidgetTester tester) async { await tester.pumpWidget( const Align( alignment: Alignment.topLeft, @@ -705,7 +704,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Visual overflow generates a clip', (WidgetTester tester) async { + testWidgets('Visual overflow generates a clip', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( textDirection: TextDirection.ltr, children: <Widget>[ @@ -727,7 +726,7 @@ void main() { expect(tester.renderObject<RenderBox>(find.byType(Wrap)), paints..clipRect()); }); - testWidgetsWithLeakTracking('Hit test children in wrap', (WidgetTester tester) async { + testWidgets('Hit test children in wrap', (WidgetTester tester) async { final List<String> log = <String>[]; await tester.pumpWidget(Wrap( @@ -763,14 +762,14 @@ void main() { expect(log, equals(<String>['hit'])); }); - testWidgetsWithLeakTracking('RenderWrap toStringShallow control test', (WidgetTester tester) async { + testWidgets('RenderWrap toStringShallow control test', (WidgetTester tester) async { await tester.pumpWidget(const Wrap(alignment: WrapAlignment.center)); final RenderBox wrap = tester.renderObject(find.byType(Wrap)); expect(wrap.toStringShallow(), hasOneLineDescription); }); - testWidgetsWithLeakTracking('RenderWrap toString control test', (WidgetTester tester) async { + testWidgets('RenderWrap toString control test', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( direction: Axis.vertical, runSpacing: 7.0, @@ -788,7 +787,7 @@ void main() { expect(width, equals(2021)); }); - testWidgetsWithLeakTracking('Wrap baseline control test', (WidgetTester tester) async { + testWidgets('Wrap baseline control test', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: Baseline( @@ -816,7 +815,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('Spacing with slight overflow', (WidgetTester tester) async { + testWidgets('Spacing with slight overflow', (WidgetTester tester) async { await tester.pumpWidget(const Wrap( textDirection: TextDirection.ltr, spacing: 10.0, @@ -838,7 +837,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Object exactly matches container width', (WidgetTester tester) async { + testWidgets('Object exactly matches container width', (WidgetTester tester) async { await tester.pumpWidget( const Column( children: <Widget>[ @@ -880,7 +879,7 @@ void main() { ]); }); - testWidgetsWithLeakTracking('Wrap can set and update clipBehavior', (WidgetTester tester) async { + testWidgets('Wrap can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(const Wrap(textDirection: TextDirection.ltr)); final RenderWrap renderObject = tester.allRenderObjects.whereType<RenderWrap>().first; expect(renderObject.clipBehavior, equals(Clip.none)); @@ -889,7 +888,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); - testWidgetsWithLeakTracking('Horizontal wrap - IntrinsicsHeight', (WidgetTester tester) async { + testWidgets('Horizontal wrap - IntrinsicsHeight', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/48679. await tester.pumpWidget( const Directionality( @@ -921,7 +920,7 @@ void main() { expect(tester.getSize(find.byType(IntrinsicHeight)).height, 2 * 16 + 40); }); - testWidgetsWithLeakTracking('Vertical wrap - IntrinsicsWidth', (WidgetTester tester) async { + testWidgets('Vertical wrap - IntrinsicsWidth', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/48679. await tester.pumpWidget( const Directionality( diff --git a/packages/flutter_test/test/reference_image_test.dart b/packages/flutter_test/test/reference_image_test.dart index 8be052337cd..9ae8475a0e0 100644 --- a/packages/flutter_test/test/reference_image_test.dart +++ b/packages/flutter_test/test/reference_image_test.dart @@ -7,7 +7,6 @@ import 'dart:ui' as ui; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; Future<ui.Image> createTestImage(int width, int height, ui.Color color) async { final ui.Paint paint = ui.Paint() @@ -29,7 +28,7 @@ void main() { const ui.Color transparentRed = ui.Color.fromARGB(128, 255, 0, 0); group('succeeds', () { - testWidgetsWithLeakTracking('when images have the same content', (WidgetTester tester) async { + testWidgets('when images have the same content', (WidgetTester tester) async { final ui.Image image1 = await createTestImage(100, 100, red); addTearDown(image1.dispose); final ui.Image referenceImage1 = await createTestImage(100, 100, red); @@ -52,13 +51,13 @@ void main() { await expectLater(image3, matchesReferenceImage(referenceImage3)); }); - testWidgetsWithLeakTracking('when images are identical', (WidgetTester tester) async { + testWidgets('when images are identical', (WidgetTester tester) async { final ui.Image image = await createTestImage(100, 100, red); addTearDown(image.dispose); await expectLater(image, matchesReferenceImage(image)); }); - testWidgetsWithLeakTracking('when widget looks the same', (WidgetTester tester) async { + testWidgets('when widget looks the same', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view ..physicalSize = const Size(10, 10) @@ -81,7 +80,7 @@ void main() { }); group('fails', () { - testWidgetsWithLeakTracking('when image sizes do not match', (WidgetTester tester) async { + testWidgets('when image sizes do not match', (WidgetTester tester) async { final ui.Image red50 = await createTestImage(50, 50, red); addTearDown(red50.dispose); final ui.Image red100 = await createTestImage(100, 100, red); @@ -93,7 +92,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('when image pixels do not match', (WidgetTester tester) async { + testWidgets('when image pixels do not match', (WidgetTester tester) async { final ui.Image red100 = await createTestImage(100, 100, red); addTearDown(red100.dispose); final ui.Image transparentRed100 = await createTestImage(100, 100, transparentRed); @@ -113,7 +112,7 @@ void main() { ); }); - testWidgetsWithLeakTracking('when widget does not look the same', (WidgetTester tester) async { + testWidgets('when widget does not look the same', (WidgetTester tester) async { addTearDown(tester.view.reset); tester.view ..physicalSize = const Size(10, 10)