Loading app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,11 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.endsWith; import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import android.annotation.TargetApi; import android.content.Intent; Loading Loading @@ -39,6 +43,8 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import foundation.e.camera.R; interface PhotoTests {} interface HDRTests {} Loading Loading @@ -6168,7 +6174,7 @@ public class InstrumentedTest { if( !single_tap_photo && !double_tap_photo ) { mActivityRule.getScenario().onActivity(activity -> { View takePhotoButton = activity.findViewById(net.sourceforge.opencamera.R.id.take_photo); View takePhotoButton = activity.findViewById(R.id.take_photo); assertFalse( activity.hasThumbnailAnimation() ); Log.d(TAG, "about to click take photo"); clickView(takePhotoButton); Loading app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java +41 −34 Original line number Diff line number Diff line package net.sourceforge.opencamera; import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import android.annotation.TargetApi; import android.content.ContentUris; Loading @@ -23,8 +28,8 @@ import android.renderscript.Allocation; import android.util.Log; import android.view.View; import androidx.annotation.RequiresApi; import androidx.exifinterface.media.ExifInterface; import androidx.test.filters.SdkSuppress; import net.sourceforge.opencamera.preview.Preview; Loading @@ -41,6 +46,8 @@ import java.util.Date; import java.util.List; import java.util.Locale; import foundation.e.camera.R; /** Helper class for testing. This method should not include any code specific to any test framework * (e.g., shouldn't be specific to ActivityInstrumentationTestCase2). */ Loading Loading @@ -356,7 +363,7 @@ public class TestUtils { * We check that we have a single range of non-zero values. * @param bitmap The bitmap to compute and check a histogram for. */ @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public static HistogramDetails checkHistogram(MainActivity activity, Bitmap bitmap) { int [] histogram = activity.getApplicationInterface().getHDRProcessor().computeHistogram(bitmap, true); assertEquals(256, histogram.length); Loading Loading @@ -778,17 +785,17 @@ public class TestUtils { public static void waitForTakePhotoChecks(MainActivity activity, long time_s) { Preview preview = activity.getPreview(); View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); //View flashButton = activity.findViewById(net.sourceforge.opencamera.R.id.flash); //View focusButton = activity.findViewById(net.sourceforge.opencamera.R.id.focus_mode); View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); View switchCameraButton = activity.findViewById(R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(R.id.switch_video); //View flashButton = activity.findViewById(R.id.flash); //View focusButton = activity.findViewById(R.id.focus_mode); View exposureButton = activity.findViewById(R.id.exposure); View exposureLockButton = activity.findViewById(R.id.exposure_lock); View audioControlButton = activity.findViewById(R.id.audio_control); View popupButton = activity.findViewById(R.id.popup); View trashButton = activity.findViewById(R.id.trash); View shareButton = activity.findViewById(R.id.share); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean is_focus_bracketing = activity.supportsFocusBracketing() && sharedPreferences.getString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_std").equals("preference_photo_mode_focus_bracketing"); boolean is_panorama = activity.supportsPanorama() && sharedPreferences.getString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_std").equals("preference_photo_mode_panorama"); Loading Loading @@ -1227,15 +1234,15 @@ public class TestUtils { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean has_audio_control_button = !sharedPreferences.getString(PreferenceKeys.AudioControlPreferenceKey, "none").equals("none"); View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); View switchCameraButton = activity.findViewById(R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(R.id.switch_video); View exposureButton = activity.findViewById(R.id.exposure); View exposureLockButton = activity.findViewById(R.id.exposure_lock); View audioControlButton = activity.findViewById(R.id.audio_control); View popupButton = activity.findViewById(R.id.popup); View trashButton = activity.findViewById(R.id.trash); View shareButton = activity.findViewById(R.id.share); // trash/share only shown when preview is paused after taking a photo boolean pause_preview = sharedPreferences.getBoolean(PreferenceKeys.PausePreviewPreferenceKey, false); Loading Loading @@ -1296,17 +1303,17 @@ public class TestUtils { boolean has_audio_control_button = !sharedPreferences.getString(PreferenceKeys.AudioControlPreferenceKey, "none").equals("none"); View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); //View flashButton = activity.findViewById(net.sourceforge.opencamera.R.id.flash); //View focusButton = activity.findViewById(net.sourceforge.opencamera.R.id.focus_mode); View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); View switchCameraButton = activity.findViewById(R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(R.id.switch_video); //View flashButton = activity.findViewById(R.id.flash); //View focusButton = activity.findViewById(R.id.focus_mode); View exposureButton = activity.findViewById(R.id.exposure); View exposureLockButton = activity.findViewById(R.id.exposure_lock); View audioControlButton = activity.findViewById(R.id.audio_control); View popupButton = activity.findViewById(R.id.popup); View trashButton = activity.findViewById(R.id.trash); View shareButton = activity.findViewById(R.id.share); assertEquals(switchCameraButton.getVisibility(), (immersive_mode ? View.GONE : (activity.getPreview().getCameraControllerManager().getNumberOfCameras() > 1 ? View.VISIBLE : View.GONE))); assertEquals(switchMultiCameraButton.getVisibility(), (immersive_mode ? View.GONE : (activity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE))); assertEquals(switchVideoButton.getVisibility(), (immersive_mode ? View.GONE : View.VISIBLE)); Loading app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +409 −413 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,11 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.endsWith; import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import android.annotation.TargetApi; import android.content.Intent; Loading Loading @@ -39,6 +43,8 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import foundation.e.camera.R; interface PhotoTests {} interface HDRTests {} Loading Loading @@ -6168,7 +6174,7 @@ public class InstrumentedTest { if( !single_tap_photo && !double_tap_photo ) { mActivityRule.getScenario().onActivity(activity -> { View takePhotoButton = activity.findViewById(net.sourceforge.opencamera.R.id.take_photo); View takePhotoButton = activity.findViewById(R.id.take_photo); assertFalse( activity.hasThumbnailAnimation() ); Log.d(TAG, "about to click take photo"); clickView(takePhotoButton); Loading
app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java +41 −34 Original line number Diff line number Diff line package net.sourceforge.opencamera; import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import android.annotation.TargetApi; import android.content.ContentUris; Loading @@ -23,8 +28,8 @@ import android.renderscript.Allocation; import android.util.Log; import android.view.View; import androidx.annotation.RequiresApi; import androidx.exifinterface.media.ExifInterface; import androidx.test.filters.SdkSuppress; import net.sourceforge.opencamera.preview.Preview; Loading @@ -41,6 +46,8 @@ import java.util.Date; import java.util.List; import java.util.Locale; import foundation.e.camera.R; /** Helper class for testing. This method should not include any code specific to any test framework * (e.g., shouldn't be specific to ActivityInstrumentationTestCase2). */ Loading Loading @@ -356,7 +363,7 @@ public class TestUtils { * We check that we have a single range of non-zero values. * @param bitmap The bitmap to compute and check a histogram for. */ @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public static HistogramDetails checkHistogram(MainActivity activity, Bitmap bitmap) { int [] histogram = activity.getApplicationInterface().getHDRProcessor().computeHistogram(bitmap, true); assertEquals(256, histogram.length); Loading Loading @@ -778,17 +785,17 @@ public class TestUtils { public static void waitForTakePhotoChecks(MainActivity activity, long time_s) { Preview preview = activity.getPreview(); View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); //View flashButton = activity.findViewById(net.sourceforge.opencamera.R.id.flash); //View focusButton = activity.findViewById(net.sourceforge.opencamera.R.id.focus_mode); View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); View switchCameraButton = activity.findViewById(R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(R.id.switch_video); //View flashButton = activity.findViewById(R.id.flash); //View focusButton = activity.findViewById(R.id.focus_mode); View exposureButton = activity.findViewById(R.id.exposure); View exposureLockButton = activity.findViewById(R.id.exposure_lock); View audioControlButton = activity.findViewById(R.id.audio_control); View popupButton = activity.findViewById(R.id.popup); View trashButton = activity.findViewById(R.id.trash); View shareButton = activity.findViewById(R.id.share); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean is_focus_bracketing = activity.supportsFocusBracketing() && sharedPreferences.getString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_std").equals("preference_photo_mode_focus_bracketing"); boolean is_panorama = activity.supportsPanorama() && sharedPreferences.getString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_std").equals("preference_photo_mode_panorama"); Loading Loading @@ -1227,15 +1234,15 @@ public class TestUtils { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean has_audio_control_button = !sharedPreferences.getString(PreferenceKeys.AudioControlPreferenceKey, "none").equals("none"); View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); View switchCameraButton = activity.findViewById(R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(R.id.switch_video); View exposureButton = activity.findViewById(R.id.exposure); View exposureLockButton = activity.findViewById(R.id.exposure_lock); View audioControlButton = activity.findViewById(R.id.audio_control); View popupButton = activity.findViewById(R.id.popup); View trashButton = activity.findViewById(R.id.trash); View shareButton = activity.findViewById(R.id.share); // trash/share only shown when preview is paused after taking a photo boolean pause_preview = sharedPreferences.getBoolean(PreferenceKeys.PausePreviewPreferenceKey, false); Loading Loading @@ -1296,17 +1303,17 @@ public class TestUtils { boolean has_audio_control_button = !sharedPreferences.getString(PreferenceKeys.AudioControlPreferenceKey, "none").equals("none"); View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); //View flashButton = activity.findViewById(net.sourceforge.opencamera.R.id.flash); //View focusButton = activity.findViewById(net.sourceforge.opencamera.R.id.focus_mode); View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); View switchCameraButton = activity.findViewById(R.id.switch_camera); View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); View switchVideoButton = activity.findViewById(R.id.switch_video); //View flashButton = activity.findViewById(R.id.flash); //View focusButton = activity.findViewById(R.id.focus_mode); View exposureButton = activity.findViewById(R.id.exposure); View exposureLockButton = activity.findViewById(R.id.exposure_lock); View audioControlButton = activity.findViewById(R.id.audio_control); View popupButton = activity.findViewById(R.id.popup); View trashButton = activity.findViewById(R.id.trash); View shareButton = activity.findViewById(R.id.share); assertEquals(switchCameraButton.getVisibility(), (immersive_mode ? View.GONE : (activity.getPreview().getCameraControllerManager().getNumberOfCameras() > 1 ? View.VISIBLE : View.GONE))); assertEquals(switchMultiCameraButton.getVisibility(), (immersive_mode ? View.GONE : (activity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE))); assertEquals(switchVideoButton.getVisibility(), (immersive_mode ? View.GONE : View.VISIBLE)); Loading
app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +409 −413 File changed.Preview size limit exceeded, changes collapsed. Show changes