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

Commit 12bdcbbf authored by Daniel Bright's avatar Daniel Bright Committed by Automerger Merge Worker
Browse files

Merge "Test that on urls changed callback called on add" am: 599e87c8 am:...

Merge "Test that on urls changed callback called on add" am: 599e87c8 am: 0e0411f1 am: 0fb4524b am: a5948bb4

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1352668

Change-Id: I31927c84e592c92b9567b24b8c5890fe9e731b02
parents a8319387 a5948bb4
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.AdditionalMatchers;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;

@@ -229,4 +230,35 @@ public class ImsRegistrationTests {
        // with onUnregistered.
        verify(mCallback2, never()).onDeregistered(any(ImsReasonInfo.class));
    }

    @SmallTest
    @Test
    public void testRegistrationCallbackCalledOnAdd() throws RemoteException {
        mRegistration.onSubscriberAssociatedUriChanged(new Uri[] { null, null });

        mRegBinder.addRegistrationCallback(mCallback2);

        verify(mCallback2).onSubscriberAssociatedUriChanged(
                AdditionalMatchers.aryEq(new Uri[] { null, null }));
    }

    @SmallTest
    @Test
    public void testRegistrationCallbackNotCalledOnAddAfterDeregistered() throws RemoteException {
        ImsReasonInfo info = new ImsReasonInfo(ImsReasonInfo.CODE_LOCAL_NETWORK_NO_LTE_COVERAGE, 0);
        mRegistration.onSubscriberAssociatedUriChanged(new Uri[] { null, null });

        mRegistration.onDeregistered(info);
        mRegBinder.addRegistrationCallback(mCallback2);

        verify(mCallback2, never()).onSubscriberAssociatedUriChanged(any());
    }

    @SmallTest
    @Test
    public void testRegistrationCallbackNotCalledOnAddAndNoSubscriberChanged()
            throws RemoteException {
        mRegBinder.addRegistrationCallback(mCallback2);
        verify(mCallback2, never()).onSubscriberAssociatedUriChanged(any());
    }
}