Revert r6710: The new popup coe is going to need to change tests, so this
needs to wait. git-svn-id: http://svn.openlayers.org/trunk/openlayers@6711 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
34
tests/Control/test_NavToolbar.html
Normal file
34
tests/Control/test_NavToolbar.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
function test_01_Control_NavToolbar_constructor (t) {
|
||||
t.plan( 4 );
|
||||
control = new OpenLayers.Control.NavToolbar();
|
||||
t.ok( control instanceof OpenLayers.Control.NavToolbar, "new OpenLayers.Control.NavToolbar returns object" );
|
||||
t.eq( control.displayClass, "olControlNavToolbar", "displayClass is correct" );
|
||||
t.ok( control.controls[0] instanceof OpenLayers.Control.Navigation, "NavToolbar contains Control.Navigation object" );
|
||||
t.ok( control.controls[1] instanceof OpenLayers.Control.ZoomBox, "NavToolbar contains Control.ZoomBox object" );
|
||||
}
|
||||
function test_02_Control_NavToolbar_addControl (t) {
|
||||
t.plan( 6 );
|
||||
map = new OpenLayers.Map('map');
|
||||
control = new OpenLayers.Control.NavToolbar();
|
||||
t.ok( control instanceof OpenLayers.Control.NavToolbar, "new OpenLayers.Control.NavToolbar returns object" );
|
||||
t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" );
|
||||
map.addControl(control);
|
||||
t.ok( control.map === map, "Control.map is set to the map object" );
|
||||
t.ok( map.controls[4] === control, "map.controls contains control" );
|
||||
t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 7, "Control div zIndexed properly" );
|
||||
t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 7, "Viewport div contains control div" );
|
||||
// t.eq( control.div.style.top, "6px", "Control div top located correctly by default");
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" style="width: 1024px; height: 512px;"/>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user