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

Commit d4dee632 authored by Jack He's avatar Jack He Committed by Gerrit Code Review
Browse files

Merge "UnitTest: Increase profile service toggle timeout in test"

parents 94cb24b9 779fc427
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -90,6 +90,7 @@ public class AdapterServiceTest {
    private @Mock android.app.Application mApplication;
    private @Mock android.app.Application mApplication;


    private static final int CONTEXT_SWITCH_MS = 100;
    private static final int CONTEXT_SWITCH_MS = 100;
    private static final int PROFILE_SERVICE_TOGGLE_TIME_MS = 200;
    private static final int GATT_START_TIME_MS = 500;
    private static final int GATT_START_TIME_MS = 500;
    private static final int ONE_SECOND_MS = 1000;
    private static final int ONE_SECOND_MS = 1000;
    private static final int NATIVE_INIT_MS = 8000;
    private static final int NATIVE_INIT_MS = 8000;
@@ -230,7 +231,7 @@ public class AdapterServiceTest {
        }
        }


        verifyStateChange(BluetoothAdapter.STATE_TURNING_ON, BluetoothAdapter.STATE_ON,
        verifyStateChange(BluetoothAdapter.STATE_TURNING_ON, BluetoothAdapter.STATE_ON,
                invocationNumber + 1, CONTEXT_SWITCH_MS);
                invocationNumber + 1, PROFILE_SERVICE_TOGGLE_TIME_MS);


        verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(2 * invocationNumber + 2))
        verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(2 * invocationNumber + 2))
                .sendBroadcast(any(), eq(android.Manifest.permission.BLUETOOTH));
                .sendBroadcast(any(), eq(android.Manifest.permission.BLUETOOTH));
@@ -259,7 +260,7 @@ public class AdapterServiceTest {
        }
        }


        verifyStateChange(BluetoothAdapter.STATE_TURNING_OFF, BluetoothAdapter.STATE_BLE_ON,
        verifyStateChange(BluetoothAdapter.STATE_TURNING_OFF, BluetoothAdapter.STATE_BLE_ON,
                invocationNumber + 1, CONTEXT_SWITCH_MS);
                invocationNumber + 1, PROFILE_SERVICE_TOGGLE_TIME_MS);


        mServiceBinder.onBrEdrDown();
        mServiceBinder.onBrEdrDown();