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 | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js b/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js new file mode 100644 index 0000000..e805e34 --- a/dev/null +++ b/frontend/gamma/tests/tests/Components/CardDialogEditing/dragAndDrop_test.js | |||
@@ -0,0 +1,128 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer to http://www.clipperz.com | ||
12 | |||
13 | * Javascript Crypto Library is free software: you can redistribute | ||
14 | 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 | ||
16 | 3 of the License, or (at your option) any later version. | ||
17 | |||
18 | * Javascript Crypto Library is distributed in the hope that it will | ||
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
21 | See the GNU Affero General Public License for more details. | ||
22 | |||
23 | * You should have received a copy of the GNU Affero General Public | ||
24 | License along with Javascript Crypto Library. If not, see | ||
25 | <http://www.gnu.org/licenses/>. | ||
26 | |||
27 | */ | ||
28 | |||
29 | Clipperz.Base.module('Clipperz.Tests.DragAndDrop'); | ||
30 | |||
31 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); | ||
32 | Clipperz.PM.Strings.Languages.initSetup(); | ||
33 | |||
34 | Clipperz.Tests.DragAndDrop.Tester = function(args) { | ||
35 | args = args || {}; | ||
36 | |||
37 | Clipperz.Tests.DragAndDrop.Tester.superclass.constructor.call(this, args); | ||
38 | this._user = new Clipperz.PM.DataModel.User({username:'test', getPassphraseFunction:function () { return 'test';}}); | ||
39 | |||
40 | return this; | ||
41 | }; | ||
42 | |||
43 | Clipperz.Base.extend(Clipperz.Tests.DragAndDrop.Tester, Object, { | ||
44 | |||
45 | 'toString': function() { | ||
46 | return "Clipperz.Tests.DragAndDrop.Tester"; | ||
47 | }, | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'user': function () { | ||
52 | return this._user; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'run': function () { | ||
58 | var deferredResult; | ||
59 | var proxy; | ||
60 | varcardDialogController; | ||
61 | varcardDialogComponent; | ||
62 | |||
63 | proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false}); | ||
64 | |||
65 | deferredResult = new Clipperz.Async.Deferred("DragAndDrop_test.init", {trace:false}); | ||
66 | deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['test_test_offline_copy_data']); | ||
67 | deferredResult.addMethod(this.user(), 'login'); | ||
68 | deferredResult.addMethod(this.user(), 'getRecord', '8280842f41162b673335b63860637e8472e8bbff0efa2bc78b0dbc5e09712e13'); | ||
69 | deferredResult.addCallback(MochiKit.Base.bind(function (aRecord) { | ||
70 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:aRecord, delegate:this}); | ||
71 | cardDialogController.run(); | ||
72 | |||
73 | cardDialogController.showPasswordTooltip('**********', MochiKit.DOM.getElement('Clipperz_PM_Components_actionLink_63')); | ||
74 | }, this)); | ||
75 | deferredResult.callback(); | ||
76 | |||
77 | return deferredResult; | ||
78 | }, | ||
79 | |||
80 | //========================================================================= | ||
81 | |||
82 | 'saveChanges': function () { | ||
83 | return this.user().saveChanges(); | ||
84 | }, | ||
85 | |||
86 | //------------------------------------------------------------------------- | ||
87 | |||
88 | 'hasPendingChanges': function () { | ||
89 | return this.user().hasPendingChanges(); | ||
90 | }, | ||
91 | |||
92 | //------------------------------------------------------------------------- | ||
93 | |||
94 | 'revertChanges': function () { | ||
95 | return this.user().revertChanges(); | ||
96 | }, | ||
97 | |||
98 | //========================================================================= | ||
99 | __syntaxFix__: "syntax fix" | ||
100 | }); | ||
101 | |||
102 | |||
103 | |||
104 | |||
105 | |||
106 | |||
107 | |||
108 | |||
109 | |||
110 | |||
111 | |||
112 | |||
113 | |||
114 | |||
115 | |||
116 | |||
117 | |||
118 | |||
119 | |||
120 | |||
121 | init = function () { | ||
122 | vartester; | ||
123 | |||
124 | tester = new Clipperz.Tests.DragAndDrop.Tester(); | ||
125 | tester.run(); | ||
126 | }; | ||
127 | |||
128 | MochiKit.DOM.addLoadEvent(init); | ||