diff options
| author | Fabian Henneke <fabian@henneke.me> | 2020-04-15 17:11:09 +0200 |
|---|---|---|
| committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-04-15 22:47:41 +0530 |
| commit | b633cc1f3dc9acf2e2a2cc11a540375a9d85390b (patch) | |
| tree | 30eb3c1bef4b144312e2bd4045476c97aef532d4 /app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt | |
| parent | db2743289d9f4423bee5a6d357c4c73c566db9d2 (diff) | |
| download | HardenedPass-b633cc1f3dc9acf2e2a2cc11a540375a9d85390b.tar.gz HardenedPass-b633cc1f3dc9acf2e2a2cc11a540375a9d85390b.zip | |
Make existing tests buildable again
Diffstat (limited to 'app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt')
| -rw-r--r-- | app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt b/app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt index 6a13e810..17c7cbed 100644 --- a/app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt +++ b/app/src/androidTest/java/com/zeapo/pwdstore/DecryptTest.kt @@ -8,6 +8,8 @@ import android.annotation.SuppressLint import android.content.ClipboardManager import android.content.Context import android.content.Intent +import android.os.IBinder +import android.os.ParcelFileDescriptor import android.os.SystemClock import android.util.Log import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -31,6 +33,7 @@ import org.junit.Assert.assertNotNull import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith +import org.openintents.openpgp.IOpenPgpService2 @RunWith(AndroidJUnit4::class) @LargeTest @@ -109,7 +112,19 @@ class DecryptTest { // second set the new timer activity.settings.edit().putString("general_show_time", "2").commit() - activity.onBound(null) + activity.onBound(object : IOpenPgpService2 { + override fun createOutputPipe(p0: Int): ParcelFileDescriptor { + TODO("Not yet implemented") + } + + override fun asBinder(): IBinder { + TODO("Not yet implemented") + } + + override fun execute(p0: Intent?, p1: ParcelFileDescriptor?, p2: Int): Intent { + TODO("Not yet implemented") + } + }) // have we decrypted things correctly? assertEquals(passEntry.password, activity.crypto_password_show.text) @@ -118,14 +133,14 @@ class DecryptTest { // did we copy the password? val clipboard: ClipboardManager = activity.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager - assertEquals(passEntry.password, clipboard.primaryClip.getItemAt(0).text) + assertEquals(passEntry.password, clipboard.primaryClip!!.getItemAt(0).text) // wait until the clipboard is cleared SystemClock.sleep(4000) // The clipboard should be cleared!! - for (i in 0..clipboard.primaryClip.itemCount) { - assertEquals("", clipboard.primaryClip.getItemAt(i).text) + for (i in 0..clipboard.primaryClip!!.itemCount) { + assertEquals("", clipboard.primaryClip!!.getItemAt(i).text) } // set back the timer @@ -145,7 +160,7 @@ class DecryptTest { val destPath = "$destination/$filename" val sourcePath = "$source/$filename" - if (assetManager.list(sourcePath).isNotEmpty()) { + if (assetManager.list(sourcePath)!!.isNotEmpty()) { FileUtils.forceMkdir(File(destination, filename)) copyAssets("$source/$filename", destPath) } else { |
