Skip to content

Commit d11f470

Browse files
committed
skipped integration tests
1 parent 2a018ac commit d11f470

File tree

3 files changed

+71
-59
lines changed

3 files changed

+71
-59
lines changed

packages/camera/camera/example/integration_test/camera_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ void main() {
9494
await controller.dispose();
9595
}
9696
}
97-
});
97+
},
98+
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
99+
skip: true);
98100

99101
// This tests that the capture is no bigger than the preset, since we have
100102
// automatic code to fall back to smaller sizes when we need to. Returns

packages/camera/camera_android/example/integration_test/camera_test.dart

Lines changed: 65 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ void main() {
9292
await controller.dispose();
9393
}
9494
}
95-
});
95+
},
96+
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
97+
skip: true);
9698

9799
// This tests that the capture is no bigger than the preset, since we have
98100
// automatic code to fall back to smaller sizes when we need to. Returns
@@ -197,7 +199,9 @@ void main() {
197199
await videoController.dispose();
198200

199201
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);
201205

202206
testWidgets('Set description while recording', (WidgetTester tester) async {
203207
final List<CameraDescription> cameras =
@@ -234,7 +238,9 @@ void main() {
234238
// cameras switched
235239
expect(controller.description, cameras[1]);
236240
}
237-
});
241+
},
242+
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
243+
skip: true);
238244

239245
testWidgets('Set description', (WidgetTester tester) async {
240246
final List<CameraDescription> cameras =
@@ -249,79 +255,79 @@ void main() {
249255
await controller.setDescription(cameras[1]);
250256

251257
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);
253261

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) {
260276
return;
261277
}
262278

263-
final CameraController controller = CameraController(cameras[0]);
279+
isDetecting = true;
264280

265-
await controller.initialize();
266-
bool isDetecting = false;
281+
expectLater(image, isNotNull).whenComplete(() => isDetecting = false);
282+
});
267283

268-
await controller.startImageStream((CameraImageData image) {
269-
if (isDetecting) {
270-
return;
271-
}
284+
expect(controller.value.isStreamingImages, true);
272285

273-
isDetecting = true;
286+
sleep(const Duration(milliseconds: 500));
274287

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);
277293

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

280-
sleep(const Duration(milliseconds: 500));
301+
final CameraController controller = CameraController(cameras[0]);
281302

282-
await controller.stopImageStream();
283-
await controller.dispose();
284-
},
285-
);
303+
await controller.initialize();
304+
bool isDetecting = false;
286305

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) {
293309
return;
294310
}
295311

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;
306313

307-
isDetecting = true;
314+
expectLater(image, isNotNull);
315+
});
308316

309-
expectLater(image, isNotNull);
310-
});
317+
expect(controller.value.isStreamingImages, true);
311318

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));
313323

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();
318326

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);
325331

326332
group('Camera settings', () {
327333
Future<CameraDescription> getCamera() async {
@@ -457,5 +463,7 @@ void main() {
457463
expect(lengths[n], greaterThan(0));
458464
}
459465
});
460-
});
466+
},
467+
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
468+
skip: true);
461469
}

packages/camera/camera_android_camerax/example/integration_test/integration_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ void main() {
107107
await controller.dispose();
108108
}
109109
}
110-
});
110+
},
111+
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
112+
skip: true);
111113

112114
testWidgets('Preview takes expected resolution from preset',
113115
(WidgetTester tester) async {

0 commit comments

Comments
 (0)