diff options
author | Andrew Lee <anwlee@google.com> | 2015-06-03 18:03:27 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-06-03 18:25:35 -0700 |
commit | bdf60d080ccab765e659b0e27b1fdb7122f5d008 (patch) | |
tree | 9839a9ed5fb283e2808bf82200bfcdd861781f61 /tests/src/com | |
parent | f42d5ee4d6581d2cb746e615dbb3c94375f8990c (diff) |
Fix unit test errors.
When this was refactored before, some of the logic was bad.
Some of the expected values were changed as well. I figured
"add to contacts" is a really bad default text, because we
don't actually support that action in call details. Also,
the strings returned by the library for describing relative
time spans changed.
Bug: 21471763
Change-Id: I0c78c89c9c2e44de198f1f9299711fc31fe81cb1
Diffstat (limited to 'tests/src/com')
-rw-r--r-- | tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index 701a06ed9..3e7eb66b6 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -132,11 +132,11 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { setPhoneCallDetailsWithDate( new GregorianCalendar(2011, 5, 3, 13, 0, 0).getTimeInMillis()); - assertDateEquals("0 mins ago"); + assertDateEquals("0 min. ago"); setPhoneCallDetailsWithDate( new GregorianCalendar(2011, 5, 3, 12, 0, 0).getTimeInMillis()); - assertDateEquals("1 hour ago"); + assertDateEquals("1 hr. ago"); setPhoneCallDetailsWithDate( new GregorianCalendar(2011, 5, 2, 13, 0, 0).getTimeInMillis()); @@ -223,7 +223,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { public void testSetCallDetailsHeader_NumberOnly() { setCallDetailsHeaderWithNumber(TEST_NUMBER, Calls.PRESENTATION_ALLOWED); assertEquals(View.VISIBLE, mNameView.getVisibility()); - assertEquals("Add to contacts", mNameView.getText().toString()); + assertEquals("1-412-255-5555", mNameView.getText().toString()); } public void testSetCallDetailsHeader_UnknownNumber() { @@ -245,7 +245,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { } public void testSetCallDetailsHeader_VoicemailNumber() { - setCallDetailsHeaderWithNumber(TEST_VOICEMAIL_NUMBER, Calls.PRESENTATION_ALLOWED); + setCallDetailsHeaderWithVoicemailNumber(TEST_VOICEMAIL_NUMBER, Calls.PRESENTATION_ALLOWED); assertEquals(View.VISIBLE, mNameView.getVisibility()); assertEquals("Voicemail", mNameView.getText().toString()); } @@ -412,6 +412,23 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { false /* isVoicemail */)); } + private void setCallDetailsHeaderWithVoicemailNumber(String number, int presentation) { + mHelper.setCallDetailsHeader(mNameView, + new PhoneCallDetails( + mContext, + number, + presentation, + TEST_FORMATTED_NUMBER, + TEST_COUNTRY_ISO, + TEST_GEOCODE, + new int[]{ Calls.INCOMING_TYPE }, + TEST_DATE, + TEST_DURATION, + null, 0, null, null, + true /* isVoicemail */)); + } + + private void setCallDetailsHeader(String name) { mHelper.setCallDetailsHeader(mNameView, new PhoneCallDetails( |