diff --git a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt index e598df961d87263d13300b4271f0be3e42ca9fd3..f91f1c4288de02ea0d8c6cf93b2a2ba8df62dc37 100644 --- a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt +++ b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt @@ -88,11 +88,11 @@ abstract class DeviceProfileBaseTest { protected fun newScalableInvariantDeviceProfile(): InvariantDeviceProfile = InvariantDeviceProfile().apply { isScalable = true - numColumns = 5 - numRows = 5 - numShownHotseatIcons = 5 + numColumns = 4 + numRows = 4 + numShownHotseatIcons = 4 numDatabaseHotseatIcons = 6 - numShrunkenHotseatIcons = 4 + numShrunkenHotseatIcons = 5 horizontalMargin = FloatArray(4) { 22f } borderSpaces = listOf( PointF(16f, 16f), diff --git a/tests/src/com/android/launcher3/HotseatSizeTest.kt b/tests/src/com/android/launcher3/HotseatSizeTest.kt index ca697d7c963ec779b1b73ef443906e0db02d12f5..a44939f4cf4ec0deef54e6d5c5b1200272c18678 100644 --- a/tests/src/com/android/launcher3/HotseatSizeTest.kt +++ b/tests/src/com/android/launcher3/HotseatSizeTest.kt @@ -43,11 +43,11 @@ class HotseatSizeTest : DeviceProfileBaseTest() { val dp = newDP() assertThat(dp.isQsbInline).isFalse() - assertThat(dp.numShownHotseatIcons).isEqualTo(5) + assertThat(dp.numShownHotseatIcons).isEqualTo(4) } @Test - fun hotseat_size_is_max_for_foldables() { + fun hotseat_size_is_max_when_large_screen() { initializeVarsForTablet(isLandscape = true) inv = newScalableInvariantDeviceProfile().apply { deviceType = TYPE_MULTI_DISPLAY @@ -61,7 +61,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { } @Test - fun hotseat_size_is_shrunk_if_needed() { + fun hotseat_size_is_shrunk_if_needed_when_large_screen() { initializeVarsForTablet(isLandscape = true) inv = newScalableInvariantDeviceProfile().apply { deviceType = TYPE_MULTI_DISPLAY @@ -79,7 +79,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { if (dp.hotseatQsbHeight > 0) { assertThat(dp.isQsbInline).isTrue() - assertThat(dp.numShownHotseatIcons).isEqualTo(4) + assertThat(dp.numShownHotseatIcons).isEqualTo(5) } else { // Launcher3 doesn't have QSB height assertThat(dp.isQsbInline).isFalse() assertThat(dp.numShownHotseatIcons).isEqualTo(6) @@ -91,7 +91,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { * inline qsb */ @Test - fun hotseat_size_is_shrunk_even_in_portrait() { + fun hotseat_size_is_shrunk_even_in_portrait_when_large_screen() { initializeVarsForTablet() inv = newScalableInvariantDeviceProfile().apply { deviceType = TYPE_MULTI_DISPLAY @@ -109,7 +109,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { if (dp.hotseatQsbHeight > 0) { assertThat(dp.isQsbInline).isFalse() - assertThat(dp.numShownHotseatIcons).isEqualTo(4) + assertThat(dp.numShownHotseatIcons).isEqualTo(5) } else { // Launcher3 doesn't have QSB height assertThat(dp.isQsbInline).isFalse() assertThat(dp.numShownHotseatIcons).isEqualTo(6) @@ -117,7 +117,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { } @Test - fun hotseat_size_is_default_when_folded() { + fun hotseat_size_is_default_when_small_screen() { initializeVarsForPhone() inv = newScalableInvariantDeviceProfile().apply { deviceType = TYPE_MULTI_DISPLAY @@ -126,7 +126,33 @@ class HotseatSizeTest : DeviceProfileBaseTest() { val dp = newDP() - assertThat(dp.numShownHotseatIcons).isEqualTo(5) + assertThat(dp.numShownHotseatIcons).isEqualTo(4) + } + + @Test + fun hotseat_size_is_not_shrunk_on_gesture_tablet() { + initializeVarsForTablet(isLandscape = true) + inv = newScalableInvariantDeviceProfile().apply { + deviceType = TYPE_TABLET + inlineQsb = booleanArrayOf( + false, + true, // landscape + false, + false + ) + numShownHotseatIcons = 6 + } + + isGestureMode = true + val dp = newDP() + + if (dp.hotseatQsbHeight > 0) { + assertThat(dp.isQsbInline).isTrue() + assertThat(dp.numShownHotseatIcons).isEqualTo(6) + } else { // Launcher3 doesn't have QSB height + assertThat(dp.isQsbInline).isFalse() + assertThat(dp.numShownHotseatIcons).isEqualTo(6) + } } @Test @@ -140,6 +166,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { false, false ) + numShownHotseatIcons = 6 } isGestureMode = false @@ -147,10 +174,10 @@ class HotseatSizeTest : DeviceProfileBaseTest() { if (dp.hotseatQsbHeight > 0) { assertThat(dp.isQsbInline).isTrue() - assertThat(dp.numShownHotseatIcons).isEqualTo(4) + assertThat(dp.numShownHotseatIcons).isEqualTo(5) } else { // Launcher3 doesn't have QSB height assertThat(dp.isQsbInline).isFalse() - assertThat(dp.numShownHotseatIcons).isEqualTo(5) + assertThat(dp.numShownHotseatIcons).isEqualTo(6) } } @@ -169,6 +196,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() { false, false ) + numShownHotseatIcons = 6 } isGestureMode = false @@ -176,10 +204,10 @@ class HotseatSizeTest : DeviceProfileBaseTest() { if (dp.hotseatQsbHeight > 0) { assertThat(dp.isQsbInline).isFalse() - assertThat(dp.numShownHotseatIcons).isEqualTo(4) + assertThat(dp.numShownHotseatIcons).isEqualTo(5) } else { // Launcher3 doesn't have QSB height assertThat(dp.isQsbInline).isFalse() - assertThat(dp.numShownHotseatIcons).isEqualTo(5) + assertThat(dp.numShownHotseatIcons).isEqualTo(6) } }