Diffstat (limited to 'frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js b/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js index 91909fa..cfe94d4 100644 --- a/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js +++ b/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js | |||
@@ -1,118 +1,116 @@ | |||
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.Base.module('Clipperz.Tests.DragAndDrop'); | 24 | Clipperz.Base.module('Clipperz.Tests.DragAndDrop'); |
27 | 25 | ||
28 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); | 26 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); |
29 | Clipperz.PM.Strings.Languages.initSetup(); | 27 | Clipperz.PM.Strings.Languages.initSetup(); |
30 | 28 | ||
31 | Clipperz.Tests.DragAndDrop.Tester = function(args) { | 29 | Clipperz.Tests.DragAndDrop.Tester = function(args) { |
32 | args = args || {}; | 30 | args = args || {}; |
33 | 31 | ||
34 | Clipperz.Tests.DragAndDrop.Tester.superclass.constructor.call(this, args); | 32 | Clipperz.Tests.DragAndDrop.Tester.superclass.constructor.call(this, args); |
35 | this._user = new Clipperz.PM.DataModel.User({username:'test', getPassphraseFunction:function () { return 'test';}}); | 33 | this._user = new Clipperz.PM.DataModel.User({username:'test', getPassphraseFunction:function () { return 'test';}}); |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | }; | 36 | }; |
39 | 37 | ||
40 | Clipperz.Base.extend(Clipperz.Tests.DragAndDrop.Tester, Object, { | 38 | Clipperz.Base.extend(Clipperz.Tests.DragAndDrop.Tester, Object, { |
41 | 39 | ||
42 | 'toString': function() { | 40 | 'toString': function() { |
43 | return "Clipperz.Tests.DragAndDrop.Tester"; | 41 | return "Clipperz.Tests.DragAndDrop.Tester"; |
44 | }, | 42 | }, |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'user': function () { | 46 | 'user': function () { |
49 | return this._user; | 47 | return this._user; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'run': function () { | 52 | 'run': function () { |
55 | var deferredResult; | 53 | var deferredResult; |
56 | var proxy; | 54 | var proxy; |
57 | varcardDialogController; | 55 | varcardDialogController; |
58 | varcardDialogComponent; | 56 | varcardDialogComponent; |
59 | 57 | ||
60 | proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false}); | 58 | proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false}); |
61 | 59 | ||
62 | deferredResult = new Clipperz.Async.Deferred("DragAndDrop_test.init", {trace:false}); | 60 | deferredResult = new Clipperz.Async.Deferred("DragAndDrop_test.init", {trace:false}); |
63 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['test_test_offline_copy_data']); | 61 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['test_test_offline_copy_data']); |
64 | deferredResult.addMethod(this.user(), 'login'); | 62 | deferredResult.addMethod(this.user(), 'login'); |
65 | deferredResult.addMethod(this.user(), 'getRecord', '8280842f41162b673335b63860637e8472e8bbff0efa2bc78b0dbc5e09712e13'); | 63 | deferredResult.addMethod(this.user(), 'getRecord', '8280842f41162b673335b63860637e8472e8bbff0efa2bc78b0dbc5e09712e13'); |
66 | deferredResult.addCallback(MochiKit.Base.bind(function (aRecord) { | 64 | deferredResult.addCallback(MochiKit.Base.bind(function (aRecord) { |
67 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:aRecord, delegate:this}); | 65 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:aRecord, delegate:this}); |
68 | cardDialogController.run(); | 66 | cardDialogController.run(); |
69 | 67 | ||
70 | cardDialogController.showPasswordTooltip('**********', MochiKit.DOM.getElement('Clipperz_PM_Components_actionLink_63')); | 68 | cardDialogController.showPasswordTooltip('**********', MochiKit.DOM.getElement('Clipperz_PM_Components_actionLink_63')); |
71 | }, this)); | 69 | }, this)); |
72 | deferredResult.callback(); | 70 | deferredResult.callback(); |
73 | 71 | ||
74 | return deferredResult; | 72 | return deferredResult; |
75 | }, | 73 | }, |
76 | 74 | ||
77 | //========================================================================= | 75 | //========================================================================= |
78 | 76 | ||
79 | 'saveChanges': function () { | 77 | 'saveChanges': function () { |
80 | return this.user().saveChanges(); | 78 | return this.user().saveChanges(); |
81 | }, | 79 | }, |
82 | 80 | ||
83 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
84 | 82 | ||
85 | 'hasPendingChanges': function () { | 83 | 'hasPendingChanges': function () { |
86 | return this.user().hasPendingChanges(); | 84 | return this.user().hasPendingChanges(); |
87 | }, | 85 | }, |
88 | 86 | ||
89 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
90 | 88 | ||
91 | 'revertChanges': function () { | 89 | 'revertChanges': function () { |
92 | return this.user().revertChanges(); | 90 | return this.user().revertChanges(); |
93 | }, | 91 | }, |
94 | 92 | ||
95 | //========================================================================= | 93 | //========================================================================= |
96 | __syntaxFix__: "syntax fix" | 94 | __syntaxFix__: "syntax fix" |
97 | }); | 95 | }); |
98 | 96 | ||
99 | 97 | ||
100 | 98 | ||
101 | 99 | ||
102 | 100 | ||
103 | 101 | ||
104 | 102 | ||
105 | 103 | ||
106 | 104 | ||
107 | 105 | ||
108 | 106 | ||
109 | 107 | ||
110 | 108 | ||
111 | 109 | ||
112 | 110 | ||
113 | 111 | ||
114 | 112 | ||
115 | 113 | ||
116 | 114 | ||
117 | 115 | ||
118 | init = function () { | 116 | init = function () { |