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

Commit 6e6494ef authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge changes from topic "jan17" into main

* changes:
  Defer (more) complex object creation until used.
  Defer complex object creation until used by tests.
  Defer AnimatorTestRule Handler until used by tests.
parents 88ab7469 a781cde8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -41,10 +41,10 @@ import org.junit.runner.RunWith
class FingerprintPropertyInteractorTest : SysuiTestCase() {
    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
    private val underTest = kosmos.fingerprintPropertyInteractor
    private val repository = kosmos.fingerprintPropertyRepository
    private val configurationRepository = kosmos.fakeConfigurationRepository
    private val displayRepository = kosmos.displayRepository
    private val underTest by lazy { kosmos.fingerprintPropertyInteractor }
    private val repository by lazy { kosmos.fingerprintPropertyRepository }
    private val configurationRepository by lazy { kosmos.fakeConfigurationRepository }
    private val displayRepository by lazy { kosmos.displayRepository }

    @Test
    fun sensorLocation_resolution1f() =
+3 −1
Original line number Diff line number Diff line
@@ -55,7 +55,9 @@ class PrimaryBouncerInteractorWithCoroutinesTest : SysuiTestCase() {
    @Mock private lateinit var keyguardUpdateMonitor: KeyguardUpdateMonitor
    @Mock private lateinit var mSelectedUserInteractor: SelectedUserInteractor
    @Mock private lateinit var faceAuthInteractor: DeviceEntryFaceAuthInteractor
    private val mainHandler = FakeHandler(Looper.getMainLooper())
    private val mainHandler by lazy {
        FakeHandler(Looper.getMainLooper())
    }
    private lateinit var underTest: PrimaryBouncerInteractor

    @Before
+3 −2
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@ class AuthMethodBouncerViewModelTest : SysuiTestCase() {

    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
    private val bouncerInteractor = kosmos.bouncerInteractor
    private val underTest =
    private val bouncerInteractor by lazy { kosmos.bouncerInteractor }
    private val underTest by lazy {
        PinBouncerViewModel(
            applicationContext = context,
            viewModelScope = testScope.backgroundScope,
@@ -49,6 +49,7 @@ class AuthMethodBouncerViewModelTest : SysuiTestCase() {
            simBouncerInteractor = kosmos.simBouncerInteractor,
            authenticationMethod = AuthenticationMethodModel.Pin,
        )
    }

    @Test
    fun animateFailure() =
+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ class BouncerViewModelTest : SysuiTestCase() {

    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
    private val authenticationInteractor = kosmos.authenticationInteractor
    private val bouncerInteractor = kosmos.bouncerInteractor
    private val authenticationInteractor by lazy { kosmos.authenticationInteractor }
    private val bouncerInteractor by lazy { kosmos.bouncerInteractor }
    private lateinit var underTest: BouncerViewModel

    @Before
+3 −1
Original line number Diff line number Diff line
@@ -66,7 +66,9 @@ class KeyguardBouncerViewModelTest : SysuiTestCase() {
    @Mock private lateinit var faceAuthInteractor: DeviceEntryFaceAuthInteractor

    lateinit var bouncerInteractor: PrimaryBouncerInteractor
    private val mainHandler = FakeHandler(Looper.getMainLooper())
    private val mainHandler by lazy {
        FakeHandler(Looper.getMainLooper())
    }
    val repository = FakeKeyguardBouncerRepository()

    lateinit var underTest: KeyguardBouncerViewModel
Loading