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
0b686be3
Unverified
Commit
0b686be3
authored
Jan 26, 2024
by
Polina Cherkasova
Committed by
GitHub
Jan 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix not disposed ImageInfo in tests. (#142287)
parent
827c94c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
image_test.dart
packages/flutter/test/widgets/image_test.dart
+13
-3
No files found.
packages/flutter/test/widgets/image_test.dart
View file @
0b686be3
...
...
@@ -1082,8 +1082,12 @@ void main() {
expect
(
lastFrame
,
isNull
);
expect
(
lastFrameWasSync
,
isFalse
);
expect
(
find
.
byType
(
RawImage
),
findsOneWidget
);
streamCompleter
.
setData
(
imageInfo:
ImageInfo
(
image:
image10x10
));
final
ImageInfo
info
=
ImageInfo
(
image:
image10x10
);
addTearDown
(
info
.
dispose
);
streamCompleter
.
setData
(
imageInfo:
info
);
await
tester
.
pump
();
expect
(
lastFrame
,
0
);
expect
(
lastFrameWasSync
,
isFalse
);
});
...
...
@@ -1261,8 +1265,12 @@ void main() {
expect
(
chunkEvents
.
length
,
3
);
expect
(
find
.
text
(
'loading 30 / 100'
),
findsOneWidget
);
expect
(
find
.
byType
(
RawImage
),
findsNothing
);
streamCompleter
.
setData
(
imageInfo:
ImageInfo
(
image:
image10x10
));
final
ImageInfo
info
=
ImageInfo
(
image:
image10x10
);
addTearDown
(
info
.
dispose
);
streamCompleter
.
setData
(
imageInfo:
info
);
await
tester
.
pump
();
expect
(
chunkEvents
.
length
,
4
);
expect
(
find
.
byType
(
Text
),
findsNothing
);
expect
(
find
.
byType
(
RawImage
),
findsOneWidget
);
...
...
@@ -1282,7 +1290,9 @@ void main() {
expect
(
tester
.
binding
.
hasScheduledFrame
,
isFalse
);
streamCompleter
.
setData
(
chunkEvent:
const
ImageChunkEvent
(
cumulativeBytesLoaded:
10
,
expectedTotalBytes:
100
));
expect
(
tester
.
binding
.
hasScheduledFrame
,
isFalse
);
streamCompleter
.
setData
(
imageInfo:
ImageInfo
(
image:
image10x10
));
final
ImageInfo
info
=
ImageInfo
(
image:
image10x10
);
addTearDown
(
info
.
dispose
);
streamCompleter
.
setData
(
imageInfo:
info
);
expect
(
tester
.
binding
.
hasScheduledFrame
,
isTrue
);
await
tester
.
pump
();
streamCompleter
.
setData
(
chunkEvent:
const
ImageChunkEvent
(
cumulativeBytesLoaded:
10
,
expectedTotalBytes:
100
));
...
...
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