Diffstat (limited to 'frontend/gamma/tests/tests/Clipperz/PM/DataModel/DirectLogin.test.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/tests/tests/Clipperz/PM/DataModel/DirectLogin.test.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/tests/tests/Clipperz/PM/DataModel/DirectLogin.test.js b/frontend/gamma/tests/tests/Clipperz/PM/DataModel/DirectLogin.test.js index d385c8c..7df0971 100644 --- a/frontend/gamma/tests/tests/Clipperz/PM/DataModel/DirectLogin.test.js +++ b/frontend/gamma/tests/tests/Clipperz/PM/DataModel/DirectLogin.test.js | |||
@@ -1,88 +1,85 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); | 26 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); |
30 | 27 | ||
31 | var tests = { | 28 | var tests = { |
32 | 29 | ||
33 | /* | 30 | /* |
34 | user = new Clipperz.PM.DataModel.User({username:'test', getPassphraseFunction:function () { return 'test';}}); | 31 | user = new Clipperz.PM.DataModel.User({username:'test', getPassphraseFunction:function () { return 'test';}}); |
35 | ... | 32 | ... |
36 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['test_test_offline_copy_data']); | 33 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['test_test_offline_copy_data']); |
37 | deferredResult.addMethod(user, 'getRecord', '8280842f41162b673335b63860637e8472e8bbff0efa2bc78b0dbc5e09712e13'); | 34 | deferredResult.addMethod(user, 'getRecord', '8280842f41162b673335b63860637e8472e8bbff0efa2bc78b0dbc5e09712e13'); |
38 | 35 | ||
39 | 36 | ||
40 | user = new Clipperz.PM.DataModel.User({username:'joe', getPassphraseFunction:function () { return 'clipperz';}}); | 37 | user = new Clipperz.PM.DataModel.User({username:'joe', getPassphraseFunction:function () { return 'clipperz';}}); |
41 | ... | 38 | ... |
42 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['joe_clipperz_offline_copy_data']); | 39 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['joe_clipperz_offline_copy_data']); |
43 | deferredResult.addMethod(user, 'getRecord', '5cdac63b317f3942da38f3a3de3b7f0e5d6678200951c6216230295550f63fb4'); //WEB PASSWORD (0) | 40 | deferredResult.addMethod(user, 'getRecord', '5cdac63b317f3942da38f3a3de3b7f0e5d6678200951c6216230295550f63fb4'); //WEB PASSWORD (0) |
44 | deferredResult.addMethod(user, 'getRecord', '36ec1a41118813ced3553534fa2607d781cba687768db305beed368a8e06e113'); //DIGG (1) | 41 | deferredResult.addMethod(user, 'getRecord', '36ec1a41118813ced3553534fa2607d781cba687768db305beed368a8e06e113'); //DIGG (1) |
45 | deferredResult.addMethod(user, 'getRecord', 'c0ce9130ca365bb02418d4305ea1d29e49c3f0e96d44b9d3cb6b4b6843d25065'); //SAP (2) | 42 | deferredResult.addMethod(user, 'getRecord', 'c0ce9130ca365bb02418d4305ea1d29e49c3f0e96d44b9d3cb6b4b6843d25065'); //SAP (2) |
46 | deferredResult.addMethod(user, 'getRecord', 'd5f700b9c3367c39551ea49e00a9ab20dae09dd79d46047b983fc7c4bfaa050d'); //YAHOO (4) | 43 | deferredResult.addMethod(user, 'getRecord', 'd5f700b9c3367c39551ea49e00a9ab20dae09dd79d46047b983fc7c4bfaa050d'); //YAHOO (4) |
47 | DirectLogin references | 44 | DirectLogin references |
48 | - dba0db679802f0e6aa6d0b7a6aaf42350aabc5f057409edd99a268a92ebb6496 //Yahoo! Mail | 45 | - dba0db679802f0e6aa6d0b7a6aaf42350aabc5f057409edd99a268a92ebb6496 //Yahoo! Mail |
49 | - aa18149164302d5dbe7e2d3724565b9550e00887b49978559783b2e38c625584 //(Yahoo! Groups) | 46 | - aa18149164302d5dbe7e2d3724565b9550e00887b49978559783b2e38c625584 //(Yahoo! Groups) |
50 | - 6f7bbc4e42ea462b5246e6f51c3f86056bec50601ce2de6067c8c1d26f21c07f //(Flickr) | 47 | - 6f7bbc4e42ea462b5246e6f51c3f86056bec50601ce2de6067c8c1d26f21c07f //(Flickr) |
51 | - a7b32e72502804bf2946a2a8856139cbbb759c5777e6b3e673db1fdf7e3bd06e //(My Yahoo!) | 48 | - a7b32e72502804bf2946a2a8856139cbbb759c5777e6b3e673db1fdf7e3bd06e //(My Yahoo!) |
52 | */ | 49 | */ |
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'editDirectLoginLabel_test': function (someTestArgs) { | 52 | 'editDirectLoginLabel_test': function (someTestArgs) { |
56 | var deferredResult; | 53 | var deferredResult; |
57 | var proxy; | 54 | var proxy; |
58 | var user; | 55 | var user; |
59 | 56 | ||
60 | proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false}); | 57 | proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false}); |
61 | user = new Clipperz.PM.DataModel.User({username:'joe', getPassphraseFunction:function () { return 'clipperz';}}); | 58 | user = new Clipperz.PM.DataModel.User({username:'joe', getPassphraseFunction:function () { return 'clipperz';}}); |
62 | 59 | ||
63 | deferredResult = new Clipperz.Async.Deferred("editDirectLoginLabel_test", someTestArgs); | 60 | deferredResult = new Clipperz.Async.Deferred("editDirectLoginLabel_test", someTestArgs); |
64 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['joe_clipperz_offline_copy_data']); | 61 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['joe_clipperz_offline_copy_data']); |
65 | deferredResult.addMethod(user, 'login'); | 62 | deferredResult.addMethod(user, 'login'); |
66 | deferredResult.addMethod(user, 'getRecord', 'd5f700b9c3367c39551ea49e00a9ab20dae09dd79d46047b983fc7c4bfaa050d'); //YAHOO (4) | 63 | deferredResult.addMethod(user, 'getRecord', 'd5f700b9c3367c39551ea49e00a9ab20dae09dd79d46047b983fc7c4bfaa050d'); //YAHOO (4) |
67 | deferredResult.addMethodcaller('directLogins'); | 64 | deferredResult.addMethodcaller('directLogins'); |
68 | deferredResult.addCallback(MochiKit.Base.itemgetter('dba0db679802f0e6aa6d0b7a6aaf42350aabc5f057409edd99a268a92ebb6496')); | 65 | deferredResult.addCallback(MochiKit.Base.itemgetter('dba0db679802f0e6aa6d0b7a6aaf42350aabc5f057409edd99a268a92ebb6496')); |
69 | deferredResult.addCallback(function (aDirectLogin) { | 66 | deferredResult.addCallback(function (aDirectLogin) { |
70 | var innerDeferredResult; | 67 | var innerDeferredResult; |
71 | var updatedLabel; | 68 | var updatedLabel; |
72 | 69 | ||
73 | updatedLabel = "updated Yahoo! Mail label"; | 70 | updatedLabel = "updated Yahoo! Mail label"; |
74 | 71 | ||
75 | innerDeferredResult = new Clipperz.Async.Deferred("editDirectLoginLabel_test <inner>", someTestArgs); | 72 | innerDeferredResult = new Clipperz.Async.Deferred("editDirectLoginLabel_test <inner>", someTestArgs); |
76 | innerDeferredResult.addMethod(aDirectLogin, 'label'); | 73 | innerDeferredResult.addMethod(aDirectLogin, 'label'); |
77 | innerDeferredResult.addTest("Yahoo! Mail", "The label of the selected direct login is correct."); | 74 | innerDeferredResult.addTest("Yahoo! Mail", "The label of the selected direct login is correct."); |
78 | innerDeferredResult.addMethod(aDirectLogin, 'setLabel', updatedLabel); | 75 | innerDeferredResult.addMethod(aDirectLogin, 'setLabel', updatedLabel); |
79 | 76 | ||
80 | innerDeferredResult.addMethod(aDirectLogin, 'label'); | 77 | innerDeferredResult.addMethod(aDirectLogin, 'label'); |
81 | innerDeferredResult.addTest(updatedLabel, "The DirectLogin returns the correct label even before committing data."); | 78 | innerDeferredResult.addTest(updatedLabel, "The DirectLogin returns the correct label even before committing data."); |
82 | 79 | ||
83 | innerDeferredResult.addMethod(user, 'hasPendingChanges'); | 80 | innerDeferredResult.addMethod(user, 'hasPendingChanges'); |
84 | innerDeferredResult.addTest(true, "When changing the label of a DirectLogin, the user should report pending changes."); | 81 | innerDeferredResult.addTest(true, "When changing the label of a DirectLogin, the user should report pending changes."); |
85 | 82 | ||
86 | //innerDeferredResult.addCallback(function () { console.log("+_+_+_+_+_+_+_+_+_+_+_+ >>>")}); | 83 | //innerDeferredResult.addCallback(function () { console.log("+_+_+_+_+_+_+_+_+_+_+_+ >>>")}); |
87 | innerDeferredResult.addMethod(user, 'saveChanges'); | 84 | innerDeferredResult.addMethod(user, 'saveChanges'); |
88 | //innerDeferredResult.addCallback(function () { console.log("+_+_+_+_+_+_+_+_+_+_+_+ <<<")}); | 85 | //innerDeferredResult.addCallback(function () { console.log("+_+_+_+_+_+_+_+_+_+_+_+ <<<")}); |