mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Ignore warning in test.
There is probably a better way than using the GlobalScope, but I'm not sure how to do it now.
This commit is contained in:
parent
99cb51af6b
commit
fc22376050
7 changed files with 17 additions and 0 deletions
|
@ -91,6 +91,7 @@ class CommonTestHelper(context: Context) {
|
|||
*
|
||||
* @param session the session to sync
|
||||
*/
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun syncSession(session: Session, timeout: Long = TestConstants.timeOutMillis) {
|
||||
val lock = CountDownLatch(1)
|
||||
|
||||
|
@ -327,6 +328,7 @@ class CommonTestHelper(context: Context) {
|
|||
assertTrue(latch.await(timeout ?: TestConstants.timeOutMillis, TimeUnit.MILLISECONDS))
|
||||
}
|
||||
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun retryPeriodicallyWithLatch(latch: CountDownLatch, condition: (() -> Boolean)) {
|
||||
GlobalScope.launch {
|
||||
while (true) {
|
||||
|
|
|
@ -84,6 +84,7 @@ class CryptoTestHelper(private val mTestHelper: CommonTestHelper) {
|
|||
/**
|
||||
* @return alice and bob sessions
|
||||
*/
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun doE2ETestWithAliceAndBobInARoom(encryptedRoom: Boolean = true): CryptoTestData {
|
||||
val cryptoTestData = doE2ETestWithAliceInARoom(encryptedRoom)
|
||||
val aliceSession = cryptoTestData.firstSession
|
||||
|
@ -255,6 +256,7 @@ class CryptoTestHelper(private val mTestHelper: CommonTestHelper) {
|
|||
)
|
||||
}
|
||||
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun createDM(alice: Session, bob: Session): String {
|
||||
val roomId = mTestHelper.runBlockingTest {
|
||||
alice.createDirectRoom(bob.myUserId)
|
||||
|
|
|
@ -60,6 +60,7 @@ class QuadSTests : InstrumentedTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun test_Generate4SKey() {
|
||||
val aliceSession = mTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
|
||||
|
||||
|
@ -275,6 +276,7 @@ class QuadSTests : InstrumentedTest {
|
|||
mTestHelper.signOutAndClose(aliceSession)
|
||||
}
|
||||
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
private fun assertAccountData(session: Session, type: String): UserAccountDataEvent {
|
||||
val accountDataLock = CountDownLatch(1)
|
||||
var accountData: UserAccountDataEvent? = null
|
||||
|
|
|
@ -50,6 +50,7 @@ class SpaceCreationTest : InstrumentedTest {
|
|||
private val commonTestHelper = CommonTestHelper(context())
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun createSimplePublicSpace() {
|
||||
val session = commonTestHelper.createAccount("Hubble", SessionTestParams(true))
|
||||
val roomName = "My Space"
|
||||
|
@ -133,6 +134,7 @@ class SpaceCreationTest : InstrumentedTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun testSimplePublicSpaceWithChildren() {
|
||||
val aliceSession = commonTestHelper.createAccount("alice", SessionTestParams(true))
|
||||
val bobSession = commonTestHelper.createAccount("bob", SessionTestParams(true))
|
||||
|
|
|
@ -47,6 +47,7 @@ class SpaceHierarchyTest : InstrumentedTest {
|
|||
private val commonTestHelper = CommonTestHelper(context())
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun createCanonicalChildRelation() {
|
||||
val session = commonTestHelper.createAccount("John", SessionTestParams(true))
|
||||
val spaceName = "My Space"
|
||||
|
@ -171,6 +172,7 @@ class SpaceHierarchyTest : InstrumentedTest {
|
|||
// }
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun testFilteringBySpace() {
|
||||
val session = commonTestHelper.createAccount("John", SessionTestParams(true))
|
||||
|
||||
|
@ -254,6 +256,7 @@ class SpaceHierarchyTest : InstrumentedTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun testBreakCycle() {
|
||||
val session = commonTestHelper.createAccount("John", SessionTestParams(true))
|
||||
|
||||
|
@ -301,6 +304,7 @@ class SpaceHierarchyTest : InstrumentedTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun testLiveFlatChildren() {
|
||||
val session = commonTestHelper.createAccount("John", SessionTestParams(true))
|
||||
|
||||
|
@ -389,6 +393,7 @@ class SpaceHierarchyTest : InstrumentedTest {
|
|||
val roomIds: List<String>
|
||||
)
|
||||
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
private fun createPublicSpace(session: Session,
|
||||
spaceName: String,
|
||||
childInfo: List<Triple<String, Boolean, Boolean?>>
|
||||
|
|
|
@ -32,6 +32,7 @@ class CoroutineSequencersTest: MatrixTest {
|
|||
private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun sequencer_should_run_sequential() {
|
||||
val sequencer = SemaphoreCoroutineSequencer()
|
||||
val results = ArrayList<String>()
|
||||
|
@ -60,6 +61,7 @@ class CoroutineSequencersTest: MatrixTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun sequencer_should_run_parallel() {
|
||||
val sequencer1 = SemaphoreCoroutineSequencer()
|
||||
val sequencer2 = SemaphoreCoroutineSequencer()
|
||||
|
@ -86,6 +88,7 @@ class CoroutineSequencersTest: MatrixTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
fun sequencer_should_jump_to_next_when_current_job_canceled() {
|
||||
val sequencer = SemaphoreCoroutineSequencer()
|
||||
val results = ArrayList<String>()
|
||||
|
|
|
@ -107,6 +107,7 @@ abstract class VerificationTestBase {
|
|||
return result!!
|
||||
}
|
||||
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
private fun syncSession(session: Session) {
|
||||
val lock = CountDownLatch(1)
|
||||
|
||||
|
|
Loading…
Reference in a new issue