Use AnimatorTestRule to end animators during tests
Using runOnUiThread to execute code that starts an Animator allows the animation to keep running beyond the lifetime of the test. This led to an eventual crash in WMShellUnitTests when the exit desktop animation finished and attempted to end() a jank CUJ, who no longer had a worker thread to work with and caused a NPE. Instead, run the test in a looper thread and use AnimatorTestRule to advance time to the end of the animation before the test finishes. Fix: 374328725 Fix: 375386897 Fix: 375386605 Fix: 375396353 Fix: 375397302 Flag: EXEMPT bugfix Test: atest WMShellModuleTests - no crashes Change-Id: I888b467972bf3974960a4d210d7f8a0d1ef4f306
Loading
Please register or sign in to comment