Merge "Adjust lock screen tests"

This commit is contained in:
TreeHugger Robot
2019-11-25 03:29:24 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -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 {

View File

@@ -132,7 +132,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);
@@ -140,6 +140,6 @@ public class LockScreenPreferenceControllerTest {
mController.displayPreference(mScreen);
mLifecycle.handleLifecycleEvent(ON_RESUME);
assertThat(mPreference.isVisible()).isFalse();
assertThat(mPreference.isVisible()).isTrue();
}
}