diff --git a/packages/flutter/test/cupertino/material/tab_scaffold_test.dart b/packages/flutter/test/cupertino/material/tab_scaffold_test.dart index c965689e5f5c..fd7d60160d98 100644 --- a/packages/flutter/test/cupertino/material/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/material/tab_scaffold_test.dart @@ -7,16 +7,12 @@ 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'; late List selectedTabs; void main() { - // TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean] - LeakTesting.settings = LeakTesting.settings.withIgnoredAll(); - setUp(() { selectedTabs = []; }); @@ -328,6 +324,7 @@ void main() { expect(contents.length, greaterThan(0)); expect(contents, isNot(contains(predicate((RichText t) => t.textScaler != const TextScaler.linear(99.0))))); + imageCache.clear(); }); } diff --git a/packages/flutter/test/material/circle_avatar_test.dart b/packages/flutter/test/material/circle_avatar_test.dart index b3a8a3d3edcd..fb3d2b28e4f6 100644 --- a/packages/flutter/test/material/circle_avatar_test.dart +++ b/packages/flutter/test/material/circle_avatar_test.dart @@ -12,7 +12,6 @@ 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'; @@ -95,10 +94,8 @@ void main() { expect(decoration.image!.fit, equals(BoxFit.cover)); }); - testWidgets('CircleAvatar backgroundImage is used as a fallback for foregroundImage', - // TODO(polina-c): make sure images are disposed, https://github.com/flutter/flutter/issues/141388 [leaks-to-clean] - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('CircleAvatar backgroundImage is used as a fallback for foregroundImage', (WidgetTester tester) async { + addTearDown(imageCache.clear); final ErrorImageProvider errorImage = ErrorImageProvider(); bool caughtForegroundImageError = false; await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/obscured_animated_image_test.dart b/packages/flutter/test/widgets/obscured_animated_image_test.dart index d44a8bad9030..40562e90c1df 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,10 +17,7 @@ Future main() async { final FakeCodec fakeCodec = await FakeCodec.fromData(Uint8List.fromList(kAnimatedGif)); final FakeImageProvider fakeImageProvider = FakeImageProvider(fakeCodec); - testWidgets('Obscured image does not animate', - // TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean] - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('Obscured image does not animate', (WidgetTester tester) async { final GlobalKey imageKey = GlobalKey(); await tester.pumpWidget( MaterialApp( @@ -47,5 +43,6 @@ Future main() async { await tester.pump(const Duration(milliseconds: 100)); final ui.Image? image4 = renderImage.image; expect(image3, same(image4)); + imageCache.clear(); }); } diff --git a/packages/flutter/test/widgets/shape_decoration_test.dart b/packages/flutter/test/widgets/shape_decoration_test.dart index b0e7c67bd541..1b49773390f2 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'; @@ -18,10 +17,8 @@ Future main() async { final ui.Image rawImage = await decodeImageFromList(Uint8List.fromList(kTransparentImage)); final ImageProvider image = TestImageProvider(0, 0, image: rawImage); - testWidgets('ShapeDecoration.image', - // TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean] - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('ShapeDecoration.image', (WidgetTester tester) async { + addTearDown(imageCache.clear); await tester.pumpWidget( MaterialApp( home: DecoratedBox( @@ -94,10 +91,8 @@ Future main() async { ); }); - testWidgets('TestBorder and Directionality - 2', - // TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean] - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('TestBorder and Directionality - 2', (WidgetTester tester) async { + addTearDown(imageCache.clear); final List log = []; await tester.pumpWidget( Directionality(