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
54673633
Unverified
Commit
54673633
authored
Sep 14, 2023
by
derdilla
Committed by
GitHub
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover some Services tests with leak tracing (#134381)
parent
d2ff2417
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
asset_bundle_test.dart
packages/flutter/test/services/asset_bundle_test.dart
+3
-2
lifecycle_test.dart
packages/flutter/test/services/lifecycle_test.dart
+3
-2
No files found.
packages/flutter/test/services/asset_bundle_test.dart
View file @
54673633
...
...
@@ -8,6 +8,7 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/painting.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
class
TestAssetBundle
extends
CachingAssetBundle
{
Map
<
String
,
int
>
loadCallCount
=
<
String
,
int
>{};
...
...
@@ -135,7 +136,7 @@ void main() {
expect
(
await
data
,
1
);
});
testWidgets
(
'loadStructuredData handles exceptions correctly'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'loadStructuredData handles exceptions correctly'
,
(
WidgetTester
tester
)
async
{
final
TestAssetBundle
bundle
=
TestAssetBundle
();
try
{
await
bundle
.
loadStructuredData
(
'AssetManifest.json'
,
(
String
value
)
=>
Future
<
String
>.
error
(
'what do they say?'
));
...
...
@@ -145,7 +146,7 @@ void main() {
}
});
testWidgets
(
'loadStructuredBinaryData handles exceptions correctly'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'loadStructuredBinaryData handles exceptions correctly'
,
(
WidgetTester
tester
)
async
{
final
TestAssetBundle
bundle
=
TestAssetBundle
();
try
{
await
bundle
.
loadStructuredBinaryData
(
'AssetManifest.bin'
,
(
ByteData
value
)
=>
Future
<
String
>.
error
(
'buy more crystals'
));
...
...
packages/flutter/test/services/lifecycle_test.dart
View file @
54673633
...
...
@@ -6,9 +6,10 @@ import 'dart:ui';
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
testWidgets
(
'initialLifecycleState is used to init state paused'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'initialLifecycleState is used to init state paused'
,
(
WidgetTester
tester
)
async
{
expect
(
ServicesBinding
.
instance
.
lifecycleState
,
isNull
);
final
TestWidgetsFlutterBinding
binding
=
tester
.
binding
;
binding
.
resetLifecycleState
();
...
...
@@ -20,7 +21,7 @@ void main() {
// even though no lifecycle event was fired from the platform.
expect
(
binding
.
lifecycleState
.
toString
(),
equals
(
'AppLifecycleState.paused'
));
});
testWidgets
(
'Handles all of the allowed states of AppLifecycleState'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Handles all of the allowed states of AppLifecycleState'
,
(
WidgetTester
tester
)
async
{
final
TestWidgetsFlutterBinding
binding
=
tester
.
binding
;
for
(
final
AppLifecycleState
state
in
AppLifecycleState
.
values
)
{
binding
.
resetLifecycleState
();
...
...
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