yet more tabs. no functional changes

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7620 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2008-07-30 22:47:00 +00:00
parent c0d29035f4
commit 3a5a649984
2 changed files with 24 additions and 24 deletions
+21 -21
View File
@@ -46,34 +46,34 @@
var ev = { var ev = {
'object': {}, 'object': {},
'listeners': { 'listeners': {
'listenerA': { 'listenerA': {
'push': function(options){ 'push': function(options){
gObjA = options.obj; gObjA = options.obj;
gFuncA = options.func; gFuncA = options.func;
} }
}, },
'listenerB': { 'listenerB': {
'push': function(options){ 'push': function(options){
gObjB = options.obj; gObjB = options.obj;
gFuncB = options.func; gFuncB = options.func;
} }
} }
}, },
'eventTypes': ['listenerA', 'listenerB'] 'eventTypes': ['listenerA', 'listenerB']
}; };
var type = null; var type = null;
var object = null; var object = null;
var func = null; var func = null;
//func null //func null
gObjA = null; gFuncA = null; gObjB = null; gFuncB = null; gObjA = null; gFuncA = null; gObjB = null; gFuncB = null;
OpenLayers.Events.prototype.register.apply(ev, [type, object, func]); OpenLayers.Events.prototype.register.apply(ev, [type, object, func]);
t.ok((gObjA == null) && (gFuncA == null) && t.ok((gObjA == null) && (gFuncA == null) &&
(gObjB == null) && (gFuncB == null), "no push called func null"); (gObjB == null) && (gFuncB == null), "no push called func null");
//valid func, type not in ev.eventTypes //valid func, type not in ev.eventTypes
func = function() {}; func = function() {};
gObjA = null; gFuncA = null; gObjB = null; gFuncB = null; gObjA = null; gFuncA = null; gObjB = null; gFuncB = null;
OpenLayers.Events.prototype.register.apply(ev, [type, object, func]); OpenLayers.Events.prototype.register.apply(ev, [type, object, func]);
@@ -89,13 +89,13 @@
//valid func, type in ev.eventTypes, valid obj //valid func, type in ev.eventTypes, valid obj
type = 'listenerB'; type = 'listenerB';
object = {}; object = {};
gObjA = null; gFuncA = null; gObjB = null; gFuncB = null; gObjA = null; gFuncA = null; gObjB = null; gFuncB = null;
OpenLayers.Events.prototype.register.apply(ev, [type, object, func]); OpenLayers.Events.prototype.register.apply(ev, [type, object, func]);
t.ok((gObjA == null) && (gFuncA == null) && t.ok((gObjA == null) && (gFuncA == null) &&
(gObjB == object) && (gFuncB == func), "push called on listenerB's mock array when type passed in 'listenerB'."); (gObjB == object) && (gFuncB == func), "push called on listenerB's mock array when type passed in 'listenerB'.");
} }
function test_Events_register_unregister(t) { function test_Events_register_unregister(t) {
+3 -3
View File
@@ -36,9 +36,9 @@
//regression testing for #1502 //regression testing for #1502
t.ok( layer.events.listeners['tileloaded'].length == 0, "no listeners for tileloaded preregister"); t.ok( layer.events.listeners['tileloaded'].length == 0, "no listeners for tileloaded preregister");
var obj = {}; var obj = {};
var func = function() {}; var func = function() {};
layer.events.register('tileloaded', obj, func); layer.events.register('tileloaded', obj, func);
t.ok( layer.events.listeners['tileloaded'].length == 1, "one listener for tileloaded after register"); t.ok( layer.events.listeners['tileloaded'].length == 1, "one listener for tileloaded after register");
} }