diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-02 20:13:20 -0500 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-02 20:13:20 -0500 |
commit | f67eff177515baa421d8717ee20efdc516fde580 (patch) | |
tree | f128e3cd8c945c1a053cfbf135ec9bb7c67c7196 /media/tests | |
parent | d6af2e0cbf144b091d9c9d1bf2f3061547220c80 (diff) | |
parent | 38b03a76616edffabb97f4131e268c701dffb00f (diff) | |
download | frameworks_base-f67eff177515baa421d8717ee20efdc516fde580.zip frameworks_base-f67eff177515baa421d8717ee20efdc516fde580.tar.gz frameworks_base-f67eff177515baa421d8717ee20efdc516fde580.tar.bz2 |
Merge change Ib0036762 into eclair
* changes:
Add windows media support check in MediaMetadataRetrieverTest bug 2232274
Diffstat (limited to 'media/tests')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java index 9927eda..8750098 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java @@ -22,6 +22,7 @@ import android.graphics.Bitmap; import java.io.FileOutputStream; import android.test.AndroidTestCase; import com.android.mediaframeworktest.MediaNames; +import com.android.mediaframeworktest.MediaProfileReader; import android.test.suitebuilder.annotation.*; /** @@ -38,10 +39,19 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase { public static void testAlbumArt() throws Exception { Log.v(TAG, "testAlbumArt starts."); MediaMetadataRetriever retriever = new MediaMetadataRetriever(); + MediaProfileReader reader = new MediaProfileReader(); + boolean supportWMA = reader.getWMAEnable(); + boolean supportWMV = reader.getWMVEnable(); retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY); for (int i = 0, n = MediaNames.ALBUMART_TEST_FILES.length; i < n; ++i) { try { Log.v(TAG, "File " + i + ": " + MediaNames.ALBUMART_TEST_FILES[i]); + if ((MediaNames.ALBUMART_TEST_FILES[i].endsWith(".wma") && !supportWMA) || + (MediaNames.ALBUMART_TEST_FILES[i].endsWith(".wmv") && !supportWMV) + ) { + Log.v(TAG, "windows media is not supported and thus we will skip the test for this file"); + continue; + } retriever.setDataSource(MediaNames.ALBUMART_TEST_FILES[i]); byte[] albumArt = retriever.extractAlbumArt(); @@ -64,11 +74,20 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase { @LargeTest public static void testThumbnailCapture() throws Exception { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); + MediaProfileReader reader = new MediaProfileReader(); + boolean supportWMA = reader.getWMAEnable(); + boolean supportWMV = reader.getWMVEnable(); Log.v(TAG, "Thumbnail processing starts"); long startedAt = System.currentTimeMillis(); for(int i = 0, n = MediaNames.THUMBNAIL_CAPTURE_TEST_FILES.length; i < n; ++i) { try { Log.v(TAG, "File " + i + ": " + MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]); + if ((MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i].endsWith(".wma") && !supportWMA) || + (MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i].endsWith(".wmv") && !supportWMV) + ) { + Log.v(TAG, "windows media is not supported and thus we will skip the test for this file"); + continue; + } retriever.setDataSource(MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]); Bitmap bitmap = retriever.captureFrame(); assertTrue(bitmap != null); @@ -91,10 +110,20 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase { @LargeTest public static void testMetadataRetrieval() throws Exception { + MediaProfileReader reader = new MediaProfileReader(); + boolean supportWMA = reader.getWMAEnable(); + boolean supportWMV = reader.getWMVEnable(); MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY); for(int i = 0, n = MediaNames.METADATA_RETRIEVAL_TEST_FILES.length; i < n; ++i) { try { + Log.v(TAG, "File " + i + ": " + MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]); + if ((MediaNames.METADATA_RETRIEVAL_TEST_FILES[i].endsWith(".wma") && !supportWMA) || + (MediaNames.METADATA_RETRIEVAL_TEST_FILES[i].endsWith(".wmv") && !supportWMV) + ) { + Log.v(TAG, "windows media is not supported and thus we will skip the test for this file"); + continue; + } retriever.setDataSource(MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]); extractAllSupportedMetadataValues(retriever); } catch(Exception e) { |