From 1f7b19512cfa7e1b153b99d6a2b40bad82a5496e Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 26 Apr 2018 17:13:34 +0200 Subject: js: created TestExtension and smaller fixes -- * Extensions: - Moved testapplication to Demoextension - Created BrowserTestExtension. Includes mocha and chai. For running tests that cannot be run outside a WebExtension Both Extensions can be found zipped in build/extensions after running build_extensions.sh * Code changes: - src/Config: Place for the configuration - small fixes raised during testing in Keyring.js, Message.js, - src/gpgmejs_openpgpjs.js don't offer direct GpgME object to the outside, as it only causes confusion - index.js init() now checks the config for validity * Tests: - Reordered tests in test/. - Input values are now in a separate file which may be of use for bulk testing * moved the build directory from dist to build --- lang/js/src/gpgmejs_openpgpjs.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lang/js/src/gpgmejs_openpgpjs.js') diff --git a/lang/js/src/gpgmejs_openpgpjs.js b/lang/js/src/gpgmejs_openpgpjs.js index 4e5e1ea0..cc2afde1 100644 --- a/lang/js/src/gpgmejs_openpgpjs.js +++ b/lang/js/src/gpgmejs_openpgpjs.js @@ -50,18 +50,12 @@ if (!this._GPGME){ this._GpgME = new GpgME(connection, config); } - if (!this._Keyring){ - this._Keyring = new GPGME_Keyring_openpgpmode(connection); + if (!this._keyring){ + this._keyring = new GPGME_Keyring_openpgpmode(connection); } } } - get GpgME(){ - if (this._GpGME){ - return this._GpGME; - } - } - /** * Encrypt Message * Supported: @@ -115,7 +109,7 @@ return Promise.reject(GPMGEJS_Error('NOT_IMPLEMENTED')); } } - return this.GpgME.encrypt(data, translateKeyInput(publicKeys), wildcard); + return this._GpgME.encrypt(data, translateKeyInput(publicKeys), wildcard); } /** Decrypt Message @@ -152,7 +146,7 @@ return Promise.reject(GPMGEJS_Error('NOT_IMPLEMENTED')); } } - return this.GpgME.decrypt(message); + return this._GpgME.decrypt(message); // TODO: translate between: // openpgp: // { data:Uint8Array|String, -- cgit v1.2.3