mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Revert "Migrating RecentsAnimationDeviceState and dependent obje..."
Revert submission 31332401-recents-device-state Reason for revert: DroidMonitor: Potential culprit for http://b/391684419 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reverted changes: /q/submissionid:31332401-recents-device-state Change-Id: I3986328ee3aa8ebb822f7ef05b9f80ef68872aef
This commit is contained in:
committed by
Android (Google) Code Review
parent
d7bfa76bcc
commit
fa30e3fc0e
@@ -86,11 +86,17 @@ class LauncherSwipeHandlerV2Test {
|
||||
whenever(displayManager.displays).thenReturn(arrayOf(display))
|
||||
|
||||
sandboxContext.initDaggerComponent(
|
||||
DaggerTestComponent.builder()
|
||||
.bindSystemUiProxy(systemUiProxy)
|
||||
.bindRotationHelper(mock(RotationTouchHelper::class.java))
|
||||
.bindRecentsState(mock(RecentsAnimationDeviceState::class.java))
|
||||
DaggerTestComponent.builder().bindSystemUiProxy(systemUiProxy)
|
||||
)
|
||||
sandboxContext.putObject(
|
||||
RotationTouchHelper.INSTANCE,
|
||||
mock(RotationTouchHelper::class.java),
|
||||
)
|
||||
sandboxContext.putObject(
|
||||
RecentsAnimationDeviceState.INSTANCE,
|
||||
mock(RecentsAnimationDeviceState::class.java),
|
||||
)
|
||||
|
||||
gestureState = spy(GestureState(OverviewComponentObserver.INSTANCE.get(sandboxContext), 0))
|
||||
|
||||
underTest =
|
||||
@@ -111,14 +117,20 @@ class LauncherSwipeHandlerV2Test {
|
||||
gestureState.setTrackpadGestureType(GestureState.TrackpadGestureType.THREE_FINGER)
|
||||
underTest.onGestureEnded(flingSpeed, PointF())
|
||||
verify(systemUiProxy)
|
||||
.updateContextualEduStats(/* isTrackpadGesture= */ eq(true), eq(GestureType.HOME))
|
||||
.updateContextualEduStats(
|
||||
/* isTrackpadGesture= */ eq(true),
|
||||
eq(GestureType.HOME),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun goHomeFromAppByTouch_updateEduStats() {
|
||||
underTest.onGestureEnded(flingSpeed, PointF())
|
||||
verify(systemUiProxy)
|
||||
.updateContextualEduStats(/* isTrackpadGesture= */ eq(false), eq(GestureType.HOME))
|
||||
.updateContextualEduStats(
|
||||
/* isTrackpadGesture= */ eq(false),
|
||||
eq(GestureType.HOME),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,10 +141,6 @@ interface TestComponent : LauncherAppComponent {
|
||||
interface Builder : LauncherAppComponent.Builder {
|
||||
@BindsInstance fun bindSystemUiProxy(proxy: SystemUiProxy): Builder
|
||||
|
||||
@BindsInstance fun bindRotationHelper(helper: RotationTouchHelper): Builder
|
||||
|
||||
@BindsInstance fun bindRecentsState(state: RecentsAnimationDeviceState): Builder
|
||||
|
||||
override fun build(): TestComponent
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.android.quickstep
|
||||
|
||||
import android.content.Context
|
||||
import androidx.test.annotation.UiThreadTest
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import androidx.test.filters.SmallTest
|
||||
import com.android.launcher3.dagger.LauncherComponentProvider
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_DENSITY
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_ROTATION
|
||||
@@ -11,7 +12,6 @@ import com.android.launcher3.util.Executors.MAIN_EXECUTOR
|
||||
import com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR
|
||||
import com.android.launcher3.util.LauncherMultivalentJUnit
|
||||
import com.android.launcher3.util.NavigationMode
|
||||
import com.android.launcher3.util.SandboxApplication
|
||||
import com.android.quickstep.util.GestureExclusionManager
|
||||
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY
|
||||
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DREAMING
|
||||
@@ -27,7 +27,6 @@ import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TOUCHPAD
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
@@ -44,32 +43,21 @@ import org.mockito.kotlin.whenever
|
||||
@RunWith(LauncherMultivalentJUnit::class)
|
||||
class RecentsAnimationDeviceStateTest {
|
||||
|
||||
@get:Rule val context = SandboxApplication()
|
||||
|
||||
@Mock private lateinit var exclusionManager: GestureExclusionManager
|
||||
@Mock private lateinit var info: Info
|
||||
|
||||
private val context = ApplicationProvider.getApplicationContext() as Context
|
||||
private lateinit var underTest: RecentsAnimationDeviceState
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
MockitoAnnotations.initMocks(this)
|
||||
|
||||
val component = LauncherComponentProvider.get(context)
|
||||
underTest =
|
||||
RecentsAnimationDeviceState(
|
||||
context,
|
||||
exclusionManager,
|
||||
component.displayController,
|
||||
component.contextualSearchStateManager,
|
||||
component.rotationTouchHelper,
|
||||
component.settingsCache,
|
||||
component.daggerSingletonTracker,
|
||||
)
|
||||
underTest = RecentsAnimationDeviceState(context, exclusionManager)
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
underTest.close()
|
||||
UI_HELPER_EXECUTOR.submit {}.get()
|
||||
MAIN_EXECUTOR.submit {}.get()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user