mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Fix backup instrumentation tests.
This commit is contained in:
committed by
Greyson Parrelli
parent
2ced30b557
commit
8e6664f41c
@@ -9,9 +9,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.github.difflib.DiffUtils
|
||||
import com.github.difflib.UnifiedDiffUtils
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.mockkObject
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
@@ -26,7 +23,6 @@ import org.thoughtcrime.securesms.backup.v2.proto.Frame
|
||||
import org.thoughtcrime.securesms.backup.v2.stream.PlainTextBackupReader
|
||||
import org.thoughtcrime.securesms.database.KeyValueDatabase
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.keyvalue.InternalValues
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.whispersystems.signalservice.api.push.ServiceId
|
||||
import java.io.ByteArrayInputStream
|
||||
@@ -48,10 +44,6 @@ class ArchiveImportExportTests {
|
||||
@Before
|
||||
fun setup() {
|
||||
AppDependencies.jobManager.shutdown()
|
||||
mockkObject(SignalStore)
|
||||
every { SignalStore.internal } returns mockk<InternalValues>(relaxed = true) {
|
||||
every { includeDebuglogInBackup } returns false
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.keyvalue
|
||||
import org.signal.ringrtc.CallManager.DataMode
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.backup.v2.proto.BackupDebugInfo
|
||||
import org.thoughtcrime.securesms.util.Environment
|
||||
import org.thoughtcrime.securesms.util.Environment.Calling.defaultSfuUrl
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
|
||||
@@ -185,7 +186,7 @@ class InternalValues internal constructor(store: KeyValueStore) : SignalStoreVal
|
||||
var showArchiveStateHint by booleanValue(SHOW_ARCHIVE_STATE_HINT, false).defaultForExternalUsers()
|
||||
|
||||
/** Whether or not we should include a debuglog in the backup debug info when generating a backup. */
|
||||
var includeDebuglogInBackup by booleanValue(INCLUDE_DEBUGLOG_IN_BACKUP, true).falseForExternalUsers()
|
||||
var includeDebuglogInBackup by booleanValue(INCLUDE_DEBUGLOG_IN_BACKUP, !Environment.IS_INSTRUMENTATION).falseForExternalUsers()
|
||||
|
||||
/** Any [BackupDebugInfo] that was imported during the last backup restore, if any. */
|
||||
var importedBackupDebugInfo: BackupDebugInfo? by protoValue(IMPORTED_BACKUP_DEBUG_INFO, BackupDebugInfo.ADAPTER).defaultForExternalUsers()
|
||||
|
||||
Reference in New Issue
Block a user