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
2ec771aa
Unverified
Commit
2ec771aa
authored
Oct 21, 2023
by
Binni Goel
Committed by
GitHub
Oct 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test cover painting for memory leaks (#136696)
parent
6db6a5a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
decoration_image_lerp_test.dart
...ges/flutter/test/painting/decoration_image_lerp_test.dart
+6
-3
gradient_test.dart
packages/flutter/test/painting/gradient_test.dart
+3
-2
No files found.
packages/flutter/test/painting/decoration_image_lerp_test.dart
View file @
2ec771aa
...
...
@@ -14,9 +14,10 @@ import 'dart:ui' as ui;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
testWidgets
(
'ImageDecoration.lerp'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'ImageDecoration.lerp'
,
(
WidgetTester
tester
)
async
{
final
MemoryImage
green
=
MemoryImage
(
Uint8List
.
fromList
(<
int
>[
0x89
,
0x50
,
0x4e
,
0x47
,
0x0d
,
0x0a
,
0x1a
,
0x0a
,
0x00
,
0x00
,
0x00
,
0x0d
,
0x49
,
0x48
,
0x44
,
0x52
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x01
,
0x03
,
0x00
,
0x00
,
0x00
,
0x25
,
0xdb
,
0x56
,
...
...
@@ -159,6 +160,7 @@ void main() {
if
(!
kIsWeb
)
{
// TODO(ianh): https://github.com/flutter/flutter/issues/130610
final
ui
.
Image
image
=
(
await
tester
.
binding
.
runAsync
<
ui
.
Image
>(()
=>
captureImage
(
find
.
byType
(
Wrap
).
evaluate
().
single
)))!;
addTearDown
(()
=>
image
.
dispose
());
final
Uint8List
bytes
=
(
await
tester
.
binding
.
runAsync
<
ByteData
?>(()
=>
image
.
toByteData
(
format:
ui
.
ImageByteFormat
.
rawStraightRgba
)))!.
buffer
.
asUint8List
();
expect
(
image
.
width
,
792
);
expect
(
image
.
height
,
48
);
...
...
@@ -189,7 +191,7 @@ void main() {
}
},
skip:
kIsWeb
);
// TODO(ianh): https://github.com/flutter/flutter/issues/130612, https://github.com/flutter/flutter/issues/130609
testWidgets
(
'ImageDecoration.lerp'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'ImageDecoration.lerp'
,
(
WidgetTester
tester
)
async
{
final
MemoryImage
cmyk
=
MemoryImage
(
Uint8List
.
fromList
(<
int
>[
0x89
,
0x50
,
0x4e
,
0x47
,
0x0d
,
0x0a
,
0x1a
,
0x0a
,
0x00
,
0x00
,
0x00
,
0x0d
,
0x49
,
0x48
,
0x44
,
0x52
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x04
,
0x02
,
0x03
,
0x00
,
0x00
,
0x00
,
0xd4
,
0x9f
,
0x76
,
...
...
@@ -355,6 +357,7 @@ void main() {
if
(!
kIsWeb
)
{
// TODO(ianh): https://github.com/flutter/flutter/issues/130610
final
ui
.
Image
image
=
(
await
tester
.
binding
.
runAsync
<
ui
.
Image
>(()
=>
captureImage
(
find
.
byType
(
Wrap
).
evaluate
().
single
)))!;
addTearDown
(()
=>
image
.
dispose
());
final
Uint8List
bytes
=
(
await
tester
.
binding
.
runAsync
<
ByteData
?>(()
=>
image
.
toByteData
(
format:
ui
.
ImageByteFormat
.
rawStraightRgba
)))!.
buffer
.
asUint8List
();
expect
(
image
.
width
,
24
*
24
);
expect
(
image
.
height
,
1
*
24
);
...
...
@@ -406,7 +409,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'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'ImageDecoration.lerp with colored background'
,
(
WidgetTester
tester
)
async
{
final
MemoryImage
cmyk
=
MemoryImage
(
Uint8List
.
fromList
(<
int
>[
0x89
,
0x50
,
0x4e
,
0x47
,
0x0d
,
0x0a
,
0x1a
,
0x0a
,
0x00
,
0x00
,
0x00
,
0x0d
,
0x49
,
0x48
,
0x44
,
0x52
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x04
,
0x02
,
0x03
,
0x00
,
0x00
,
0x00
,
0xd4
,
0x9f
,
0x76
,
...
...
packages/flutter/test/painting/gradient_test.dart
View file @
2ec771aa
...
...
@@ -11,6 +11,7 @@ import 'dart:math' as math;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
test
(
'LinearGradient scale test'
,
()
{
...
...
@@ -881,7 +882,7 @@ void main() {
group
(
'Gradients - 45 degrees'
,
()
{
for
(
final
Gradient
gradient
in
gradients45
)
{
testWidgets
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
await
runTest
(
tester
,
gradient
,
45
);
});
}
...
...
@@ -889,7 +890,7 @@ void main() {
group
(
'Gradients - 90 degrees'
,
()
{
for
(
final
Gradient
gradient
in
gradients90
)
{
testWidgets
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
await
runTest
(
tester
,
gradient
,
90
);
});
}
...
...
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