mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Split up tests by actual hardware keyboard status.
Flag: TEST_ONLY Bug: 230027385 Test: TaskbarStashControllerTest Change-Id: I63fc433810af3993db5655571a11887eb2c68422
This commit is contained in:
@@ -56,8 +56,8 @@ import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_
|
||||
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING
|
||||
import com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_BAR
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import com.google.common.truth.TruthJUnit.assume
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -82,11 +82,6 @@ class TaskbarStashControllerTest {
|
||||
|
||||
private val activityContext by taskbarUnitTestRule::activityContext
|
||||
|
||||
// Disable hardware keyboard mode during tests.
|
||||
@Before fun enableSoftwareIme() = TaskbarStashController.enableSoftwareImeForTests(true)
|
||||
|
||||
@After fun resetIme() = TaskbarStashController.enableSoftwareImeForTests(false)
|
||||
|
||||
@After fun cancelTimeoutIfExists() = stashController.cancelTimeoutIfExists()
|
||||
|
||||
@Test
|
||||
@@ -544,6 +539,8 @@ class TaskbarStashControllerTest {
|
||||
@Test
|
||||
@TaskbarMode(PINNED)
|
||||
fun testAnimatePinnedTaskbar_imeShown_replacesIconsWithHandle() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isFalse()
|
||||
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, false)
|
||||
animatorTestRule.advanceTimeBy(TASKBAR_STASH_DURATION_FOR_IME)
|
||||
@@ -555,6 +552,8 @@ class TaskbarStashControllerTest {
|
||||
@Test
|
||||
@TaskbarMode(PINNED)
|
||||
fun testAnimatePinnedTaskbar_imeHidden_replacesHandleWithIcons() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isFalse()
|
||||
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true)
|
||||
animatorTestRule.advanceTimeBy(0)
|
||||
@@ -571,6 +570,8 @@ class TaskbarStashControllerTest {
|
||||
@Test
|
||||
@TaskbarMode(PINNED)
|
||||
fun testAnimatePinnedTaskbar_imeHidden_verifyAnimationDuration() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isFalse()
|
||||
|
||||
// Start with IME shown.
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true)
|
||||
@@ -596,6 +597,8 @@ class TaskbarStashControllerTest {
|
||||
@Test
|
||||
@TaskbarMode(THREE_BUTTONS)
|
||||
fun testAnimateThreeButtonsTaskbar_imeShown_hidesIconsAndBg() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isFalse()
|
||||
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, false)
|
||||
animatorTestRule.advanceTimeBy(TASKBAR_STASH_DURATION_FOR_IME)
|
||||
@@ -607,6 +610,8 @@ class TaskbarStashControllerTest {
|
||||
@Test
|
||||
@TaskbarMode(THREE_BUTTONS)
|
||||
fun testAnimateThreeButtonsTaskbar_imeHidden_showsIconsAndBg() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isFalse()
|
||||
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, false)
|
||||
animatorTestRule.advanceTimeBy(TASKBAR_STASH_DURATION_FOR_IME)
|
||||
@@ -625,6 +630,8 @@ class TaskbarStashControllerTest {
|
||||
@Test
|
||||
@TaskbarMode(PINNED)
|
||||
fun testSetSystemGestureInProgress_whileImeShown_unstashesTaskbar() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isFalse()
|
||||
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true)
|
||||
animatorTestRule.advanceTimeBy(0)
|
||||
@@ -639,6 +646,19 @@ class TaskbarStashControllerTest {
|
||||
assertThat(stashController.isStashed).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarMode(PINNED)
|
||||
fun testSysuiStateImeShowingInApp_hardwareKeyboardWithPinnedMode_notStashedForIme() {
|
||||
assume().that(activityContext.isHardwareKeyboard).isTrue()
|
||||
|
||||
getInstrumentation().runOnMainSync {
|
||||
stashController.updateStateForFlag(FLAG_IN_APP, true)
|
||||
stashController.updateStateForSysuiFlags(SYSUI_STATE_IME_SHOWING, true)
|
||||
}
|
||||
|
||||
assertThat(stashController.isStashed).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarMode(PINNED)
|
||||
fun testUnlockTransition_pinnedMode_fadesOutHandle() {
|
||||
|
||||
Reference in New Issue
Block a user