summaryrefslogtreecommitdiff
path: root/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2016-04-07 17:19:18 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-07 17:19:18 +0000
commitfae70b9521bfc61ef06afc6eb787987d26acbdad (patch)
tree5c6d02b0287f778586b8eecb35935748ee35cee6 /tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java
parentf5cef690b6df32e31fe7b412c7329749a9eb4ad0 (diff)
parent8607dfb43c2707ca534d68f2dcf728fece01c82b (diff)
Merge "Add via number to CallLog Account entry" into nyc-dev am: 87b9abf
am: 8607dfb * commit '8607dfb43c2707ca534d68f2dcf728fece01c82b': Add via number to CallLog Account entry Change-Id: I55e9f40fb5497a4edeec31fc0abeb2efd459f1a2
Diffstat (limited to 'tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java')
-rw-r--r--tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java
index 107cf7562..beb83b1ad 100644
--- a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java
+++ b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java
@@ -109,6 +109,26 @@ public class CallLogGroupBuilderTest extends AndroidTestCase {
}
}
+ public void testAddGroups_WithViaNumberMatching() {
+ addCallLogEntryWithViaNumber(TEST_NUMBER1, TEST_NUMBER2,
+ AppCompatConstants.CALLS_OUTGOING_TYPE);
+ addCallLogEntryWithViaNumber(TEST_NUMBER1, TEST_NUMBER2,
+ AppCompatConstants.CALLS_OUTGOING_TYPE);
+ addCallLogEntryWithViaNumber(TEST_NUMBER1, "",
+ AppCompatConstants.CALLS_OUTGOING_TYPE);
+
+ mBuilder.addGroups(mCursor);
+
+ if (CompatUtils.isNCompatible()) {
+ 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() {
addCallLogEntry(TEST_NUMBER1, AppCompatConstants.CALLS_INCOMING_TYPE);
addCallLogEntry(TEST_NUMBER1, AppCompatConstants.CALLS_OUTGOING_TYPE);
@@ -387,6 +407,19 @@ public class CallLogGroupBuilderTest extends AndroidTestCase {
mCursor.addRow(values);
}
+ /** Adds a call log entry with the given number, post-dial digits, and type to the cursor. */
+ private void addCallLogEntryWithViaNumber(String number, String viaNumber, int type) {
+ mCursor.moveToNext();
+ Object[] values = CallLogQueryTestUtils.createTestValues();
+ values[CallLogQuery.ID] = mCursor.getPosition();
+ values[CallLogQuery.NUMBER] = number;
+ values[CallLogQuery.CALL_TYPE] = type;
+ if (CompatUtils.isNCompatible()) {
+ values[CallLogQuery.VIA_NUMBER] = viaNumber;
+ }
+ mCursor.addRow(values);
+ }
+
/** Adds a call log entry with a header to the cursor. */
private void addCallLogHeader(int section) {
mCursor.moveToNext();