From 6dff3da31cd08233d2d8fbf13ed4ddf6a79004d9 Mon Sep 17 00:00:00 2001 From: Polina Cherkasova Date: Mon, 29 Jan 2024 21:21:34 -0800 Subject: [PATCH] Organize leak tracking TODOs. (#142460) --- .../test/animation/live_binding_test.dart | 2 +- .../flutter/test/cupertino/refresh_test.dart | 2 +- .../test/material/circle_avatar_test.dart | 2 +- .../test/material/input_decorator_test.dart | 2 +- .../flutter/test/material/scaffold_test.dart | 2 +- .../painting/decoration_image_lerp_test.dart | 6 ++-- .../test/painting/image_stream_test.dart | 2 +- .../test/painting/system_fonts_test.dart | 2 +- .../semantics/semantics_elevation_test.dart | 2 +- packages/flutter/test/widgets/basic_test.dart | 2 +- .../widgets/context_menu_controller_test.dart | 4 +-- .../flutter/test/widgets/draggable_test.dart | 2 +- packages/flutter/test/widgets/image_test.dart | 24 +++++++-------- .../test/widgets/nested_scroll_view_test.dart | 5 +--- .../widgets/overscroll_indicator_test.dart | 2 +- .../flutter/test/widgets/page_view_test.dart | 29 +++++-------------- .../test/widgets/pageable_list_test.dart | 6 +--- .../scroll_aware_image_provider_test.dart | 15 ++++++---- .../widgets/scrollable_restoration_test.dart | 12 ++------ ...ssion_for_current_semantics_tree_test.dart | 2 +- .../test/widgets/shape_decoration_test.dart | 2 +- .../tracking_scroll_controller_test.dart | 11 ++----- 22 files changed, 54 insertions(+), 84 deletions(-) diff --git a/packages/flutter/test/animation/live_binding_test.dart b/packages/flutter/test/animation/live_binding_test.dart index 60f8401a194..33692e66eed 100644 --- a/packages/flutter/test/animation/live_binding_test.dart +++ b/packages/flutter/test/animation/live_binding_test.dart @@ -79,7 +79,7 @@ void main() { }, skip: true); // Typically skip: isBrowser https://github.com/flutter/flutter/issues/42767 testWidgets('Should show event indicator for pointer events with setSurfaceSize', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(200, 200), allLayers: true); diff --git a/packages/flutter/test/cupertino/refresh_test.dart b/packages/flutter/test/cupertino/refresh_test.dart index 7a4b37ae73a..fb66030fe7d 100644 --- a/packages/flutter/test/cupertino/refresh_test.dart +++ b/packages/flutter/test/cupertino/refresh_test.dart @@ -36,7 +36,7 @@ void main() { void uiTestGroup() { testWidgets("doesn't invoke anything without user interaction", - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/material/circle_avatar_test.dart b/packages/flutter/test/material/circle_avatar_test.dart index 72b297516c0..6fafdfb8886 100644 --- a/packages/flutter/test/material/circle_avatar_test.dart +++ b/packages/flutter/test/material/circle_avatar_test.dart @@ -96,7 +96,7 @@ void main() { }); testWidgets('CircleAvatar backgroundImage is used as a fallback for foregroundImage', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final ErrorImageProvider errorImage = ErrorImageProvider(); diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 986d867bbce..26922efed16 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -170,7 +170,7 @@ void main() { void runAllTests({ required bool useMaterial3 }) { testWidgets('InputDecorator input/label text layout', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { // The label appears above the input text diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index d1aab5b5087..7fc2ff30146 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -2207,7 +2207,7 @@ void main() { testWidgets( 'didUpdate bottomSheet while a previous bottom sheet is still displayed', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final GlobalKey key = GlobalKey(); diff --git a/packages/flutter/test/painting/decoration_image_lerp_test.dart b/packages/flutter/test/painting/decoration_image_lerp_test.dart index 7b9ec33d47b..fbdc03918f5 100644 --- a/packages/flutter/test/painting/decoration_image_lerp_test.dart +++ b/packages/flutter/test/painting/decoration_image_lerp_test.dart @@ -18,7 +18,7 @@ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { testWidgets('ImageDecoration.lerp', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final MemoryImage green = MemoryImage(Uint8List.fromList([ @@ -195,7 +195,7 @@ void main() { }, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609 testWidgets('ImageDecoration.lerp', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final MemoryImage cmyk = MemoryImage(Uint8List.fromList([ @@ -416,7 +416,7 @@ void main() { }, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609 testWidgets('ImageDecoration.lerp with colored background', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final MemoryImage cmyk = MemoryImage(Uint8List.fromList([ diff --git a/packages/flutter/test/painting/image_stream_test.dart b/packages/flutter/test/painting/image_stream_test.dart index 615596e4b81..e29cd450527 100644 --- a/packages/flutter/test/painting/image_stream_test.dart +++ b/packages/flutter/test/painting/image_stream_test.dart @@ -78,7 +78,7 @@ class FakeEventReportingImageStreamCompleter extends ImageStreamCompleter { } void main() { - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] LeakTesting.settings = LeakTesting.settings.withIgnoredAll(); late Image image20x10; diff --git a/packages/flutter/test/painting/system_fonts_test.dart b/packages/flutter/test/painting/system_fonts_test.dart index c4a43b875cc..3aa495a86fd 100644 --- a/packages/flutter/test/painting/system_fonts_test.dart +++ b/packages/flutter/test/painting/system_fonts_test.dart @@ -38,7 +38,7 @@ Future verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(WidgetTester t void main() { testWidgets('RenderParagraph relayout upon system fonts changes', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/semantics/semantics_elevation_test.dart b/packages/flutter/test/semantics/semantics_elevation_test.dart index 34eea21fa95..b9d37d0bc60 100644 --- a/packages/flutter/test/semantics/semantics_elevation_test.dart +++ b/packages/flutter/test/semantics/semantics_elevation_test.dart @@ -11,7 +11,7 @@ import '../widgets/semantics_tester.dart'; void main() { testWidgets('SemanticsNodes overlapping in z', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { // Cards are semantic boundaries that always own their own SemanticNode, diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart index e15a01c097c..b33885dc093 100644 --- a/packages/flutter/test/widgets/basic_test.dart +++ b/packages/flutter/test/widgets/basic_test.dart @@ -22,7 +22,7 @@ import 'semantics_tester.dart'; void main() { group('RawImage', () { testWidgets('properties', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final ui.Image image1 = (await tester.runAsync(() => createTestImage()))!; diff --git a/packages/flutter/test/widgets/context_menu_controller_test.dart b/packages/flutter/test/widgets/context_menu_controller_test.dart index 71ddff69947..a161f439458 100644 --- a/packages/flutter/test/widgets/context_menu_controller_test.dart +++ b/packages/flutter/test/widgets/context_menu_controller_test.dart @@ -92,7 +92,7 @@ void main() { }); testWidgets('A menu can be hidden and then reshown', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); @@ -183,7 +183,7 @@ void main() { }); testWidgets('Calling show when a built-in widget is already showing its context menu hides the built-in menu', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final GlobalKey builtInKey = GlobalKey(); diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 5af50d9af42..04d30b64b72 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -3432,7 +3432,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/92083 testWidgets('feedback respect the MouseRegion cursor configure', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/image_test.dart b/packages/flutter/test/widgets/image_test.dart index ec281efca50..34b6e024fda 100644 --- a/packages/flutter/test/widgets/image_test.dart +++ b/packages/flutter/test/widgets/image_test.dart @@ -798,7 +798,7 @@ void main() { }); testWidgets('Precache', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageProvider provider = _TestImageProvider(); @@ -823,7 +823,7 @@ void main() { }); testWidgets('Precache removes original listener immediately after future completes, does not crash on successive calls #25143', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter(); @@ -1021,7 +1021,7 @@ void main() { }); testWidgets('Image invokes frameBuilder with correct frameNumber argument', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final ui.Codec codec = (await tester.runAsync(() { @@ -1093,7 +1093,7 @@ void main() { }); testWidgets('Image invokes frameBuilder with correct wasSynchronouslyLoaded=true', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(ImageInfo(image: image10x10.clone())); @@ -1154,7 +1154,7 @@ void main() { }); testWidgets('Image state handles enabling and disabling of tickers', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final ui.Codec codec = (await tester.runAsync(() { @@ -1565,7 +1565,7 @@ void main() { }); testWidgets('precacheImage does not hold weak ref for more than a frame', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { imageCache.maximumSize = 0; @@ -1619,7 +1619,7 @@ void main() { }); testWidgets('precacheImage allows time to take over weak reference', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageProvider provider = _TestImageProvider(); @@ -1673,7 +1673,7 @@ void main() { }); testWidgets('evict an image during precache', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { // This test checks that the live image tracking does not hold on to a @@ -1790,7 +1790,7 @@ void main() { testWidgets( 'Rotated images', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await testRotatedImage(tester, true); @@ -1801,7 +1801,7 @@ void main() { testWidgets( 'Image opacity', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final Key key = UniqueKey(); @@ -1852,7 +1852,7 @@ void main() { ); testWidgets('Reports image size when painted', - // TODO(polina-c): make sure images are disposed, https://github.com/flutter/flutter/issues/141388 + // 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 { late ImageSizeInfo imageSizeInfo; @@ -1964,7 +1964,7 @@ void main() { }); testWidgets('Load a good image after a bad image was loaded should not call errorBuilder', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final UniqueKey errorKey = UniqueKey(); diff --git a/packages/flutter/test/widgets/nested_scroll_view_test.dart b/packages/flutter/test/widgets/nested_scroll_view_test.dart index fbf84f5188f..94a4d16137a 100644 --- a/packages/flutter/test/widgets/nested_scroll_view_test.dart +++ b/packages/flutter/test/widgets/nested_scroll_view_test.dart @@ -534,10 +534,7 @@ void main() { expect(find.text('ddd1'), findsOneWidget); }); - testWidgets('Three NestedScrollViews with one ScrollController', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('Three NestedScrollViews with one ScrollController', (WidgetTester tester) async { final TrackingScrollController controller = TrackingScrollController(); addTearDown(controller.dispose); expect(controller.mostRecentlyUpdatedPosition, isNull); diff --git a/packages/flutter/test/widgets/overscroll_indicator_test.dart b/packages/flutter/test/widgets/overscroll_indicator_test.dart index 659c4bc4c4d..b647416216e 100644 --- a/packages/flutter/test/widgets/overscroll_indicator_test.dart +++ b/packages/flutter/test/widgets/overscroll_indicator_test.dart @@ -293,7 +293,7 @@ void main() { }); testWidgets('Nested overscrolls do not throw exceptions', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await tester.pumpWidget(Directionality( diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index 3dd159355ee..aa6d305a307 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,10 +14,7 @@ import 'states.dart'; void main() { // Regression test for https://github.com/flutter/flutter/issues/100451 - testWidgets('PageView.builder respects findChildIndexCallback', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('PageView.builder respects findChildIndexCallback', (WidgetTester tester) async { bool finderCalled = false; int itemCount = 7; late StateSetter stateSetter; @@ -333,10 +329,7 @@ void main() { expect(find.text('California'), findsOneWidget); }); - testWidgets('PageController page stability', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('PageController page stability', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Center( @@ -422,10 +415,7 @@ void main() { expect(previousPageCompleted, true); }); - testWidgets('PageView in zero-size container', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('PageView in zero-size container', (WidgetTester tester) async { await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Center( @@ -605,10 +595,7 @@ void main() { expect(tester.getTopLeft(find.text('Idaho')), const Offset(790.0, 0.0)); }); - testWidgets('Page snapping disable and reenable', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('Page snapping disable and reenable', (WidgetTester tester) async { final List log = []; Widget build({ required bool pageSnapping }) { @@ -1333,20 +1320,20 @@ void main() { } Future testPageViewWithController(PageController controller, WidgetTester tester, bool controls) async { - int curentVisiblePage() { + int currentVisiblePage() { return int.parse(tester.widgetList(find.byType(Text)).whereType().first.data!); } - final int initialPageInView = curentVisiblePage(); + final int initialPageInView = currentVisiblePage(); for (int i = 0; i < 3; i++) { if (controls) { controller.jumpToPage(i); await tester.pumpAndSettle(); - expect(curentVisiblePage(), i); + expect(currentVisiblePage(), i); } else { expect(()=> controller.jumpToPage(i), throwsAssertionError); - expect(curentVisiblePage(), initialPageInView); + expect(currentVisiblePage(), initialPageInView); } } } diff --git a/packages/flutter/test/widgets/pageable_list_test.dart b/packages/flutter/test/widgets/pageable_list_test.dart index 135fe7e5c4e..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 defaultPages = [0, 1, 2, 3, 4, 5]; @@ -60,10 +59,7 @@ Future pageRight(WidgetTester tester) { } void main() { - testWidgets('PageView default control', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('PageView default control', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, 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 e5f1e8b6b84..d0968ec32b8 100644 --- a/packages/flutter/test/widgets/scroll_aware_image_provider_test.dart +++ b/packages/flutter/test/widgets/scroll_aware_image_provider_test.dart @@ -35,7 +35,7 @@ void main() { } testWidgets('ScrollAwareImageProvider does not delay if widget is not in scrollable', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final GlobalKey key = GlobalKey(); @@ -65,7 +65,10 @@ void main() { expect(imageCache.currentSize, 1); }); - testWidgets('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', + // 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 { final GlobalKey key = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -103,7 +106,7 @@ void main() { }); testWidgets('ScrollAwareImageProvider does not delay if in scrollable that is scrolling slowly', - // TODO(polina-c): make sure images are disposed, https://github.com/flutter/flutter/issues/141388 + // 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 { final List> keys = >[]; @@ -234,7 +237,7 @@ void main() { }); testWidgets('ScrollAwareImageProvider delays if in scrollable that is scrolling fast and fizzles if disposed', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final List> keys = >[]; @@ -308,7 +311,7 @@ void main() { }); testWidgets('ScrollAwareImageProvider resolves from ImageCache and does not set completer twice', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final GlobalKey key = GlobalKey(); @@ -361,7 +364,7 @@ void main() { }); testWidgets('ScrollAwareImageProvider does not block LRU updates to image cache', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final int oldSize = imageCache.maximumSize; diff --git a/packages/flutter/test/widgets/scrollable_restoration_test.dart b/packages/flutter/test/widgets/scrollable_restoration_test.dart index 7fc94780776..d0b72937c49 100644 --- a/packages/flutter/test/widgets/scrollable_restoration_test.dart +++ b/packages/flutter/test/widgets/scrollable_restoration_test.dart @@ -264,7 +264,7 @@ void main() { }); testWidgets('PageView restoration', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await tester.pumpWidget( @@ -282,10 +282,7 @@ void main() { await pageViewScrollAndRestore(tester); }); - testWidgets('PageView.builder restoration', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('PageView.builder restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: PageView.builder( @@ -301,10 +298,7 @@ void main() { await pageViewScrollAndRestore(tester); }); - testWidgets('PageView.custom restoration', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('PageView.custom restoration', (WidgetTester tester) async { await tester.pumpWidget( TestHarness( child: PageView.custom( 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 57f2c5740c0..1f3267983bf 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 @@ -54,7 +54,7 @@ void _tests() { // // This test is flexible w.r.t. leading and trailing whitespace. testWidgets('generates code', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); diff --git a/packages/flutter/test/widgets/shape_decoration_test.dart b/packages/flutter/test/widgets/shape_decoration_test.dart index 83def39cb27..1ef7cad4f26 100644 --- a/packages/flutter/test/widgets/shape_decoration_test.dart +++ b/packages/flutter/test/widgets/shape_decoration_test.dart @@ -19,7 +19,7 @@ Future main() async { final ImageProvider image = TestImageProvider(0, 0, image: rawImage); testWidgets('ShapeDecoration.image', - // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 + // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/tracking_scroll_controller_test.dart b/packages/flutter/test/widgets/tracking_scroll_controller_test.dart index d9d8cb1a7d2..884583e1139 100644 --- a/packages/flutter/test/widgets/tracking_scroll_controller_test.dart +++ b/packages/flutter/test/widgets/tracking_scroll_controller_test.dart @@ -4,13 +4,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_testing/leak_tracker_testing.dart'; void main() { - testWidgets('TrackingScrollController saves offset', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('TrackingScrollController saves offset', (WidgetTester tester) async { final TrackingScrollController controller = TrackingScrollController(); addTearDown(controller.dispose); const double listItemHeight = 100.0; @@ -64,10 +60,7 @@ void main() { expect(controller.initialScrollOffset, 0.0); }); - testWidgets('TrackingScrollController saves offset', - // TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119 - experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), - (WidgetTester tester) async { + testWidgets('TrackingScrollController saves offset', (WidgetTester tester) async { int attach = 0; int detach = 0; final TrackingScrollController controller = TrackingScrollController(