diff options
author | Guang Zhu <guangzhu@google.com> | 2014-08-22 15:08:36 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2014-08-22 15:08:36 -0700 |
commit | 12747ab3aafc92f3b86da7df2b1d992866cbaf52 (patch) | |
tree | 563944651667eaa712718e2bc8ef95550aa5ae23 /core/tests | |
parent | 705e9879fc295fbb04ac3c1ba98ad37bb852379f (diff) | |
download | frameworks_base-12747ab3aafc92f3b86da7df2b1d992866cbaf52.zip frameworks_base-12747ab3aafc92f3b86da7df2b1d992866cbaf52.tar.gz frameworks_base-12747ab3aafc92f3b86da7df2b1d992866cbaf52.tar.bz2 |
add some missing assert messages for wifi test
Change-Id: I04f4cbbca1a181ab1404fa3abba874e1f78fed3c
Diffstat (limited to 'core/tests')
2 files changed, 13 insertions, 9 deletions
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java index b4b0e53..01995c7 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java @@ -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 diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java index 859c30c..6ef4f06 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java @@ -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); |