diff options
author | chengjie-he <chengjie.he@linaro.org> | 2012-05-25 17:32:43 +0800 |
---|---|---|
committer | chengjie-he <chengjie.he@linaro.org> | 2012-05-25 21:12:47 +0800 |
commit | e4435a9536d8282a85e714c486fd104aa0883f96 (patch) | |
tree | 43f154984972d5c075894e46a8543c4692237974 | |
parent | 82e1ee7c14389f194efc28a947e9685f8d989c9f (diff) | |
download | base-e4435a9536d8282a85e714c486fd104aa0883f96.tar.gz |
platform/frameworks/base: add some delay to make bluetooth module tests work
to enable or disable the bluetooth module, to start pair and stop pair the bluetooth module, a delay of 2 seconds is added since these operations need some time to finish
Signed-off-by: chengjie-he <chengjie.he@linaro.org>
Change-Id: Ie11d6f459f9302a9d38f986c450ab9995a6ac428
-rw-r--r-- | core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java index 755e7c4504c8..06b2270391f0 100644 --- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java +++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java @@ -67,6 +67,7 @@ public class BluetoothStressTest extends InstrumentationTestCase { for (int i = 0; i < iterations; i++) { mTestUtils.writeOutput("enable iteration " + (i + 1) + " of " + iterations); mTestUtils.enable(adapter); + sleep(SCO_SLEEP_TIME); mTestUtils.disable(adapter); } } @@ -82,12 +83,14 @@ public class BluetoothStressTest extends InstrumentationTestCase { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); mTestUtils.disable(adapter); + sleep(SCO_SLEEP_TIME); mTestUtils.enable(adapter); mTestUtils.undiscoverable(adapter); for (int i = 0; i < iterations; i++) { mTestUtils.writeOutput("discoverable iteration " + (i + 1) + " of " + iterations); mTestUtils.discoverable(adapter); + sleep(SCO_SLEEP_TIME); mTestUtils.undiscoverable(adapter); } @@ -105,12 +108,14 @@ public class BluetoothStressTest extends InstrumentationTestCase { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); mTestUtils.disable(adapter); + sleep(SCO_SLEEP_TIME); mTestUtils.enable(adapter); mTestUtils.stopScan(adapter); for (int i = 0; i < iterations; i++) { mTestUtils.writeOutput("scan iteration " + (i + 1) + " of " + iterations); mTestUtils.startScan(adapter); + sleep(SCO_SLEEP_TIME); mTestUtils.stopScan(adapter); } @@ -134,6 +139,7 @@ public class BluetoothStressTest extends InstrumentationTestCase { mTestUtils.writeOutput("testEnablePan iteration " + (i + 1) + " of " + iterations); mTestUtils.enablePan(adapter); + sleep(SCO_SLEEP_TIME); mTestUtils.disablePan(adapter); } @@ -162,6 +168,7 @@ public class BluetoothStressTest extends InstrumentationTestCase { mTestUtils.writeOutput("pair iteration " + (i + 1) + " of " + iterations); mTestUtils.pair(adapter, device, BluetoothTestRunner.sDevicePairPasskey, BluetoothTestRunner.sDevicePairPin); + sleep(SCO_SLEEP_TIME); mTestUtils.unpair(adapter, device); } mTestUtils.disable(adapter); @@ -188,6 +195,7 @@ public class BluetoothStressTest extends InstrumentationTestCase { mTestUtils.writeOutput("acceptPair iteration " + (i + 1) + " of " + iterations); mTestUtils.acceptPair(adapter, device, BluetoothTestRunner.sDevicePairPasskey, BluetoothTestRunner.sDevicePairPin); + sleep(SCO_SLEEP_TIME); mTestUtils.unpair(adapter, device); } mTestUtils.disable(adapter); |