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

Commit 003a7569 authored by Yu Shan Emily Lau's avatar Yu Shan Emily Lau
Browse files

Insert 2 seconds wait in each test case setup.

This is the work around for the surface request race
condition.

Change-Id: Iaf8be12cfe4eb70d0a309ad875f38427181ac4b4
parent b7b3894a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med

    protected void setUp() throws Exception {
        super.setUp();
        //Insert a 2 second before launching the test activity. This is
        //the workaround for the race condition of requesting the updated surface.
        Thread.sleep(2000);
        getActivity();
        if (MediaFrameworkPerfTestRunner.mGetNativeHeapDump)
            MediaTestUtil.getNativeHeapDump(this.getName() + "_before");
+6 −1
Original line number Diff line number Diff line
@@ -43,13 +43,18 @@ import android.test.InstrumentationTestCase;
/**
 * Junit / Instrumentation test case for the media player
 */
public class MediaPlayerStressTest extends InstrumentationTestCase {
public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<MediaFrameworkTest> {
    private String TAG = "MediaPlayerStressTest";

    public MediaPlayerStressTest() {
        super("com.android.mediaframeworktest", MediaFrameworkTest.class);
    }

    protected void setUp() throws Exception {
        //Insert a 2 second before launching the test activity. This is
        //the workaround for the race condition of requesting the updated surface.
        Thread.sleep(2000);
        getActivity();
        super.setUp();
    }

+3 −1
Original line number Diff line number Diff line
@@ -88,7 +88,9 @@ public class MediaRecorderStressTest extends ActivityInstrumentationTestCase2<Me
        if (! sem.tryAcquire(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) {
            fail("Failed to start the looper.");
        }

        //Insert a 2 second before launching the test activity. This is
        //the workaround for the race condition of requesting the updated surface.
        Thread.sleep(2000);
        getActivity();
        super.setUp();
    }