diff --git a/packages/flutter/test/rendering/debug_overflow_indicator_test.dart b/packages/flutter/test/rendering/debug_overflow_indicator_test.dart index 7e49c164fa..4e7b7df34f 100644 --- a/packages/flutter/test/rendering/debug_overflow_indicator_test.dart +++ b/packages/flutter/test/rendering/debug_overflow_indicator_test.dart @@ -4,9 +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() { - testWidgets('overflow indicator is not shown when not overflowing', (WidgetTester tester) async { + testWidgetsWithLeakTracking('overflow indicator is not shown when not overflowing', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: UnconstrainedBox( @@ -18,7 +19,7 @@ void main() { expect(find.byType(UnconstrainedBox), isNot(paints..rect())); }); - testWidgets('overflow indicator is shown when overflowing', (WidgetTester tester) async { + testWidgetsWithLeakTracking('overflow indicator is shown when overflowing', (WidgetTester tester) async { const UnconstrainedBox box = UnconstrainedBox( child: SizedBox(width: 200.0, height: 200.0), ); @@ -54,7 +55,7 @@ void main() { expect(find.byType(UnconstrainedBox), paints..rect()); }); - testWidgets('overflow indicator is not shown when constraint size is zero.', (WidgetTester tester) async { + testWidgetsWithLeakTracking('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 8804f3319c..fbfbf35ad9 100644 --- a/packages/flutter/test/rendering/error_test.dart +++ b/packages/flutter/test/rendering/error_test.dart @@ -5,12 +5,13 @@ 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'; - testWidgets('test draw error paragraph', (WidgetTester tester) async { + testWidgetsWithLeakTracking('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 0119c83919..c0aff93bec 100644 --- a/packages/flutter/test/rendering/flex_overflow_test.dart +++ b/packages/flutter/test/rendering/flex_overflow_test.dart @@ -4,9 +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() { - testWidgets('Flex overflow indicator', (WidgetTester tester) async { + testWidgetsWithLeakTracking('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 b7ff7be2c5..83afd88416 100644 --- a/packages/flutter/test/rendering/localized_fonts_test.dart +++ b/packages/flutter/test/rendering/localized_fonts_test.dart @@ -9,12 +9,12 @@ 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() { - testWidgets( + testWidgetsWithLeakTracking( 'Material2 - RichText TextSpan styles with different locales', (WidgetTester tester) async { @@ -60,7 +60,7 @@ void main() { }, ); - testWidgets( + testWidgetsWithLeakTracking( 'Material3 - RichText TextSpan styles with different locales', (WidgetTester tester) async { @@ -106,7 +106,7 @@ void main() { }, ); - testWidgets( + testWidgetsWithLeakTracking( 'Material2 - Text with locale-specific glyphs, ambient locale', (WidgetTester tester) async { await tester.pumpWidget( @@ -158,7 +158,7 @@ void main() { }, ); - testWidgets( + testWidgetsWithLeakTracking( 'Material3 - Text with locale-specific glyphs, ambient locale', (WidgetTester tester) async { await tester.pumpWidget( @@ -210,7 +210,7 @@ void main() { }, ); - testWidgets( + testWidgetsWithLeakTracking( 'Material2 - Text with locale-specific glyphs, explicit locale', (WidgetTester tester) async { await tester.pumpWidget( @@ -254,7 +254,7 @@ void main() { }, ); - testWidgets( + testWidgetsWithLeakTracking( '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 b57b69b303..33d1802e97 100644 --- a/packages/flutter/test/rendering/non_normalized_constraints_test.dart +++ b/packages/flutter/test/rendering/non_normalized_constraints_test.dart @@ -3,11 +3,11 @@ // found in the LICENSE file. // THIS TEST IS SENSITIVE TO LINE NUMBERS AT THE TOP OF THIS FILE - 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,7 +32,7 @@ class Foo extends SingleChildRenderObjectWidget { // END OF SENSITIVE SECTION void main() { - testWidgets('Stack parsing in non-normalized constraints error', (WidgetTester tester) async { + testWidgetsWithLeakTracking('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();