Cleanup and fix test compilation
This commit is contained in:
parent
4709002429
commit
c75eb050df
@ -378,7 +378,9 @@ class CommonTestHelper(context: Context) {
|
|||||||
fun Iterable<Session>.signOutAndClose() = forEach { signOutAndClose(it) }
|
fun Iterable<Session>.signOutAndClose() = forEach { signOutAndClose(it) }
|
||||||
|
|
||||||
fun signOutAndClose(session: Session) {
|
fun signOutAndClose(session: Session) {
|
||||||
doSync<Unit>(60_000) { session.signOut(true, it) }
|
runBlockingTest(timeout = 60_000) {
|
||||||
|
session.signOut(true)
|
||||||
|
}
|
||||||
// no need signout will close
|
// no need signout will close
|
||||||
// session.close()
|
// session.close()
|
||||||
}
|
}
|
||||||
|
@ -66,8 +66,8 @@ class TimelineForwardPaginationTest : InstrumentedTest {
|
|||||||
numberOfMessagesToSend)
|
numberOfMessagesToSend)
|
||||||
|
|
||||||
// Alice clear the cache
|
// Alice clear the cache
|
||||||
commonTestHelper.doSync<Unit> {
|
commonTestHelper.runBlockingTest {
|
||||||
aliceSession.clearCache(it)
|
aliceSession.clearCache()
|
||||||
}
|
}
|
||||||
|
|
||||||
// And restarts the sync
|
// And restarts the sync
|
||||||
|
@ -20,7 +20,6 @@ import androidx.annotation.MainThread
|
|||||||
import dagger.Lazy
|
import dagger.Lazy
|
||||||
import io.realm.RealmConfiguration
|
import io.realm.RealmConfiguration
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import org.matrix.android.sdk.api.MatrixCallback
|
|
||||||
import org.matrix.android.sdk.api.auth.data.SessionParams
|
import org.matrix.android.sdk.api.auth.data.SessionParams
|
||||||
import org.matrix.android.sdk.api.failure.GlobalError
|
import org.matrix.android.sdk.api.failure.GlobalError
|
||||||
import org.matrix.android.sdk.api.pushrules.PushRuleService
|
import org.matrix.android.sdk.api.pushrules.PushRuleService
|
||||||
|
@ -175,12 +175,10 @@ class MainActivity : VectorBaseActivity<FragmentLoadingBinding>(), UnlockedActiv
|
|||||||
emptyViewModel.viewModelScope.launch {
|
emptyViewModel.viewModelScope.launch {
|
||||||
try {
|
try {
|
||||||
session.clearCache()
|
session.clearCache()
|
||||||
Timber.e("CACHE success")
|
|
||||||
doLocalCleanup(clearPreferences = false)
|
doLocalCleanup(clearPreferences = false)
|
||||||
session.startSyncing(applicationContext)
|
session.startSyncing(applicationContext)
|
||||||
startNextActivityAndFinish()
|
startNextActivityAndFinish()
|
||||||
} catch (failure: Throwable) {
|
} catch (failure: Throwable) {
|
||||||
Timber.e("CACHE failure")
|
|
||||||
displayError(failure)
|
displayError(failure)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user