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

Skip to content
Commit c4f6b122 authored by Tiger Huang's avatar Tiger Huang
Browse files

Fix DisplayPolicyLayoutTests

WindowTestsBase.createWindow() would not only create a WindowState
object, but would also create its parents and add it to the scene
graph. When WindowTestsBase is creating the StackWindowController, it
will invoke controller.onOverrideConfigurationChanged() which
eventually requests a traversal to layout all the windows. The layout
caused by the traversal has chances to impact the test.

DisplayPolicyLayoutTests uses its own display frame to perform the
layout. The width and height are arbitrary which may not be the same
as the width and height of the mDisplayContent in the scene graph.
So if the layout is performed by the mDisplayContent (instead of
DisplayPolicyLayoutTests), the window frames will be different.

With this change, we use the mGlobalLock to protect our tests. It
ensures that no one would modify the window frames computed by
layoutWindowLw() when we are testing them.

Bug: 120075361
Test: atest DisplayPolicyInsetsTests \
            DisplayPolicyLayoutTests \
            DisplayPolicyTests
Change-Id: I11420d3ddfc1d0610d000919574ad5bfba27345a
parent ff9d6ab6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment