From 42be85d8a976c049ea237a48a35beada80638b85 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 29 May 2015 10:39:14 -0700 Subject: Fix CallDetailActivity tests. + Reset the AsyncTaskExecutor's instance between calls in tests. I don't know why this is necessary, but it fixes a class of problems which were happening. + Don't try to release a media player if it has not been prepared. + Handle possible race conditions since MediaPlayer's async prepare may be buffering or finished when a test assert is executed. + Add asset file no longer provided by variablespeed library. - Cleanup some stream copy code. Change-Id: I0ae5fde00514c6dcdb1e9c063435a13eed6e8528 --- src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/com/android/dialer/calllog') diff --git a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java index 20e213c4f..aa186eb69 100644 --- a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java +++ b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java @@ -34,6 +34,8 @@ import com.android.dialer.util.AsyncTaskExecutor; import com.android.dialer.util.AsyncTaskExecutors; import com.android.dialer.util.TelecomUtil; +import com.google.common.annotations.VisibleForTesting; + public class CallLogAsyncTaskUtil { private static String TAG = CallLogAsyncTaskUtil.class.getSimpleName(); @@ -297,4 +299,9 @@ public class CallLogAsyncTaskUtil { } }); } + + @VisibleForTesting + public static void resetForTest() { + sAsyncTaskExecutor = null; + } } -- cgit v1.2.3