Changeset 746
- Timestamp:
- 04/24/06 22:56:58 (2 years ago)
- Files:
-
- mochikit/trunk/tests/test_Signal.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mochikit/trunk/tests/test_Signal.js
r733 r746 40 40 if (MochiKit.DOM.getElement('submit').fireEvent || 41 41 (document.createEvent && 42 (typeof(document.createEvent('MouseEvents').initMouseEvent) == 'function'))) {42 typeof(document.createEvent('MouseEvents').initMouseEvent) == 'function')) { 43 43 44 44 /* … … 125 125 }; 126 126 127 var bFunction = function(someArg, someOtherArg) { 128 i += someArg + someOtherArg; 129 }; 130 131 127 132 var aObject = {}; 128 133 aObject.aMethod = function() { … … 149 154 t.is(i, 0, 'New style disconnecting function'); 150 155 i = 0; 156 157 158 ident = connect(hasSignals, 'signalOne', bFunction); 159 signal(hasSignals, 'signalOne', 1, 2); 160 t.is(i, 3, 'Connecting function'); 161 i = 0; 162 163 disconnect(ident); 164 signal(hasSignals, 'signalOne', 1, 2); 165 t.is(i, 0, 'New style disconnecting function'); 166 i = 0; 167 151 168 152 169 connect(hasSignals, 'signalOne', aFunction); … … 283 300 t.ok(true, 'An exception was raised when connecting an undefined method'); 284 301 } 285 286 if (0) {287 // XXX: bob - not sure this warrants an exception288 try {289 disconnect(hasSignals, 'signalOne', aObject, aObject.nothing);290 t.ok(false, 'An exception was not raised when disconnecting an undefined method');291 } catch (e) {292 t.ok(true, 'An exception was raised when disconnecting an undefined method');293 }294 }295 302 296 303 try { … … 302 309 } 303 310 304 if (0) {305 // XXX: bob - not sure this warrants an exception306 try {307 disconnect(hasSignals, 'signalOne', aObject, 'nothing');308 t.ok(false, 'An exception was not raised when disconnecting an undefined method (as string)');309 } catch (e) {310 t.ok(true, 'An exception was raised when disconnecting an undefined method (as string)');311 }312 }313 314 311 t.is(i, 0, 'Signals should not have fired'); 315 312
