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
67170b12
Unverified
Commit
67170b12
authored
Oct 09, 2023
by
droidbg
Committed by
GitHub
Oct 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[leak-tracking] Add leak tracking in test/painting #1 (#136167)
parent
3df6078b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
15 deletions
+19
-15
_network_image_test_web.dart
packages/flutter/test/painting/_network_image_test_web.dart
+4
-4
binding_test.dart
packages/flutter/test/painting/binding_test.dart
+2
-1
border_test.dart
packages/flutter/test/painting/border_test.dart
+2
-1
box_painter_test.dart
packages/flutter/test/painting/box_painter_test.dart
+9
-8
flutter_logo_test.dart
packages/flutter/test/painting/flutter_logo_test.dart
+2
-1
No files found.
packages/flutter/test/painting/_network_image_test_web.dart
View file @
67170b12
...
...
@@ -6,17 +6,17 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/src/painting/_network_image_web.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
import
'package:web/web.dart'
as
web
;
import
'../image_data.dart'
;
import
'_test_http_request.dart'
;
void
runTests
(
)
{
tearDown
(()
{
debugRestoreHttpRequestFactory
();
});
testWidgets
(
'loads an image from the network with headers'
,
testWidgets
WithLeakTracking
(
'loads an image from the network with headers'
,
(
WidgetTester
tester
)
async
{
final
TestHttpRequest
testHttpRequest
=
TestHttpRequest
()
..
status
=
200
...
...
@@ -42,7 +42,7 @@ void runTests() {
assert
(
mapEquals
(
testHttpRequest
.
responseHeaders
,
headers
),
true
);
});
testWidgets
(
'loads an image from the network with unsuccessful HTTP code'
,
testWidgets
WithLeakTracking
(
'loads an image from the network with unsuccessful HTTP code'
,
(
WidgetTester
tester
)
async
{
final
TestHttpRequest
testHttpRequest
=
TestHttpRequest
()
..
status
=
404
...
...
@@ -67,7 +67,7 @@ void runTests() {
expect
((
tester
.
takeException
()
as
web
.
ProgressEvent
).
type
,
'test error'
);
});
testWidgets
(
'loads an image from the network with empty response'
,
testWidgets
WithLeakTracking
(
'loads an image from the network with empty response'
,
(
WidgetTester
tester
)
async
{
final
TestHttpRequest
testHttpRequest
=
TestHttpRequest
()
..
status
=
200
...
...
packages/flutter/test/painting/binding_test.dart
View file @
67170b12
...
...
@@ -10,11 +10,12 @@ import 'package:flutter/scheduler.dart';
import
'package:flutter/services.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
Future
<
void
>
main
()
async
{
final
ui
.
Image
image
=
await
createTestImage
();
testWidgets
(
'didHaveMemoryPressure clears imageCache'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'didHaveMemoryPressure clears imageCache'
,
(
WidgetTester
tester
)
async
{
imageCache
.
putIfAbsent
(
1
,
()
=>
OneFrameImageStreamCompleter
(
Future
<
ImageInfo
>.
value
(
ImageInfo
(
image:
image
,
...
...
packages/flutter/test/painting/border_test.dart
View file @
67170b12
...
...
@@ -4,6 +4,7 @@
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
class
TestCanvas
implements
Canvas
{
final
List
<
Invocation
>
invocations
=
<
Invocation
>[];
...
...
@@ -316,7 +317,7 @@ void main() {
expect
(
nonUniformBorderDirectional
.
dimensions
,
const
EdgeInsetsDirectional
.
fromSTEB
(
5
,
5
,
0
,
20
));
});
testWidgets
(
'Non-Uniform Border variations'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Non-Uniform Border variations'
,
(
WidgetTester
tester
)
async
{
Widget
buildWidget
({
required
BoxBorder
border
,
BorderRadius
?
borderRadius
,
BoxShape
boxShape
=
BoxShape
.
rectangle
})
{
return
Directionality
(
...
...
packages/flutter/test/painting/box_painter_test.dart
View file @
67170b12
...
...
@@ -9,6 +9,7 @@ library;
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
(
)
{
tearDown
(()
{
...
...
@@ -160,7 +161,7 @@ void main() {
expect
(
const
BoxShadow
(
blurRadius:
4.0
,
blurStyle:
BlurStyle
.
solid
).
toString
(),
equals
(
'BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0, BlurStyle.solid)'
));
});
testWidgets
(
'BoxShadow BoxStyle.solid'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.solid'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -192,7 +193,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.outer'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.outer'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -224,7 +225,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.inner'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.inner'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -256,7 +257,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.normal'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.normal'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -288,7 +289,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.normal.wide_radius'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.normal.wide_radius'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -321,7 +322,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.outer.wide_radius'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.outer.wide_radius'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -354,7 +355,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.solid.wide_radius'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.solid.wide_radius'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
@@ -386,7 +387,7 @@ void main() {
debugDisableShadows
=
true
;
});
testWidgets
(
'BoxShadow BoxStyle.inner.wide_radius'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'BoxShadow BoxStyle.inner.wide_radius'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
debugDisableShadows
=
false
;
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/painting/flutter_logo_test.dart
View file @
67170b12
...
...
@@ -9,6 +9,7 @@ library;
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
(
)
{
// Here and below, see: https://github.com/dart-lang/sdk/issues/26980
...
...
@@ -85,7 +86,7 @@ void main() {
);
});
testWidgets
(
'Flutter Logo golden test'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Flutter Logo golden test'
,
(
WidgetTester
tester
)
async
{
final
Key
logo
=
UniqueKey
();
await
tester
.
pumpWidget
(
Container
(
key:
logo
,
...
...
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