@@ -92,7 +92,9 @@ void main() {
92
92
await controller.dispose ();
93
93
}
94
94
}
95
- });
95
+ },
96
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
97
+ skip: true );
96
98
97
99
// This tests that the capture is no bigger than the preset, since we have
98
100
// automatic code to fall back to smaller sizes when we need to. Returns
@@ -197,7 +199,9 @@ void main() {
197
199
await videoController.dispose ();
198
200
199
201
expect (duration, lessThan (recordingTime - timePaused));
200
- });
202
+ },
203
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
204
+ skip: true );
201
205
202
206
testWidgets ('Set description while recording' , (WidgetTester tester) async {
203
207
final List <CameraDescription > cameras =
@@ -234,7 +238,9 @@ void main() {
234
238
// cameras switched
235
239
expect (controller.description, cameras[1 ]);
236
240
}
237
- });
241
+ },
242
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
243
+ skip: true );
238
244
239
245
testWidgets ('Set description' , (WidgetTester tester) async {
240
246
final List <CameraDescription > cameras =
@@ -249,79 +255,79 @@ void main() {
249
255
await controller.setDescription (cameras[1 ]);
250
256
251
257
expect (controller.description, cameras[1 ]);
252
- });
258
+ },
259
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
260
+ skip: true );
253
261
254
- testWidgets (
255
- 'image streaming' ,
256
- (WidgetTester tester) async {
257
- final List <CameraDescription > cameras =
258
- await CameraPlatform .instance.availableCameras ();
259
- if (cameras.isEmpty) {
262
+ testWidgets ('image streaming' , (WidgetTester tester) async {
263
+ final List <CameraDescription > cameras =
264
+ await CameraPlatform .instance.availableCameras ();
265
+ if (cameras.isEmpty) {
266
+ return ;
267
+ }
268
+
269
+ final CameraController controller = CameraController (cameras[0 ]);
270
+
271
+ await controller.initialize ();
272
+ bool isDetecting = false ;
273
+
274
+ await controller.startImageStream ((CameraImageData image) {
275
+ if (isDetecting) {
260
276
return ;
261
277
}
262
278
263
- final CameraController controller = CameraController (cameras[ 0 ]) ;
279
+ isDetecting = true ;
264
280
265
- await controller. initialize ( );
266
- bool isDetecting = false ;
281
+ expectLater (image, isNotNull). whenComplete (() => isDetecting = false );
282
+ }) ;
267
283
268
- await controller.startImageStream ((CameraImageData image) {
269
- if (isDetecting) {
270
- return ;
271
- }
284
+ expect (controller.value.isStreamingImages, true );
272
285
273
- isDetecting = true ;
286
+ sleep ( const Duration (milliseconds : 500 )) ;
274
287
275
- expectLater (image, isNotNull).whenComplete (() => isDetecting = false );
276
- });
288
+ await controller.stopImageStream ();
289
+ await controller.dispose ();
290
+ },
291
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
292
+ skip: true );
277
293
278
- expect (controller.value.isStreamingImages, true );
294
+ testWidgets ('recording with image stream' , (WidgetTester tester) async {
295
+ final List <CameraDescription > cameras =
296
+ await CameraPlatform .instance.availableCameras ();
297
+ if (cameras.isEmpty) {
298
+ return ;
299
+ }
279
300
280
- sleep ( const Duration (milliseconds : 500 ) );
301
+ final CameraController controller = CameraController (cameras[ 0 ] );
281
302
282
- await controller.stopImageStream ();
283
- await controller.dispose ();
284
- },
285
- );
303
+ await controller.initialize ();
304
+ bool isDetecting = false ;
286
305
287
- testWidgets (
288
- 'recording with image stream' ,
289
- (WidgetTester tester) async {
290
- final List <CameraDescription > cameras =
291
- await CameraPlatform .instance.availableCameras ();
292
- if (cameras.isEmpty) {
306
+ await controller.startVideoRecording (
307
+ streamCallback: (CameraImageData image) {
308
+ if (isDetecting) {
293
309
return ;
294
310
}
295
311
296
- final CameraController controller = CameraController (cameras[0 ]);
297
-
298
- await controller.initialize ();
299
- bool isDetecting = false ;
300
-
301
- await controller.startVideoRecording (
302
- streamCallback: (CameraImageData image) {
303
- if (isDetecting) {
304
- return ;
305
- }
312
+ isDetecting = true ;
306
313
307
- isDetecting = true ;
314
+ expectLater (image, isNotNull);
315
+ });
308
316
309
- expectLater (image, isNotNull);
310
- });
317
+ expect (controller.value.isStreamingImages, true );
311
318
312
- expect (controller.value.isStreamingImages, true );
319
+ // Stopping recording before anything is recorded will throw, per
320
+ // https://developer.android.com/reference/android/media/MediaRecorder.html#stop()
321
+ // so delay long enough to ensure that some data is recorded.
322
+ await Future <void >.delayed (const Duration (seconds: 2 ));
313
323
314
- // Stopping recording before anything is recorded will throw, per
315
- // https://developer.android.com/reference/android/media/MediaRecorder.html#stop()
316
- // so delay long enough to ensure that some data is recorded.
317
- await Future <void >.delayed (const Duration (seconds: 2 ));
324
+ await controller.stopVideoRecording ();
325
+ await controller.dispose ();
318
326
319
- await controller.stopVideoRecording ();
320
- await controller.dispose ();
321
-
322
- expect (controller.value.isStreamingImages, false );
323
- },
324
- );
327
+ expect (controller.value.isStreamingImages, false );
328
+ },
329
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
330
+ skip: true );
325
331
326
332
group ('Camera settings' , () {
327
333
Future <CameraDescription > getCamera () async {
@@ -457,5 +463,7 @@ void main() {
457
463
expect (lengths[n], greaterThan (0 ));
458
464
}
459
465
});
460
- });
466
+ },
467
+ // TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
468
+ skip: true );
461
469
}
0 commit comments