Merge "Use tapl instrumentation to go home." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9a81734415
@@ -107,33 +107,6 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
|||||||
uiDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "dismiss")), FIND_TIMEOUT)
|
uiDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "dismiss")), FIND_TIMEOUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmOverloads
|
|
||||||
fun enterPipViaHomeButton(wmHelper: WindowManagerStateHelper) {
|
|
||||||
uiDevice.pressHome()
|
|
||||||
|
|
||||||
// Wait on WMHelper or simply wait for 3 seconds
|
|
||||||
wmHelper.waitPipShown() ?: SystemClock.sleep(3_000)
|
|
||||||
// when entering pip, the dismiss button is visible at the start. to ensure the pip
|
|
||||||
// animation is complete, wait until the pip dismiss button is no longer visible.
|
|
||||||
// b/176822698: dismiss-only state will be removed in the future
|
|
||||||
uiDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "dismiss")), FIND_TIMEOUT)
|
|
||||||
}
|
|
||||||
|
|
||||||
@JvmOverloads
|
|
||||||
fun enterPipViaSwipeToHome(wmHelper: WindowManagerStateHelper) {
|
|
||||||
uiDevice.swipe(
|
|
||||||
uiDevice.displayWidth / 2, uiDevice.displayHeight - 10,
|
|
||||||
uiDevice.displayWidth / 2, uiDevice.displayHeight - 300, 3
|
|
||||||
)
|
|
||||||
|
|
||||||
// Wait on WMHelper or simply wait for 3 seconds
|
|
||||||
wmHelper.waitPipShown() ?: SystemClock.sleep(3_000)
|
|
||||||
// when entering pip, the dismiss button is visible at the start. to ensure the pip
|
|
||||||
// animation is complete, wait until the pip dismiss button is no longer visible.
|
|
||||||
// b/176822698: dismiss-only state will be removed in the future
|
|
||||||
uiDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "dismiss")), FIND_TIMEOUT)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun enableEnterPipOnUserLeaveHint() {
|
fun enableEnterPipOnUserLeaveHint() {
|
||||||
clickObject(ENTER_PIP_ON_USER_LEAVE_HINT)
|
clickObject(ENTER_PIP_ON_USER_LEAVE_HINT)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.wm.shell.flicker.pip
|
package com.android.wm.shell.flicker.pip
|
||||||
|
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
|
import com.android.launcher3.tapl.LauncherInstrumentation
|
||||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||||
import com.android.server.wm.flicker.FlickerTestParameter
|
import com.android.server.wm.flicker.FlickerTestParameter
|
||||||
import com.android.server.wm.flicker.annotation.Group3
|
import com.android.server.wm.flicker.annotation.Group3
|
||||||
@@ -50,7 +51,7 @@ import org.junit.runners.Parameterized
|
|||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@Group3
|
@Group3
|
||||||
class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest(testSpec) {
|
class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest(testSpec) {
|
||||||
|
protected val taplInstrumentation = LauncherInstrumentation()
|
||||||
/**
|
/**
|
||||||
* Defines the transition used to run the test
|
* Defines the transition used to run the test
|
||||||
*/
|
*/
|
||||||
@@ -69,10 +70,7 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
transitions {
|
transitions {
|
||||||
when (testSpec.isGesturalNavigation) {
|
taplInstrumentation.goHome()
|
||||||
true -> pipApp.enterPipViaSwipeToHome(wmHelper)
|
|
||||||
false -> pipApp.enterPipViaHomeButton(wmHelper)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user