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

Commit 1109c7d4 authored by Guang Zhu's avatar Guang Zhu Committed by Android (Google) Code Review
Browse files

Merge "add some missing assert messages for wifi test" into lmp-dev

parents 4bf859a9 12747ab3
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -127,10 +127,11 @@ public class ConnectivityManagerMobileTest extends
        assertTrue("failed to connect to " + mTestAccessPoint,
                connectToWifi(mTestAccessPoint));
        // assert that WifiManager reports correct state
        assertTrue(waitForWifiState(WifiManager.WIFI_STATE_ENABLED, LONG_TIMEOUT));
        assertTrue("wifi not enabled", waitForWifiState(
                WifiManager.WIFI_STATE_ENABLED, LONG_TIMEOUT));
        // assert that ConnectivityManager reports correct state for Wifi
        assertTrue(waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                WIFI_CONNECTION_TIMEOUT));
        assertTrue("wifi not connected", waitForNetworkState(
                ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT));
        // below check disbabled since we have bug in what ConnectivityManager returns
//        if (!mWifiOnlyFlag) {
//            // assert that ConnectivityManager reports correct state for mobile
@@ -267,8 +268,8 @@ public class ConnectivityManagerMobileTest extends
        // connect to Wifi
        assertTrue("failed to connect to " + mTestAccessPoint,
                connectToWifi(mTestAccessPoint));
        assertTrue(waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                WIFI_CONNECTION_TIMEOUT));
        assertTrue("wifi not connected", waitForNetworkState(
                ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT));
        // verify that connection actually works
        assertTrue("no network connectivity after wifi enable", checkNetworkConnectivity());

@@ -289,8 +290,8 @@ public class ConnectivityManagerMobileTest extends
        // connect to Wifi
        assertTrue("failed to connect to " + mTestAccessPoint,
                connectToWifi(mTestAccessPoint));
        assertTrue(waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                WIFI_CONNECTION_TIMEOUT));
        assertTrue("wifi not connected", waitForNetworkState(
                ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT));

        // enable airplane mode without clearing Wifi
        mCm.setAirplaneMode(true);
@@ -322,8 +323,8 @@ public class ConnectivityManagerMobileTest extends
        // connect to Wifi
        assertTrue("failed to connect to " + mTestAccessPoint,
                connectToWifi(mTestAccessPoint));
        assertTrue(waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                WIFI_CONNECTION_TIMEOUT));
        assertTrue("wifi not connected", waitForNetworkState(
                ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT));
        assertNotNull("not associated with any AP", mWifiManager.getConnectionInfo().getBSSID());

        // disconnect from the current AP
+3 −0
Original line number Diff line number Diff line
@@ -198,6 +198,9 @@ public class WifiStressTest extends ConnectivityManagerTestBase {
    // Stress Wifi reconnection to secure net after sleep
    @LargeTest
    public void testWifiReconnectionAfterSleep() {
        // set always scan to false
        Settings.Global.putInt(mRunner.getContext().getContentResolver(),
                Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0);
        // set wifi sleep policy to never on while in sleep
        Settings.Global.putInt(mRunner.getContext().getContentResolver(),
                Settings.Global.WIFI_SLEEP_POLICY, Settings.Global.WIFI_SLEEP_POLICY_NEVER);