Fix suppressed CallDetailsActivityTest tests.
A recent change that marked voicemails as read when call details page is
opened broke callDetailsActivityTest because it used arbitrary fake
voicemail uri which never matched a valid content provider.
The offending tests were suppressed subsequently.
This change modifies the fake_uri to be built out of voicemail content
uri, but does not point to any real entry.
testVoicemailPlaybackRateDisplayedOnUi still fails due to an unrelated
change. This is still suppressed. Other tests have been unsupprressed.
Change-Id: Ie25a44f3cfc7263d9b127aa33f467a57eae07af7
diff --git a/tests/src/com/android/contacts/CallDetailActivityTest.java b/tests/src/com/android/contacts/CallDetailActivityTest.java
index 7e225c4..6848429 100644
--- a/tests/src/com/android/contacts/CallDetailActivityTest.java
+++ b/tests/src/com/android/contacts/CallDetailActivityTest.java
@@ -28,6 +28,7 @@
import android.content.Intent;
import android.net.Uri;
import android.provider.CallLog;
+import android.provider.VoicemailContract.Voicemails;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.Suppress;
@@ -42,7 +43,8 @@
*/
@LargeTest
public class CallDetailActivityTest extends ActivityInstrumentationTestCase2<CallDetailActivity> {
- private static final String FAKE_VOICEMAIL_URI_STRING = "content://fake_uri";
+ private static final String FAKE_VOICEMAIL_URI_STRING = ContentUris.withAppendedId(
+ Voicemails.CONTENT_URI, Integer.MAX_VALUE).toString();
private Uri mUri;
private IntegrationTestUtils mTestUtils;
private LocaleTestUtils mLocaleTestUtils;
@@ -80,7 +82,6 @@
* then click the play button (which just reported an error), then after that try to adjust the
* rate. See http://b/5047879.
*/
- @Suppress
public void testClickIncreaseRateButtonWithInvalidVoicemailDoesNotCrash() throws Throwable {
setActivityIntentForTestVoicemailEntry();
Activity activity = getActivity();
@@ -89,7 +90,6 @@
}
/** Test for bug where missing Extras on intent used to start Activity causes NPE. */
- @Suppress
public void testCallLogUriWithMissingExtrasShouldNotCauseNPE() throws Exception {
setActivityIntentForTestCallEntry();
getActivity();
@@ -100,7 +100,6 @@
* <p>
* See http://b/5054103.
*/
- @Suppress
public void testVoicemailDoesNotHaveRemoveFromCallLog() throws Throwable {
setActivityIntentForTestVoicemailEntry();
CallDetailActivity activity = getActivity();