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

Commit 9cf0b739 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Improve error message when testing network factory" am: e8cd6e4f am:...

Merge "Improve error message when testing network factory" am: e8cd6e4f am: 324e0f16 am: 795ef23e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531798

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b421f7b2895a24912d37d73dc011fa440440cf2
parents 8dd46b0e 795ef23e
Loading
Loading
Loading
Loading
+44 −40
Original line number Diff line number Diff line
@@ -3624,6 +3624,8 @@ public class ConnectivityServiceTest {
        // Register the factory and expect it to start looking for a network.
        testFactory.expectAddRequestsWithScores(0);  // Score 0 as the request is not served yet.
        testFactory.register();

        try {
            testFactory.waitForNetworkRequests(1);
            assertTrue(testFactory.getMyStartRequested());

@@ -3650,7 +3652,8 @@ public class ConnectivityServiceTest {
            mCellNetworkAgent.connect(true);
            cellNetworkCallback.expectAvailableThenValidatedCallbacks(mCellNetworkAgent);
            testFactory.waitForNetworkRequests(2);
        assertFalse(testFactory.getMyStartRequested());  // Because the cell network outscores us.
            assertFalse(
                    testFactory.getMyStartRequested());  // Because the cell network outscores us.

            // Check that cell data stays up.
            waitForIdle();
@@ -3665,11 +3668,12 @@ public class ConnectivityServiceTest {
            // ...  and cell data to be torn down.
            cellNetworkCallback.expectCallback(CallbackEntry.LOST, mCellNetworkAgent);
            assertLength(1, mCm.getAllNetworks());

        } finally {
            testFactory.terminate();
            mCm.unregisterNetworkCallback(cellNetworkCallback);
            handlerThread.quit();
        }
    }

    @Test
    public void testAvoidBadWifiSetting() throws Exception {