Methods Summary |
---|
private void | assertMediaPlaybackActivityHandles(java.lang.String mime)
ResolveInfo ri = resolveMime(mime);
assertNotNull(ri);
assertEquals(MEDIA_PLAYBACK_NAME, ri.activityInfo.name.toString());
|
private void | assertNoActivityHandles(java.lang.String mime)
assertNull(resolveMime(mime));
|
private android.content.pm.ResolveInfo | resolveMime(java.lang.String mime)
Intent viewIntent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.fromParts("file", MP3_FILE, null);
viewIntent.setDataAndType(uri, mime);
return mContext.getPackageManager().resolveActivity(
viewIntent, PackageManager.MATCH_DEFAULT_ONLY);
|
protected void | setUp()
super.setUp();
mContext = getActivity();
// Checks you have all the test files on your SDCARD.
assertTrue(new File(MP3_FILE).exists());
|
protected void | tearDown()
super.tearDown();
|
public void | testCheckActivityResolverMimeHandlingIsCaseSensitive()
assertNoActivityHandles("AUDIO/MP3"); // <--- look uppercase
|
public void | testCheckMediaPlaybackHandlesApplicationItunes()
assertMediaPlaybackActivityHandles("application/itunes");
|
public void | testCheckMediaPlaybackHandlesAudio()
assertMediaPlaybackActivityHandles("audio/*");
|
public void | testCheckMediaPlaybackHandlesAudioMp3()
assertMediaPlaybackActivityHandles("audio/mp3");
|
public void | testCheckWhiteSpacesInMimeTypeHandling()
assertNoActivityHandles(" audio/mp3");
assertNoActivityHandles(" audio/mp3 ");
assertMediaPlaybackActivityHandles("audio/mp3 ");
|