diff options
author | Gloria Wang <gwang@google.com> | 2011-06-23 10:39:51 -0700 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-06-23 15:28:36 -0700 |
commit | 1e1b13e62e38d6efc7cef4b496b3119bd45ee2c2 (patch) | |
tree | 7e7979f36b9f18b65548009b62a7e8f18f2aaaec /media/tests | |
parent | 0ff6d7ee17de33d314ef726e7506b39c64a3ed35 (diff) | |
download | frameworks_base-1e1b13e62e38d6efc7cef4b496b3119bd45ee2c2.zip frameworks_base-1e1b13e62e38d6efc7cef4b496b3119bd45ee2c2.tar.gz frameworks_base-1e1b13e62e38d6efc7cef4b496b3119bd45ee2c2.tar.bz2 |
- Public part of the Metadata API.
- Modify the media framework test for Metadata.
Change-Id: Ib8fa4991f114e1bb88a17ca662844b9b8e1d0faf
Diffstat (limited to 'media/tests')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerMetadataParserTest.java | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerMetadataParserTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerMetadataParserTest.java index 38f598a..bfa3976 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerMetadataParserTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaPlayerMetadataParserTest.java @@ -277,11 +277,17 @@ public class MediaPlayerMetadataParserTest extends AndroidTestCase { // getBoolean @SmallTest public void testGetBoolean() throws Exception { - writeBooleanRecord(Metadata.DRM_CRIPPLED, true); + writeBooleanRecord(Metadata.PAUSE_AVAILABLE, true); + writeBooleanRecord(Metadata.SEEK_AVAILABLE, true); + writeBooleanRecord(Metadata.SEEK_BACKWARD_AVAILABLE, true); + writeBooleanRecord(Metadata.SEEK_FORWARD_AVAILABLE, true); adjustSize(); assertParse(); - assertEquals(true, mMetadata.getBoolean(Metadata.DRM_CRIPPLED)); + assertEquals(true, mMetadata.getBoolean(Metadata.PAUSE_AVAILABLE)); + assertEquals(true, mMetadata.getBoolean(Metadata.SEEK_AVAILABLE)); + assertEquals(true, mMetadata.getBoolean(Metadata.SEEK_BACKWARD_AVAILABLE)); + assertEquals(true, mMetadata.getBoolean(Metadata.SEEK_FORWARD_AVAILABLE)); } // getLong @@ -329,19 +335,6 @@ public class MediaPlayerMetadataParserTest extends AndroidTestCase { assertEquals(new Date(0), mMetadata.getDate(Metadata.DATE)); } - // getTimedText - @SmallTest - public void testGetTimedText() throws Exception { - Date now = Calendar.getInstance().getTime(); - writeTimedTextRecord(Metadata.CAPTION, now.getTime(), - 10, "Some caption"); - adjustSize(); - assertParse(); - - Metadata.TimedText caption = mMetadata.getTimedText(Metadata.CAPTION); - assertEquals("" + now + "-" + 10 + ":Some caption", caption.toString()); - } - // ---------------------------------------------------------------------- // HELPERS TO APPEND RECORDS // ---------------------------------------------------------------------- @@ -416,17 +409,4 @@ public class MediaPlayerMetadataParserTest extends AndroidTestCase { mParcel.writeString(tz); adjustSize(start); } - - // Insert a TimedText record at the current position. - private void writeTimedTextRecord(int metadataId, long begin, - int duration, String text) { - final int start = mParcel.dataPosition(); - mParcel.writeInt(-1); // Placeholder for the length - mParcel.writeInt(metadataId); - mParcel.writeInt(Metadata.TIMED_TEXT_VAL); - mParcel.writeLong(begin); - mParcel.writeInt(duration); - mParcel.writeString(text); - adjustSize(start); - } } |