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

Commit f26e541e authored by Elliot Sisteron's avatar Elliot Sisteron
Browse files

Fix tests for BiometricsSafetySource and LockScreenSafetySource.

It seems these tests have been failing for a while (probably they were never passing in the first place; as the issue appears to be with the tests and not the prod code).

Are they not being run on pre and/or post-submit?

Bug: 323649900
Test: atest LockScreenSafetySourceTest && atest BiometricsSafetySourceTest
Change-Id: Ie75241455317da6749ccf648dae71c49ea9f766f
parent 6b64e92f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ public class BiometricsSafetySourceTest {

    @Test
    public void setSafetySourceData_whenSafetyCenterIsEnabled_withoutBiometrics_setsNullData() {
        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(false);
        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
        when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
        when(mFaceManager.isHardwareDetected()).thenReturn(false);

+2 −0
Original line number Diff line number Diff line
@@ -413,6 +413,8 @@ public class LockScreenSafetySourceTest {
        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
                .thenReturn(false);
        when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(true);
        when(mScreenLockPreferenceDetailsUtils.shouldShowGearMenu()).thenReturn(true);

        LockScreenSafetySource.setSafetySourceData(
                mApplicationContext, mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);