Merge "Adjust lock screen tests"
This commit is contained in:
committed by
Android (Google) Code Review
commit
a6198c25be
@@ -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 {
|
||||||
|
@@ -132,7 +132,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);
|
||||||
@@ -140,6 +140,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