deactivate on clear. r=bartvde (closes #2471)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10114 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2010-03-19 08:46:36 +00:00
parent fc4e05dd83
commit 1757d4082e
2 changed files with 30 additions and 2 deletions

View File

@@ -168,6 +168,33 @@
}
function test_clear(t) {
t.plan(7);
var map = new OpenLayers.Map("map");
var layer = new OpenLayers.Layer(
"test", {isBaseLayer: true}
);
map.addLayer(layer);
map.zoomToMaxExtent();
var control = new OpenLayers.Control.NavigationHistory();
map.addControl(control);
t.ok(!control.previous.active, "previous control not active");
t.ok(!control.next.active, "next control not active");
map.zoomTo(4);
t.ok(control.previous.active, "previous control is active after a move");
t.ok(!control.next.active, "next control is not active after a move");
control.clear();
t.eq(control.previousStack.length + control.nextStack.length, 0, "stacks are empty after a clear");
t.ok(!control.previous.active, "previous control not active after a clear");
t.ok(!control.next.active, "next control not active after a clear");
control.destroy();
}
</script>
</head>
<body>