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

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

Insert the 2 seconds before test start to

workaround the race conditon for requesting
the surface.

Change-Id: Ic8ba358400492860b0d38fc71468ea4bb4d3d7bd
parent e252077d
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import com.android.mediaframeworktest.MediaProfileReader;
import com.android.mediaframeworktest.functional.CodecTest;

import android.content.Context;
import android.test.ActivityInstrumentationTestCase;
import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
@@ -33,7 +33,7 @@ import java.io.File;
/**
 * Junit / Instrumentation test case for the media player api
 */
public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFrameworkTest> {
public class MediaPlayerApiTest extends  ActivityInstrumentationTestCase2<MediaFrameworkTest> {
    private boolean duratoinWithinTolerence = false;
    private String TAG = "MediaPlayerApiTest";
    private boolean isWMAEnable = false;
@@ -48,8 +48,11 @@ public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFra
    }

    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();
   
    }

    public boolean verifyDuration(int duration, int expectedDuration){