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

Commit 50bea9c4 authored by Joe Bolinger's avatar Joe Bolinger
Browse files

Fix biometric tests that relied on a non-zero error reset delay.

Swapping the hardcoded value for the injected delay in AuthBiometricView.java
broke two tests since the reset callback now executes before the test completes.

Fix: 189031816
Test: atest com.android.systemui.biometrics.AuthBiometricViewTest
Change-Id: I96ff544a35ebc611259d7dd534530ce35c18ffc7
parent 06cd94a6
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;

import android.content.Context;
import android.hardware.biometrics.BiometricPrompt;
import android.hardware.biometrics.PromptInfo;
import android.os.Bundle;
import android.test.suitebuilder.annotation.SmallTest;
@@ -205,7 +206,7 @@ public class AuthBiometricViewTest extends SysuiTestCase {
        waitForIdleSync();

        verify(mCallback).onAction(AuthBiometricView.Callback.ACTION_ERROR);
        assertEquals(AuthBiometricView.STATE_ERROR, mBiometricView.mState);
        assertEquals(AuthBiometricView.STATE_IDLE, mBiometricView.mState);
    }

    @Test
@@ -258,6 +259,12 @@ public class AuthBiometricViewTest extends SysuiTestCase {
            public TextView getIndicatorView() {
                return indicatorView;
            }

            @Override
            public int getDelayAfterError() {
                // keep a real delay to test saving in the error state
                return BiometricPrompt.HIDE_DIALOG_DELAY;
            }
        });

        final String failureMessage = "testFailureMessage";