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;
}
@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;
+ }
}
}
import com.android.connectivitymanagertest.ConnectivityManagerStressTestRunner;
import com.android.connectivitymanagertest.ConnectivityManagerTestActivity;
+import com.android.connectivitymanagertest.UtilHelper;
import android.content.Context;
import android.net.ConnectivityManager;
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",