diff options
author | Yorke Lee <yorkelee@google.com> | 2013-08-04 14:58:55 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-08-05 10:31:44 -0700 |
commit | fb585079cc4c522c27f6dd6bf03fd296535960f3 (patch) | |
tree | 112cb8055ecdca34094f43c0754c4d1ea8216666 /tests | |
parent | f7840b76fb2a2323b085489e75f1cf80a8236bbe (diff) |
Code cleanup for call log related items
Change-Id: I2aa0458e1fb74abaea60a02f430a4e413dfed365
Diffstat (limited to 'tests')
3 files changed, 14 insertions, 18 deletions
diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index 9170a0b18..05c59a77f 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -179,24 +179,24 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { public void testSetPhoneCallDetails_Geocode() { setPhoneCallDetailsWithNumberAndGeocode("+14125555555", "1-412-555-5555", "Pennsylvania"); assertNameEquals("1-412-555-5555"); // The phone number is shown as the name. - assertNumberEquals("Pennsylvania"); // The geocode is shown as the number. + assertLabelEquals("Pennsylvania"); // The geocode is shown as the label. } public void testSetPhoneCallDetails_NoGeocode() { setPhoneCallDetailsWithNumberAndGeocode("+14125555555", "1-412-555-5555", null); assertNameEquals("1-412-555-5555"); // The phone number is shown as the name. - assertNumberEquals("-"); // The empty geocode is shown as the number. + assertLabelEquals("-"); // The empty geocode is shown as the label. } public void testSetPhoneCallDetails_EmptyGeocode() { setPhoneCallDetailsWithNumberAndGeocode("+14125555555", "1-412-555-5555", ""); assertNameEquals("1-412-555-5555"); // The phone number is shown as the name. - assertNumberEquals("-"); // The empty geocode is shown as the number. + assertLabelEquals("-"); // The empty geocode is shown as the label. } public void testSetPhoneCallDetails_NoGeocodeForVoicemail() { setPhoneCallDetailsWithNumberAndGeocode(TEST_VOICEMAIL_NUMBER, "", "United States"); - assertNumberEquals("-"); // The empty geocode is shown as the number. + assertLabelEquals("-"); // The empty geocode is shown as the label. } public void testSetPhoneCallDetails_Highlighted() { @@ -250,9 +250,9 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { assertEquals(text, mViews.nameView.getText().toString()); } - /** Asserts that the number text field contains the given string value. */ - private void assertNumberEquals(String text) { - assertEquals(text, mViews.numberView.getText().toString()); + /** Asserts that the label text field contains the given string value. */ + private void assertLabelEquals(String text) { + assertEquals(text, mViews.labelView.getText().toString()); } /** Asserts that the date text field contains the given string value. */ diff --git a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java index c9055ca81..7ceec8f08 100644 --- a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java @@ -225,7 +225,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme CallLogListItemViews views = (CallLogListItemViews) view.getTag(); assertNameIs(views, "John Doe"); - assertNumberAndLabelAre(views, TEST_FORMATTED_NUMBER, getTypeLabel(Phone.TYPE_HOME)); + assertLabel(views, TEST_FORMATTED_NUMBER, getTypeLabel(Phone.TYPE_HOME)); } @MediumTest @@ -238,7 +238,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme CallLogListItemViews views = (CallLogListItemViews) view.getTag(); assertNameIs(views, "John Doe"); - assertNumberAndLabelAre(views, "sip:johndoe@gmail.com", null); + assertLabel(views, "sip:johndoe@gmail.com", null); } @MediumTest @@ -251,7 +251,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme CallLogListItemViews views = (CallLogListItemViews) view.getTag(); assertNameIs(views, "John Doe"); - assertNumberAndLabelAre(views, TEST_FORMATTED_NUMBER, getTypeLabel(Phone.TYPE_HOME)); + assertLabel(views, TEST_FORMATTED_NUMBER, getTypeLabel(Phone.TYPE_HOME)); } @MediumTest @@ -264,7 +264,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme CallLogListItemViews views = (CallLogListItemViews) view.getTag(); assertNameIs(views, "John Doe"); - assertNumberAndLabelAre(views, TEST_FORMATTED_NUMBER, getTypeLabel(Phone.TYPE_WORK)); + assertLabel(views, TEST_FORMATTED_NUMBER, getTypeLabel(Phone.TYPE_WORK)); } @MediumTest @@ -278,7 +278,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme CallLogListItemViews views = (CallLogListItemViews) view.getTag(); assertNameIs(views, "John Doe"); - assertNumberAndLabelAre(views, TEST_FORMATTED_NUMBER, numberLabel); + assertLabel(views, TEST_FORMATTED_NUMBER, numberLabel); } @MediumTest @@ -620,12 +620,9 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme assertEquals(name, views.phoneCallDetailsViews.nameView.getText()); } - /** Asserts that the number and label text view contains the given text. */ - private void assertNumberAndLabelAre(CallLogListItemViews views, CharSequence number, + /** Asserts that the label text view contains the given text. */ + private void assertLabel(CallLogListItemViews views, CharSequence number, CharSequence label) { - assertEquals(View.VISIBLE, views.phoneCallDetailsViews.numberView.getVisibility()); - assertEquals(number, views.phoneCallDetailsViews.numberView.getText().toString()); - assertEquals(label == null ? View.GONE : View.VISIBLE, views.phoneCallDetailsViews.labelView.getVisibility()); if (label != null) { diff --git a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java index 73c33ae6d..2cc742359 100644 --- a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java @@ -117,7 +117,6 @@ public class CallLogListItemHelperTest extends AndroidTestCase { /** Asserts that the whole call area is gone. */ private void assertNoCallButton() { assertEquals(View.GONE, mViews.secondaryActionView.getVisibility()); - assertEquals(View.GONE, mViews.dividerView.getVisibility()); } /** Sets the details of a phone call using the specified phone number. */ |