From 987b31746809dfe04966e37edd759a448a28d975 Mon Sep 17 00:00:00 2001
From: Maximilian Krambach
Date: Mon, 14 May 2018 16:23:24 +0200
Subject: [PATCH] js: Tests and improvements for openpgp mode
--
* Added openpgp - Mode tests to the browsertest Extension. These tests
require openpgp, which should not be a hard dependency for the main
project. Packing openpgpjs into the extension is still TODO
* Fixes:
- openpgp mode API now correctly handles parameters as an object,
similar to openpgpjs
- proper check and parsing of openpgpjs Message Objects
---
lang/js/BrowserTestExtension/index.html | 7 +
.../BrowserTestExtension/openpgpModeTest.html | 23 ++
.../tests/encryptDecryptTest.js | 21 +-
.../tests/inputValues_openpgpjs.js | 32 +++
.../BrowserTestExtension/tests/inputvalues.js | 131 ++----------
.../tests/longRunningTests.js | 1 +
.../tests/openpgpModeTest.js | 196 ++++++++++++++++++
lang/js/src/Connection.js | 1 -
lang/js/src/gpgmejs.js | 18 +-
lang/js/src/gpgmejs_openpgpjs.js | 77 ++++---
10 files changed, 346 insertions(+), 161 deletions(-)
create mode 100644 lang/js/BrowserTestExtension/openpgpModeTest.html
create mode 100644 lang/js/BrowserTestExtension/tests/inputValues_openpgpjs.js
create mode 100644 lang/js/BrowserTestExtension/tests/openpgpModeTest.js
diff --git a/lang/js/BrowserTestExtension/index.html b/lang/js/BrowserTestExtension/index.html
index 05d413ba..c49aedae 100644
--- a/lang/js/BrowserTestExtension/index.html
+++ b/lang/js/BrowserTestExtension/index.html
@@ -34,6 +34,13 @@
Functionality tests with larger/longer running data sets.
+
+
+ Testing openPGP mode.
+ - Please notice that, due to comparing
+ the inputs and outputs with openpgpjs objects, this test
+ requires a copy of openpgpjs in libs.
+
+ Openpgp mode test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lang/js/BrowserTestExtension/openpgpModeTest.html b/lang/js/BrowserTestExtension/openpgpModeTest.html
new file mode 100644
index 00000000..e7a12be9
--- /dev/null
+++ b/lang/js/BrowserTestExtension/openpgpModeTest.html
@@ -0,0 +1,23 @@
+
+
+