@@ -15,6 +15,7 @@ import 'package:flutter/src/widgets/_html_element_view_web.dart'
15
15
show debugOverridePlatformViewRegistry;
16
16
import 'package:flutter/widgets.dart' ;
17
17
import 'package:flutter_test/flutter_test.dart' ;
18
+ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart' ;
18
19
import 'package:web/web.dart' as web;
19
20
20
21
final Object _mockHtmlElement = Object ();
@@ -42,7 +43,7 @@ void main() {
42
43
});
43
44
44
45
group ('HtmlElementView' , () {
45
- testWidgets ('Create HTML view' , (WidgetTester tester) async {
46
+ testWidgetsWithLeakTracking ('Create HTML view' , (WidgetTester tester) async {
46
47
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
47
48
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
48
49
@@ -64,7 +65,7 @@ void main() {
64
65
);
65
66
});
66
67
67
- testWidgets ('Create HTML view with PlatformViewCreatedCallback' , (WidgetTester tester) async {
68
+ testWidgetsWithLeakTracking ('Create HTML view with PlatformViewCreatedCallback' , (WidgetTester tester) async {
68
69
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
69
70
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
70
71
@@ -97,7 +98,7 @@ void main() {
97
98
);
98
99
});
99
100
100
- testWidgets ('Create HTML view with creation params' , (WidgetTester tester) async {
101
+ testWidgetsWithLeakTracking ('Create HTML view with creation params' , (WidgetTester tester) async {
101
102
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
102
103
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
103
104
await tester.pumpWidget (
@@ -132,7 +133,7 @@ void main() {
132
133
);
133
134
});
134
135
135
- testWidgets ('Resize HTML view' , (WidgetTester tester) async {
136
+ testWidgetsWithLeakTracking ('Resize HTML view' , (WidgetTester tester) async {
136
137
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
137
138
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
138
139
await tester.pumpWidget (
@@ -168,7 +169,7 @@ void main() {
168
169
);
169
170
});
170
171
171
- testWidgets ('Change HTML view type' , (WidgetTester tester) async {
172
+ testWidgetsWithLeakTracking ('Change HTML view type' , (WidgetTester tester) async {
172
173
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
173
174
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
174
175
fakePlatformViewRegistry.registerViewFactory ('maps' , _mockViewFactory);
@@ -200,7 +201,7 @@ void main() {
200
201
);
201
202
});
202
203
203
- testWidgets ('Dispose HTML view' , (WidgetTester tester) async {
204
+ testWidgetsWithLeakTracking ('Dispose HTML view' , (WidgetTester tester) async {
204
205
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
205
206
await tester.pumpWidget (
206
207
const Center (
@@ -227,7 +228,7 @@ void main() {
227
228
);
228
229
});
229
230
230
- testWidgets ('HTML view survives widget tree change' , (WidgetTester tester) async {
231
+ testWidgetsWithLeakTracking ('HTML view survives widget tree change' , (WidgetTester tester) async {
231
232
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
232
233
fakePlatformViewRegistry.registerViewFactory ('webview' , _mockViewFactory);
233
234
final GlobalKey key = GlobalKey ();
@@ -259,7 +260,7 @@ void main() {
259
260
);
260
261
});
261
262
262
- testWidgets ('HtmlElementView has correct semantics' , (WidgetTester tester) async {
263
+ testWidgetsWithLeakTracking ('HtmlElementView has correct semantics' , (WidgetTester tester) async {
263
264
final SemanticsHandle handle = tester.ensureSemantics ();
264
265
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
265
266
expect (currentViewId, greaterThanOrEqualTo (0 ));
@@ -306,7 +307,7 @@ void main() {
306
307
debugOverridePlatformViewRegistry = null ;
307
308
});
308
309
309
- testWidgets ('Create platform view from tagName' , (WidgetTester tester) async {
310
+ testWidgetsWithLeakTracking ('Create platform view from tagName' , (WidgetTester tester) async {
310
311
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
311
312
312
313
await tester.pumpWidget (
@@ -331,7 +332,7 @@ void main() {
331
332
expect (htmlElement.tagName, equalsIgnoringCase ('div' ));
332
333
});
333
334
334
- testWidgets ('Create invisible platform view' , (WidgetTester tester) async {
335
+ testWidgetsWithLeakTracking ('Create invisible platform view' , (WidgetTester tester) async {
335
336
final int currentViewId = platformViewsRegistry.getNextPlatformViewId ();
336
337
337
338
await tester.pumpWidget (
@@ -357,7 +358,7 @@ void main() {
357
358
expect (htmlElement.tagName, equalsIgnoringCase ('script' ));
358
359
});
359
360
360
- testWidgets ('onElementCreated' , (WidgetTester tester) async {
361
+ testWidgetsWithLeakTracking ('onElementCreated' , (WidgetTester tester) async {
361
362
final List <Object > createdElements = < Object > [];
362
363
void onElementCreated (Object element) {
363
364
createdElements.add (element);
0 commit comments