Insert 2 seconds wait in each test case setup.
This is the work around for the surface request race condition. Change-Id: Iaf8be12cfe4eb70d0a309ad875f38427181ac4b4
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user