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
This commit is contained in:
@@ -123,13 +123,13 @@ public class LockscreenDashboardFragmentTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isPageSearchable_notLocked_shouldNotBeSearchable() {
|
public void isPageSearchable_notLocked_shouldBeSearchable() {
|
||||||
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(false);
|
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(false);
|
||||||
when(mLockPatternUtils.isLockScreenDisabled(anyInt())).thenReturn(true);
|
when(mLockPatternUtils.isLockScreenDisabled(anyInt())).thenReturn(true);
|
||||||
|
|
||||||
assertThat(LockscreenDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
|
assertThat(LockscreenDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||||
.getNonIndexableKeys(mContext))
|
.getNonIndexableKeys(mContext))
|
||||||
.contains("security_lockscreen_settings_screen");
|
.doesNotContain("security_lockscreen_settings_screen");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TestFragment extends LockscreenDashboardFragment {
|
public static class TestFragment extends LockscreenDashboardFragment {
|
||||||
|
@@ -133,7 +133,7 @@ public class LockScreenPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onResume_unavailable_shouldHide() {
|
public void onResume_unavailable_shouldShow() {
|
||||||
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(true);
|
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(true);
|
||||||
when(mLockPatternUtils.getKeyguardStoredPasswordQuality(anyInt()))
|
when(mLockPatternUtils.getKeyguardStoredPasswordQuality(anyInt()))
|
||||||
.thenReturn(PASSWORD_QUALITY_UNSPECIFIED);
|
.thenReturn(PASSWORD_QUALITY_UNSPECIFIED);
|
||||||
@@ -141,6 +141,6 @@ public class LockScreenPreferenceControllerTest {
|
|||||||
mController.displayPreference(mScreen);
|
mController.displayPreference(mScreen);
|
||||||
mLifecycle.handleLifecycleEvent(ON_RESUME);
|
mLifecycle.handleLifecycleEvent(ON_RESUME);
|
||||||
|
|
||||||
assertThat(mPreference.isVisible()).isFalse();
|
assertThat(mPreference.isVisible()).isTrue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user