updated sandbox with singleroot.3.patch from #1666

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8664 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-01-14 23:16:53 +00:00
parent 94203ec0f8
commit 34599e7f50

View File

@@ -11,7 +11,7 @@
var control = new OpenLayers.Control.SelectFeature(layer, options);
t.ok(control instanceof OpenLayers.Control.SelectFeature,
"new OpenLayers.Control.SelectFeature returns an instance");
t.eq(control.layer, "bar",
t.eq(control.layers[0], "bar",
"constructor sets layer correctly");
// t.eq(control.handlers.feature.geometryTypes, "foo",
// "constructor sets options correctly on feature handler");
@@ -74,14 +74,15 @@
features[i] = {
id: Math.random(),
tested: 0,
style: ""
style: "",
layer: layer
};
}
// test that onSelect gets called properly
control.onSelect = function(feature) {
feature.tested += 1;
t.eq(feature, features[feature.index],
t.eq(feature.id, features[feature.index].id,
"onSelect called with proper feature (" + feature.index + ")");
t.eq(feature.tested, feature.test,
"onSelect called only once for feature (" + feature.index + ")");
@@ -90,7 +91,7 @@
// test that onUnselect gets called properly
control.onUnselect = function(feature) {
feature.tested += 1;
t.eq(feature, features[feature.index],
t.eq(feature.id, features[feature.index].id,
"onUnselect called with proper feature (" + feature.index + ")");
t.eq(feature.tested, feature.test,
"onUnselect called only once for feature (" + feature.index + ")");