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

Commit 9ff7d5db authored by James Dong's avatar James Dong Committed by Android Git Automerger
Browse files

am 7b996d19: Fix a test case failure when there is no back-facing camera on a device

* commit '7b996d19':
  Fix a test case failure when there is no back-facing camera on a device
parents 1a7d90c4 7b996d19
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());