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

Commit 67e38cf6 authored by William Escande's avatar William Escande
Browse files

Trunk Stable/GattServiceTest: do not skip test

Bug: 324658330
Bug: 320402249
Bug: 323110155
Test: m Bluetooth | mechanical refactor
Change-Id: Iadef10dd7f561b722bc4e06675b59fca46c30b83
parent de2fca6a
Loading
Loading
Loading
Loading
+4 −10
Original line number Original line Diff line number Diff line
@@ -45,10 +45,8 @@ import android.location.LocationManager;
import android.os.Binder;
import android.os.Binder;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.WorkSource;
import android.os.WorkSource;
import android.platform.test.flag.junit.SetFlagsRule;


import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import androidx.test.InstrumentationRegistry;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.filters.SmallTest;
import androidx.test.rule.ServiceTestRule;
import androidx.test.rule.ServiceTestRule;
@@ -67,7 +65,6 @@ import com.android.bluetooth.flags.Flags;


import org.junit.After;
import org.junit.After;
import org.junit.Assert;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.Test;
@@ -110,9 +107,7 @@ public class GattServiceTest {
    @Mock private AdvertiseManagerNativeInterface mAdvertiseManagerNativeInterface;
    @Mock private AdvertiseManagerNativeInterface mAdvertiseManagerNativeInterface;


    @Rule public final ServiceTestRule mServiceRule = new ServiceTestRule();
    @Rule public final ServiceTestRule mServiceRule = new ServiceTestRule();

    @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
    @Rule
    public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();


    private BluetoothDevice mDevice;
    private BluetoothDevice mDevice;
    private BluetoothAdapter mAdapter;
    private BluetoothAdapter mAdapter;
@@ -502,10 +497,9 @@ public class GattServiceTest {
        verify(mScanManager).flushBatchScanResults(new ScanClient(scannerId));
        verify(mScanManager).flushBatchScanResults(new ScanClient(scannerId));
    }
    }


    @RequiresFlagsEnabled(Flags.FLAG_LE_SCAN_FIX_REMOTE_EXCEPTION)
    @Test
    @Test
    public void onScanResult_remoteException_clientDied() throws Exception {
    public void onScanResult_remoteException_clientDied() throws Exception {
        Assume.assumeTrue(Flags.leScanFixRemoteException());
        mSetFlagsRule.enableFlags(Flags.FLAG_LE_SCAN_FIX_REMOTE_EXCEPTION);
        int scannerId = 1;
        int scannerId = 1;


        int eventType = 0;
        int eventType = 0;
@@ -893,9 +887,9 @@ public class GattServiceTest {
                        BluetoothProfile.STATE_CONNECTED);
                        BluetoothProfile.STATE_CONNECTED);
    }
    }


    @RequiresFlagsEnabled(Flags.FLAG_GATT_CLEANUP_RESTRICTED_HANDLES)
    @Test
    @Test
    public void restrictedHandles() throws Exception {
    public void restrictedHandles() throws Exception {
        mSetFlagsRule.enableFlags(Flags.FLAG_GATT_CLEANUP_RESTRICTED_HANDLES);
        int clientIf = 1;
        int clientIf = 1;
        int connId = 1;
        int connId = 1;
        ArrayList<GattDbElement> db = new ArrayList<>();
        ArrayList<GattDbElement> db = new ArrayList<>();