diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 1c5c8526c733..28bc923f106a 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -94,7 +94,8 @@ void main() { await controller.dispose(); } } - }); + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + }, skip: true); // This tests that the capture is no bigger than the preset, since we have // automatic code to fall back to smaller sizes when we need to. Returns diff --git a/packages/camera/camera_android/example/integration_test/camera_test.dart b/packages/camera/camera_android/example/integration_test/camera_test.dart index 8e1a6ce7f791..a9618c6e9cd0 100644 --- a/packages/camera/camera_android/example/integration_test/camera_test.dart +++ b/packages/camera/camera_android/example/integration_test/camera_test.dart @@ -92,7 +92,9 @@ void main() { await controller.dispose(); } } - }); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); // This tests that the capture is no bigger than the preset, since we have // automatic code to fall back to smaller sizes when we need to. Returns @@ -197,7 +199,9 @@ void main() { await videoController.dispose(); expect(duration, lessThan(recordingTime - timePaused)); - }); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); testWidgets('Set description while recording', (WidgetTester tester) async { final List cameras = @@ -234,7 +238,9 @@ void main() { // cameras switched expect(controller.description, cameras[1]); } - }); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); testWidgets('Set description', (WidgetTester tester) async { final List cameras = @@ -249,79 +255,79 @@ void main() { await controller.setDescription(cameras[1]); expect(controller.description, cameras[1]); - }); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); - testWidgets( - 'image streaming', - (WidgetTester tester) async { - final List cameras = - await CameraPlatform.instance.availableCameras(); - if (cameras.isEmpty) { + testWidgets('image streaming', (WidgetTester tester) async { + final List cameras = + await CameraPlatform.instance.availableCameras(); + if (cameras.isEmpty) { + return; + } + + final CameraController controller = CameraController(cameras[0]); + + await controller.initialize(); + bool isDetecting = false; + + await controller.startImageStream((CameraImageData image) { + if (isDetecting) { return; } - final CameraController controller = CameraController(cameras[0]); + isDetecting = true; - await controller.initialize(); - bool isDetecting = false; + expectLater(image, isNotNull).whenComplete(() => isDetecting = false); + }); - await controller.startImageStream((CameraImageData image) { - if (isDetecting) { - return; - } + expect(controller.value.isStreamingImages, true); - isDetecting = true; + sleep(const Duration(milliseconds: 500)); - expectLater(image, isNotNull).whenComplete(() => isDetecting = false); - }); + await controller.stopImageStream(); + await controller.dispose(); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); - expect(controller.value.isStreamingImages, true); + testWidgets('recording with image stream', (WidgetTester tester) async { + final List cameras = + await CameraPlatform.instance.availableCameras(); + if (cameras.isEmpty) { + return; + } - sleep(const Duration(milliseconds: 500)); + final CameraController controller = CameraController(cameras[0]); - await controller.stopImageStream(); - await controller.dispose(); - }, - ); + await controller.initialize(); + bool isDetecting = false; - testWidgets( - 'recording with image stream', - (WidgetTester tester) async { - final List cameras = - await CameraPlatform.instance.availableCameras(); - if (cameras.isEmpty) { + await controller.startVideoRecording( + streamCallback: (CameraImageData image) { + if (isDetecting) { return; } - final CameraController controller = CameraController(cameras[0]); - - await controller.initialize(); - bool isDetecting = false; - - await controller.startVideoRecording( - streamCallback: (CameraImageData image) { - if (isDetecting) { - return; - } + isDetecting = true; - isDetecting = true; + expectLater(image, isNotNull); + }); - expectLater(image, isNotNull); - }); + expect(controller.value.isStreamingImages, true); - expect(controller.value.isStreamingImages, true); + // Stopping recording before anything is recorded will throw, per + // https://developer.android.com/reference/android/media/MediaRecorder.html#stop() + // so delay long enough to ensure that some data is recorded. + await Future.delayed(const Duration(seconds: 2)); - // Stopping recording before anything is recorded will throw, per - // https://developer.android.com/reference/android/media/MediaRecorder.html#stop() - // so delay long enough to ensure that some data is recorded. - await Future.delayed(const Duration(seconds: 2)); + await controller.stopVideoRecording(); + await controller.dispose(); - await controller.stopVideoRecording(); - await controller.dispose(); - - expect(controller.value.isStreamingImages, false); - }, - ); + expect(controller.value.isStreamingImages, false); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); group('Camera settings', () { Future getCamera() async { @@ -457,5 +463,7 @@ void main() { expect(lengths[n], greaterThan(0)); } }); - }); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); } diff --git a/packages/camera/camera_android_camerax/example/integration_test/integration_test.dart b/packages/camera/camera_android_camerax/example/integration_test/integration_test.dart index 5da28d229e73..14b3a29fed77 100644 --- a/packages/camera/camera_android_camerax/example/integration_test/integration_test.dart +++ b/packages/camera/camera_android_camerax/example/integration_test/integration_test.dart @@ -107,7 +107,9 @@ void main() { await controller.dispose(); } } - }); + }, + // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682. + skip: true); testWidgets('Preview takes expected resolution from preset', (WidgetTester tester) async {