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

Commit 624bf3d7 authored by Erik Kline's avatar Erik Kline
Browse files

Verify duplicate upstream notifications are ignored

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest .../tethering/TetherInterfaceStateMachineTest.java passes
Bug: 32163131

Change-Id: I3c097d766fe4c416a8e3f02640809fe1199c6ef2
parent ed6d75d5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -294,6 +294,18 @@ public class TetherInterfaceStateMachineTest {
                IFACE_NAME, mTestedSm, STATE_AVAILABLE, TETHER_ERROR_ENABLE_NAT_ERROR);
    }

    @Test
    public void ignoresDuplicateUpstreamNotifications() throws Exception {
        initTetheredStateMachine(TETHERING_WIFI, UPSTREAM_IFACE);

        verifyNoMoreInteractions(mNMService, mStatsService, mTetherHelper);

        for (int i = 0; i < 5; i++) {
            dispatchTetherConnectionChanged(UPSTREAM_IFACE);
            verifyNoMoreInteractions(mNMService, mStatsService, mTetherHelper);
        }
    }

    /**
     * Send a command to the state machine under test, and run the event loop to idle.
     *