@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
6
6
import 'package:flutter/scheduler.dart' ;
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
12
Future <void > setAppLifeCycleState (AppLifecycleState state) async {
@@ -15,7 +16,7 @@ void main() {
15
16
.handlePlatformMessage ('flutter/lifecycle' , message, (_) {});
16
17
}
17
18
18
- testWidgets ('Ticker mute control test' , (WidgetTester tester) async {
19
+ testWidgetsWithLeakTracking ('Ticker mute control test' , (WidgetTester tester) async {
19
20
int tickCount = 0 ;
20
21
void handleTick (Duration duration) {
21
22
tickCount += 1 ;
@@ -97,7 +98,7 @@ void main() {
97
98
expect (ticker.isActive, isFalse);
98
99
});
99
100
100
- testWidgets ('Ticker control test' , (WidgetTester tester) async {
101
+ testWidgetsWithLeakTracking ('Ticker control test' , (WidgetTester tester) async {
101
102
late Ticker ticker;
102
103
103
104
void testFunction () {
@@ -110,7 +111,7 @@ void main() {
110
111
expect (ticker.toString (debugIncludeStack: true ), contains ('testFunction' ));
111
112
});
112
113
113
- testWidgets ('Ticker can be sped up with time dilation' , (WidgetTester tester) async {
114
+ testWidgetsWithLeakTracking ('Ticker can be sped up with time dilation' , (WidgetTester tester) async {
114
115
timeDilation = 0.5 ; // Move twice as fast.
115
116
late Duration lastDuration;
116
117
void handleTick (Duration duration) {
@@ -128,7 +129,7 @@ void main() {
128
129
timeDilation = 1.0 ; // restore time dilation, or it will affect other tests
129
130
});
130
131
131
- testWidgets ('Ticker can be slowed down with time dilation' , (WidgetTester tester) async {
132
+ testWidgetsWithLeakTracking ('Ticker can be slowed down with time dilation' , (WidgetTester tester) async {
132
133
timeDilation = 2.0 ; // Move half as fast.
133
134
late Duration lastDuration;
134
135
void handleTick (Duration duration) {
@@ -146,7 +147,7 @@ void main() {
146
147
timeDilation = 1.0 ; // restore time dilation, or it will affect other tests
147
148
});
148
149
149
- testWidgets ('Ticker stops ticking when application is paused' , (WidgetTester tester) async {
150
+ testWidgetsWithLeakTracking ('Ticker stops ticking when application is paused' , (WidgetTester tester) async {
150
151
int tickCount = 0 ;
151
152
void handleTick (Duration duration) {
152
153
tickCount += 1 ;
@@ -169,7 +170,7 @@ void main() {
169
170
setAppLifeCycleState (AppLifecycleState .resumed);
170
171
});
171
172
172
- testWidgets ('Ticker can be created before application unpauses' , (WidgetTester tester) async {
173
+ testWidgetsWithLeakTracking ('Ticker can be created before application unpauses' , (WidgetTester tester) async {
173
174
setAppLifeCycleState (AppLifecycleState .paused);
174
175
175
176
int tickCount = 0 ;
0 commit comments