am a4d259dd: Merge "Add a test for setDataSource(null)"
* commit 'a4d259dd3b16f51617d3df5ea17dc8b2a37d7580':
Add a test for setDataSource(null)
diff --git a/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java b/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java
index b090e27..da54171 100644
--- a/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java
@@ -70,4 +70,15 @@
assertNull("Writer was unexpected present",
retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_WRITER));
}
+
+ public void testSetDataSourceNull() {
+ MediaMetadataRetriever retriever = new MediaMetadataRetriever();
+
+ try {
+ retriever.setDataSource((String)null);
+ fail("Expected IllegalArgumentException.");
+ } catch (IllegalArgumentException ex) {
+ // Expected, test passed.
+ }
+ }
}