Fix landscape pattern enroll crash

Test: atest SetupChooseLockPatternTest.java
Bug: 77878150
Change-Id: Ie54286765ea0d766bcc9e2c8e56cfbda919d5fd7
This commit is contained in:
Maurice Lam
2018-04-10 19:53:41 -07:00
parent 16594545ff
commit 8ca084e62b
3 changed files with 36 additions and 8 deletions

View File

@@ -101,9 +101,7 @@ public class SetupChooseLockPatternTest {
ReflectionHelpers.callInstanceMethod(lockPatternView, "notifyPatternDetected");
}
@Config(qualifiers = "sw400dp")
@Test
public void sw400dp_shouldShowScreenLockOptions() {
private void verifyScreenLockOptionsShown() {
Button button = mActivity.findViewById(R.id.screen_lock_options);
assertThat(button).isNotNull();
assertThat(button.getVisibility()).isEqualTo(View.VISIBLE);
@@ -115,14 +113,36 @@ public class SetupChooseLockPatternTest {
assertThat(count).named("List items shown").isEqualTo(3);
}
@Config(qualifiers = "sw300dp")
@Config(qualifiers = "sw400dp")
@Test
public void smallScreens_shouldHideScreenLockOptions() {
public void sw400dp_shouldShowScreenLockOptions() {
verifyScreenLockOptionsShown();
}
@Config(qualifiers = "sw400dp-land")
@Test
public void sw400dpLandscape_shouldShowScreenLockOptions() {
verifyScreenLockOptionsShown();
}
private void verifyScreenLockOptionsHidden() {
Button button = mActivity.findViewById(R.id.screen_lock_options);
assertThat(button).isNotNull();
assertThat(button.getVisibility()).isEqualTo(View.GONE);
}
@Config(qualifiers = "sw300dp")
@Test
public void smallScreens_shouldHideScreenLockOptions() {
verifyScreenLockOptionsHidden();
}
@Config(qualifiers = "sw300dp-land")
@Test
public void smallScreensLandscape_shouldHideScreenLockOptions() {
verifyScreenLockOptionsHidden();
}
@Test
public void skipButton_shouldBeVisible_duringNonFingerprintFlow() {
Button skipButton = mActivity.findViewById(R.id.skip_button);