diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2012-04-04 21:20:54 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-04 21:20:54 -0700 |
commit | 8fa23393e9f9de1c65a45f49463e745de498c557 (patch) | |
tree | 3d342ca9c7fd7773a809e6d4130a36854f3d4c33 /media/tests/MediaFrameworkTest/src | |
parent | cde8aae955f2c1074a840074a9f586f95c3f61f7 (diff) | |
parent | a79edb72333ceda76c73166acef139c8668ee829 (diff) | |
download | frameworks_base-8fa23393e9f9de1c65a45f49463e745de498c557.zip frameworks_base-8fa23393e9f9de1c65a45f49463e745de498c557.tar.gz frameworks_base-8fa23393e9f9de1c65a45f49463e745de498c557.tar.bz2 |
Merge "Insert the 2 seconds before test start to workaround the race conditon for requesting the surface."
Diffstat (limited to 'media/tests/MediaFrameworkTest/src')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/mediaplayback/MediaPlayerApiTest.java | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/mediaplayback/MediaPlayerApiTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/mediaplayback/MediaPlayerApiTest.java index c501d3f..7be2707 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/mediaplayback/MediaPlayerApiTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/mediaplayback/MediaPlayerApiTest.java @@ -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,25 +33,28 @@ import java.io.File; /** * Junit / Instrumentation test case for the media player api */ -public class MediaPlayerApiTest extends ActivityInstrumentationTestCase<MediaFrameworkTest> { - private boolean duratoinWithinTolerence = false; - private String TAG = "MediaPlayerApiTest"; - private boolean isWMAEnable = false; - private boolean isWMVEnable = false; +public class MediaPlayerApiTest extends ActivityInstrumentationTestCase2<MediaFrameworkTest> { + private boolean duratoinWithinTolerence = false; + private String TAG = "MediaPlayerApiTest"; + private boolean isWMAEnable = false; + private boolean isWMVEnable = false; - Context mContext; + Context mContext; - public MediaPlayerApiTest() { - super("com.android.mediaframeworktest", MediaFrameworkTest.class); - isWMAEnable = MediaProfileReader.getWMAEnable(); - isWMVEnable = MediaProfileReader.getWMVEnable(); - } + public MediaPlayerApiTest() { + super("com.android.mediaframeworktest", MediaFrameworkTest.class); + isWMAEnable = MediaProfileReader.getWMAEnable(); + isWMVEnable = MediaProfileReader.getWMVEnable(); + } 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(); + super.setUp(); + } + public boolean verifyDuration(int duration, int expectedDuration){ if ((duration > expectedDuration * 1.1) || (duration < expectedDuration * 0.9)) return false; |