summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-06-17 19:40:19 -0700
committerAndrew Lee <anwlee@google.com>2015-06-18 11:43:30 -0700
commitefd863ad7b84562155e08435a0fd7adfe456b5cb (patch)
treebc861a47931ff462d764d8da65c66f6ba623dcfa /tests
parente445ae79d87f70f207c1a16a3585c03f577b901f (diff)
Pass activity into VoicemailPlaybackPresenter.
We will use it to set windows flags to help make playback behaviors reasonable. Bug: 21856243 Change-Id: I7c1ecb9e225a507ea8956ccc31d667361a4b6824
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/dialer/voicemail/VoicemailPlaybackTest.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/src/com/android/dialer/voicemail/VoicemailPlaybackTest.java b/tests/src/com/android/dialer/voicemail/VoicemailPlaybackTest.java
index 96ef62abf..ea341a30e 100644
--- a/tests/src/com/android/dialer/voicemail/VoicemailPlaybackTest.java
+++ b/tests/src/com/android/dialer/voicemail/VoicemailPlaybackTest.java
@@ -18,6 +18,7 @@ package com.android.dialer.voicemail;
import static com.android.dialer.voicemail.VoicemailPlaybackPresenter.Tasks.CHECK_FOR_CONTENT;
+import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
@@ -25,13 +26,14 @@ import android.content.Context;
import android.content.res.AssetManager;
import android.net.Uri;
import android.provider.VoicemailContract;
-import android.test.InstrumentationTestCase;
+import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;
import android.widget.TextView;
import com.android.contacts.common.test.IntegrationTestUtils;
import com.android.dialer.R;
+import com.android.dialer.calllog.CallLogActivity;
import com.android.dialer.util.AsyncTaskExecutors;
import com.android.dialer.util.FakeAsyncTaskExecutor;
import com.android.dialer.util.LocaleTestUtils;
@@ -48,13 +50,13 @@ import java.util.Locale;
* Unit tests for the {@link VoicemailPlaybackPresenter} and {@link VoicemailPlaybackLayout}.
*/
@LargeTest
-public class VoicemailPlaybackTest extends InstrumentationTestCase {
+public class VoicemailPlaybackTest extends ActivityInstrumentationTestCase2<CallLogActivity> {
private static final String TEST_ASSET_NAME = "quick_test_recording.mp3";
private static final String MIME_TYPE = "audio/mp3";
private static final String CONTACT_NUMBER = "+1412555555";
private static final String VOICEMAIL_FILE_LOCATION = "/sdcard/sadlfj893w4j23o9sfu.mp3";
- private Context mContext;
+ private Activity mActivity;
private VoicemailPlaybackPresenter mPresenter;
private VoicemailPlaybackLayout mLayout;
@@ -63,6 +65,10 @@ public class VoicemailPlaybackTest extends InstrumentationTestCase {
private LocaleTestUtils mLocaleTestUtils;
private FakeAsyncTaskExecutor mFakeAsyncTaskExecutor;
+ public VoicemailPlaybackTest() {
+ super(CallLogActivity.class);
+ }
+
@Override
public void setUp() throws Exception {
super.setUp();
@@ -75,10 +81,11 @@ public class VoicemailPlaybackTest extends InstrumentationTestCase {
mLocaleTestUtils = new LocaleTestUtils(getInstrumentation().getTargetContext());
mLocaleTestUtils.setLocale(Locale.US);
- mContext = getInstrumentation().getTargetContext();
- mLayout = new VoicemailPlaybackLayout(mContext);
+ mActivity = getActivity();
+ mLayout = new VoicemailPlaybackLayout(mActivity);
mLayout.onFinishInflate();
- mPresenter = new VoicemailPlaybackPresenter(mContext, null);
+
+ mPresenter = new VoicemailPlaybackPresenter(mActivity, null);
}
@Override