OSDN Git Service

Fix some WM unit tests
authorAndrii Kulian <akulian@google.com>
Fri, 31 Mar 2017 02:00:41 +0000 (19:00 -0700)
committerAndrii Kulian <akulian@google.com>
Sat, 1 Apr 2017 02:00:57 +0000 (19:00 -0700)
commita95bfff74604bbf05a66ff37947b1b2fb2fdcaa2
treee1048c7e611a8a262d585ba1cf6ac86742f4b4b3
parent670e750b2e750a648d8d6ef6f076142780bf6eb4
Fix some WM unit tests

WindowFrameTests#testLayoutNonfullscreenTask and
sizes because test assumed that frame for window was always
bigger than screen size. Now we calculate all frames relative
to real display size.

TestWindowManagerPolicy used in WM unit tests reported incorrect
value from rotationHasCompatibleMetricsLw(), which lead to
DisplayContent#mAltOrientation set to "true" after any rotation
and resulted in shrinked display metrics.

DisplayContentTests#testDefaultDisplayOverrideConfigUpdate was
not restoring the config applied to default display because
it was trying update values in config from non-empty to empty,
which is considered a no-diff.

Test: com.android.server.wm.WindowFrameTests
Test: #testCalculatePolicyCrop
Test: #testLayoutNonfullscreenTask
Test: com.android.server.wm.AppWindowTokenTests
Test: #testLandscapeSeascapeRotationByApp
Test: com.android.server.wm.DisplayContentTests
Test: #testDefaultDisplayOverrideConfigUpdate
Change-Id: Ia0ed46307f67f6b47859209ebcf13253b59b8002
services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java