Skip to content

Commit

Permalink
Merge "Adjust lock screen tests"
Browse files Browse the repository at this point in the history
  • Loading branch information
TreeHugger Robot authored and Android (Google) Code Review committed Nov 25, 2019
2 parents bfbb018 + b5c17fb commit a6198c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ public void onAttach_pickUp_shouldInvokeSetters() {
}

@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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ public void onResume_available_shouldShow() {
}

@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);

mController.displayPreference(mScreen);
mLifecycle.handleLifecycleEvent(ON_RESUME);

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

0 comments on commit a6198c2

Please sign in to comment.