Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68d17c62 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Fixes Failing Telecom Tests and marks flaky ones

This change fixes the failing Telecom tests and marks the
inconsistently failing ones as @FlakyTest.

Test: Build and run Telecom Unit Tests
Change-Id: Ifc6b296f7acddc136d99f063094f3d30bc2f02d0
parent 2c4235d3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.telecom.TelecomAnalytics;
import android.telecom.TelecomManager;
import android.telecom.VideoCallImpl;
import android.telecom.VideoProfile;
import android.support.test.filters.FlakyTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Base64;
@@ -92,6 +93,7 @@ public class AnalyticsTests extends TelecomSystemTest {
        }
    }

    @FlakyTest
    @MediumTest
    public void testAnalyticsDumping() throws Exception {
        Analytics.reset();
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.support.test.filters.FlakyTest;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;

@@ -874,6 +875,7 @@ public class BasicCallTests extends TelecomSystemTest {
     * then subsequently selects a PhoneAccount which does not support video calling.
     * @throws Exception
     */
    @FlakyTest
    @LargeTest
    public void testOutgoingCallSelectPhoneAccountNoVideo() throws Exception {
        startOutgoingPhoneCallPendingCreateConnection("650-555-1212",
+4 −4
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ public class MissedCallNotifierImplTest extends TelecomTestCase {

        ArgumentCaptor<Integer> requestIdCaptor = ArgumentCaptor.forClass(
                Integer.class);
        verify(mNotificationManager, times(2)).notifyAsUser(isNull(String.class),
        verify(mNotificationManager, times(2)).notifyAsUser(nullable(String.class),
                requestIdCaptor.capture(), nullable(Notification.class), eq(userHandle));
        verify(mNotificationManager).cancelAsUser(nullable(String.class),
                eq(requestIdCaptor.getValue()), eq(userHandle));
@@ -245,7 +245,7 @@ public class MissedCallNotifierImplTest extends TelecomTestCase {
        // to notifyAsUser are the versions which contain sensitive information.
        ArgumentCaptor<Notification> notificationArgumentCaptor = ArgumentCaptor.forClass(
                Notification.class);
        verify(mNotificationManager, times(2)).notifyAsUser(isNull(String.class), eq(1),
        verify(mNotificationManager, times(2)).notifyAsUser(nullable(String.class), eq(1),
                notificationArgumentCaptor.capture(), eq(PRIMARY_USER));
        HashSet<String> privateNotifications = new HashSet<>();
        for (Notification n : notificationArgumentCaptor.getAllValues()) {
@@ -332,7 +332,7 @@ public class MissedCallNotifierImplTest extends TelecomTestCase {
        } else {
            expectedUserHandle = phoneAccount.getAccountHandle().getUserHandle();
        }
        verify(mNotificationManager).notifyAsUser(isNull(String.class), eq(1),
        verify(mNotificationManager).notifyAsUser(nullable(String.class), eq(1),
                notificationArgumentCaptor.capture(), eq((expectedUserHandle)));

        Notification.Builder builder;
@@ -534,7 +534,7 @@ public class MissedCallNotifierImplTest extends TelecomTestCase {
        listenerCaptor.getAllValues().get(1).onCallerInfoQueryComplete(escapedSipHandle, ci);

        // Verify that two notifications were generated, both with the same id.
        verify(mNotificationManager, times(2)).notifyAsUser(isNull(String.class), eq(1),
        verify(mNotificationManager, times(2)).notifyAsUser(nullable(String.class), eq(1),
                nullable(Notification.class), eq(PRIMARY_USER));
    }

+2 −1
Original line number Diff line number Diff line
@@ -405,7 +405,8 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase {

        Intent capturedIntent = intentCaptor.getValue();
        assertEquals(Intent.ACTION_NEW_OUTGOING_CALL, capturedIntent.getAction());
        assertEquals(Intent.FLAG_RECEIVER_FOREGROUND, capturedIntent.getFlags());
        assertEquals(Intent.FLAG_RECEIVER_FOREGROUND | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND,
                capturedIntent.getFlags());
        assertTrue(areBundlesEqual(expectedExtras, capturedIntent.getExtras()));

        BroadcastReceiver receiver = receiverCaptor.getValue();