Ticket #2927: test-events-duplicate.patch
File test-events-duplicate.patch, 1.3 KB (added by , 15 years ago) |
---|
-
_source/tests/core/event.html
61 61 assert.areSame( 'a,b', calls.toString() ); 62 62 }, 63 63 64 test_implementOn : function()64 test_implementOn1 : function() 65 65 { 66 66 // Create a testObject and implement CKEDITOR.event on it. 67 67 var testObject = { someprop : 'Test' }; … … 102 102 assert.areSame( 2, calls.length, 'number of calls doesn\'t match' ); 103 103 assert.areSame( 'a,b', calls.toString() ); 104 104 }, 105 105 106 /** 107 * Test the {@link CKEDITOR.event.implementOn} correctly applied on prototype object. 108 */ 109 test_implementOn2 : function() 110 { 111 var times = 0; 112 113 function myClass() 114 { 115 CKEDITOR.event.call( this ); 116 } 117 CKEDITOR.event.implementOn( myClass.prototype ); 118 119 var instance1 = new myClass(), instance2 = new myClass(); 120 121 instance1.on( 'event1', function() 122 { 123 times++; 124 } ); 125 instance2.on( 'event1', function() 126 { 127 times++; 128 } ); 129 //sync 130 instance1.fire( 'event1' ); 131 assert.areSame( 1, times ); 132 133 }, 134 106 135 test_eventNameCase : function() 107 136 { 108 137 // Create a testObject and implement CKEDITOR.event on it.