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

Commit 3d96a843 authored by Chalard Jean's avatar Chalard Jean Committed by android-build-merger
Browse files

Merge "Fix TestNetworkAgentWrapper flakiness" am: 6f41ae92 am: ad8525b9

am: b39c5615

Change-Id: Ia8b281648ceb9bf0a8424de024c9ae62daed0ae5
parents 0b08ec70 b39c5615
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -504,6 +504,8 @@ public class ConnectivityServiceTest {
            // Waits for the NetworkAgent to be registered, which includes the creation of the
            // Waits for the NetworkAgent to be registered, which includes the creation of the
            // NetworkMonitor.
            // NetworkMonitor.
            waitForIdle(TIMEOUT_MS);
            waitForIdle(TIMEOUT_MS);
            HandlerUtilsKt.waitForIdle(mCsHandlerThread, TIMEOUT_MS);
            HandlerUtilsKt.waitForIdle(ConnectivityThread.get(), TIMEOUT_MS);
        }
        }


        @Override
        @Override
@@ -4315,16 +4317,16 @@ public class ConnectivityServiceTest {
        assertFalse(mCm.isNetworkSupported(TYPE_NONE));
        assertFalse(mCm.isNetworkSupported(TYPE_NONE));


        assertThrows(IllegalArgumentException.class,
        assertThrows(IllegalArgumentException.class,
                () -> { mCm.networkCapabilitiesForType(TYPE_NONE); });
                () -> mCm.networkCapabilitiesForType(TYPE_NONE));


        Class<UnsupportedOperationException> unsupported = UnsupportedOperationException.class;
        Class<UnsupportedOperationException> unsupported = UnsupportedOperationException.class;
        assertThrows(unsupported, () -> { mCm.startUsingNetworkFeature(TYPE_WIFI, ""); });
        assertThrows(unsupported, () -> mCm.startUsingNetworkFeature(TYPE_WIFI, ""));
        assertThrows(unsupported, () -> { mCm.stopUsingNetworkFeature(TYPE_WIFI, ""); });
        assertThrows(unsupported, () -> mCm.stopUsingNetworkFeature(TYPE_WIFI, ""));
        // TODO: let test context have configuration application target sdk version
        // TODO: let test context have configuration application target sdk version
        // and test that pre-M requesting for TYPE_NONE sends back APN_REQUEST_FAILED
        // and test that pre-M requesting for TYPE_NONE sends back APN_REQUEST_FAILED
        assertThrows(unsupported, () -> { mCm.startUsingNetworkFeature(TYPE_NONE, ""); });
        assertThrows(unsupported, () -> mCm.startUsingNetworkFeature(TYPE_NONE, ""));
        assertThrows(unsupported, () -> { mCm.stopUsingNetworkFeature(TYPE_NONE, ""); });
        assertThrows(unsupported, () -> mCm.stopUsingNetworkFeature(TYPE_NONE, ""));
        assertThrows(unsupported, () -> { mCm.requestRouteToHostAddress(TYPE_NONE, null); });
        assertThrows(unsupported, () -> mCm.requestRouteToHostAddress(TYPE_NONE, null));
    }
    }


    @Test
    @Test