From 8cf48a5fd9728ba3f3be15a52e2056a6bbcf549b Mon Sep 17 00:00:00 2001 From: roldenburg Date: Thu, 6 Jul 2017 13:24:25 -0700 Subject: Improve GoogleCallLogAdapterTest to better emulate reality The tests now call through the click listener to expand instead of just calling the expanding method directly. This was done after we had a bug come up inside the click listener that these tests did not catch. The bug: Lightbringer.getPackageName can return null, so when using a stub there was an NPE inside the ExpandCollapseListener. Test: only tests PiperOrigin-RevId: 161121777 Change-Id: Ie58a4c14a32984c183b6159db2076a96cf46b37e --- java/com/android/dialer/callintent/CallIntentBuilder.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'java/com/android/dialer/callintent') diff --git a/java/com/android/dialer/callintent/CallIntentBuilder.java b/java/com/android/dialer/callintent/CallIntentBuilder.java index e5449c804..36ea907ff 100644 --- a/java/com/android/dialer/callintent/CallIntentBuilder.java +++ b/java/com/android/dialer/callintent/CallIntentBuilder.java @@ -160,4 +160,11 @@ public class CallIntentBuilder { public static int getLightbringerButtonAppearInSearchCount() { return lightbringerButtonAppearInSearchCount; } + + @VisibleForTesting(otherwise = VisibleForTesting.NONE) + public static void clearLightbringerCounts() { + lightbringerButtonAppearInCollapsedCallLogItemCount = 0; + lightbringerButtonAppearInExpandedCallLogItemCount = 0; + lightbringerButtonAppearInSearchCount = 0; + } } -- cgit v1.2.3