Unverified Commit 6dff3da3 authored by Polina Cherkasova's avatar Polina Cherkasova Committed by GitHub

Organize leak tracking TODOs. (#142460)

parent 5c64d037
...@@ -79,7 +79,7 @@ void main() { ...@@ -79,7 +79,7 @@ void main() {
}, skip: true); // Typically skip: isBrowser https://github.com/flutter/flutter/issues/42767 }, skip: true); // Typically skip: isBrowser https://github.com/flutter/flutter/issues/42767
testWidgets('Should show event indicator for pointer events with setSurfaceSize', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(200, 200), allLayers: true); final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(frameSize: const Size(200, 200), allLayers: true);
......
...@@ -36,7 +36,7 @@ void main() { ...@@ -36,7 +36,7 @@ void main() {
void uiTestGroup() { void uiTestGroup() {
testWidgets("doesn't invoke anything without user interaction", 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
......
...@@ -96,7 +96,7 @@ void main() { ...@@ -96,7 +96,7 @@ void main() {
}); });
testWidgets('CircleAvatar backgroundImage is used as a fallback for foregroundImage', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final ErrorImageProvider errorImage = ErrorImageProvider(); final ErrorImageProvider errorImage = ErrorImageProvider();
......
...@@ -170,7 +170,7 @@ void main() { ...@@ -170,7 +170,7 @@ void main() {
void runAllTests({ required bool useMaterial3 }) { void runAllTests({ required bool useMaterial3 }) {
testWidgets('InputDecorator input/label text layout', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
// The label appears above the input text // The label appears above the input text
......
...@@ -2207,7 +2207,7 @@ void main() { ...@@ -2207,7 +2207,7 @@ void main() {
testWidgets( testWidgets(
'didUpdate bottomSheet while a previous bottom sheet is still displayed', '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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final GlobalKey<ScaffoldState> key = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> key = GlobalKey<ScaffoldState>();
......
...@@ -18,7 +18,7 @@ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; ...@@ -18,7 +18,7 @@ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
void main() { void main() {
testWidgets('ImageDecoration.lerp', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final MemoryImage green = MemoryImage(Uint8List.fromList(<int>[ final MemoryImage green = MemoryImage(Uint8List.fromList(<int>[
...@@ -195,7 +195,7 @@ void main() { ...@@ -195,7 +195,7 @@ void main() {
}, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609 }, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609
testWidgets('ImageDecoration.lerp', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final MemoryImage cmyk = MemoryImage(Uint8List.fromList(<int>[ final MemoryImage cmyk = MemoryImage(Uint8List.fromList(<int>[
...@@ -416,7 +416,7 @@ void main() { ...@@ -416,7 +416,7 @@ void main() {
}, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609 }, skip: kIsWeb); // TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609
testWidgets('ImageDecoration.lerp with colored background', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final MemoryImage cmyk = MemoryImage(Uint8List.fromList(<int>[ final MemoryImage cmyk = MemoryImage(Uint8List.fromList(<int>[
......
...@@ -78,7 +78,7 @@ class FakeEventReportingImageStreamCompleter extends ImageStreamCompleter { ...@@ -78,7 +78,7 @@ class FakeEventReportingImageStreamCompleter extends ImageStreamCompleter {
} }
void main() { 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(); LeakTesting.settings = LeakTesting.settings.withIgnoredAll();
late Image image20x10; late Image image20x10;
......
...@@ -38,7 +38,7 @@ Future<void> verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(WidgetTester t ...@@ -38,7 +38,7 @@ Future<void> verifyMarkedNeedsLayoutDuringTransientCallbacksPhase(WidgetTester t
void main() { void main() {
testWidgets('RenderParagraph relayout upon system fonts changes', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
......
...@@ -11,7 +11,7 @@ import '../widgets/semantics_tester.dart'; ...@@ -11,7 +11,7 @@ import '../widgets/semantics_tester.dart';
void main() { void main() {
testWidgets('SemanticsNodes overlapping in z', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
// Cards are semantic boundaries that always own their own SemanticNode, // Cards are semantic boundaries that always own their own SemanticNode,
......
...@@ -22,7 +22,7 @@ import 'semantics_tester.dart'; ...@@ -22,7 +22,7 @@ import 'semantics_tester.dart';
void main() { void main() {
group('RawImage', () { group('RawImage', () {
testWidgets('properties', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final ui.Image image1 = (await tester.runAsync<ui.Image>(() => createTestImage()))!; final ui.Image image1 = (await tester.runAsync<ui.Image>(() => createTestImage()))!;
......
...@@ -92,7 +92,7 @@ void main() { ...@@ -92,7 +92,7 @@ void main() {
}); });
testWidgets('A menu can be hidden and then reshown', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final GlobalKey key1 = GlobalKey(); final GlobalKey key1 = GlobalKey();
...@@ -183,7 +183,7 @@ void main() { ...@@ -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', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final GlobalKey builtInKey = GlobalKey(); final GlobalKey builtInKey = GlobalKey();
......
...@@ -3432,7 +3432,7 @@ void main() { ...@@ -3432,7 +3432,7 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/92083 // Regression test for https://github.com/flutter/flutter/issues/92083
testWidgets('feedback respect the MouseRegion cursor configure', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
......
...@@ -798,7 +798,7 @@ void main() { ...@@ -798,7 +798,7 @@ void main() {
}); });
testWidgets('Precache', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final _TestImageProvider provider = _TestImageProvider(); final _TestImageProvider provider = _TestImageProvider();
...@@ -823,7 +823,7 @@ void main() { ...@@ -823,7 +823,7 @@ void main() {
}); });
testWidgets('Precache removes original listener immediately after future completes, does not crash on successive calls #25143', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter(); final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter();
...@@ -1021,7 +1021,7 @@ void main() { ...@@ -1021,7 +1021,7 @@ void main() {
}); });
testWidgets('Image invokes frameBuilder with correct frameNumber argument', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final ui.Codec codec = (await tester.runAsync(() { final ui.Codec codec = (await tester.runAsync(() {
...@@ -1093,7 +1093,7 @@ void main() { ...@@ -1093,7 +1093,7 @@ void main() {
}); });
testWidgets('Image invokes frameBuilder with correct wasSynchronouslyLoaded=true', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(ImageInfo(image: image10x10.clone())); final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(ImageInfo(image: image10x10.clone()));
...@@ -1154,7 +1154,7 @@ void main() { ...@@ -1154,7 +1154,7 @@ void main() {
}); });
testWidgets('Image state handles enabling and disabling of tickers', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final ui.Codec codec = (await tester.runAsync(() { final ui.Codec codec = (await tester.runAsync(() {
...@@ -1565,7 +1565,7 @@ void main() { ...@@ -1565,7 +1565,7 @@ void main() {
}); });
testWidgets('precacheImage does not hold weak ref for more than a frame', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
imageCache.maximumSize = 0; imageCache.maximumSize = 0;
...@@ -1619,7 +1619,7 @@ void main() { ...@@ -1619,7 +1619,7 @@ void main() {
}); });
testWidgets('precacheImage allows time to take over weak reference', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final _TestImageProvider provider = _TestImageProvider(); final _TestImageProvider provider = _TestImageProvider();
...@@ -1673,7 +1673,7 @@ void main() { ...@@ -1673,7 +1673,7 @@ void main() {
}); });
testWidgets('evict an image during precache', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
// This test checks that the live image tracking does not hold on to a // This test checks that the live image tracking does not hold on to a
...@@ -1790,7 +1790,7 @@ void main() { ...@@ -1790,7 +1790,7 @@ void main() {
testWidgets( testWidgets(
'Rotated images', '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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await testRotatedImage(tester, true); await testRotatedImage(tester, true);
...@@ -1801,7 +1801,7 @@ void main() { ...@@ -1801,7 +1801,7 @@ void main() {
testWidgets( testWidgets(
'Image opacity', '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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final Key key = UniqueKey(); final Key key = UniqueKey();
...@@ -1852,7 +1852,7 @@ void main() { ...@@ -1852,7 +1852,7 @@ void main() {
); );
testWidgets('Reports image size when painted', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
late ImageSizeInfo imageSizeInfo; late ImageSizeInfo imageSizeInfo;
...@@ -1964,7 +1964,7 @@ void main() { ...@@ -1964,7 +1964,7 @@ void main() {
}); });
testWidgets('Load a good image after a bad image was loaded should not call errorBuilder', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final UniqueKey errorKey = UniqueKey(); final UniqueKey errorKey = UniqueKey();
......
...@@ -534,10 +534,7 @@ void main() { ...@@ -534,10 +534,7 @@ void main() {
expect(find.text('ddd1'), findsOneWidget); expect(find.text('ddd1'), findsOneWidget);
}); });
testWidgets('Three NestedScrollViews with one ScrollController', testWidgets('Three NestedScrollViews with one ScrollController', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
final TrackingScrollController controller = TrackingScrollController(); final TrackingScrollController controller = TrackingScrollController();
addTearDown(controller.dispose); addTearDown(controller.dispose);
expect(controller.mostRecentlyUpdatedPosition, isNull); expect(controller.mostRecentlyUpdatedPosition, isNull);
......
...@@ -293,7 +293,7 @@ void main() { ...@@ -293,7 +293,7 @@ void main() {
}); });
testWidgets('Nested overscrolls do not throw exceptions', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget(Directionality( await tester.pumpWidget(Directionality(
......
...@@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; ...@@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.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 '../rendering/rendering_tester.dart' show TestClipPaintingContext;
import 'semantics_tester.dart'; import 'semantics_tester.dart';
...@@ -15,10 +14,7 @@ import 'states.dart'; ...@@ -15,10 +14,7 @@ import 'states.dart';
void main() { void main() {
// Regression test for https://github.com/flutter/flutter/issues/100451 // Regression test for https://github.com/flutter/flutter/issues/100451
testWidgets('PageView.builder respects findChildIndexCallback', testWidgets('PageView.builder respects findChildIndexCallback', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
bool finderCalled = false; bool finderCalled = false;
int itemCount = 7; int itemCount = 7;
late StateSetter stateSetter; late StateSetter stateSetter;
...@@ -333,10 +329,7 @@ void main() { ...@@ -333,10 +329,7 @@ void main() {
expect(find.text('California'), findsOneWidget); expect(find.text('California'), findsOneWidget);
}); });
testWidgets('PageController page stability', testWidgets('PageController page stability', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
await tester.pumpWidget(Directionality( await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
...@@ -422,10 +415,7 @@ void main() { ...@@ -422,10 +415,7 @@ void main() {
expect(previousPageCompleted, true); expect(previousPageCompleted, true);
}); });
testWidgets('PageView in zero-size container', testWidgets('PageView in zero-size container', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
await tester.pumpWidget(Directionality( await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
...@@ -605,10 +595,7 @@ void main() { ...@@ -605,10 +595,7 @@ void main() {
expect(tester.getTopLeft(find.text('Idaho')), const Offset(790.0, 0.0)); expect(tester.getTopLeft(find.text('Idaho')), const Offset(790.0, 0.0));
}); });
testWidgets('Page snapping disable and reenable', testWidgets('Page snapping disable and reenable', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
final List<int> log = <int>[]; final List<int> log = <int>[];
Widget build({ required bool pageSnapping }) { Widget build({ required bool pageSnapping }) {
...@@ -1333,20 +1320,20 @@ void main() { ...@@ -1333,20 +1320,20 @@ void main() {
} }
Future<void> testPageViewWithController(PageController controller, WidgetTester tester, bool controls) async { Future<void> testPageViewWithController(PageController controller, WidgetTester tester, bool controls) async {
int curentVisiblePage() { int currentVisiblePage() {
return int.parse(tester.widgetList(find.byType(Text)).whereType<Text>().first.data!); return int.parse(tester.widgetList(find.byType(Text)).whereType<Text>().first.data!);
} }
final int initialPageInView = curentVisiblePage(); final int initialPageInView = currentVisiblePage();
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
if (controls) { if (controls) {
controller.jumpToPage(i); controller.jumpToPage(i);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(curentVisiblePage(), i); expect(currentVisiblePage(), i);
} else { } else {
expect(()=> controller.jumpToPage(i), throwsAssertionError); expect(()=> controller.jumpToPage(i), throwsAssertionError);
expect(curentVisiblePage(), initialPageInView); expect(currentVisiblePage(), initialPageInView);
} }
} }
} }
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.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); Size pageSize = const Size(600.0, 300.0);
const List<int> defaultPages = <int>[0, 1, 2, 3, 4, 5]; const List<int> defaultPages = <int>[0, 1, 2, 3, 4, 5];
...@@ -60,10 +59,7 @@ Future<void> pageRight(WidgetTester tester) { ...@@ -60,10 +59,7 @@ Future<void> pageRight(WidgetTester tester) {
} }
void main() { void main() {
testWidgets('PageView default control', testWidgets('PageView default control', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
......
...@@ -35,7 +35,7 @@ void main() { ...@@ -35,7 +35,7 @@ void main() {
} }
testWidgets('ScrollAwareImageProvider does not delay if widget is not in scrollable', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>();
...@@ -65,7 +65,10 @@ void main() { ...@@ -65,7 +65,10 @@ void main() {
expect(imageCache.currentSize, 1); 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<TestWidgetState> key = GlobalKey<TestWidgetState>(); final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>();
await tester.pumpWidget(Directionality( await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -103,7 +106,7 @@ void main() { ...@@ -103,7 +106,7 @@ void main() {
}); });
testWidgets('ScrollAwareImageProvider does not delay if in scrollable that is scrolling slowly', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[]; final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[];
...@@ -234,7 +237,7 @@ void main() { ...@@ -234,7 +237,7 @@ void main() {
}); });
testWidgets('ScrollAwareImageProvider delays if in scrollable that is scrolling fast and fizzles if disposed', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[]; final List<GlobalKey<TestWidgetState>> keys = <GlobalKey<TestWidgetState>>[];
...@@ -308,7 +311,7 @@ void main() { ...@@ -308,7 +311,7 @@ void main() {
}); });
testWidgets('ScrollAwareImageProvider resolves from ImageCache and does not set completer twice', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>();
...@@ -361,7 +364,7 @@ void main() { ...@@ -361,7 +364,7 @@ void main() {
}); });
testWidgets('ScrollAwareImageProvider does not block LRU updates to image cache', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final int oldSize = imageCache.maximumSize; final int oldSize = imageCache.maximumSize;
......
...@@ -264,7 +264,7 @@ void main() { ...@@ -264,7 +264,7 @@ void main() {
}); });
testWidgets('PageView restoration', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
...@@ -282,10 +282,7 @@ void main() { ...@@ -282,10 +282,7 @@ void main() {
await pageViewScrollAndRestore(tester); await pageViewScrollAndRestore(tester);
}); });
testWidgets('PageView.builder restoration', testWidgets('PageView.builder restoration', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
TestHarness( TestHarness(
child: PageView.builder( child: PageView.builder(
...@@ -301,10 +298,7 @@ void main() { ...@@ -301,10 +298,7 @@ void main() {
await pageViewScrollAndRestore(tester); await pageViewScrollAndRestore(tester);
}); });
testWidgets('PageView.custom restoration', testWidgets('PageView.custom restoration', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
TestHarness( TestHarness(
child: PageView.custom( child: PageView.custom(
......
...@@ -54,7 +54,7 @@ void _tests() { ...@@ -54,7 +54,7 @@ void _tests() {
// //
// This test is flexible w.r.t. leading and trailing whitespace. // This test is flexible w.r.t. leading and trailing whitespace.
testWidgets('generates code', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester); final SemanticsTester semantics = SemanticsTester(tester);
......
...@@ -19,7 +19,7 @@ Future<void> main() async { ...@@ -19,7 +19,7 @@ Future<void> main() async {
final ImageProvider image = TestImageProvider(0, 0, image: rawImage); final ImageProvider image = TestImageProvider(0, 0, image: rawImage);
testWidgets('ShapeDecoration.image', 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(), experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
......
...@@ -4,13 +4,9 @@ ...@@ -4,13 +4,9 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:leak_tracker_testing/leak_tracker_testing.dart';
void main() { void main() {
testWidgets('TrackingScrollController saves offset', testWidgets('TrackingScrollController saves offset', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
final TrackingScrollController controller = TrackingScrollController(); final TrackingScrollController controller = TrackingScrollController();
addTearDown(controller.dispose); addTearDown(controller.dispose);
const double listItemHeight = 100.0; const double listItemHeight = 100.0;
...@@ -64,10 +60,7 @@ void main() { ...@@ -64,10 +60,7 @@ void main() {
expect(controller.initialScrollOffset, 0.0); expect(controller.initialScrollOffset, 0.0);
}); });
testWidgets('TrackingScrollController saves offset', testWidgets('TrackingScrollController saves offset', (WidgetTester tester) async {
// TODO(polina-c): Remove when PageView is fixed, https://github.com/flutter/flutter/issues/141119
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
int attach = 0; int attach = 0;
int detach = 0; int detach = 0;
final TrackingScrollController controller = TrackingScrollController( final TrackingScrollController controller = TrackingScrollController(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment