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

Commit 889976d4 authored by William Escande's avatar William Escande
Browse files

SystemServer: Nit change in the test logging

Bug: 311772251
Test: atest ServiceBluetoothRoboTests
Change-Id: Ib20e35aa203c3c58e0f679bd59535ee4708d6af0
parent e697b022
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -13,9 +13,11 @@
 * See the License for the specific language governing permissions and
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * limitations under the License.
 */
 */
package com.android.server.bluetooth
package com.android.server.bluetooth.test


import android.bluetooth.BluetoothAdapter.STATE_OFF
import android.bluetooth.BluetoothAdapter.STATE_OFF
import com.android.server.bluetooth.BluetoothAdapterState
import com.android.server.bluetooth.Log
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertThat
import kotlin.time.Duration.Companion.days
import kotlin.time.Duration.Companion.days
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.CoroutineStart
@@ -24,7 +26,9 @@ import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.yield
import kotlinx.coroutines.yield
import org.junit.Before
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.Test
import org.junit.rules.TestName
import org.junit.runner.RunWith
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RobolectricTestRunner


@@ -33,9 +37,11 @@ import org.robolectric.RobolectricTestRunner
class BluetoothAdapterStateTest {
class BluetoothAdapterStateTest {


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


    @Before
    @Before
    fun setUp() {
    fun setUp() {
        Log.i("BluetoothAdapterStateTest", "\t--> setup of " + testName.getMethodName())
        mState = BluetoothAdapterState()
        mState = BluetoothAdapterState()
    }
    }


+5 −0
Original line number Original line Diff line number Diff line
@@ -20,10 +20,13 @@ import android.content.Context
import android.os.Looper
import android.os.Looper
import android.provider.Settings
import android.provider.Settings
import androidx.test.core.app.ApplicationProvider
import androidx.test.core.app.ApplicationProvider
import com.android.server.bluetooth.Log
import com.android.server.bluetooth.initializeRadioModeListener
import com.android.server.bluetooth.initializeRadioModeListener
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.Test
import org.junit.rules.TestName
import org.junit.runner.RunWith
import org.junit.runner.RunWith
import org.mockito.Mockito.times
import org.mockito.Mockito.times
import org.robolectric.RobolectricTestRunner
import org.robolectric.RobolectricTestRunner
@@ -57,6 +60,7 @@ internal fun enableMode(resolver: ContentResolver, looper: Looper, modeKey: Stri
class RadioModeListenerTest {
class RadioModeListenerTest {
    private val resolver: ContentResolver =
    private val resolver: ContentResolver =
        ApplicationProvider.getApplicationContext<Context>().getContentResolver()
        ApplicationProvider.getApplicationContext<Context>().getContentResolver()
    @JvmField @Rule val testName = TestName()


    private val looper: Looper = Looper.getMainLooper()
    private val looper: Looper = Looper.getMainLooper()


@@ -64,6 +68,7 @@ class RadioModeListenerTest {


    @Before
    @Before
    public fun setup() {
    public fun setup() {
        Log.i("RadioModeListenerTest", "\t--> setup of " + testName.getMethodName())
        mode = ArrayList()
        mode = ArrayList()
    }
    }


+1 −2
Original line number Original line Diff line number Diff line
@@ -71,8 +71,7 @@ class ModeListenerTest {


    @Before
    @Before
    public fun setup() {
    public fun setup() {
        Log.i("AirplaneModeListenerTest", "-------------------------------------------------------")
        Log.i("AirplaneModeListenerTest", "\t--> setup of " + testName.getMethodName())
        Log.i("AirplaneModeListenerTest", "--> Start of test: " + testName.getMethodName())


        // Most test will expect the system to be sensitive + off
        // Most test will expect the system to be sensitive + off
        enableSensitive()
        enableSensitive()
+1 −2
Original line number Original line Diff line number Diff line
@@ -50,8 +50,7 @@ class ModeListenerTest {


    @Before
    @Before
    public fun setup() {
    public fun setup() {
        Log.i("SatelliteModeListener", "-------------------------------------------------------")
        Log.i("SatelliteModeListener", "\t--> setup of " + testName.getMethodName())
        Log.i("SatelliteModeListener", "--> Start of test: " + testName.getMethodName())
        mode = ArrayList()
        mode = ArrayList()
    }
    }