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

Skip to content
Commit 4bdcf7e9 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Defer complex object creation until used by tests.

As part of supporting SysUI multivalentTests under the new Ravenwood
testing environment, tests need to be more careful about only
creating and interacting with "complex" objects when they're actually
needed by a test.  Attempting interactions during <init> or <clinit>
of the overall test class fails on Ravenwood when these complex
objects aren't yet supported, and they throw an exception.

The smoothest path towards mitigating this is by leveraging the
`by lazy` feature of Kotlin, where we only create and interact with
a complex object when actually requested by test method code.  This
strategy gives Ravenwood enough room to successfully instantiate
test classes to decide if it should be executed or ignored via
future annotations.

This change is a purely mechanical adding of `by lazy` in all
relevant locations, as uncovered via local investigation.

Bug: 319647875
Test: atest SystemUiRoboTests
Change-Id: I16b62d790511a9b9f37491f2e0d0f4719783d2ac
parent aea2a174
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment