Fix DragDividerToResize flicker tests
Add a proper duration to dragging so it won't dismiss split screen unexpectedly in transitions phase. Since both sides of split will be invisible due to screenshot/icon-view fade animation, update the tests to address the change. Fix: 263213649 Test: atest WMShellFlickerTests:DragDividerToResize Change-Id: I809bf7b66f065798b8b335ae5bd8f78ede5f2c83
This commit is contained in:
@@ -212,7 +212,7 @@ class SplitScreenTransitions {
|
||||
}
|
||||
}
|
||||
|
||||
void applyResizeTransition(@NonNull IBinder transition, @NonNull TransitionInfo info,
|
||||
void playResizeAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info,
|
||||
@NonNull SurfaceControl.Transaction startTransaction,
|
||||
@NonNull SurfaceControl.Transaction finishTransaction,
|
||||
@NonNull Transitions.TransitionFinishCallback finishCallback,
|
||||
|
||||
@@ -2376,7 +2376,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
return true;
|
||||
}
|
||||
} else if (mSplitTransitions.isPendingResize(transition)) {
|
||||
mSplitTransitions.applyResizeTransition(transition, info, startTransaction,
|
||||
mSplitTransitions.playResizeAnimation(transition, info, startTransaction,
|
||||
finishTransaction, finishCallback, mMainStage.mRootTaskInfo.token,
|
||||
mSideStage.mRootTaskInfo.token, mMainStage.getSplitDecorManager(),
|
||||
mSideStage.getSplitDecorManager());
|
||||
|
||||
@@ -217,28 +217,37 @@ fun FlickerTest.splitAppLayerBoundsChanges(
|
||||
) {
|
||||
assertLayers {
|
||||
if (landscapePosLeft) {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
.then()
|
||||
.isInvisible(component)
|
||||
.then()
|
||||
.splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
} else {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
.then()
|
||||
.isInvisible(component)
|
||||
.then()
|
||||
.splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
.then()
|
||||
.isInvisible(component)
|
||||
.then()
|
||||
.splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.splitscreen
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.tools.device.flicker.isShellTransitionsEnabled
|
||||
@@ -86,16 +85,14 @@ class DragDividerToResize(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerKeepVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
flicker.layerKeepVisible(primaryApp)
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 263213649)
|
||||
@Test
|
||||
fun primaryAppLayerKeepVisible_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
flicker.layerKeepVisible(primaryApp)
|
||||
fun primaryAppLayerVisibilityChanges() {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(secondaryApp)
|
||||
.then()
|
||||
.isInvisible(secondaryApp)
|
||||
.then()
|
||||
.isVisible(secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@@ -110,7 +107,9 @@ class DragDividerToResize(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit @Test fun primaryAppWindowKeepVisible() = flicker.appWindowKeepVisible(primaryApp)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowKeepVisible() = flicker.appWindowKeepVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -127,17 +126,6 @@ class DragDividerToResize(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
)
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 263213649)
|
||||
@Test
|
||||
fun primaryAppBoundsChanges_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
flicker.splitAppLayerBoundsChanges(
|
||||
primaryApp,
|
||||
landscapePosLeft = true,
|
||||
portraitPosTop = false
|
||||
)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsChanges() =
|
||||
@@ -148,7 +136,7 @@ class DragDividerToResize(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 263213649)
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ internal object SplitScreenUtils {
|
||||
wmHelper.currentState.layerState.displays.firstOrNull { !it.isVirtual }?.layerStackSpace
|
||||
?: error("Display not found")
|
||||
val dividerBar = device.wait(Until.findObject(dividerBarSelector), TIMEOUT_MS)
|
||||
dividerBar.drag(Point(displayBounds.width * 1 / 3, displayBounds.height * 2 / 3))
|
||||
dividerBar.drag(Point(displayBounds.width * 1 / 3, displayBounds.height * 2 / 3), 2000)
|
||||
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
|
||||
Reference in New Issue
Block a user