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

Commit 8f5ff897 authored by Sanket Padawe's avatar Sanket Padawe Committed by android-build-merger
Browse files

Merge "Fix ServiceStateTracker unit tests." into nyc-dev

am: cdc32166

* commit 'cdc32166':
  Fix ServiceStateTracker unit tests.

Change-Id: I034fa11bd5299354d9634de15f6b67fed19b5959
parents 0527c02e cdc32166
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -539,6 +539,8 @@ public class ServiceStateTrackerTest extends TelephonyTest {
        mSimulatedCommands.setDataRegState(ServiceState.RIL_REG_STATE_UNKNOWN);
        mSimulatedCommands.setDataRegState(ServiceState.RIL_REG_STATE_UNKNOWN);
        mSimulatedCommands.notifyVoiceNetworkStateChanged();
        mSimulatedCommands.notifyVoiceNetworkStateChanged();


        waitForMs(100);

        sst.registerForDataConnectionAttached(mTestHandler, EVENT_DATA_CONNECTION_ATTACHED, null);
        sst.registerForDataConnectionAttached(mTestHandler, EVENT_DATA_CONNECTION_ATTACHED, null);


        // set service state in service and trigger events to post message on handler
        // set service state in service and trigger events to post message on handler
@@ -646,6 +648,8 @@ public class ServiceStateTrackerTest extends TelephonyTest {
        mSimulatedCommands.setDataRegState(ServiceState.RIL_REG_STATE_UNKNOWN);
        mSimulatedCommands.setDataRegState(ServiceState.RIL_REG_STATE_UNKNOWN);
        mSimulatedCommands.notifyVoiceNetworkStateChanged();
        mSimulatedCommands.notifyVoiceNetworkStateChanged();


        waitForMs(100);

        sst.registerForNetworkAttached(mTestHandler, EVENT_REGISTERED_TO_NETWORK, null);
        sst.registerForNetworkAttached(mTestHandler, EVENT_REGISTERED_TO_NETWORK, null);


        // set service state in service and trigger events to post message on handler
        // set service state in service and trigger events to post message on handler
@@ -743,7 +747,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    public void testEnableLocationUpdates() throws Exception {
    public void testEnableLocationUpdates() throws Exception {
        sst.enableLocationUpdates();
        sst.enableLocationUpdates();
        verify(mSimulatedCommandsVerifier, times(1)).setLocationUpdates(eq(true),
        verify(mSimulatedCommandsVerifier, times(1)).setLocationUpdates(eq(true),
                eq(any(Message.class)));
                any(Message.class));
    }
    }


    @Test
    @Test
@@ -751,7 +755,7 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    public void testDisableLocationUpdates() throws Exception {
    public void testDisableLocationUpdates() throws Exception {
        sst.disableLocationUpdates();
        sst.disableLocationUpdates();
        verify(mSimulatedCommandsVerifier, times(1)).setLocationUpdates(eq(false),
        verify(mSimulatedCommandsVerifier, times(1)).setLocationUpdates(eq(false),
                eq(any(Message.class)));
                any(Message.class));
    }
    }


    @Test
    @Test