File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
packages/flutter/test/services Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import 'package:flutter/foundation.dart';
8
8
import 'package:flutter/painting.dart' ;
9
9
import 'package:flutter/services.dart' ;
10
10
import 'package:flutter_test/flutter_test.dart' ;
11
+ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart' ;
11
12
12
13
class TestAssetBundle extends CachingAssetBundle {
13
14
Map <String , int > loadCallCount = < String , int > {};
@@ -135,7 +136,7 @@ void main() {
135
136
expect (await data, 1 );
136
137
});
137
138
138
- testWidgets ('loadStructuredData handles exceptions correctly' , (WidgetTester tester) async {
139
+ testWidgetsWithLeakTracking ('loadStructuredData handles exceptions correctly' , (WidgetTester tester) async {
139
140
final TestAssetBundle bundle = TestAssetBundle ();
140
141
try {
141
142
await bundle.loadStructuredData ('AssetManifest.json' , (String value) => Future <String >.error ('what do they say?' ));
@@ -145,7 +146,7 @@ void main() {
145
146
}
146
147
});
147
148
148
- testWidgets ('loadStructuredBinaryData handles exceptions correctly' , (WidgetTester tester) async {
149
+ testWidgetsWithLeakTracking ('loadStructuredBinaryData handles exceptions correctly' , (WidgetTester tester) async {
149
150
final TestAssetBundle bundle = TestAssetBundle ();
150
151
try {
151
152
await bundle.loadStructuredBinaryData ('AssetManifest.bin' , (ByteData value) => Future <String >.error ('buy more crystals' ));
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ import 'dart:ui';
6
6
7
7
import 'package:flutter/services.dart' ;
8
8
import 'package:flutter_test/flutter_test.dart' ;
9
+ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart' ;
9
10
10
11
void main () {
11
- testWidgets ('initialLifecycleState is used to init state paused' , (WidgetTester tester) async {
12
+ testWidgetsWithLeakTracking ('initialLifecycleState is used to init state paused' , (WidgetTester tester) async {
12
13
expect (ServicesBinding .instance.lifecycleState, isNull);
13
14
final TestWidgetsFlutterBinding binding = tester.binding;
14
15
binding.resetLifecycleState ();
@@ -20,7 +21,7 @@ void main() {
20
21
// even though no lifecycle event was fired from the platform.
21
22
expect (binding.lifecycleState.toString (), equals ('AppLifecycleState.paused' ));
22
23
});
23
- testWidgets ('Handles all of the allowed states of AppLifecycleState' , (WidgetTester tester) async {
24
+ testWidgetsWithLeakTracking ('Handles all of the allowed states of AppLifecycleState' , (WidgetTester tester) async {
24
25
final TestWidgetsFlutterBinding binding = tester.binding;
25
26
for (final AppLifecycleState state in AppLifecycleState .values) {
26
27
binding.resetLifecycleState ();
You can’t perform that action at this time.
0 commit comments