summaryrefslogtreecommitdiff
path: root/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2024-03-07 06:41:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-03-07 06:41:07 +0000
commit17dabff1dd38e8f0e08736176a8a587e039e610a (patch)
treebd40604eb4b00a1a0e63edfe28cb0ebe33f23029 /tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
parentded14cc2110e39408f74abac8a83e0a0f16608d2 (diff)
parent7e8ae158f4a73ee580c468d71ca9a1df6f90a8cd (diff)
downloadLauncher3-17dabff1dd38e8f0e08736176a8a587e039e610a.tar.gz
Merge "Merge Android 14 QPR2 to AOSP main" into main
Diffstat (limited to 'tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt')
-rw-r--r--tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt27
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt b/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
index c22cf40de6..30b5663a1e 100644
--- a/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
+++ b/tests/src/com/android/launcher3/FakeInvariantDeviceProfileTest.kt
@@ -27,9 +27,9 @@ import com.android.launcher3.util.WindowBounds
import java.io.PrintWriter
import java.io.StringWriter
import org.junit.Before
-import org.mockito.ArgumentMatchers.any
-import org.mockito.Mockito.mock
-import org.mockito.Mockito.`when` as whenever
+import org.mockito.kotlin.any
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
/**
* This is an abstract class for DeviceProfile tests that don't need the real Context and mock an
@@ -41,12 +41,13 @@ abstract class FakeInvariantDeviceProfileTest {
protected var context: Context? = null
protected var inv: InvariantDeviceProfile? = null
- protected var info: Info = mock(Info::class.java)
+ protected val info: Info = mock()
protected var windowBounds: WindowBounds? = null
protected var isMultiWindowMode: Boolean = false
protected var transposeLayoutWithOrientation: Boolean = false
protected var useTwoPanels: Boolean = false
protected var isGestureMode: Boolean = true
+ protected var isTransientTaskbar: Boolean = true
@Before
fun setUp() {
@@ -68,7 +69,8 @@ abstract class FakeInvariantDeviceProfileTest {
useTwoPanels,
isGestureMode,
DEFAULT_PROVIDER,
- DEFAULT_DIMENSION_PROVIDER
+ DEFAULT_DIMENSION_PROVIDER,
+ isTransientTaskbar,
)
protected fun initializeVarsForPhone(
@@ -93,6 +95,7 @@ abstract class FakeInvariantDeviceProfileTest {
whenever(info.smallestSizeDp(any())).thenReturn(411f)
this.isGestureMode = isGestureMode
+ this.isTransientTaskbar = false
transposeLayoutWithOrientation = true
inv =
@@ -118,8 +121,8 @@ abstract class FakeInvariantDeviceProfileTest {
listOf(PointF(16f, 16f), PointF(16f, 16f), PointF(16f, 16f), PointF(16f, 16f))
.toTypedArray()
- numFolderRows = 3
- numFolderColumns = 3
+ numFolderRows = intArrayOf(3, 3, 3, 3)
+ numFolderColumns = intArrayOf(3, 3, 3, 3)
folderStyle = R.style.FolderStyleDefault
inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_split
@@ -175,6 +178,7 @@ abstract class FakeInvariantDeviceProfileTest {
whenever(info.smallestSizeDp(any())).thenReturn(800f)
this.isGestureMode = isGestureMode
+ this.isTransientTaskbar = true
useTwoPanels = false
inv =
@@ -200,8 +204,8 @@ abstract class FakeInvariantDeviceProfileTest {
listOf(PointF(16f, 64f), PointF(64f, 16f), PointF(16f, 64f), PointF(16f, 64f))
.toTypedArray()
- numFolderRows = 3
- numFolderColumns = 3
+ numFolderRows = intArrayOf(3, 3, 3, 3)
+ numFolderColumns = intArrayOf(3, 3, 3, 3)
folderStyle = R.style.FolderStyleDefault
inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_6_5
@@ -258,6 +262,7 @@ abstract class FakeInvariantDeviceProfileTest {
whenever(info.smallestSizeDp(any())).thenReturn(700f)
this.isGestureMode = isGestureMode
+ this.isTransientTaskbar = true
useTwoPanels = true
inv =
@@ -283,8 +288,8 @@ abstract class FakeInvariantDeviceProfileTest {
listOf(PointF(16f, 16f), PointF(16f, 16f), PointF(16f, 20f), PointF(20f, 20f))
.toTypedArray()
- numFolderRows = 3
- numFolderColumns = 3
+ numFolderRows = intArrayOf(3, 3, 3, 3)
+ numFolderColumns = intArrayOf(3, 3, 3, 3)
folderStyle = R.style.FolderStyleDefault
inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_split