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:
43
tests/Control/test_Attribution.html
Normal file
43
tests/Control/test_Attribution.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
function test_01_Control_Attribution_constructor (t) {
|
||||
t.plan( 2 );
|
||||
|
||||
control = new OpenLayers.Control.Attribution();
|
||||
t.ok( control instanceof OpenLayers.Control.Attribution, "new OpenLayers.Control returns object" );
|
||||
t.eq( control.displayClass, "olControlAttribution", "displayClass is correct" );
|
||||
}
|
||||
function test_Control_Attribution_setBaseLayer (t) {
|
||||
t.plan(1);
|
||||
map = new OpenLayers.Map("map");
|
||||
map.addControl(control);
|
||||
map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer!', isBaseLayer: true}));
|
||||
map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer 2!', isBaseLayer: true}));
|
||||
map.setBaseLayer(map.layers[1]);
|
||||
t.eq(control.div.innerHTML, 'My layer 2!', "Attribution correct with changed base layer");
|
||||
|
||||
}
|
||||
function test_Control_Attribution_draw (t) {
|
||||
t.plan(3);
|
||||
control = new OpenLayers.Control.Attribution();
|
||||
map = new OpenLayers.Map("map");
|
||||
map.addControl(control);
|
||||
map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer!'}));
|
||||
t.eq(control.div.innerHTML, 'My layer!', "Attribution correct with one layer.");
|
||||
map.addLayer(new OpenLayers.Layer("name", {'attribution':'My layer 2!'}));
|
||||
t.eq(control.div.innerHTML, 'My layer!, My layer 2!', "Attribution correct with two layers.");
|
||||
control.separator = '|';
|
||||
map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer 3!'}));
|
||||
t.eq(control.div.innerHTML, 'My layer!|My layer 2!|My layer 3!', "Attribution correct with three layers and diff seperator.");
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" style="width: 1024px; height: 512px;"/>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user