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
2afded61
Unverified
Commit
2afded61
authored
Aug 23, 2023
by
Polina Cherkasova
Committed by
GitHub
Aug 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to mark recording as leaking. (#133073)
parent
5e9e959d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
36 deletions
+71
-36
animation_sheet_test.dart
packages/flutter/test/animation/animation_sheet_test.dart
+32
-4
live_binding_test.dart
packages/flutter/test/animation/live_binding_test.dart
+6
-2
date_range_picker_test.dart
packages/flutter/test/material/date_range_picker_test.dart
+7
-6
text_selection_theme_test.dart
...ages/flutter/test/material/text_selection_theme_test.dart
+26
-24
No files found.
packages/flutter/test/animation/animation_sheet_test.dart
View file @
2afded61
...
...
@@ -11,6 +11,7 @@ import 'dart:ui' as ui;
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
(
)
{
...
...
@@ -19,7 +20,25 @@ void main() {
* because [matchesGoldenFile] does not use Skia Gold in its native package.
*/
testWidgets
(
'correctly records frames using collate'
,
(
WidgetTester
tester
)
async
{
testWidgetsWithLeakTracking
(
'recording disposes images'
,
(
WidgetTester
tester
)
async
{
final
AnimationSheetBuilder
builder
=
AnimationSheetBuilder
(
frameSize:
_DecuplePixels
.
size
);
await
tester
.
pumpFrames
(
builder
.
record
(
const
_DecuplePixels
(
Duration
(
seconds:
1
)),
),
const
Duration
(
milliseconds:
200
),
const
Duration
(
milliseconds:
100
),
);
},
skip:
isBrowser
,
// [intended] https://github.com/flutter/flutter/issues/56001
// TODO(polina-c): remove after fixing https://github.com/flutter/flutter/issues/133071
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
allowAllNotDisposed:
true
),
);
testWidgetsWithLeakTracking
(
'correctly records frames using collate'
,
(
WidgetTester
tester
)
async
{
final
AnimationSheetBuilder
builder
=
AnimationSheetBuilder
(
frameSize:
_DecuplePixels
.
size
);
await
tester
.
pumpFrames
(
...
...
@@ -53,10 +72,15 @@ void main() {
image
,
matchesGoldenFile
(
'test.animation_sheet_builder.collate.png'
),
);
image
.
dispose
();
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56001
},
skip:
isBrowser
,
// [intended] https://github.com/flutter/flutter/issues/56001
// TODO(polina-c): remove after fixing https://github.com/flutter/flutter/issues/133071
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
allowAllNotDisposed:
true
),
);
// https://github.com/flutter/flutter/issues/56001
testWidgets
(
'use allLayers to record out-of-subtree contents'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'use allLayers to record out-of-subtree contents'
,
(
WidgetTester
tester
)
async
{
final
AnimationSheetBuilder
builder
=
AnimationSheetBuilder
(
frameSize:
const
Size
(
8
,
2
),
allLayers:
true
,
...
...
@@ -88,7 +112,11 @@ void main() {
matchesGoldenFile
(
'test.animation_sheet_builder.out_of_tree.png'
),
);
image
.
dispose
();
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56001
},
skip:
isBrowser
,
// [intended] https://github.com/flutter/flutter/issues/56001
// TODO(polina-c): remove after fixing https://github.com/flutter/flutter/issues/133071
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
allowAllNotDisposed:
true
),
);
}
// An animation of a yellow pixel moving from left to right, in a container of
...
...
packages/flutter/test/animation/live_binding_test.dart
View file @
2afded61
...
...
@@ -79,7 +79,7 @@ void main() {
// Currently skipped due to daily flake: https://github.com/flutter/flutter/issues/87588
},
skip:
true
);
// Typically skip: isBrowser https://github.com/flutter/flutter/issues/42767
testWidgets
(
'Should show event indicator for pointer events with setSurfaceSize'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Should show event indicator for pointer events with setSurfaceSize'
,
(
WidgetTester
tester
)
async
{
final
AnimationSheetBuilder
animationSheet
=
AnimationSheetBuilder
(
frameSize:
const
Size
(
200
,
200
),
allLayers:
true
);
final
List
<
Offset
>
taps
=
<
Offset
>[];
Widget
target
({
bool
recording
=
true
})
=>
Container
(
...
...
@@ -138,5 +138,9 @@ void main() {
matchesGoldenFile
(
'LiveBinding.press.animation.2.png'
),
);
image
.
dispose
();
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56001
},
skip:
isBrowser
,
// [intended] https://github.com/flutter/flutter/issues/56001
// TODO(polina-c): remove after fixing https://github.com/flutter/flutter/issues/133071
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
allowAllNotDisposed:
true
),
);
}
packages/flutter/test/material/date_range_picker_test.dart
View file @
2afded61
...
...
@@ -255,12 +255,13 @@ void main() {
await
tester
.
tap
(
find
.
text
(
'Cancel'
));
await
tester
.
pumpAndSettle
();
},
// TODO(polina-c): remove after resolving
// https://github.com/flutter/flutter/issues/130354
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
allowAllNotGCed:
true
,
allowAllNotDisposed:
true
,
));
// TODO(polina-c): remove after resolving
// https://github.com/flutter/flutter/issues/130354
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
allowAllNotGCed:
true
,
allowAllNotDisposed:
true
,
),
);
});
testWidgets
(
'Save and help text is used'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/material/text_selection_theme_test.dart
View file @
2afded61
...
...
@@ -106,18 +106,19 @@ void main() {
final
RenderBox
handle
=
tester
.
firstRenderObject
<
RenderBox
>(
find
.
byType
(
CustomPaint
));
expect
(
handle
,
paints
..
path
(
color:
defaultSelectionHandleColor
));
},
// TODO(polina-c): remove after fixing
// https://github.com/flutter/flutter/issues/130469
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
notDisposedAllowList:
<
String
,
int
?>{
'ValueNotifier<MagnifierInfo>'
:
1
,
'ValueNotifier<_OverlayEntryWidgetState?>'
:
2
,
'ValueNotifier<bool>'
:
2
,
'_InputBorderGap'
:
1
,
},
// TODO(polina-c): investigate notGCed, if it does not disappear after fixing notDisposed.
allowAllNotGCed:
true
,
));
// TODO(polina-c): remove after fixing
// https://github.com/flutter/flutter/issues/130469
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
notDisposedAllowList:
<
String
,
int
?>{
'ValueNotifier<MagnifierInfo>'
:
1
,
'ValueNotifier<_OverlayEntryWidgetState?>'
:
2
,
'ValueNotifier<bool>'
:
2
,
'_InputBorderGap'
:
1
,
},
// TODO(polina-c): investigate notGCed, if it does not disappear after fixing notDisposed.
allowAllNotGCed:
true
,
),
);
testWidgetsWithLeakTracking
(
'Material3 - Empty textSelectionTheme will use defaults'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
theme
=
ThemeData
(
useMaterial3:
true
);
...
...
@@ -167,18 +168,19 @@ void main() {
final
RenderBox
handle
=
tester
.
firstRenderObject
<
RenderBox
>(
find
.
byType
(
CustomPaint
));
expect
(
handle
,
paints
..
path
(
color:
defaultSelectionHandleColor
));
},
// TODO(polina-c): remove after fixing
// https://github.com/flutter/flutter/issues/130469
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
notDisposedAllowList:
<
String
,
int
?>{
'ValueNotifier<MagnifierInfo>'
:
1
,
'ValueNotifier<_OverlayEntryWidgetState?>'
:
2
,
'ValueNotifier<bool>'
:
2
,
'_InputBorderGap'
:
1
,
},
// TODO(polina-c): investigate notGCed, if it does not disappear after fixing notDisposed.
allowAllNotGCed:
true
,
));
// TODO(polina-c): remove after fixing
// https://github.com/flutter/flutter/issues/130469
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
notDisposedAllowList:
<
String
,
int
?>{
'ValueNotifier<MagnifierInfo>'
:
1
,
'ValueNotifier<_OverlayEntryWidgetState?>'
:
2
,
'ValueNotifier<bool>'
:
2
,
'_InputBorderGap'
:
1
,
},
// TODO(polina-c): investigate notGCed, if it does not disappear after fixing notDisposed.
allowAllNotGCed:
true
,
),
);
testWidgets
(
'ThemeData.textSelectionTheme will be used if provided'
,
(
WidgetTester
tester
)
async
{
const
TextSelectionThemeData
textSelectionTheme
=
TextSelectionThemeData
(
...
...
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