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

Commit a5b94fea authored by William Escande's avatar William Escande
Browse files

AdapterServiceTest: Ignore native test

Bug: 295237486
Test: atest AdapterServiceTest
Change-Id: Id5dc18d76e6dc4fff51309b9c09de1b0808cb752
parent c225a3d7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -342,6 +342,7 @@ public class AdapterServiceFactoryResetTest {
     * native layer
     */
    @Test
    @Ignore("b/296127545: BluetoothInstrumentationTests should not call native")
    public void testObfuscateBluetoothAddress_FactoryResetAndReloadNativeLayer()
            throws PackageManager.NameNotFoundException {
        byte[] metricsSalt1 = AdapterServiceTest.getMetricsSalt(mAdapterConfig);
+10 −10
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.internal.app.IBatteryStats;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -256,12 +257,13 @@ public class AdapterServiceRestartTest {
    }

    /**
     * Test: Check if obfuscated Bluetooth address stays the same after re-initializing
     *       {@link AdapterService}
     * Test: Check if obfuscated Bluetooth address stays the same after re-initializing {@link
     * AdapterService}
     */
    @Test
    public void testObfuscateBluetoothAddress_PersistentBetweenAdapterServiceInitialization() throws
            PackageManager.NameNotFoundException {
    @Ignore("b/296127545: This is a native test")
    public void testObfuscateBluetoothAddress_PersistentBetweenAdapterServiceInitialization()
            throws PackageManager.NameNotFoundException {
        // Sleep needed to ensure the metrics are valid in both native and java (b/267528843)
        try {
            Thread.sleep(1_000);
@@ -291,13 +293,11 @@ public class AdapterServiceRestartTest {
        assertThat(obfuscatedAddress2).isEqualTo(obfuscatedAddress1);
    }

    /**
     * Test: Check if id gotten stays the same after re-initializing
     *       {@link AdapterService}
     */
    /** Test: Check if id gotten stays the same after re-initializing {@link AdapterService} */
    @Test
    public void testgetMetricId_PersistentBetweenAdapterServiceInitialization() throws
            PackageManager.NameNotFoundException {
    @Ignore("b/296127545: This is a native test")
    public void testgetMetricId_PersistentBetweenAdapterServiceInitialization()
            throws PackageManager.NameNotFoundException {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0);
        int initialMetricId = mAdapterService.getMetricId(device);
+15 −16
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ import libcore.util.HexEncoding;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -842,10 +843,11 @@ public class AdapterServiceTest {
    }

    /**
     * Test: Obfuscate Bluetooth address when Bluetooth is disabled
     * Check whether the returned value meets expectation
     * Test: Obfuscate Bluetooth address when Bluetooth is disabled Check whether the returned value
     * meets expectation
     */
    @Test
    @Ignore("b/296127545: This is a native test")
    public void testObfuscateBluetoothAddress_BluetoothDisabled() {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        byte[] metricsSalt = getMetricsSalt(mAdapterConfig);
@@ -858,10 +860,11 @@ public class AdapterServiceTest {
    }

    /**
     * Test: Obfuscate Bluetooth address when Bluetooth is enabled
     * Check whether the returned value meets expectation
     * Test: Obfuscate Bluetooth address when Bluetooth is enabled Check whether the returned value
     * meets expectation
     */
    @Test
    @Ignore("b/296127545: This is a native test")
    public void testObfuscateBluetoothAddress_BluetoothEnabled() {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        doEnable(false);
@@ -875,10 +878,9 @@ public class AdapterServiceTest {
        assertThat(obfuscateInJava(metricsSalt, device)).isEqualTo(obfuscatedAddress);
    }

    /**
     * Test: Check if obfuscated Bluetooth address stays the same after toggling Bluetooth
     */
    /** Test: Check if obfuscated Bluetooth address stays the same after toggling Bluetooth */
    @Test
    @Ignore("b/296127545: This is a native test")
    public void testObfuscateBluetoothAddress_PersistentBetweenToggle() {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        byte[] metricsSalt = getMetricsSalt(mAdapterConfig);
@@ -972,21 +974,19 @@ public class AdapterServiceTest {
    }

    /**
     * Test: Get id when Bluetooth is disabled
     * Check whether the returned value meets expectation
     * Test: Get id when Bluetooth is disabled Check whether the returned value meets expectation
     */
    @Test
    @Ignore("b/296127545: This is a native test")
    public void testGetMetricId_BluetoothDisabled() {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0);
        assertThat(mAdapterService.getMetricId(device)).isGreaterThan(0);
    }

    /**
     * Test: Get id when Bluetooth is enabled
     * Check whether the returned value meets expectation
     */
    /** Test: Get id when Bluetooth is enabled Check whether the returned value meets expectation */
    @Test
    @Ignore("b/296127545: This is a native test")
    public void testGetMetricId_BluetoothEnabled() {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        doEnable(false);
@@ -995,10 +995,9 @@ public class AdapterServiceTest {
        assertThat(mAdapterService.getMetricId(device)).isGreaterThan(0);
    }

    /**
     * Test: Check if id gotten stays the same after toggling Bluetooth
     */
    /** Test: Check if id gotten stays the same after toggling Bluetooth */
    @Test
    @Ignore("b/296127545: This is a native test")
    public void testGetMetricId_PersistentBetweenToggle() {
        assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF);
        BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0);