Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b996d19 authored by James Dong's avatar James Dong
Browse files

Fix a test case failure when there is no back-facing camera on a device

Change-Id: I427b2e03b266ff2d92c6fe64f732a256d285020e
related-to-bug: 6538628
parent 7f651969
Loading
Loading
Loading
Loading
+53 −51
Original line number Diff line number Diff line
@@ -415,9 +415,10 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me
        output.write("Total number of loops: " + NUMBER_OF_TIME_LAPSE_LOOPS + "\n");

        try {
            output.write("No of loop: ");
            for (int j = 0, n = Camera.getNumberOfCameras(); j < n; j++) {
                output.write("No of loop: camera " + j);
                for (int i = 0; i < NUMBER_OF_TIME_LAPSE_LOOPS; i++) {
                filename = OUTPUT_FILE + i + OUTPUT_FILE_EXT;
                    filename = OUTPUT_FILE + j + "_" + i + OUTPUT_FILE_EXT;
                    Log.v(TAG, filename);
                    runOnLooper(new Runnable() {
                        @Override
@@ -434,7 +435,7 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me

                    // Set camcorder profile for time lapse
                    CamcorderProfile profile =
                        CamcorderProfile.get(CamcorderProfile.QUALITY_TIME_LAPSE_HIGH);
                        CamcorderProfile.get(j, CamcorderProfile.QUALITY_TIME_LAPSE_HIGH);
                    mRecorder.setProfile(profile);

                    // Set the timelapse setting; 0.1 = 10 sec timelapse, 0.5 = 2 sec timelapse, etc.
@@ -470,6 +471,7 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me
                    output.write(", " + i);
                }
            }
        }
        catch (IllegalStateException e) {
            assertTrue("Camera time lapse stress test IllegalStateException", false);
            Log.v(TAG, e.toString());