diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-30 15:37:02 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-30 15:37:02 +0200 |
commit | 473866baaf5c736de74cc8b95f8acc84631c1043 (patch) | |
tree | 6f3d7d9e8e2e77261c0cf9dc30db73a4edeea755 /OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain | |
parent | f1c0c3e00c7287cdc501cd9148461f4c1ef1d8ec (diff) | |
download | open-keychain-473866baaf5c736de74cc8b95f8acc84631c1043.tar.gz open-keychain-473866baaf5c736de74cc8b95f8acc84631c1043.tar.bz2 open-keychain-473866baaf5c736de74cc8b95f8acc84631c1043.zip |
instrument: add test for empty clipboard, fix empty clipboard error
Diffstat (limited to 'OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain')
-rw-r--r-- | OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/ui/MiscCryptOperationTests.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/ui/MiscCryptOperationTests.java b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/ui/MiscCryptOperationTests.java index 96d69e833..7b4506986 100644 --- a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/ui/MiscCryptOperationTests.java +++ b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/ui/MiscCryptOperationTests.java @@ -23,6 +23,9 @@ import java.io.File; import android.annotation.TargetApi; import android.app.Activity; import android.app.Instrumentation.ActivityResult; +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build.VERSION_CODES; @@ -144,6 +147,18 @@ public class MiscCryptOperationTests { } @Test + public void testDecryptEmptyClipboard() throws Exception { + + // decrypt any non-pgp file + ClipboardManager clipboard = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE); + clipboard.setPrimaryClip(ClipData.newPlainText("", "")); + + onView(withId(R.id.decrypt_from_clipboard)).perform(click()); + checkSnackbar(Style.ERROR, R.string.error_clipboard_empty); + + } + + @Test public void testDecryptNonPgpClipboard() throws Exception { // decrypt any non-pgp file |