Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7182b7a authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge changes I35df4c98,Ibb6e8645,I30385040,Ieb4ff478 into main

* changes:
  Add parametrized test for airplane mode listener
  Properly use test rules in kotlin
  Fix generate coverage script
  Add flag: get_state_from_system_server
parents 7a02a604 26cd5407
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -36,6 +36,16 @@ flag {
    bug: "328698375"
}

flag {
    name: "get_state_from_system_server"
    namespace: "bluetooth"
    description: "Get Bluetooth state from system server instead of from Bluetooth app"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
    bug: "362569584"
}

flag {
    name: "kill_instead_of_exit"
    namespace: "bluetooth"
+4 −2
Original line number Diff line number Diff line
@@ -23,8 +23,10 @@ unzip "${ANDROID_HOST_OUT}"/testcases/ServiceBluetoothRoboTests/ServiceBluetooth
# shellcheck disable=SC2046
rm -rf $(find ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip -iname "*test*")
# shellcheck disable=SC2016
rm ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip/com/android/server/bluetooth/'BluetoothAdapterState$waitForState$3$invokeSuspend$$inlined$filter$1.class'
rm ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip/com/android/server/bluetooth/R.class
rm -rf ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip/com/android/server/bluetooth/'BluetoothAdapterState$waitForState$3$invokeSuspend$$inlined$filter$1.class'
# shellcheck disable=SC2016
rm -rf ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip/com/android/server/bluetooth/'BluetoothAdapterState$waitForState$3$invokeSuspend$$inlined$filter$1$2.class'
rm -rf ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip/com/android/server/bluetooth/R.class

# Generate report:
# You may want to run "m jacoco-cli" if above command failed
+1 −2
Original line number Diff line number Diff line
@@ -42,8 +42,7 @@ import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
@kotlinx.coroutines.ExperimentalCoroutinesApi
class ActiveLogTest {

    @JvmField @Rule val testName = TestName()
    @get:Rule val testName = TestName()

    @Before
    fun setUp() {
+1 −1
Original line number Diff line number Diff line
@@ -35,9 +35,9 @@ import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
@kotlinx.coroutines.ExperimentalCoroutinesApi
class BluetoothAdapterStateTest {
    @get:Rule val testName = TestName()

    lateinit var mState: BluetoothAdapterState
    @JvmField @Rule val testName = TestName()

    @Before
    fun setUp() {
+3 −3
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ import org.robolectric.Shadows.shadowOf
@RunWith(RobolectricTestRunner::class)
@kotlinx.coroutines.ExperimentalCoroutinesApi
class AutoOnFeatureTest {
    @get:Rule val testName = TestName()
    @get:Rule val expect = Expect.create()

    private val looper = Looper.getMainLooper()
    private val state = BluetoothAdapterState()
    private val context = ApplicationProvider.getApplicationContext<Context>()
@@ -65,9 +68,6 @@ class AutoOnFeatureTest {

    private var callback_count = 0

    @JvmField @Rule val testName = TestName()
    @JvmField @Rule val expect = Expect.create()

    @Before
    fun setUp() {
        Log.i("AutoOnFeatureTest", "\t--> setUp(${testName.getMethodName()})")
Loading