diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java index 402a47da..b240c7aa 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java @@ -9,6 +9,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -109,25 +110,6 @@ public class CameraOptions1Test extends BaseTest { } } - @Test - public void testFacing() { - Set supported = new HashSet<>(); - Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); - for (int i = 0, count = Camera.getNumberOfCameras(); i < count; i++) { - Camera.getCameraInfo(i, cameraInfo); - supported.add(cameraInfo.facing); - } - - CameraOptions o = new CameraOptions(mock(Camera.Parameters.class), false); - Mapper m = new Mapper.Mapper1(); - Set s = o.getSupportedFacing(); - assertEquals(o.getSupportedFacing().size(), supported.size()); - for (Facing facing : s) { - assertTrue(supported.contains(m.map(facing))); - assertTrue(o.supports(facing)); - } - } - @Test public void testGestureActions() { Camera.Parameters params = mock(Camera.Parameters.class); @@ -145,6 +127,41 @@ public class CameraOptions1Test extends BaseTest { assertFalse(o.supports(GestureAction.EXPOSURE_CORRECTION)); } + @Test + public void testAlwaysSupportedControls() { + // Grid, VideoQuality, SessionType and Audio are always supported. + Camera.Parameters params = mock(Camera.Parameters.class); + CameraOptions o = new CameraOptions(params, false); + + Collection grids = o.getSupportedControls(Grid.class); + Collection video = o.getSupportedControls(VideoQuality.class); + Collection sessions = o.getSupportedControls(SessionType.class); + Collection