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

Commit b5c17fb3 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Adjust lock screen tests

Lock screen dashboard is now always visible, and tests should reflect
the new behavior.

Fixes: 144899234
Test: treehugger
Test: make RunSettingsRoboTests ROBOTEST_FILTER=LockScreenPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=LockscreenDashboardFragmentTest
Change-Id: Ia1cd79c5d8f6ea74525f6afdea900c230806fd88
parent 68e501f8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,13 +123,13 @@ public class LockscreenDashboardFragmentTest {
    }

    @Test
    public void isPageSearchable_notLocked_shouldNotBeSearchable() {
    public void isPageSearchable_notLocked_shouldBeSearchable() {
        when(mLockPatternUtils.isSecure(anyInt())).thenReturn(false);
        when(mLockPatternUtils.isLockScreenDisabled(anyInt())).thenReturn(true);

        assertThat(LockscreenDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
                .getNonIndexableKeys(mContext))
                .contains("security_lockscreen_settings_screen");
                .doesNotContain("security_lockscreen_settings_screen");
    }

    public static class TestFragment extends LockscreenDashboardFragment {
+2 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ public class LockScreenPreferenceControllerTest {
    }

    @Test
    public void onResume_unavailable_shouldHide() {
    public void onResume_unavailable_shouldShow() {
        when(mLockPatternUtils.isSecure(anyInt())).thenReturn(true);
        when(mLockPatternUtils.getKeyguardStoredPasswordQuality(anyInt()))
                .thenReturn(PASSWORD_QUALITY_UNSPECIFIED);
@@ -141,6 +141,6 @@ public class LockScreenPreferenceControllerTest {
        mController.displayPreference(mScreen);
        mLifecycle.handleLifecycleEvent(ON_RESUME);

        assertThat(mPreference.isVisible()).isFalse();
        assertThat(mPreference.isVisible()).isTrue();
    }
}