Skip to content

Commit 94c4a3e

Browse files
[camera]: Activate leak testing for sub packages (#8353)
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* Follow up of #8287 Activates leak testing for the packages including a `test` folder See the documentation: https://github.com/dart-lang/leak_tracker/blob/main/doc%2Fleak_tracking%2FDETECT.md
1 parent aad08ec commit 94c4a3e

File tree

10 files changed

+70
-0
lines changed

10 files changed

+70
-0
lines changed

packages/camera/camera_android/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dev_dependencies:
3030
build_runner: ^2.4.11
3131
flutter_test:
3232
sdk: flutter
33+
leak_tracker_flutter_testing: any
3334
mockito: ^5.4.4
3435
pigeon: ^22.4.1
3536

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+
}

packages/camera/camera_android_camerax/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dev_dependencies:
3131
sdk: flutter
3232
integration_test:
3333
sdk: flutter
34+
leak_tracker_flutter_testing: any
3435
mockito: ^5.4.4
3536
pigeon: ^9.1.0
3637

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+
}

packages/camera/camera_avfoundation/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dev_dependencies:
2727
build_runner: ^2.4.9
2828
flutter_test:
2929
sdk: flutter
30+
leak_tracker_flutter_testing: any
3031
mockito: ^5.4.4
3132
pigeon: ^22.4.2
3233

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+
}

packages/camera/camera_platform_interface/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dev_dependencies:
2121
async: ^2.5.0
2222
flutter_test:
2323
sdk: flutter
24+
leak_tracker_flutter_testing: any
2425

2526
topics:
2627
- camera
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+
}

packages/camera/camera_windows/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dev_dependencies:
2828
build_runner: ^2.4.9
2929
flutter_test:
3030
sdk: flutter
31+
leak_tracker_flutter_testing: any
3132
mockito: ^5.4.4
3233
pigeon: ^22.6.0
3334

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)