Diffstat (limited to 'frontend/gamma/tests/tests/Clipperz/PM/DataModel/EncryptedRemoteObject.test.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/tests/tests/Clipperz/PM/DataModel/EncryptedRemoteObject.test.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/tests/tests/Clipperz/PM/DataModel/EncryptedRemoteObject.test.js b/frontend/gamma/tests/tests/Clipperz/PM/DataModel/EncryptedRemoteObject.test.js index 9c50c43..c5f0e00 100644 --- a/frontend/gamma/tests/tests/Clipperz/PM/DataModel/EncryptedRemoteObject.test.js +++ b/frontend/gamma/tests/tests/Clipperz/PM/DataModel/EncryptedRemoteObject.test.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); | 24 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); |
27 | 25 | ||
28 | var tests = { | 26 | var tests = { |
29 | 27 | ||
30 | //------------------------------------------------------------------------- | 28 | //------------------------------------------------------------------------- |
31 | 29 | ||
32 | 'simple_tests': function(someTestArgs) { | 30 | 'simple_tests': function(someTestArgs) { |
33 | vardeferredResult; | 31 | vardeferredResult; |
34 | varencryptedRemoteObject; | 32 | varencryptedRemoteObject; |
35 | 33 | ||
36 | varkey; | 34 | varkey; |
37 | var version; | 35 | var version; |
38 | var rawData; | 36 | var rawData; |
39 | 37 | ||
40 | key = "just a random key"; | 38 | key = "just a random key"; |
41 | version = Clipperz.PM.Crypto.encryptingFunctions.currentVersion; | 39 | version = Clipperz.PM.Crypto.encryptingFunctions.currentVersion; |
42 | rawData = "just a random text to encrypt"; | 40 | rawData = "just a random text to encrypt"; |
43 | 41 | ||
44 | encryptedRemoteObject = new Clipperz.PM.DataModel.EncryptedRemoteObject({ | 42 | encryptedRemoteObject = new Clipperz.PM.DataModel.EncryptedRemoteObject({ |
45 | 'retrieveKeyFunction': MochiKit.Base.noop, | 43 | 'retrieveKeyFunction': MochiKit.Base.noop, |
46 | 'retrieveRemoteDataFunction':function () { return "--"}, | 44 | 'retrieveRemoteDataFunction':function () { return "--"}, |
47 | 'encryptedDataKeypath': '--', | 45 | 'encryptedDataKeypath': '--', |
48 | 'encryptedVersionKeypath': '--' | 46 | 'encryptedVersionKeypath': '--' |
49 | }); | 47 | }); |
50 | SimpleTest.ok(encryptedRemoteObject != null, "create an encryptedRemoteObject"); | 48 | SimpleTest.ok(encryptedRemoteObject != null, "create an encryptedRemoteObject"); |
51 | 49 | ||
52 | deferredResult = Clipperz.Async.callbacks("EncryptedRemoteObject.test - simple_tests", [ | 50 | deferredResult = Clipperz.Async.callbacks("EncryptedRemoteObject.test - simple_tests", [ |
53 | MochiKit.Base.method(encryptedRemoteObject, 'getRemoteData'), | 51 | MochiKit.Base.method(encryptedRemoteObject, 'getRemoteData'), |
54 | function(aResult) { | 52 | function(aResult) { |
55 | SimpleTest.is(aResult, "--", "setting and getting serverData works"); | 53 | SimpleTest.is(aResult, "--", "setting and getting serverData works"); |
56 | } | 54 | } |
57 | ], someTestArgs); | 55 | ], someTestArgs); |
58 | 56 | ||
59 | return deferredResult; | 57 | return deferredResult; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'decrypt_test': function (someTestArgs) { | 62 | 'decrypt_test': function (someTestArgs) { |
65 | vardeferredResult; | 63 | vardeferredResult; |
66 | varencryptedRemoteObject; | 64 | varencryptedRemoteObject; |
67 | varkey; | 65 | varkey; |
68 | var version; | 66 | var version; |
69 | var rawData; | 67 | var rawData; |
70 | 68 | ||