Fix test compilation
This commit is contained in:
parent
1485ce363a
commit
318a5a8fc1
|
@ -541,7 +541,6 @@ class CommonTestHelper internal constructor(context: Context, val cryptoConfig:
|
|||
return
|
||||
}
|
||||
}
|
||||
Timber.w("## VALR Trial success for")
|
||||
}
|
||||
|
||||
suspend fun <T> waitForCallback(timeout: Long = TestConstants.timeOutMillis, block: (MatrixCallback<T>) -> Unit): T {
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventCon
|
|||
import org.matrix.android.sdk.api.session.events.model.toModel
|
||||
import org.matrix.android.sdk.api.session.getRoom
|
||||
import org.matrix.android.sdk.api.session.room.getTimelineEvent
|
||||
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
|
||||
import org.matrix.android.sdk.common.CommonTestHelper
|
||||
import org.matrix.android.sdk.common.CommonTestHelper.Companion.runCryptoTest
|
||||
|
@ -119,7 +118,7 @@ class E2eeSanityTests : InstrumentedTest {
|
|||
fail("New Users shouldn't be able to decrypt history")
|
||||
}
|
||||
) {
|
||||
val timelineEvent = otherSession.getRoom(e2eRoomID)?.getTimelineEvent(sentEventId!!).also {
|
||||
val timelineEvent = otherSession.getRoom(e2eRoomID)?.getTimelineEvent(sentEventId).also {
|
||||
Log.v("#E2E TEST", "Event seen by new user ${it?.root?.getClearType()}|${it?.root?.mCryptoError}")
|
||||
}
|
||||
timelineEvent != null &&
|
||||
|
@ -142,7 +141,7 @@ class E2eeSanityTests : InstrumentedTest {
|
|||
fail("New user ${otherSession.myUserId.take(10)} should be able to decrypt the second message")
|
||||
}
|
||||
) {
|
||||
val timelineEvent = otherSession.getRoom(e2eRoomID)?.getTimelineEvent(secondSentEventId!!).also {
|
||||
val timelineEvent = otherSession.getRoom(e2eRoomID)?.getTimelineEvent(secondSentEventId).also {
|
||||
Log.v("#E2E TEST", "Second Event seen by new user ${it?.root?.getClearType()}|${it?.root?.mCryptoError}")
|
||||
}
|
||||
timelineEvent != null &&
|
||||
|
@ -721,16 +720,6 @@ class E2eeSanityTests : InstrumentedTest {
|
|||
// }
|
||||
// }
|
||||
|
||||
private suspend fun ensureMembersHaveJoined(testHelper: CommonTestHelper, aliceSession: Session, otherAccounts: List<Session>, e2eRoomID: String) {
|
||||
testHelper.retryPeriodically {
|
||||
otherAccounts.map {
|
||||
aliceSession.roomService().getRoomMember(it.myUserId, e2eRoomID)?.membership
|
||||
}.all {
|
||||
it == Membership.JOIN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun ensureIsDecrypted(testHelper: CommonTestHelper, sentEventIds: List<String>, session: Session, e2eRoomID: String) {
|
||||
sentEventIds.forEach { sentEventId ->
|
||||
testHelper.retryPeriodically {
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.matrix.android.sdk.internal.crypto
|
|||
|
||||
import android.util.Log
|
||||
import androidx.test.filters.LargeTest
|
||||
import junit.framework.Assert.fail
|
||||
import junit.framework.TestCase.fail
|
||||
import kotlinx.coroutines.delay
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
|
|
Loading…
Reference in New Issue