Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
94c63f82
Unverified
Commit
94c63f82
authored
Mar 26, 2024
by
Kostia Sokolovskyi
Committed by
GitHub
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory leaks clean up 2 (#145757)
parent
8953ba65
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
7 deletions
+37
-7
box_decoration_test.dart
packages/flutter/test/widgets/box_decoration_test.dart
+9
-2
context_menu_controller_test.dart
...es/flutter/test/widgets/context_menu_controller_test.dart
+1
-0
image_headers_test.dart
packages/flutter/test/widgets/image_headers_test.dart
+5
-1
image_icon_test.dart
packages/flutter/test/widgets/image_icon_test.dart
+9
-2
image_rtl_test.dart
packages/flutter/test/widgets/image_rtl_test.dart
+4
-0
image_test.dart
packages/flutter/test/widgets/image_test.dart
+4
-1
obscured_animated_image_test.dart
...es/flutter/test/widgets/obscured_animated_image_test.dart
+5
-1
No files found.
packages/flutter/test/widgets/box_decoration_test.dart
View file @
94c63f82
...
@@ -9,6 +9,7 @@ import 'dart:ui' as ui show Image;
...
@@ -9,6 +9,7 @@ import 'dart:ui' as ui show Image;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.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
'../image_data.dart'
;
import
'../image_data.dart'
;
...
@@ -36,7 +37,10 @@ Future<void> main() async {
...
@@ -36,7 +37,10 @@ Future<void> main() async {
AutomatedTestWidgetsFlutterBinding
();
AutomatedTestWidgetsFlutterBinding
();
TestImageProvider
.
image
=
await
decodeImageFromList
(
Uint8List
.
fromList
(
kTransparentImage
));
TestImageProvider
.
image
=
await
decodeImageFromList
(
Uint8List
.
fromList
(
kTransparentImage
));
testWidgets
(
'DecoratedBox handles loading images'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'DecoratedBox handles loading images'
,
// TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean]
experimentalLeakTesting:
LeakTesting
.
settings
.
withIgnoredAll
(),
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
final
GlobalKey
key
=
GlobalKey
();
final
Completer
<
void
>
completer
=
Completer
<
void
>();
final
Completer
<
void
>
completer
=
Completer
<
void
>();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -59,7 +63,10 @@ Future<void> main() async {
...
@@ -59,7 +63,10 @@ Future<void> main() async {
expect
(
tester
.
binding
.
hasScheduledFrame
,
isFalse
);
expect
(
tester
.
binding
.
hasScheduledFrame
,
isFalse
);
});
});
testWidgets
(
'Moving a DecoratedBox'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Moving a DecoratedBox'
,
// TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean]
experimentalLeakTesting:
LeakTesting
.
settings
.
withIgnoredAll
(),
(
WidgetTester
tester
)
async
{
final
Completer
<
void
>
completer
=
Completer
<
void
>();
final
Completer
<
void
>
completer
=
Completer
<
void
>();
final
Widget
subtree
=
KeyedSubtree
(
final
Widget
subtree
=
KeyedSubtree
(
key:
GlobalKey
(),
key:
GlobalKey
(),
...
...
packages/flutter/test/widgets/context_menu_controller_test.dart
View file @
94c63f82
...
@@ -110,6 +110,7 @@ void main() {
...
@@ -110,6 +110,7 @@ void main() {
expect
(
find
.
byKey
(
key1
),
findsNothing
);
expect
(
find
.
byKey
(
key1
),
findsNothing
);
final
ContextMenuController
controller
=
ContextMenuController
();
final
ContextMenuController
controller
=
ContextMenuController
();
addTearDown
(
controller
.
remove
);
// Instantiating the controller does not shown it.
// Instantiating the controller does not shown it.
await
tester
.
pump
();
await
tester
.
pump
();
...
...
packages/flutter/test/widgets/image_headers_test.dart
View file @
94c63f82
...
@@ -7,13 +7,17 @@ import 'dart:io';
...
@@ -7,13 +7,17 @@ import 'dart:io';
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'
;
import
'../image_data.dart'
;
import
'../image_data.dart'
;
void
main
(
)
{
void
main
(
)
{
final
MockHttpClient
client
=
MockHttpClient
();
final
MockHttpClient
client
=
MockHttpClient
();
testWidgets
(
'Headers'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Headers'
,
// TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean]
experimentalLeakTesting:
LeakTesting
.
settings
.
withIgnoredAll
(),
(
WidgetTester
tester
)
async
{
HttpOverrides
.
runZoned
<
Future
<
void
>>(()
async
{
HttpOverrides
.
runZoned
<
Future
<
void
>>(()
async
{
await
tester
.
pumpWidget
(
Image
.
network
(
await
tester
.
pumpWidget
(
Image
.
network
(
'https://www.example.com/images/frame.png'
,
'https://www.example.com/images/frame.png'
,
...
...
packages/flutter/test/widgets/image_icon_test.dart
View file @
94c63f82
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
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'
;
import
'../painting/mocks_for_image_cache.dart'
;
import
'../painting/mocks_for_image_cache.dart'
;
...
@@ -20,7 +21,10 @@ void main() {
...
@@ -20,7 +21,10 @@ void main() {
);
);
});
});
testWidgets
(
'ImageIcon sizing - no theme, default size'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ImageIcon sizing - no theme, default size'
,
// TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean]
experimentalLeakTesting:
LeakTesting
.
settings
.
withIgnoredAll
(),
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Center
(
Center
(
child:
ImageIcon
(
image
),
child:
ImageIcon
(
image
),
...
@@ -32,7 +36,10 @@ void main() {
...
@@ -32,7 +36,10 @@ void main() {
expect
(
find
.
byType
(
Image
),
findsOneWidget
);
expect
(
find
.
byType
(
Image
),
findsOneWidget
);
});
});
testWidgets
(
'Icon opacity'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Icon opacity'
,
// TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean]
experimentalLeakTesting:
LeakTesting
.
settings
.
withIgnoredAll
(),
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Center
(
Center
(
child:
IconTheme
(
child:
IconTheme
(
...
...
packages/flutter/test/widgets/image_rtl_test.dart
View file @
94c63f82
...
@@ -7,6 +7,7 @@ import 'dart:ui' as ui show Image;
...
@@ -7,6 +7,7 @@ import 'dart:ui' as ui show Image;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
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'
;
class
TestImageProvider
extends
ImageProvider
<
TestImageProvider
>
{
class
TestImageProvider
extends
ImageProvider
<
TestImageProvider
>
{
const
TestImageProvider
(
this
.
image
);
const
TestImageProvider
(
this
.
image
);
...
@@ -27,6 +28,9 @@ class TestImageProvider extends ImageProvider<TestImageProvider> {
...
@@ -27,6 +28,9 @@ class TestImageProvider extends ImageProvider<TestImageProvider> {
}
}
void
main
(
)
{
void
main
(
)
{
// TODO(polina-c): dispose ImageStreamCompleterHandle, https://github.com/flutter/flutter/issues/145599 [leaks-to-clean]
LeakTesting
.
settings
=
LeakTesting
.
settings
.
withIgnoredAll
();
late
ui
.
Image
testImage
;
late
ui
.
Image
testImage
;
setUpAll
(()
async
{
setUpAll
(()
async
{
...
...
packages/flutter/test/widgets/image_test.dart
View file @
94c63f82
...
@@ -2066,7 +2066,10 @@ void main() {
...
@@ -2066,7 +2066,10 @@ void main() {
);
);
});
});
testWidgets
(
'Animated GIFs do not require layout for subsequent frames'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Animated GIFs do not require layout for subsequent frames'
,
// 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
(()
{
final
ui
.
Codec
codec
=
(
await
tester
.
runAsync
(()
{
return
ui
.
instantiateImageCodec
(
Uint8List
.
fromList
(
kAnimatedGif
));
return
ui
.
instantiateImageCodec
(
Uint8List
.
fromList
(
kAnimatedGif
));
}))!;
}))!;
...
...
packages/flutter/test/widgets/obscured_animated_image_test.dart
View file @
94c63f82
...
@@ -8,6 +8,7 @@ import 'dart:ui' as ui show Image;
...
@@ -8,6 +8,7 @@ import 'dart:ui' as ui show Image;
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
'../image_data.dart'
;
import
'../image_data.dart'
;
import
'../painting/fake_codec.dart'
;
import
'../painting/fake_codec.dart'
;
...
@@ -17,7 +18,10 @@ Future<void> main() async {
...
@@ -17,7 +18,10 @@ Future<void> main() async {
final
FakeCodec
fakeCodec
=
await
FakeCodec
.
fromData
(
Uint8List
.
fromList
(
kAnimatedGif
));
final
FakeCodec
fakeCodec
=
await
FakeCodec
.
fromData
(
Uint8List
.
fromList
(
kAnimatedGif
));
final
FakeImageProvider
fakeImageProvider
=
FakeImageProvider
(
fakeCodec
);
final
FakeImageProvider
fakeImageProvider
=
FakeImageProvider
(
fakeCodec
);
testWidgets
(
'Obscured image does not animate'
,
(
WidgetTester
tester
)
async
{
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
{
final
GlobalKey
imageKey
=
GlobalKey
();
final
GlobalKey
imageKey
=
GlobalKey
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
MaterialApp
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment