From 48ae6b90fcb701d2d73db28fde084498b6ab65c6 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Wed, 6 Dec 2023 13:53:09 +0000 Subject: In some cases launcher is not ready at test creation, in computeTestMethods This causes the tests to fail, instead use TAPL only when first used to prevent Stack:java.lang.AssertionError: http://go/tapl test failure: Launcher content provider is still not enabled; Fixes: 315061537 Test: Change-Id: Idf8bb12693234a4a92af815f36267314388cc9f5 --- tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt index ad272a052220..ce92eac3fc59 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt @@ -40,10 +40,9 @@ abstract class BaseTest constructor( protected val flicker: LegacyFlickerTest, protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation(), - protected val tapl: LauncherInstrumentation = LauncherInstrumentation() ) { - init { - tapl.setExpectedRotationCheckEnabled(true) + protected val tapl: LauncherInstrumentation by lazy { + LauncherInstrumentation().also { it.expectedRotationCheckEnabled = true } } private val logTag = this::class.java.simpleName -- cgit v1.2.3-59-g8ed1b