summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nataniel Borges <natanieljr@google.com> 2023-12-06 13:53:09 +0000
committer Nataniel Borges <natanieljr@google.com> 2023-12-06 13:53:09 +0000
commit48ae6b90fcb701d2d73db28fde084498b6ab65c6 (patch)
tree35b7e807b4fc872de1a2368a1b747517fba52cd9
parent4a4bbbfb7e7c64b2201780c06dcd93dc355d6b2b (diff)
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: <flicker tests in presubmit> Change-Id: Idf8bb12693234a4a92af815f36267314388cc9f5
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt5
1 files 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