diff options
author | Maximilian Krambach <[email protected]> | 2018-07-27 18:36:21 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-07-27 18:36:21 +0000 |
commit | 94ee0988d4eaac27785de6efb7c19ca9976e1e9c (patch) | |
tree | b9a06e35d1a2831cb0750177daa978314b9be481 /lang/js/BrowserTestExtension/tests/inputvalues.js | |
parent | js: clean up test extension (diff) | |
download | gpgme-94ee0988d4eaac27785de6efb7c19ca9976e1e9c.tar.gz gpgme-94ee0988d4eaac27785de6efb7c19ca9976e1e9c.zip |
js: change the write access for js class methods
--
* src/ [Connection, Error, Key, Keyring, MEssage, Signature, gpgmejs]:
Functions and values that are not meant to be overwritten are now
moved into their constructors, thus eliminating the possibility of
overwrites after initialization.
* Key: The mode of use (synchronous cached, or async promises) ivs now
determined at initialization of that Key. The property Key.isAsync
reflects this state.
* unittests: fixed old Key syntax for testing.
* Message.js isComplete is now a method and not a getter anymore.
* Added some startup tests.
Diffstat (limited to 'lang/js/BrowserTestExtension/tests/inputvalues.js')
-rw-r--r-- | lang/js/BrowserTestExtension/tests/inputvalues.js | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/lang/js/BrowserTestExtension/tests/inputvalues.js b/lang/js/BrowserTestExtension/tests/inputvalues.js index 5289eab7..9d956b69 100644 --- a/lang/js/BrowserTestExtension/tests/inputvalues.js +++ b/lang/js/BrowserTestExtension/tests/inputvalues.js @@ -86,7 +86,9 @@ const inputvalues = {// eslint-disable-line no-unused-vars 'T2JfzEN+E7Y3PB8UwLgp/ZRmG8zRrQ==\n' + '=ioB6\n' + '-----END PGP SIGNATURE-----\n', - } + }, + + someInputParameter: 'bad string' }; // (Pseudo-)Random String covering all of utf8. @@ -158,27 +160,6 @@ function slightlyLessBoringString(megabytes, set){ return string.join(''); } -// Take a gpg looking string and destroy it a bit by changing random values -// eslint-disable-next-line no-unused-vars -function destroylegitimateGpg(string, mutations=5){ - const allowed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/\n'; - for (let i=0; i < mutations.length; i++){ - // leave the first and last 35 chars (header/footer) intact - let position = Math.floor(Math.random() *(string.length - 70)) + 35; - let str0 = string.substring(0,position - 1); - let str1 = string.substring(position, position + 1); - let str2 = string.substring(position +1); - let success = false; - while (!success){ - let newchar = Math.floor(Math.random() * allowed.length); - if (newchar !== str1){ - string = str0 + newchar + str2; - success = true; - } - } - } -} - // Data encrypted with testKey const encryptedData =// eslint-disable-line no-unused-vars '-----BEGIN PGP MESSAGE-----\n' + |