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

Commit abb7bf4f authored by Yu Shan Emily Lau's avatar Yu Shan Emily Lau Committed by Android Git Automerger
Browse files

am f18222da: Merge "Fix the test cases which fail to launch the camera in the...

am f18222da: Merge "Fix the test cases which fail to launch the camera in the device which only has one camera." into jb-dev

* commit 'f18222da':
  Fix the test cases which fail to launch the camera in the device which only has one camera.
parents 8316e51c f18222da
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -47,6 +47,7 @@ public class CameraTest extends ActivityInstrumentationTestCase<MediaFrameworkTe
    private boolean jpegPictureCallbackResult = false;
    private boolean jpegPictureCallbackResult = false;
    
    
    private static int WAIT_FOR_COMMAND_TO_COMPLETE = 10000;  // Milliseconds.
    private static int WAIT_FOR_COMMAND_TO_COMPLETE = 10000;  // Milliseconds.
    private static final int CAMERA_ID = 0;
    
    
    private RawPreviewCallback mRawPreviewCallback = new RawPreviewCallback();
    private RawPreviewCallback mRawPreviewCallback = new RawPreviewCallback();
    private TestShutterCallback mShutterCallback = new TestShutterCallback();
    private TestShutterCallback mShutterCallback = new TestShutterCallback();
@@ -85,7 +86,7 @@ public class CameraTest extends ActivityInstrumentationTestCase<MediaFrameworkTe
                // Save the looper so that we can terminate this thread 
                // Save the looper so that we can terminate this thread 
                // after we are done with it.
                // after we are done with it.
                mLooper = Looper.myLooper();
                mLooper = Looper.myLooper();
                mCamera = Camera.open();
                mCamera = Camera.open(CAMERA_ID);
                startDone.open();
                startDone.open();
                Looper.loop();  // Blocks forever until Looper.quit() is called.
                Looper.loop();  // Blocks forever until Looper.quit() is called.
                Log.v(TAG, "initializeMessageLooper: quit.");
                Log.v(TAG, "initializeMessageLooper: quit.");
+3 −1
Original line number Original line Diff line number Diff line
@@ -54,6 +54,8 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase2<MediaFra


    private int MIN_VIDEO_FPS = 5;
    private int MIN_VIDEO_FPS = 5;


    private static final int CAMERA_ID = 0;

    Context mContext;
    Context mContext;
    Camera mCamera;
    Camera mCamera;
  
  
@@ -247,7 +249,7 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase2<MediaFra
    public void testPortraitH263() throws Exception {
    public void testPortraitH263() throws Exception {
        boolean videoRecordedResult = false;
        boolean videoRecordedResult = false;
        try {
        try {
            mCamera = Camera.open();
            mCamera = Camera.open(CAMERA_ID);
            Camera.Parameters parameters = mCamera.getParameters();
            Camera.Parameters parameters = mCamera.getParameters();
            parameters.setPreviewSize(352, 288);
            parameters.setPreviewSize(352, 288);
            parameters.set("orientation", "portrait");
            parameters.set("orientation", "portrait");
+2 −1
Original line number Original line Diff line number Diff line
@@ -72,6 +72,7 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
        "/sdcard/mediaMemOutput.txt";
        "/sdcard/mediaMemOutput.txt";
    private static final String MEDIA_PROCMEM_OUTPUT =
    private static final String MEDIA_PROCMEM_OUTPUT =
        "/sdcard/mediaProcmemOutput.txt";
        "/sdcard/mediaProcmemOutput.txt";
    private static final int CAMERA_ID = 0;


    private static int mStartMemory = 0;
    private static int mStartMemory = 0;
    private static int mEndMemory = 0;
    private static int mEndMemory = 0;
@@ -132,7 +133,7 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
                Looper.prepare();
                Looper.prepare();
                Log.v(TAG, "start loopRun");
                Log.v(TAG, "start loopRun");
                mLooper = Looper.myLooper();
                mLooper = Looper.myLooper();
                mCamera = Camera.open();
                mCamera = Camera.open(CAMERA_ID);
                startDone.open();
                startDone.open();
                Looper.loop();
                Looper.loop();
                Log.v(TAG, "initializeMessageLooper: quit.");
                Log.v(TAG, "initializeMessageLooper: quit.");
+3 −2
Original line number Original line Diff line number Diff line
@@ -60,6 +60,7 @@ public class CameraStressTest extends ActivityInstrumentationTestCase2<MediaFram
    private static final long WAIT_ZOOM_ANIMATION = 5 * 1000; // 5 seconds
    private static final long WAIT_ZOOM_ANIMATION = 5 * 1000; // 5 seconds
    private static final String CAMERA_STRESS_OUTPUT =
    private static final String CAMERA_STRESS_OUTPUT =
            "/sdcard/cameraStressOutput.txt";
            "/sdcard/cameraStressOutput.txt";
    private static final int CAMERA_ID = 0;
    private final CameraErrorCallback mCameraErrorCallback = new CameraErrorCallback();
    private final CameraErrorCallback mCameraErrorCallback = new CameraErrorCallback();


    private Thread mLooperThread;
    private Thread mLooperThread;
@@ -213,7 +214,7 @@ public class CameraStressTest extends ActivityInstrumentationTestCase2<MediaFram
            Log.v(TAG, "Start preview");
            Log.v(TAG, "Start preview");
            output.write("No of loop: ");
            output.write("No of loop: ");


            mCamera = Camera.open();
            mCamera = Camera.open(CAMERA_ID);
            Camera.Parameters params = mCamera.getParameters();
            Camera.Parameters params = mCamera.getParameters();
            mCamera.release();
            mCamera.release();


@@ -230,7 +231,7 @@ public class CameraStressTest extends ActivityInstrumentationTestCase2<MediaFram
                    runOnLooper(new Runnable() {
                    runOnLooper(new Runnable() {
                        @Override
                        @Override
                        public void run() {
                        public void run() {
                            mCamera = Camera.open();
                            mCamera = Camera.open(CAMERA_ID);
                        }
                        }
                    });
                    });


+4 −2
Original line number Original line Diff line number Diff line
@@ -60,6 +60,8 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me
    private static final String OUTPUT_FILE_EXT = ".3gp";
    private static final String OUTPUT_FILE_EXT = ".3gp";
    private static final String MEDIA_STRESS_OUTPUT =
    private static final String MEDIA_STRESS_OUTPUT =
        "/sdcard/mediaStressOutput.txt";
        "/sdcard/mediaStressOutput.txt";
    private static final int CAMERA_ID = 0;

    private final CameraErrorCallback mCameraErrorCallback = new CameraErrorCallback();
    private final CameraErrorCallback mCameraErrorCallback = new CameraErrorCallback();
    private final RecorderErrorCallback mRecorderErrorCallback = new RecorderErrorCallback();
    private final RecorderErrorCallback mRecorderErrorCallback = new RecorderErrorCallback();


@@ -162,7 +164,7 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me
                runOnLooper(new Runnable() {
                runOnLooper(new Runnable() {
                    @Override
                    @Override
                    public void run() {
                    public void run() {
                        mCamera = Camera.open();
                        mCamera = Camera.open(CAMERA_ID);
                    }
                    }
                });
                });
                mCamera.setErrorCallback(mCameraErrorCallback);
                mCamera.setErrorCallback(mCameraErrorCallback);
@@ -250,7 +252,7 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me
                runOnLooper(new Runnable() {
                runOnLooper(new Runnable() {
                    @Override
                    @Override
                    public void run() {
                    public void run() {
                        mCamera = Camera.open();
                        mCamera = Camera.open(CAMERA_ID);
                    }
                    }
                });
                });
                mCamera.setErrorCallback(mCameraErrorCallback);
                mCamera.setErrorCallback(mCameraErrorCallback);