From 146a4cdf57f0d4d0cd85e808f1df2bdea639b24c Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 5 May 2014 16:51:42 -0700 Subject: Adding support for expandable call log entries. Bug: 13962594 Change-Id: I19a4a65dce922619df0a709293ca291c345c8be7 --- .../android/dialer/PhoneCallDetailsHelperTest.java | 16 +-- .../android/dialer/calllog/CallLogAdapterTest.java | 2 +- .../dialer/calllog/CallLogFragmentTest.java | 19 ++-- .../dialer/calllog/CallLogListItemHelperTest.java | 112 +++------------------ 4 files changed, 34 insertions(+), 115 deletions(-) (limited to 'tests') diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index 9b7d9de13..626ff1686 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -22,6 +22,7 @@ import android.provider.CallLog.Calls; import android.test.AndroidTestCase; import android.text.Html; import android.text.Spanned; +import android.util.Log; import android.view.View; import android.widget.TextView; @@ -111,9 +112,9 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { public void testSetPhoneCallDetails_Normal() { setPhoneCallDetailsWithNumber("14125551212", Calls.PRESENTATION_ALLOWED, "1-412-555-1212"); - assertEquals("Yesterday", mViews.callTypeAndDate.getText().toString()); - assertEqualsHtml("Yesterday", - mViews.callTypeAndDate.getText()); + assertTrue(mViews.callLocationAndDate.getText().toString().contains("Yesterday")); + assertTrue(mViews.callLocationAndDate.getText().toString().contains( + "Yesterday")); } /** Asserts that a char sequence is actually a Spanned corresponding to the expected HTML. */ @@ -252,12 +253,12 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { /** Asserts that the label text field contains the given string value. */ private void assertLabelEquals(String text) { - assertEquals(text, mViews.labelView.getText().toString()); + assertTrue(mViews.callLocationAndDate.getText().toString().contains(text)); } /** Asserts that the date text field contains the given string value. */ private void assertDateEquals(String text) { - assertEquals(text, mViews.callTypeAndDate.getText().toString()); + assertTrue(mViews.callLocationAndDate.getText().toString().contains(text)); } /** Asserts that the call type contains the images with the given drawables. */ @@ -268,7 +269,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { assertEquals(id, mViews.callTypeIcons.getCallType(index)); } assertEquals(View.VISIBLE, mViews.callTypeIcons.getVisibility()); - assertEquals("Yesterday", mViews.callTypeAndDate.getText().toString()); + assertTrue(mViews.callLocationAndDate.getText().toString().contains("Yesterday")); } /** @@ -282,7 +283,8 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { assertEquals(id, mViews.callTypeIcons.getCallType(index)); } assertEquals(View.VISIBLE, mViews.callTypeIcons.getVisibility()); - assertEquals(overflowText + " Yesterday", mViews.callTypeAndDate.getText().toString()); + assertTrue(mViews.callLocationAndDate.getText().toString().contains(overflowText)); + assertTrue(mViews.callLocationAndDate.getText().toString().contains("Yesterday")); } /** Sets the phone call details with default values and the given number. */ diff --git a/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java b/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java index 12cdb2b99..55e422498 100644 --- a/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java @@ -212,7 +212,7 @@ public class CallLogAdapterTest extends AndroidTestCase { public TestCallLogAdapter(Context context, CallFetcher callFetcher, ContactInfoHelper contactInfoHelper) { - super(context, callFetcher, contactInfoHelper, false, false); + super(context, callFetcher, contactInfoHelper, false); } @Override diff --git a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java index 25f53790b..a423cde21 100644 --- a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java @@ -35,6 +35,7 @@ import android.telephony.TelephonyManager; import android.test.ActivityInstrumentationTestCase2; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; +import android.util.Log; import android.view.View; import android.widget.FrameLayout; @@ -174,7 +175,6 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2