<lambda>null1package com.android.systemui.sensorprivacy 2 3 import android.testing.AndroidTestingRunner 4 import android.testing.TestableLooper 5 import androidx.test.ext.junit.rules.ActivityScenarioRule 6 import androidx.test.filters.SmallTest 7 import com.android.systemui.SysuiTestCase 8 import com.android.systemui.util.mockito.mock 9 import com.google.common.truth.Truth.assertThat 10 import org.junit.Rule 11 import org.junit.Test 12 import org.junit.runner.RunWith 13 14 @RunWith(AndroidTestingRunner::class) 15 @SmallTest 16 @TestableLooper.RunWithLooper 17 class SensorUseStartedActivityTest : SysuiTestCase() { 18 open class SensorUseStartedActivityTestable : 19 SensorUseStartedActivity( 20 sensorPrivacyController = mock(), 21 keyguardStateController = mock(), 22 keyguardDismissUtil = mock(), 23 bgHandler = mock(), 24 ) 25 26 @get:Rule val activityRule = ActivityScenarioRule(SensorUseStartedActivityTestable::class.java) 27 28 @Test 29 fun onBackPressed_doNothing() { 30 activityRule.scenario.onActivity { activity -> 31 assertThat(activity.isFinishing).isFalse() 32 33 activity.onBackPressed() 34 35 assertThat(activity.isFinishing).isFalse() 36 } 37 } 38 } 39