diff options
-rw-r--r-- | tests/src/com/android/dialer/calllog/CallLogAdapterTest.java | 14 | ||||
-rw-r--r-- | tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java | 15 |
2 files changed, 21 insertions, 8 deletions
diff --git a/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java b/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java index 12ae78538..80dfe3578 100644 --- a/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java @@ -240,7 +240,9 @@ public class CallLogAdapterTest extends AndroidTestCase { mAdapter.changeCursor(mCursor); mAdapter.onBindViewHolder(mViewHolder, 0); - assertHasCallActionToGivenNumber(mViewHolder, TEST_NUMBER + TEST_POST_DIAL_DIGITS); + if (PhoneNumberDisplayUtil.canShowPostDial()) { + assertHasCallActionToGivenNumber(mViewHolder, TEST_NUMBER + TEST_POST_DIAL_DIGITS); + } } @MediumTest @@ -262,7 +264,9 @@ public class CallLogAdapterTest extends AndroidTestCase { mAdapter.changeCursor(mCursor); mAdapter.onBindViewHolder(mViewHolder, 0); - assertNameIs(mViewHolder, TEST_NUMBER + TEST_POST_DIAL_DIGITS); + if (PhoneNumberDisplayUtil.canShowPostDial()) { + assertNameIs(mViewHolder, TEST_NUMBER + TEST_POST_DIAL_DIGITS); + } } @MediumTest @@ -274,7 +278,9 @@ public class CallLogAdapterTest extends AndroidTestCase { mAdapter.changeCursor(mCursor); mAdapter.onBindViewHolder(mViewHolder, 0); - assertNameIs(mViewHolder, TEST_CACHED_NAME_PRIMARY); + if (PhoneNumberDisplayUtil.canShowPostDial()) { + assertNameIs(mViewHolder, TEST_CACHED_NAME_PRIMARY); + } } @MediumTest @@ -655,7 +661,7 @@ public class CallLogAdapterTest extends AndroidTestCase { if (!TextUtils.isEmpty(number)) { values[CallLogQuery.NUMBER] = number; } - if (!TextUtils.isEmpty(postDialDigits)) { + if (!TextUtils.isEmpty(postDialDigits) && PhoneNumberDisplayUtil.canShowPostDial()) { values[CallLogQuery.POST_DIAL_DIGITS] = postDialDigits; } if (presentation != NO_VALUE_SET) { diff --git a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java index fa18afff5..04463c230 100644 --- a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java @@ -98,9 +98,14 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { mBuilder.addGroups(mCursor); - assertEquals(2, mFakeGroupCreator.groups.size()); - assertGroupIs(0, 2, mFakeGroupCreator.groups.get(0)); - assertGroupIs(2, 1, mFakeGroupCreator.groups.get(1)); + if (PhoneNumberDisplayUtil.canShowPostDial()) { + assertEquals(2, mFakeGroupCreator.groups.size()); + assertGroupIs(0, 2, mFakeGroupCreator.groups.get(0)); + assertGroupIs(2, 1, mFakeGroupCreator.groups.get(1)); + } else { + assertEquals(1, mFakeGroupCreator.groups.size()); + assertGroupIs(0, 3, mFakeGroupCreator.groups.get(0)); + } } public void testAddGroups_MatchingIncomingAndOutgoing() { @@ -339,7 +344,9 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { values[CallLogQuery.ID] = mCursor.getPosition(); values[CallLogQuery.NUMBER] = number; values[CallLogQuery.CALL_TYPE] = type; - values[CallLogQuery.POST_DIAL_DIGITS] = postDialDigits; + if (PhoneNumberDisplayUtil.canShowPostDial()) { + values[CallLogQuery.POST_DIAL_DIGITS] = postDialDigits; + } mCursor.addRow(values); } |