Loading app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java +17 −17 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public class InstrumentedTest { try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } if( wait_for_preview ) { Loading @@ -176,7 +176,7 @@ public class InstrumentedTest { try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -235,7 +235,7 @@ public class InstrumentedTest { Thread.sleep(DrawPreview.dim_effect_time_c+50); // wait for updateForSettings } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -357,7 +357,7 @@ public class InstrumentedTest { //this.getInstrumentation().waitForIdleSync(); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } iso = getActivityValue(activity -> activity.getPreview().getCameraController().getISO()); Log.d(TAG, "changed iso to: "+ iso); Loading Loading @@ -390,7 +390,7 @@ public class InstrumentedTest { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -421,7 +421,7 @@ public class InstrumentedTest { Thread.sleep(1000); // wait for camera to open } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } List<Bitmap> inputs = new ArrayList<>(); Loading @@ -430,7 +430,7 @@ public class InstrumentedTest { activity.getApplicationInterface().getHDRProcessor().processHDR(inputs, true, null, true, null, 0.0f, 4, true, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, HDRProcessor.DROTonemappingAlgorithm.DROALGORITHM_NONE); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Loading Loading @@ -465,7 +465,7 @@ public class InstrumentedTest { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } }); } Loading Loading @@ -5126,7 +5126,7 @@ public class InstrumentedTest { Thread.sleep(1000); // need to wait for debug images to be saved/broadcast? } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } }); } Loading Loading @@ -6488,7 +6488,7 @@ public class InstrumentedTest { TestUtils.checkFilesAfterTakePhoto(activity, is_raw, test_wait_capture_result, files); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from checkFilesAfterTakePhoto", e); } TestUtils.checkFocusAfterTakePhoto2(activity, touch_to_focus, single_tap_photo, double_tap_photo, test_wait_capture_result, locked_focus, info.can_auto_focus, info.can_focus_area, saved_count); Loading Loading @@ -6532,7 +6532,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, false, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6563,7 +6563,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, false, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6592,7 +6592,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, true, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6648,7 +6648,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, true, true, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6689,7 +6689,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, true, true, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -7203,7 +7203,7 @@ public class InstrumentedTest { Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } mActivityRule.getScenario().onActivity(activity -> { Loading Loading @@ -7236,7 +7236,7 @@ public class InstrumentedTest { Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } mActivityRule.getScenario().onActivity(activity -> { Loading app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java +17 −19 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class TestUtils { return getBitmapFromFileCore(activity, filename, inSampleSize); } catch(FileNotFoundException e) { e.printStackTrace(); Log.e(TAG, "FileNotFoundException loading: " + filename, e); fail("FileNotFoundException loading: " + filename); return null; } Loading Loading @@ -155,7 +155,7 @@ public class TestUtils { is.close(); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "failed to close input stream", e); } } else { Loading Loading @@ -221,7 +221,7 @@ public class TestUtils { } } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "failed to load bitmap", e); } finally { if( parcelFileDescriptor != null ) { Loading @@ -229,7 +229,7 @@ public class TestUtils { parcelFileDescriptor.close(); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "failed to close parcelFileDescriptor", e); } } } Loading Loading @@ -262,8 +262,7 @@ public class TestUtils { } } catch(Exception e) { Log.e(TAG, "Exception trying to find uri from filename"); e.printStackTrace(); Log.e(TAG, "exception trying to find uri from filename", e); } finally { if( cursor != null ) { Loading @@ -278,7 +277,7 @@ public class TestUtils { saveBitmapCore(activity, bitmap, name); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "IOException saving: " + name, e); fail("IOException saving: " + name); } } Loading Loading @@ -411,7 +410,7 @@ public class TestUtils { Thread.sleep(1000); // wait for camera to open } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } Bitmap dro_bitmap_in = null; Loading @@ -432,7 +431,7 @@ public class TestUtils { //test_callback.doHDR(inputs, tonemapping_algorithm, hdr_alpha); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Log.d(TAG, "HDR time: " + (System.currentTimeMillis() - time_s)); Loading @@ -451,7 +450,7 @@ public class TestUtils { //test_callback.doHDR(inputs, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, 0.5f); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Log.d(TAG, "DRO time: " + (System.currentTimeMillis() - time_s)); Loading @@ -465,7 +464,7 @@ public class TestUtils { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } return hdrHistogramDetails; Loading Loading @@ -518,7 +517,7 @@ public class TestUtils { Thread.sleep(1000); // wait for camera to open } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } /*Bitmap nr_bitmap = getBitmapFromFile(activity, inputs.get(0)); Loading @@ -538,7 +537,7 @@ public class TestUtils { //activity.getApplicationInterface().getHDRProcessor().processAvgMulti(inputs, hdr_strength, 4); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processAvg failed", e); throw new RuntimeException(); } Log.d(TAG, "Avg time: " + (System.currentTimeMillis() - time_s)); Loading Loading @@ -599,7 +598,7 @@ public class TestUtils { Log.d(TAG, " total: " + total_time); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "HDRProcessorException", e); throw new RuntimeException(); } Loading @@ -613,7 +612,7 @@ public class TestUtils { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } return hdrHistogramDetails; Loading Loading @@ -679,8 +678,7 @@ public class TestUtils { inputStream = new FileInputStream(gyro_debug_info_filename); } catch(FileNotFoundException e) { Log.e(TAG, "failed to load gyro debug info file: " + gyro_debug_info_filename); e.printStackTrace(); Log.e(TAG, "failed to load gyro debug info file: " + gyro_debug_info_filename, e); throw new RuntimeException(); } Loading @@ -703,7 +701,7 @@ public class TestUtils { panorama = activity.getApplicationInterface().getPanoramaProcessor().panorama(bitmaps, panorama_pics_per_screen, camera_angle_y, crop); } catch(PanoramaProcessorException e) { e.printStackTrace(); Log.e(TAG, "panorama failed", e); fail(); } Loading @@ -712,7 +710,7 @@ public class TestUtils { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } // check we've cropped correctly: Loading app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +27 −27 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } if( wait_for_preview ) { Loading @@ -176,7 +176,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -250,7 +250,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(DrawPreview.dim_effect_time_c+50); // wait for updateForSettings } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } this.getInstrumentation().waitForIdleSync(); Loading Loading @@ -388,7 +388,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv this.getInstrumentation().waitForIdleSync(); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } iso = mPreview.getCameraController().getISO(); Log.d(TAG, "changed iso to: "+ iso); Loading Loading @@ -429,7 +429,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -6162,7 +6162,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(2000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading @@ -6174,7 +6174,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(2000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading Loading @@ -6209,7 +6209,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading Loading @@ -6238,7 +6238,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(pauseVideoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.resume_video)); Loading Loading @@ -6266,7 +6266,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "takePhotoButton description: " + takePhotoButton.getContentDescription()); Loading Loading @@ -6317,7 +6317,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading Loading @@ -6346,7 +6346,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "takePhotoButton description: " + takePhotoButton.getContentDescription()); Loading Loading @@ -6387,7 +6387,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading @@ -6412,7 +6412,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading Loading @@ -6557,7 +6557,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "done waiting"); Loading Loading @@ -6638,7 +6638,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(10000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "check still recording"); Loading Loading @@ -6697,7 +6697,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading @@ -6706,7 +6706,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } View takePhotoButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.take_photo); Loading @@ -6720,7 +6720,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "done wait for stop"); Loading Loading @@ -6816,7 +6816,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(38000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "ensure we've really stopped"); Loading Loading @@ -6859,7 +6859,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(100); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading @@ -6877,7 +6877,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(100); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading Loading @@ -8120,7 +8120,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertEquals(2, n_new_files); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading Loading @@ -8194,7 +8194,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertFalse(mPreview.isOnTimer()); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading Loading @@ -8503,7 +8503,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading Loading @@ -8911,7 +8911,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertEquals(8, n_new_files); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading Loading @@ -14004,7 +14004,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv mActivity.getApplicationInterface().getHDRProcessor().processHDR(inputs, true, null, true, null, 0.0f, 4, true, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, HDRProcessor.DROTonemappingAlgorithm.DROALGORITHM_NONE); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Loading
app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java +17 −17 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public class InstrumentedTest { try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } if( wait_for_preview ) { Loading @@ -176,7 +176,7 @@ public class InstrumentedTest { try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -235,7 +235,7 @@ public class InstrumentedTest { Thread.sleep(DrawPreview.dim_effect_time_c+50); // wait for updateForSettings } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -357,7 +357,7 @@ public class InstrumentedTest { //this.getInstrumentation().waitForIdleSync(); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } iso = getActivityValue(activity -> activity.getPreview().getCameraController().getISO()); Log.d(TAG, "changed iso to: "+ iso); Loading Loading @@ -390,7 +390,7 @@ public class InstrumentedTest { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -421,7 +421,7 @@ public class InstrumentedTest { Thread.sleep(1000); // wait for camera to open } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } List<Bitmap> inputs = new ArrayList<>(); Loading @@ -430,7 +430,7 @@ public class InstrumentedTest { activity.getApplicationInterface().getHDRProcessor().processHDR(inputs, true, null, true, null, 0.0f, 4, true, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, HDRProcessor.DROTonemappingAlgorithm.DROALGORITHM_NONE); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Loading Loading @@ -465,7 +465,7 @@ public class InstrumentedTest { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } }); } Loading Loading @@ -5126,7 +5126,7 @@ public class InstrumentedTest { Thread.sleep(1000); // need to wait for debug images to be saved/broadcast? } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } }); } Loading Loading @@ -6488,7 +6488,7 @@ public class InstrumentedTest { TestUtils.checkFilesAfterTakePhoto(activity, is_raw, test_wait_capture_result, files); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from checkFilesAfterTakePhoto", e); } TestUtils.checkFocusAfterTakePhoto2(activity, touch_to_focus, single_tap_photo, double_tap_photo, test_wait_capture_result, locked_focus, info.can_auto_focus, info.can_focus_area, saved_count); Loading Loading @@ -6532,7 +6532,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, false, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6563,7 +6563,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, false, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6592,7 +6592,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, true, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6648,7 +6648,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, true, true, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -6689,7 +6689,7 @@ public class InstrumentedTest { TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, true, true, false); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "testExif failed", e); fail(); } }); Loading Loading @@ -7203,7 +7203,7 @@ public class InstrumentedTest { Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } mActivityRule.getScenario().onActivity(activity -> { Loading Loading @@ -7236,7 +7236,7 @@ public class InstrumentedTest { Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } mActivityRule.getScenario().onActivity(activity -> { Loading
app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java +17 −19 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class TestUtils { return getBitmapFromFileCore(activity, filename, inSampleSize); } catch(FileNotFoundException e) { e.printStackTrace(); Log.e(TAG, "FileNotFoundException loading: " + filename, e); fail("FileNotFoundException loading: " + filename); return null; } Loading Loading @@ -155,7 +155,7 @@ public class TestUtils { is.close(); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "failed to close input stream", e); } } else { Loading Loading @@ -221,7 +221,7 @@ public class TestUtils { } } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "failed to load bitmap", e); } finally { if( parcelFileDescriptor != null ) { Loading @@ -229,7 +229,7 @@ public class TestUtils { parcelFileDescriptor.close(); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "failed to close parcelFileDescriptor", e); } } } Loading Loading @@ -262,8 +262,7 @@ public class TestUtils { } } catch(Exception e) { Log.e(TAG, "Exception trying to find uri from filename"); e.printStackTrace(); Log.e(TAG, "exception trying to find uri from filename", e); } finally { if( cursor != null ) { Loading @@ -278,7 +277,7 @@ public class TestUtils { saveBitmapCore(activity, bitmap, name); } catch(IOException e) { e.printStackTrace(); Log.e(TAG, "IOException saving: " + name, e); fail("IOException saving: " + name); } } Loading Loading @@ -411,7 +410,7 @@ public class TestUtils { Thread.sleep(1000); // wait for camera to open } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } Bitmap dro_bitmap_in = null; Loading @@ -432,7 +431,7 @@ public class TestUtils { //test_callback.doHDR(inputs, tonemapping_algorithm, hdr_alpha); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Log.d(TAG, "HDR time: " + (System.currentTimeMillis() - time_s)); Loading @@ -451,7 +450,7 @@ public class TestUtils { //test_callback.doHDR(inputs, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, 0.5f); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); } Log.d(TAG, "DRO time: " + (System.currentTimeMillis() - time_s)); Loading @@ -465,7 +464,7 @@ public class TestUtils { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } return hdrHistogramDetails; Loading Loading @@ -518,7 +517,7 @@ public class TestUtils { Thread.sleep(1000); // wait for camera to open } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } /*Bitmap nr_bitmap = getBitmapFromFile(activity, inputs.get(0)); Loading @@ -538,7 +537,7 @@ public class TestUtils { //activity.getApplicationInterface().getHDRProcessor().processAvgMulti(inputs, hdr_strength, 4); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processAvg failed", e); throw new RuntimeException(); } Log.d(TAG, "Avg time: " + (System.currentTimeMillis() - time_s)); Loading Loading @@ -599,7 +598,7 @@ public class TestUtils { Log.d(TAG, " total: " + total_time); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "HDRProcessorException", e); throw new RuntimeException(); } Loading @@ -613,7 +612,7 @@ public class TestUtils { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } return hdrHistogramDetails; Loading Loading @@ -679,8 +678,7 @@ public class TestUtils { inputStream = new FileInputStream(gyro_debug_info_filename); } catch(FileNotFoundException e) { Log.e(TAG, "failed to load gyro debug info file: " + gyro_debug_info_filename); e.printStackTrace(); Log.e(TAG, "failed to load gyro debug info file: " + gyro_debug_info_filename, e); throw new RuntimeException(); } Loading @@ -703,7 +701,7 @@ public class TestUtils { panorama = activity.getApplicationInterface().getPanoramaProcessor().panorama(bitmaps, panorama_pics_per_screen, camera_angle_y, crop); } catch(PanoramaProcessorException e) { e.printStackTrace(); Log.e(TAG, "panorama failed", e); fail(); } Loading @@ -712,7 +710,7 @@ public class TestUtils { Thread.sleep(500); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } // check we've cropped correctly: Loading
app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +27 −27 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } if( wait_for_preview ) { Loading @@ -176,7 +176,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv try { Thread.sleep(100); // sleep a bit just to be safe } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -250,7 +250,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(DrawPreview.dim_effect_time_c+50); // wait for updateForSettings } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } this.getInstrumentation().waitForIdleSync(); Loading Loading @@ -388,7 +388,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv this.getInstrumentation().waitForIdleSync(); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } iso = mPreview.getCameraController().getISO(); Log.d(TAG, "changed iso to: "+ iso); Loading Loading @@ -429,7 +429,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); } } Loading Loading @@ -6162,7 +6162,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(2000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading @@ -6174,7 +6174,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(2000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading Loading @@ -6209,7 +6209,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading Loading @@ -6238,7 +6238,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(pauseVideoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.resume_video)); Loading Loading @@ -6266,7 +6266,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "takePhotoButton description: " + takePhotoButton.getContentDescription()); Loading Loading @@ -6317,7 +6317,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading Loading @@ -6346,7 +6346,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "takePhotoButton description: " + takePhotoButton.getContentDescription()); Loading Loading @@ -6387,7 +6387,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading @@ -6412,7 +6412,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(3000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video)); Loading Loading @@ -6557,7 +6557,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "done waiting"); Loading Loading @@ -6638,7 +6638,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(10000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "check still recording"); Loading Loading @@ -6697,7 +6697,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading @@ -6706,7 +6706,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } View takePhotoButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.take_photo); Loading @@ -6720,7 +6720,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "done wait for stop"); Loading Loading @@ -6816,7 +6816,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(38000); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Log.d(TAG, "ensure we've really stopped"); Loading Loading @@ -6859,7 +6859,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(100); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading @@ -6877,7 +6877,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv Thread.sleep(100); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading Loading @@ -8120,7 +8120,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertEquals(2, n_new_files); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading Loading @@ -8194,7 +8194,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertFalse(mPreview.isOnTimer()); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading Loading @@ -8503,7 +8503,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } Loading Loading @@ -8911,7 +8911,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv assertEquals(8, n_new_files); } catch(InterruptedException e) { e.printStackTrace(); Log.e(TAG, "InterruptedException from sleep", e); fail(); } } Loading Loading @@ -14004,7 +14004,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv mActivity.getApplicationInterface().getHDRProcessor().processHDR(inputs, true, null, true, null, 0.0f, 4, true, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, HDRProcessor.DROTonemappingAlgorithm.DROALGORITHM_NONE); } catch(HDRProcessorException e) { e.printStackTrace(); Log.e(TAG, "processHDR failed", e); throw new RuntimeException(); }