summaryrefslogtreecommitdiffstats
path: root/core/tests/ConnectivityManagerTest
diff options
context:
space:
mode:
authorXia Wang <xiaw@google.com>2011-12-02 17:49:36 -0800
committerXia Wang <xiaw@google.com>2011-12-05 12:22:47 -0800
commit10a3e8fae865f17c10816d1767d2efa3d4a18935 (patch)
treeb6fd5bbfdaeb75fcf4a86071e70f77cda41e2f3d /core/tests/ConnectivityManagerTest
parent051606150a80efa71b139e9d52fe6c8b2c02c884 (diff)
downloadframeworks_base-10a3e8fae865f17c10816d1767d2efa3d4a18935.zip
frameworks_base-10a3e8fae865f17c10816d1767d2efa3d4a18935.tar.gz
frameworks_base-10a3e8fae865f17c10816d1767d2efa3d4a18935.tar.bz2
Add extra 2 minute for wifi to shutdown
Change-Id: I3cf2fbf5de8b96b75d5e460e4ad822a1947ff6e7
Diffstat (limited to 'core/tests/ConnectivityManagerTest')
-rw-r--r--core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java14
1 files changed, 8 insertions, 6 deletions
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 0b32fde..2069789 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
@@ -63,10 +63,12 @@ public class WifiStressTest
private final static long WIFI_IDLE_MS = 60 * 1000;
/**
- * The delay for Wi-Fi to get into idle, after screen off + WIFI_IDEL_MS + WIFI_IDLE_DELAY
- * the Wi-Fi should be in idle mode and device should be in cellular mode.
+ * Delay after issuing wifi shutdown.
+ * The framework keep driver up for at leat 2 minutes to avoid problems
+ * that a quick shutdown could cause on wext driver and protentially
+ * on cfg based driver
*/
- private final static long WIFI_IDLE_DELAY = 3 * 1000;
+ private final static long WIFI_SHUTDOWN_DELAY = 2 * 60 * 1000;
private final static String OUTPUT_FILE = "WifiStressTestOutput.txt";
private ConnectivityManagerTestActivity mAct;
@@ -265,7 +267,7 @@ public class WifiStressTest
PowerManager pm =
(PowerManager)mRunner.getContext().getSystemService(Context.POWER_SERVICE);
assertFalse(pm.isScreenOn());
- sleep(WIFI_IDLE_MS, "Interruped while wait for wifi to be idle");
+ sleep(WIFI_IDLE_MS + WIFI_SHUTDOWN_DELAY, "Interruped while wait for wifi to be idle");
assertTrue("Wait for Wi-Fi to idle timeout",
mAct.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.DISCONNECTED,
6 * ConnectivityManagerTestActivity.SHORT_TIMEOUT));
@@ -273,9 +275,9 @@ public class WifiStressTest
// use long timeout as the pppd startup may take several retries.
assertTrue("Wait for cellular connection timeout",
mAct.waitForNetworkState(ConnectivityManager.TYPE_MOBILE, State.CONNECTED,
- ConnectivityManagerTestActivity.LONG_TIMEOUT));
+ 2 * ConnectivityManagerTestActivity.LONG_TIMEOUT));
}
- sleep(mWifiSleepTime + WIFI_IDLE_DELAY, "Interrupted while device is in sleep mode");
+ sleep(mWifiSleepTime, "Interrupted while device is in sleep mode");
// Verify the wi-fi is still off and data connection is on
assertEquals("Wi-Fi is reconnected", State.DISCONNECTED,
mAct.mCM.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState());