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

Commit 0bba5194 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Re-enable biometric prompt tests." into tm-dev

parents c5cf4471 05c96d4b
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.view.View;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;

import org.junit.After;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -50,7 +51,6 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;

@Ignore
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
@SmallTest
@@ -66,6 +66,11 @@ public class AuthBiometricViewTest extends SysuiTestCase {

    private AuthBiometricView mBiometricView;

    @After
    public void tearDown() {
        destroyDialog();
    }

    @Test
    public void testOnAuthenticationSucceeded_noConfirmationRequired_sendsActionAuthenticated() {
        initDialog(false /* allowDeviceCredential */, mCallback);
@@ -245,6 +250,7 @@ public class AuthBiometricViewTest extends SysuiTestCase {
        // TODO: Test dialog size. Should move requireConfirmation to buildBiometricPromptBundle

        // Create new dialog and restore the previous state into it
        destroyDialog();
        initDialog(false /* allowDeviceCredential */, mCallback, state, 10000);
        mBiometricView.mAnimationDurationHideDialog = 10000;
        mBiometricView.setRequireConfirmation(requireConfirmation);
@@ -304,6 +310,12 @@ public class AuthBiometricViewTest extends SysuiTestCase {
        waitForIdleSync();
    }

    private void destroyDialog() {
        if (mBiometricView != null && mBiometricView.isAttachedToWindow()) {
            ViewUtils.detachView(mBiometricView);
        }
    }

    @Override
    protected void waitForIdleSync() {
        TestableLooper.get(this).processAllMessages();