Skip to content

Commit 1e497d6

Browse files
authored
[camera_web] Add missing setFlashMode test (flutter#4235)
1 parent e5fc83d commit 1e497d6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/camera/camera_web/example/integration_test/camera_web_test.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,21 @@ void main() {
998998
});
999999

10001000
group('setFlashMode', () {
1001+
testWidgets('calls setFlashMode on the camera', (tester) async {
1002+
final camera = MockCamera();
1003+
const flashMode = FlashMode.always;
1004+
1005+
// Save the camera in the camera plugin.
1006+
(CameraPlatform.instance as CameraPlugin).cameras[cameraId] = camera;
1007+
1008+
await CameraPlatform.instance.setFlashMode(
1009+
cameraId,
1010+
flashMode,
1011+
);
1012+
1013+
verify(() => camera.setFlashMode(flashMode)).called(1);
1014+
});
1015+
10011016
group('throws PlatformException', () {
10021017
testWidgets(
10031018
'with notFound error '

0 commit comments

Comments
 (0)