am 9865567b: Merge branch \'eclair-plus-aosp\' of ssh://android-git.corp.google.com:29418/platform/packages/apps/Email into eclair-mr2-plus-aosp

Merge commit '9865567bfc4f86e7569e97e2114bac62b49b3b16'

* commit '9865567bfc4f86e7569e97e2114bac62b49b3b16':
  Fix a crash when you scroll MessageList to junk @ bottom
This commit is contained in:
Dmitri Plotnikov 2009-10-12 12:39:16 -07:00 committed by Android Git Automerger
commit 74cd5ab3cd
2 changed files with 33 additions and 4 deletions

View File

@ -120,6 +120,6 @@
<!-- TYPE_TRASH = 6 -->
<item>@drawable/ic_list_trash</item>
<!-- TYPE_JUNK = 7 -->
<item></item>
<item>@drawable/ic_list_spam</item>
</array>
</resources>

View File

@ -17,14 +17,14 @@
package com.android.email;
import com.android.email.provider.EmailContent.Mailbox;
import com.android.email.R;
import com.android.email.Utility;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import junit.framework.TestCase;
import java.util.HashSet;
import java.util.Set;
/**
* This is a series of unit tests for the Utility class. These tests must be locally
@ -83,4 +83,33 @@ public class UtilityUnitTests extends AndroidTestCase {
name = Utility.FolderProperties.getInstance(context).getDisplayName(8);
assertEquals(expect, name);
}
/**
* Confirm that all of the special icons are available and unique
*/
public void testSpecialIcons() {
Utility.FolderProperties fp = Utility.FolderProperties.getInstance(mContext);
// Make sure they're available
Drawable inbox = fp.getIconIds(Mailbox.TYPE_INBOX);
Drawable mail = fp.getIconIds(Mailbox.TYPE_MAIL);
Drawable parent = fp.getIconIds(Mailbox.TYPE_PARENT);
Drawable drafts = fp.getIconIds(Mailbox.TYPE_DRAFTS);
Drawable outbox = fp.getIconIds(Mailbox.TYPE_OUTBOX);
Drawable sent = fp.getIconIds(Mailbox.TYPE_SENT);
Drawable trash = fp.getIconIds(Mailbox.TYPE_TRASH);
Drawable junk = fp.getIconIds(Mailbox.TYPE_JUNK);
// Make sure they're unique
Set<Drawable> set = new HashSet<Drawable>();
set.add(inbox);
set.add(mail);
set.add(parent);
set.add(drafts);
set.add(outbox);
set.add(sent);
set.add(trash);
set.add(junk);
assertEquals(8, set.size());
}
}