Fix ui test compilation
This commit is contained in:
parent
8b7238e051
commit
71d56108c2
@ -45,6 +45,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
|||||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||||
import im.vector.app.core.time.DefaultClock
|
import im.vector.app.core.time.DefaultClock
|
||||||
import im.vector.app.espresso.tools.waitUntilViewVisible
|
import im.vector.app.espresso.tools.waitUntilViewVisible
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
import org.hamcrest.Matcher
|
import org.hamcrest.Matcher
|
||||||
import org.hamcrest.Matchers
|
import org.hamcrest.Matchers
|
||||||
import org.hamcrest.StringDescription
|
import org.hamcrest.StringDescription
|
||||||
@ -229,7 +230,7 @@ fun allSecretsKnownIdling(session: Session): IdlingResource {
|
|||||||
val res = object : IdlingResource, Observer<Optional<PrivateKeysInfo>> {
|
val res = object : IdlingResource, Observer<Optional<PrivateKeysInfo>> {
|
||||||
private var callback: IdlingResource.ResourceCallback? = null
|
private var callback: IdlingResource.ResourceCallback? = null
|
||||||
|
|
||||||
var privateKeysInfo: PrivateKeysInfo? = session.cryptoService().crossSigningService().getCrossSigningPrivateKeys()
|
var privateKeysInfo: PrivateKeysInfo? = null
|
||||||
override fun getName() = "AllSecretsKnownIdling_${session.myUserId}"
|
override fun getName() = "AllSecretsKnownIdling_${session.myUserId}"
|
||||||
|
|
||||||
override fun isIdleNow(): Boolean {
|
override fun isIdleNow(): Boolean {
|
||||||
@ -251,6 +252,10 @@ fun allSecretsKnownIdling(session: Session): IdlingResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res.privateKeysInfo = runBlocking {
|
||||||
|
session.cryptoService().crossSigningService().getCrossSigningPrivateKeys()
|
||||||
|
}
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
session.cryptoService().crossSigningService().getLiveCrossSigningPrivateKeys().observeForever(res)
|
session.cryptoService().crossSigningService().getLiveCrossSigningPrivateKeys().observeForever(res)
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,10 @@ class SecurityBootstrapTest : VerificationTestBase() {
|
|||||||
onView(withText(R.string._continue)).perform(click())
|
onView(withText(R.string._continue)).perform(click())
|
||||||
|
|
||||||
// Assert that all is configured
|
// Assert that all is configured
|
||||||
assert(uiSession.cryptoService().crossSigningService().isCrossSigningInitialized())
|
val crossSigningInitialized = runBlockingTest {
|
||||||
|
uiSession.cryptoService().crossSigningService().isCrossSigningInitialized()
|
||||||
|
}
|
||||||
|
assert(crossSigningInitialized)
|
||||||
assert(uiSession.cryptoService().crossSigningService().canCrossSign())
|
assert(uiSession.cryptoService().crossSigningService().canCrossSign())
|
||||||
assert(uiSession.cryptoService().crossSigningService().allPrivateKeysKnown())
|
assert(uiSession.cryptoService().crossSigningService().allPrivateKeysKnown())
|
||||||
assert(uiSession.cryptoService().keysBackupService().isEnabled())
|
assert(uiSession.cryptoService().keysBackupService().isEnabled())
|
||||||
|
@ -74,7 +74,7 @@ class VerifySessionPassphraseTest : VerificationTestBase() {
|
|||||||
val matrix = getMatrixInstance()
|
val matrix = getMatrixInstance()
|
||||||
val userName = "foobar_${Random.nextLong()}"
|
val userName = "foobar_${Random.nextLong()}"
|
||||||
existingSession = createAccountAndSync(matrix, userName, password, true)
|
existingSession = createAccountAndSync(matrix, userName, password, true)
|
||||||
doSync<Unit> {
|
runBlockingTest {
|
||||||
existingSession!!.cryptoService().crossSigningService()
|
existingSession!!.cryptoService().crossSigningService()
|
||||||
.initializeCrossSigning(
|
.initializeCrossSigning(
|
||||||
object : UserInteractiveAuthInterceptor {
|
object : UserInteractiveAuthInterceptor {
|
||||||
@ -87,7 +87,7 @@ class VerifySessionPassphraseTest : VerificationTestBase() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, it
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user