Merge "Fix DragDividerToResize flicker tests" into udc-dev

This commit is contained in:
Jerry Chang
2023-03-30 13:06:06 +00:00
committed by Android (Google) Code Review
5 changed files with 40 additions and 43 deletions

View File

@@ -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,

View File

@@ -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());

View File

@@ -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
)
}
}
}

View File

@@ -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()

View File

@@ -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()