diff options
author | Xia Wang <xiaw@google.com> | 2011-03-08 18:25:31 -0800 |
---|---|---|
committer | Xia Wang <xiaw@google.com> | 2011-03-08 18:25:31 -0800 |
commit | 3d58d63b03edd95352b70b9b18251c4f72f17b74 (patch) | |
tree | 930e113845448dd2570df68626820052807b8852 /core | |
parent | b3c991b0190faa4fc833a5fc9074939fd5d8a3c4 (diff) | |
download | frameworks_base-3d58d63b03edd95352b70b9b18251c4f72f17b74.zip frameworks_base-3d58d63b03edd95352b70b9b18251c4f72f17b74.tar.gz frameworks_base-3d58d63b03edd95352b70b9b18251c4f72f17b74.tar.bz2 |
Add WifiStressTest to Wi-Fi only test suite.
Change-Id: Id15ec2e291729b910ee05cef4650efb8d2e1a43c
Diffstat (limited to 'core')
2 files changed, 20 insertions, 18 deletions
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java index 3f78ce0..d23dfd3 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java @@ -49,13 +49,8 @@ public class ConnectivityManagerStressTestRunner extends InstrumentationTestRunn suite.addTestSuite(WifiApStress.class); suite.addTestSuite(WifiStressTest.class); } else { - // create a new test suite - suite.setName("WifiOnlyStressTests"); - String[] methodNames = {"testWifiScanning"}; - Class<WifiStressTest> testClass = WifiStressTest.class; - for (String method: methodNames) { - suite.addTest(TestSuite.createTest(testClass, method)); - } + // only the wifi stress tests + suite.addTestSuite(WifiStressTest.class); } return suite; } @@ -68,11 +63,13 @@ public class ConnectivityManagerStressTestRunner extends InstrumentationTestRunn @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); - String valueStr = (String) icicle.get("softap_iterations"); - if (valueStr != null) { - int iteration = Integer.parseInt(valueStr); - if (iteration > 0) { - mSoftapIterations = iteration; + if (!UtilHelper.isWifiOnly()) { + String valueStr = (String) icicle.get("softap_iterations"); + if (valueStr != null) { + int iteration = Integer.parseInt(valueStr); + if (iteration > 0) { + mSoftapIterations = iteration; + } } } 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 ae009ca..1cc5575 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java @@ -18,6 +18,7 @@ package com.android.connectivitymanagertest.stress; import com.android.connectivitymanagertest.ConnectivityManagerStressTestRunner; import com.android.connectivitymanagertest.ConnectivityManagerTestActivity; +import com.android.connectivitymanagertest.UtilHelper; import android.content.Context; import android.net.ConnectivityManager; @@ -261,16 +262,20 @@ public class WifiStressTest assertTrue("Wait for Wi-Fi to idle timeout", mAct.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.DISCONNECTED, 6 * ConnectivityManagerTestActivity.SHORT_TIMEOUT)); - // 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)); + if (!UtilHelper.isWifiOnly()) { + // 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)); + } sleep(mWifiSleepTime + WIFI_IDLE_DELAY, "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()); - assertEquals("Cellular connection is down", State.CONNECTED, - mAct.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState()); + if (!UtilHelper.isWifiOnly()) { + assertEquals("Cellular connection is down", State.CONNECTED, + mAct.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState()); + } // Turn screen on again mAct.turnScreenOn(); assertTrue("Wait for Wi-Fi enable timeout after wake up", |