diff options
author | Andrew Lee <anwlee@google.com> | 2015-09-15 16:50:36 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-09-15 16:52:25 -0700 |
commit | c19f4b7ec72dfe75c99c53cdac19c9932c8e5519 (patch) | |
tree | c49ec6543a7965ad12a1e7ed247c9c9cef6a7fc4 /src/com/android | |
parent | 411dd7401997a83a876446261bdf70b3e2c9c4de (diff) |
Fix VoicemailPlaybackTests.
There appears to be two issues which were borking this, although I'm not sure why
there was the change (maybe it's been around a long time).
A single instance of presenter is retained over time, which is no good for our case
where we're creating different FakeAsyncTaskExecutors each time, so added a method
for testing where we can clear the instance.
Secondly, the method checking the text views didn't work anymore. Not sure why, but
I added a hook into the state text so the tests can continue to check for that.
Bug: 23640774
Change-Id: Ie729627f3bb4ee08476d5ad0198e43cfea72ce5c
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java | 6 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java index 133da363d..14c5473ae 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java @@ -42,6 +42,7 @@ import com.android.dialer.PhoneCallDetails; import com.android.dialer.R; import com.android.dialer.calllog.CallLogAsyncTaskUtil; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import java.util.concurrent.TimeUnit; @@ -411,4 +412,9 @@ public class VoicemailPlaybackLayout extends LinearLayout } return String.format("%02d:%02d", minutes, seconds); } + + @VisibleForTesting + public String getStateText() { + return mStateText.getText().toString(); + } } diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 62da9423e..95622bfa2 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -781,4 +781,9 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene public boolean isSpeakerphoneOn() { return mIsSpeakerphoneOn; } + + @VisibleForTesting + public void clearInstance() { + sInstance = null; + } } |