Fixed Android tests to work on emulator

This commit is contained in:
Felix Ableitner 2016-10-09 14:05:36 +09:00
parent f50d0697e6
commit a4a50d0341

View file

@ -6,14 +6,18 @@ import android.test.AndroidTestCase
class BluetoothInterfaceTest extends AndroidTestCase {
private lazy val adapter = new BluetoothInterface(getContext, new Handler(), null)
private lazy val btInterface = new BluetoothInterface(getContext, new Handler(), null)
/**
* Test for issue [[https://github.com/Nutomic/ensichat/issues/3 #3]].
*/
def testStartBluetoothOff(): Unit = {
BluetoothAdapter.getDefaultAdapter.disable()
adapter.create()
val btAdapter = BluetoothAdapter.getDefaultAdapter
if (btAdapter == null)
return
btAdapter.disable()
btInterface.create()
}
}