Skip to content

Commit

Permalink
[camera]: Activate leak testing for sub packages (#8353)
Browse files Browse the repository at this point in the history
*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
  • Loading branch information
ValentinVignal authored Jan 10, 2025
1 parent aad08ec commit 94c4a3e
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dev_dependencies:
build_runner: ^2.4.11
flutter_test:
sdk: flutter
leak_tracker_flutter_testing: any
mockito: ^5.4.4
pigeon: ^22.4.1

Expand Down
13 changes: 13 additions & 0 deletions packages/camera/camera_android/test/flutter_test_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
LeakTesting.enable();
LeakTracking.warnForUnsupportedPlatforms = false;
await testMain();
}
1 change: 1 addition & 0 deletions packages/camera/camera_android_camerax/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dev_dependencies:
sdk: flutter
integration_test:
sdk: flutter
leak_tracker_flutter_testing: any
mockito: ^5.4.4
pigeon: ^9.1.0

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
LeakTesting.enable();
LeakTracking.warnForUnsupportedPlatforms = false;
await testMain();
}
1 change: 1 addition & 0 deletions packages/camera/camera_avfoundation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dev_dependencies:
build_runner: ^2.4.9
flutter_test:
sdk: flutter
leak_tracker_flutter_testing: any
mockito: ^5.4.4
pigeon: ^22.4.2

Expand Down
13 changes: 13 additions & 0 deletions packages/camera/camera_avfoundation/test/flutter_test_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
LeakTesting.enable();
LeakTracking.warnForUnsupportedPlatforms = false;
await testMain();
}
1 change: 1 addition & 0 deletions packages/camera/camera_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dev_dependencies:
async: ^2.5.0
flutter_test:
sdk: flutter
leak_tracker_flutter_testing: any

topics:
- camera
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
LeakTesting.enable();
LeakTracking.warnForUnsupportedPlatforms = false;
await testMain();
}
1 change: 1 addition & 0 deletions packages/camera/camera_windows/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dev_dependencies:
build_runner: ^2.4.9
flutter_test:
sdk: flutter
leak_tracker_flutter_testing: any
mockito: ^5.4.4
pigeon: ^22.6.0

Expand Down
13 changes: 13 additions & 0 deletions packages/camera/camera_windows/test/flutter_test_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
LeakTesting.enable();
LeakTracking.warnForUnsupportedPlatforms = false;
await testMain();
}

0 comments on commit 94c4a3e

Please sign in to comment.