diff options
author | Andrew Sapperstein <asapperstein@google.com> | 2014-04-22 14:33:55 -0700 |
---|---|---|
committer | Andrew Sapperstein <asapperstein@google.com> | 2014-05-21 16:37:45 -0700 |
commit | a839fd0af18f53574128e32dc0900339280fba05 (patch) | |
tree | 6473763b357b8249b277c3c4069a25a91cd3a6f1 /tests | |
parent | dc7c68e6376c3b8ddeacc6e00545f60fe8e2d309 (diff) | |
download | android_packages_apps_UnifiedEmail-a839fd0af18f53574128e32dc0900339280fba05.tar.gz android_packages_apps_UnifiedEmail-a839fd0af18f53574128e32dc0900339280fba05.tar.bz2 android_packages_apps_UnifiedEmail-a839fd0af18f53574128e32dc0900339280fba05.zip |
Revert the CLs that updated the message headers.
Revert "Remove padding for message details. b/13329913."
This reverts commit 42c39c4026970508a536099085d5155196bbee42.
Revert "Fix UI issues caused by new attachment asset."
This reverts commit b6a6a5c2cd6d8b07e93c07b8a2cafa2276d9bec7.
Revert "Redesign of message headers. b/12933316."
This reverts commit 2ed8c0409cd7d8e64c58ada6f63a519517ddaf7d.
Revert "Ensure expanded details always shows. b/13348592."
This reverts commit bac524cc0575ff3cf54aa93247bf33c06edcdd9d.
Change-Id: I1d70329504dd788e4b2879137bae43eb4c4167fe
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/mail/browse/MessageHeaderViewTest.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/com/android/mail/browse/MessageHeaderViewTest.java b/tests/src/com/android/mail/browse/MessageHeaderViewTest.java index 0ba04f5c4..1cadb73cd 100644 --- a/tests/src/com/android/mail/browse/MessageHeaderViewTest.java +++ b/tests/src/com/android/mail/browse/MessageHeaderViewTest.java @@ -27,6 +27,43 @@ import java.util.HashMap; public class MessageHeaderViewTest extends AndroidTestCase { @SmallTest + public void testRecipientSummaryLongTo() { + String[] to = makeRecipientArray("TO", 60); + String[] cc = makeRecipientArray("CC", 60); + String summary = MessageHeaderView.getRecipientSummaryText(getContext(), "", "", to, cc, + null, new HashMap<String, Address>(), null).toString(); + + assertTrue(summary.contains("TO00")); + assertTrue(summary.contains("TO49")); + assertFalse(summary.contains("TO50")); + } + + @SmallTest + public void testRecipientSummaryLongMultipleLists() { + String[] to = makeRecipientArray("TO", 20); + String[] cc = makeRecipientArray("CC", 10); + String[] bcc = makeRecipientArray("BB", 60); + String summary = MessageHeaderView.getRecipientSummaryText(getContext(), "", "", to, cc, + bcc, new HashMap<String, Address>(), null).toString(); + + assertTrue(summary.contains("TO00")); + assertTrue(summary.contains("TO19")); + assertTrue(summary.contains("CC00")); + assertTrue(summary.contains("CC09")); + assertTrue(summary.contains("BB00")); + assertTrue(summary.contains("BB19")); + assertFalse(summary.contains("BB20")); + } + + private static String[] makeRecipientArray(String prefix, int len) { + String[] arr = new String[len]; + for (int i=0; i < arr.length; i++) { + arr[i] = String.format("\"%s%02d\" <foo@bar.com>", prefix, i); + } + return arr; + } + + @SmallTest public void testMakeSnippet() { assertSnippetEquals("Hello, world!", "Hello, world!"); |