Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96f809e3 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Update ActivityTransitionAnimatorTest to work with the new transaction.

Ordinarily we would be able to use a stubbed transaction to avoid the
`reparent` operation which doesn't work in tests. However, because we
are still using the remote animation wrapper around RemoteTransition,
we can't directly inject such transaction. For now we just disable
the `reparent` operation in tests.

Bug: 390422470
Flag: EXEMPT test only
Test: atest ActivityTransitionAnimatorTest
Change-Id: I733b3768ea7d1ecec85896c3d66ef9a9561f2bb9
parent a23bc7e5
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -107,6 +107,16 @@ constructor(
     */
    // TODO(b/301385865): Remove this flag.
    private val disableWmTimeout: Boolean = false,

    /**
     * Whether we should disable the reparent transaction that puts the opening/closing window above
     * the view's window. This should be set to true in tests only, where we can't currently use a
     * valid leash.
     *
     * TODO(b/397180418): Remove this flag when we don't have the RemoteAnimation wrapper anymore
     *   and we can just inject a fake transaction.
     */
    private val skipReparentTransaction: Boolean = false,
) {
    @JvmOverloads
    constructor(
@@ -1140,6 +1150,7 @@ constructor(
                    DelegatingAnimationCompletionListener(listener, this::dispose),
                    transitionAnimator,
                    disableWmTimeout,
                    skipReparentTransaction,
                )
        }

@@ -1173,6 +1184,16 @@ constructor(
         */
        // TODO(b/301385865): Remove this flag.
        disableWmTimeout: Boolean = false,

        /**
         * Whether we should disable the reparent transaction that puts the opening/closing window
         * above the view's window. This should be set to true in tests only, where we can't
         * currently use a valid leash.
         *
         * TODO(b/397180418): Remove this flag when we don't have the RemoteAnimation wrapper
         *   anymore and we can just inject a fake transaction.
         */
        private val skipReparentTransaction: Boolean = false,
    ) : RemoteAnimationDelegate<IRemoteAnimationFinishedCallback> {
        private val transitionContainer = controller.transitionContainer
        private val context = transitionContainer.context
@@ -1515,7 +1536,7 @@ constructor(
                            )
                        }

                        if (moveTransitionAnimationLayer()) {
                        if (moveTransitionAnimationLayer() && !skipReparentTransaction) {
                            // Ensure that the launching window is rendered above the view's window,
                            // so it is not obstructed.
                            // TODO(b/397180418): re-use the start transaction once the
+230 −156

File changed.

Preview size limit exceeded, changes collapsed.