Merge "Fix BiometricProvider test" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
42efec1a00
@@ -26,7 +26,6 @@ import android.platform.test.flag.junit.DeviceFlagsValueProvider
|
|||||||
import com.android.settings.flags.Flags
|
import com.android.settings.flags.Flags
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
@@ -46,7 +45,9 @@ class BiometricSettingsProviderTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
|
whenever(context.resources).thenReturn(resources)
|
||||||
provider = BiometricSettingsProvider()
|
provider = BiometricSettingsProvider()
|
||||||
|
provider.attachInfo(context, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = UnsupportedOperationException::class)
|
@Test(expected = UnsupportedOperationException::class)
|
||||||
@@ -74,16 +75,14 @@ class BiometricSettingsProviderTest {
|
|||||||
provider.update(Uri.EMPTY, null, null, null)
|
provider.update(Uri.EMPTY, null, null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("b/313342682")
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresFlagsEnabled(Flags.FLAG_BIOMETRIC_SETTINGS_PROVIDER)
|
@RequiresFlagsEnabled(Flags.FLAG_BIOMETRIC_SETTINGS_PROVIDER)
|
||||||
fun getSuggestionState_shouldQueryFeatureProvider() {
|
fun getSuggestionState_shouldQueryFeatureProvider() {
|
||||||
val expectedValue = false
|
val expectedValue = false
|
||||||
setSupportFaceEnroll(expectedValue)
|
setSupportFaceEnroll(expectedValue)
|
||||||
|
|
||||||
val bundle =
|
val bundle = provider.call(BiometricSettingsProvider.GET_SUW_FACE_ENABLED, null, Bundle())
|
||||||
provider.call(BiometricSettingsProvider.GET_SUW_FACE_ENABLED, null, Bundle())
|
assertThat(bundle!!.getBoolean(BiometricSettingsProvider.SUW_FACE_ENABLED))
|
||||||
assertThat(bundle!!.getString(BiometricSettingsProvider.SUW_FACE_ENABLED))
|
|
||||||
.isEqualTo(expectedValue)
|
.isEqualTo(expectedValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user