Search in sources :

Example 1 with CameraTestHelper

use of com.android.mediaframeworktest.CameraTestHelper in project android_frameworks_base by ParanoidAndroid.

the class CameraFunctionalTest method setUp.

protected void setUp() throws Exception {
    final Semaphore sem = new Semaphore(0);
    mLooperThread = new Thread() {

        @Override
        public void run() {
            Log.v(TAG, "starting looper");
            Looper.prepare();
            mHandler = new Handler();
            sem.release();
            Looper.loop();
            Log.v(TAG, "quit looper");
        }
    };
    mLooperThread.start();
    if (!sem.tryAcquire(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) {
        fail("Failed to start the looper.");
    }
    getActivity();
    super.setUp();
    mCameraTestHelper = new CameraTestHelper();
}
Also used : CameraTestHelper(com.android.mediaframeworktest.CameraTestHelper) Handler(android.os.Handler) Semaphore(java.util.concurrent.Semaphore)

Example 2 with CameraTestHelper

use of com.android.mediaframeworktest.CameraTestHelper in project android_frameworks_base by ParanoidAndroid.

the class CameraPairwiseTest method setUp.

protected void setUp() throws Exception {
    final Semaphore sem = new Semaphore(0);
    mLooperThread = new Thread() {

        @Override
        public void run() {
            Log.v(TAG, "starting looper");
            Looper.prepare();
            mHandler = new Handler();
            sem.release();
            Looper.loop();
            Log.v(TAG, "quit looper");
        }
    };
    mLooperThread.start();
    if (!sem.tryAcquire(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) {
        fail("Failed to start the looper.");
    }
    getActivity();
    super.setUp();
    mCameraTestHelper = new CameraTestHelper();
}
Also used : CameraTestHelper(com.android.mediaframeworktest.CameraTestHelper) Handler(android.os.Handler) Semaphore(java.util.concurrent.Semaphore)

Example 3 with CameraTestHelper

use of com.android.mediaframeworktest.CameraTestHelper in project android_frameworks_base by ParanoidAndroid.

the class CameraStressTest method setUp.

protected void setUp() throws Exception {
    final Semaphore sem = new Semaphore(0);
    mLooperThread = new Thread() {

        @Override
        public void run() {
            Log.v(TAG, "starting looper");
            Looper.prepare();
            mHandler = new Handler();
            sem.release();
            Looper.loop();
            Log.v(TAG, "quit looper");
        }
    };
    mLooperThread.start();
    if (!sem.tryAcquire(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) {
        fail("Failed to start the looper.");
    }
    getActivity();
    super.setUp();
    mCameraTestHelper = new CameraTestHelper();
    File stressOutFile = new File(String.format("%s/%s", Environment.getExternalStorageDirectory(), CAMERA_STRESS_OUTPUT));
    mOutput = new BufferedWriter(new FileWriter(stressOutFile, true));
    mOutput.write(this.getName() + "\n");
}
Also used : CameraTestHelper(com.android.mediaframeworktest.CameraTestHelper) FileWriter(java.io.FileWriter) Handler(android.os.Handler) Semaphore(java.util.concurrent.Semaphore) File(java.io.File) BufferedWriter(java.io.BufferedWriter)

Aggregations

Handler (android.os.Handler)3 CameraTestHelper (com.android.mediaframeworktest.CameraTestHelper)3 Semaphore (java.util.concurrent.Semaphore)3 BufferedWriter (java.io.BufferedWriter)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1