Browse Source

Fixed Android tests to work on emulator

master
Felix Ableitner 5 years ago
parent
commit
a4a50d0341
  1. 10
      android/src/androidTest/scala/com/nutomic/ensichat/bluetooth/BluetoothInterfaceTest.scala

10
android/src/androidTest/scala/com/nutomic/ensichat/bluetooth/BluetoothInterfaceTest.scala

@ -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()
}
}