diff options
author | Andrew Lee <anwlee@google.com> | 2015-10-07 17:49:35 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-07 17:49:35 +0000 |
commit | a0a08083e2f21ec45ef40064687b550b9af6a388 (patch) | |
tree | 06ccd13e98268af765d849850504d04d4454ce23 /tests/src/com/android | |
parent | e9c8233a77d6daa5374e146e1c871e000d7657e4 (diff) | |
parent | 42e25341043525b7f9bc991dfe1afba7846b4f5f (diff) |
Merge "Group blocked calls separately in call log." into ub-contactsdialer-a-dev
Diffstat (limited to 'tests/src/com/android')
-rw-r--r-- | tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java index f5a9fe612..5d0b6bebb 100644 --- a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java @@ -95,7 +95,7 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { assertGroupIs(0, 3, mFakeGroupCreator.groups.get(0)); } - public void testAddGroups_Voicemail() { + public void testGrouping_Voicemail() { // Does not group with other types of calls, include voicemail themselves. assertCallsAreNotGrouped( AppCompatConstants.CALLS_VOICEMAIL_TYPE, AppCompatConstants.CALLS_MISSED_TYPE); @@ -107,7 +107,7 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { AppCompatConstants.CALLS_VOICEMAIL_TYPE, AppCompatConstants.CALLS_OUTGOING_TYPE); } - public void testAddGroups_Missed() { + public void testGrouping_Missed() { // Groups with one or more missed calls. assertCallsAreGrouped( AppCompatConstants.CALLS_MISSED_TYPE, AppCompatConstants.CALLS_MISSED_TYPE); @@ -124,7 +124,7 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { AppCompatConstants.CALLS_MISSED_TYPE, AppCompatConstants.CALLS_OUTGOING_TYPE); } - public void testAddGroups_Incoming() { + public void testGrouping_Incoming() { // Groups with one or more incoming or outgoing. assertCallsAreGrouped( AppCompatConstants.CALLS_INCOMING_TYPE, AppCompatConstants.CALLS_INCOMING_TYPE); @@ -145,7 +145,7 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { AppCompatConstants.CALLS_INCOMING_TYPE, AppCompatConstants.CALLS_VOICEMAIL_TYPE); } - public void testAddGroups_Outgoing() { + public void testGrouping_Outgoing() { // Groups with one or more incoming or outgoing. assertCallsAreGrouped( AppCompatConstants.CALLS_OUTGOING_TYPE, AppCompatConstants.CALLS_INCOMING_TYPE); @@ -166,20 +166,31 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { AppCompatConstants.CALLS_INCOMING_TYPE, AppCompatConstants.CALLS_VOICEMAIL_TYPE); } + public void testGrouping_Blocked() { + assertCallsAreNotGrouped( + AppCompatConstants.CALLS_BLOCKED_TYPE, AppCompatConstants.CALLS_INCOMING_TYPE); + assertCallsAreNotGrouped( + AppCompatConstants.CALLS_BLOCKED_TYPE, AppCompatConstants.CALLS_OUTGOING_TYPE); + assertCallsAreNotGrouped( + AppCompatConstants.CALLS_BLOCKED_TYPE, AppCompatConstants.CALLS_MISSED_TYPE); + + } + public void testAddGroups_Mixed() { addMultipleCallLogEntries(TEST_NUMBER1, - AppCompatConstants.CALLS_VOICEMAIL_TYPE, // Group 1:Stand-alone + AppCompatConstants.CALLS_VOICEMAIL_TYPE, // Group 1: 0 AppCompatConstants.CALLS_INCOMING_TYPE, // Group 2: 1-4 AppCompatConstants.CALLS_OUTGOING_TYPE, AppCompatConstants.CALLS_MISSED_TYPE, AppCompatConstants.CALLS_MISSED_TYPE, - AppCompatConstants.CALLS_VOICEMAIL_TYPE, // Group 3: Stand-alone - AppCompatConstants.CALLS_INCOMING_TYPE, // Group 4: Stand-alone - AppCompatConstants.CALLS_VOICEMAIL_TYPE, // Group 5: Stand-alone + AppCompatConstants.CALLS_VOICEMAIL_TYPE, // Group 3: 5 + AppCompatConstants.CALLS_INCOMING_TYPE, // Group 4: 6 + AppCompatConstants.CALLS_VOICEMAIL_TYPE, // Group 5: 7 AppCompatConstants.CALLS_MISSED_TYPE, // Group 6: 8-10 AppCompatConstants.CALLS_MISSED_TYPE, AppCompatConstants.CALLS_OUTGOING_TYPE); mBuilder.addGroups(mCursor); + assertEquals(6, mFakeGroupCreator.groups.size()); assertGroupIs(0, 1, mFakeGroupCreator.groups.get(0)); assertGroupIs(1, 4, mFakeGroupCreator.groups.get(1)); @@ -189,6 +200,23 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { assertGroupIs(8, 3, mFakeGroupCreator.groups.get(5)); } + public void testAddGroups_Blocked() { + addMultipleCallLogEntries(TEST_NUMBER1, + AppCompatConstants.CALLS_INCOMING_TYPE, // Group 1: 0-1 + AppCompatConstants.CALLS_OUTGOING_TYPE, + AppCompatConstants.CALLS_BLOCKED_TYPE, // Group 2: 2 + AppCompatConstants.CALLS_MISSED_TYPE, // Group 3: 3 + AppCompatConstants.CALLS_BLOCKED_TYPE, // Group 4: 4-5 + AppCompatConstants.CALLS_BLOCKED_TYPE); + mBuilder.addGroups(mCursor); + + assertEquals(4, mFakeGroupCreator.groups.size()); + assertGroupIs(0, 2, mFakeGroupCreator.groups.get(0)); + assertGroupIs(2, 1, mFakeGroupCreator.groups.get(1)); + assertGroupIs(3, 1, mFakeGroupCreator.groups.get(2)); + assertGroupIs(4, 2, mFakeGroupCreator.groups.get(3)); + } + public void testEqualPhoneNumbers() { // Identical. assertTrue(mBuilder.equalNumbers("6505555555", "6505555555")); |