Skip to content

Commit d0320ea

Browse files
[in_app_purchase] Activate leak testing for android (#8369)
The android package manipulates disposable objects. This PR activate leak testing to make sure disposable objects are correctly disposed. See the documentation: https://github.com/dart-lang/leak_tracker/blob/main/doc%2Fleak_tracking%2FDETECT.md
1 parent 3bb7397 commit d0320ea

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/in_app_purchase/in_app_purchase_android/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dev_dependencies:
2626
build_runner: ^2.0.0
2727
flutter_test:
2828
sdk: flutter
29+
leak_tracker_flutter_testing: any
2930
mockito: ^5.4.4
3031
pigeon: ^22.4.2
3132
test: ^1.16.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'dart:async';
6+
7+
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
8+
9+
Future<void> testExecutable(FutureOr<void> Function() testMain) async {
10+
LeakTesting.enable();
11+
LeakTracking.warnForUnsupportedPlatforms = false;
12+
await testMain();
13+
}

0 commit comments

Comments
 (0)