diff --git a/packages/flutter/test/painting/_network_image_test_web.dart b/packages/flutter/test/painting/_network_image_test_web.dart index 307d6f9108..942fa579bf 100644 --- a/packages/flutter/test/painting/_network_image_test_web.dart +++ b/packages/flutter/test/painting/_network_image_test_web.dart @@ -6,17 +6,17 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/src/painting/_network_image_web.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; import '../image_data.dart'; import '_test_http_request.dart'; - void runTests() { tearDown(() { debugRestoreHttpRequestFactory(); }); - testWidgets('loads an image from the network with headers', + testWidgetsWithLeakTracking('loads an image from the network with headers', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 200 @@ -42,7 +42,7 @@ void runTests() { assert(mapEquals(testHttpRequest.responseHeaders, headers), true); }); - testWidgets('loads an image from the network with unsuccessful HTTP code', + testWidgetsWithLeakTracking('loads an image from the network with unsuccessful HTTP code', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 404 @@ -67,7 +67,7 @@ void runTests() { expect((tester.takeException() as web.ProgressEvent).type, 'test error'); }); - testWidgets('loads an image from the network with empty response', + testWidgetsWithLeakTracking('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 b594ac8097..f865fbde0e 100644 --- a/packages/flutter/test/painting/binding_test.dart +++ b/packages/flutter/test/painting/binding_test.dart @@ -10,11 +10,12 @@ 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 main() async { final ui.Image image = await createTestImage(); - testWidgets('didHaveMemoryPressure clears imageCache', (WidgetTester tester) async { + testWidgetsWithLeakTracking('didHaveMemoryPressure clears imageCache', (WidgetTester tester) async { imageCache.putIfAbsent(1, () => OneFrameImageStreamCompleter( Future.value(ImageInfo( image: image, diff --git a/packages/flutter/test/painting/border_test.dart b/packages/flutter/test/painting/border_test.dart index e4298f8c54..96079e0c4f 100644 --- a/packages/flutter/test/painting/border_test.dart +++ b/packages/flutter/test/painting/border_test.dart @@ -4,6 +4,7 @@ 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 invocations = []; @@ -316,7 +317,7 @@ void main() { expect(nonUniformBorderDirectional.dimensions, const EdgeInsetsDirectional.fromSTEB(5, 5, 0, 20)); }); - testWidgets('Non-Uniform Border variations', (WidgetTester tester) async { + testWidgetsWithLeakTracking('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 3087119c9f..dbf334d833 100644 --- a/packages/flutter/test/painting/box_painter_test.dart +++ b/packages/flutter/test/painting/box_painter_test.dart @@ -9,6 +9,7 @@ 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(() { @@ -160,7 +161,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)')); }); - testWidgets('BoxShadow BoxStyle.solid', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.solid', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -192,7 +193,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.outer', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.outer', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -224,7 +225,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.inner', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.inner', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -256,7 +257,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.normal', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.normal', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -288,7 +289,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.normal.wide_radius', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.normal.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -321,7 +322,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.outer.wide_radius', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.outer.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -354,7 +355,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.solid.wide_radius', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.solid.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( @@ -386,7 +387,7 @@ void main() { debugDisableShadows = true; }); - testWidgets('BoxShadow BoxStyle.inner.wide_radius', (WidgetTester tester) async { + testWidgetsWithLeakTracking('BoxShadow BoxStyle.inner.wide_radius', (WidgetTester tester) async { final Key key = UniqueKey(); debugDisableShadows = false; await tester.pumpWidget( diff --git a/packages/flutter/test/painting/flutter_logo_test.dart b/packages/flutter/test/painting/flutter_logo_test.dart index 434e2d9d47..220137bb7d 100644 --- a/packages/flutter/test/painting/flutter_logo_test.dart +++ b/packages/flutter/test/painting/flutter_logo_test.dart @@ -9,6 +9,7 @@ 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 @@ -85,7 +86,7 @@ void main() { ); }); - testWidgets('Flutter Logo golden test', (WidgetTester tester) async { + testWidgetsWithLeakTracking('Flutter Logo golden test', (WidgetTester tester) async { final Key logo = UniqueKey(); await tester.pumpWidget(Container( key: logo,