r406@creusa: crschmidt | 2006-05-27 12:26:35 -0400
Added tests for PanZoomBar, currently just a mirror of PanZoom, but at least will catch if something is horribly broken. git-svn-id: http://svn.openlayers.org/trunk/openlayers@430 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -17,5 +17,6 @@
|
||||
<li>test_Tile_Image.html</li>
|
||||
<li>test_Control.html</li>
|
||||
<li>test_Control_PanZoom.html</li>
|
||||
<li>test_Control_PanZoomBar.html</li>
|
||||
<li>test_Map.html</li>
|
||||
</ul>
|
||||
|
||||
35
tests/test_Control_PanZoomBar.html
Normal file
35
tests/test_Control_PanZoomBar.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
var map;
|
||||
function test_01_Control_PanZoomBar_constructor (t) {
|
||||
t.plan( 1 );
|
||||
|
||||
control = new OpenLayers.Control.PanZoomBar();
|
||||
t.ok( control instanceof OpenLayers.Control.PanZoomBar, "new OpenLayers.Control.PanZoomBar returns object" );
|
||||
}
|
||||
function test_02_Control_PanZoomBar_addControl (t) {
|
||||
t.plan( 8 );
|
||||
map = new OpenLayers.Map('map', {controls:[]});
|
||||
control = new OpenLayers.Control.PanZoomBar();
|
||||
t.ok( control instanceof OpenLayers.Control.PanZoomBar, "new OpenLayers.Control.PanZoomBar 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[0] === control, "map.controls contains control" );
|
||||
t.eq( parseInt(control.div.style.zIndex), 1001, "Control div zIndexed properly" );
|
||||
t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), 1001, "Viewport div contains control div" );
|
||||
t.eq( control.div.style.top, "4px", "Control div top located correctly by default");
|
||||
|
||||
var control2 = new OpenLayers.Control.PanZoomBar();
|
||||
map.addControl(control2, new OpenLayers.Pixel(100,100));
|
||||
t.eq( control2.div.style.top, "100px", "2nd control div is located correctly");
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" style="width: 1024px; height: 512px;"/>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user