summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrandon Maxwell <maxwelb@google.com>2016-03-22 17:02:25 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-03-22 17:02:25 +0000
commit8e3e51da8bdee28f1e0ef6867c8ec5482c2e15cb (patch)
tree4c646e66b2e9ec6812b0abd32cea30ce681422cc /tests
parent664300c657fbfec010c3d2e948a387705ac69f64 (diff)
parent9877f59d3c4af34bedbbd27e45d00efa0ccb0b6a (diff)
Updating logic for isBlockedNumber am: fd75e4c
am: 9877f59 * commit '9877f59d3c4af34bedbbd27e45d00efa0ccb0b6a': Updating logic for isBlockedNumber
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/dialer/database/FilteredNumberAsyncQueryHandlerTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/src/com/android/dialer/database/FilteredNumberAsyncQueryHandlerTest.java b/tests/src/com/android/dialer/database/FilteredNumberAsyncQueryHandlerTest.java
index 28fdda0dc..625f3fdb5 100644
--- a/tests/src/com/android/dialer/database/FilteredNumberAsyncQueryHandlerTest.java
+++ b/tests/src/com/android/dialer/database/FilteredNumberAsyncQueryHandlerTest.java
@@ -47,6 +47,7 @@ public class FilteredNumberAsyncQueryHandlerTest extends InstrumentationTestCase
private static final String NUMBER = "6502530000";
private static final String COUNTRY_ISO = "US";
private static final Integer ID = 1;
+ private static final Integer ID2 = 2;
private static final Uri BLOCKED_NUMBER_URI_N = CompatUtils.isNCompatible() ?
Uri.withAppendedPath(BlockedNumberContract.AUTHORITY_URI, "blocked") : null;
private static final Uri BLOCKED_NUMBER_URI_M =
@@ -177,6 +178,26 @@ public class FilteredNumberAsyncQueryHandlerTest extends InstrumentationTestCase
mContentProvider.verify();
}
+ public void testIsBlockedNumber_MultipleResults() throws Throwable {
+ if (CompatUtils.isNCompatible()) {
+ newIsBlockedNumberExpectedQuery().returnRow(ID).returnRow(ID2);
+ } else {
+ newIsBlockedNumberExpectedQuery().returnRow(ID, FilteredNumberTypes.BLOCKED_NUMBER)
+ .returnRow(ID2, FilteredNumberTypes.BLOCKED_NUMBER);
+ }
+ final CheckBlockedListener listener = new CheckBlockedListener();
+ runTestOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ new FilteredNumberAsyncQueryHandler(mContentResolver)
+ .isBlockedNumber(listener, NUMBER, COUNTRY_ISO);
+ }
+ });
+ // When there are multiple matches, the first is returned
+ assertEquals(ID, listener.waitForCallback());
+ mContentProvider.verify();
+ }
+
public void testBlockNumber_Disabled() throws Throwable {
if (!CompatUtils.isNCompatible()) {
return;