summaryrefslogtreecommitdiff
path: root/InCallUI/tests
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2015-11-23 11:26:38 -0800
committerNancy Chen <nancychen@google.com>2015-11-23 13:16:41 -0800
commit06c9281eee70e8b34ec89f1e0aef7b174e29de2c (patch)
treea0ed728a4b1133063927503f30a05392a70f0aad /InCallUI/tests
parentfacd5c18a0947c5f8c1dad395ca18ebb27f41126 (diff)
Fix crash when business is closed today but open tomorrow.
Attempted to index into -1 position of opening hours array when business is not open today but open tomorrow. That is because entries exist in the array for tomorrow, but not today. Bug: 25830349 Change-Id: Ib3def69e3d2813bf9cb4739a954b7b9f3724b56a
Diffstat (limited to 'InCallUI/tests')
-rw-r--r--InCallUI/tests/src/com/android/incallui/InCallContactInteractionsTest.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/InCallUI/tests/src/com/android/incallui/InCallContactInteractionsTest.java b/InCallUI/tests/src/com/android/incallui/InCallContactInteractionsTest.java
index 1c2e9ded7..625cda448 100644
--- a/InCallUI/tests/src/com/android/incallui/InCallContactInteractionsTest.java
+++ b/InCallUI/tests/src/com/android/incallui/InCallContactInteractionsTest.java
@@ -174,6 +174,17 @@ public class InCallContactInteractionsTest extends AndroidTestCase {
.detail);
}
+ public void testOpeningHours_NotOpenTodayOpenTomorrow() {
+ assertEquals("Opens tomorrow at 8:00 AM",
+ mInCallContactInteractions.constructHoursInfo(
+ getTestCalendarWithHour(21),
+ Arrays.asList(
+ Pair.create(
+ getTestCalendarWithHourAndDaysFromToday(8, 1),
+ getTestCalendarWithHourAndDaysFromToday(10, 1))))
+ .detail);
+ }
+
public void testMultipleOpenRanges_BeforeOpen() {
assertEquals("Opens today at 8:00 AM",
mInCallContactInteractions.constructHoursInfo(
@@ -214,7 +225,7 @@ public class InCallContactInteractionsTest extends AndroidTestCase {
.detail);
}
- public void testInvalidOpeningHours() {
+ public void testNotOpenTodayOrTomorrow() {
assertEquals(null,
mInCallContactInteractions.constructHoursInfo(
getTestCalendarWithHour(21),