Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add tests for className and removeBackBufferDelay default values

  • Loading branch information...
commit d252a6156a0c9eebdb8f2b9d1cb1ca0006037709 1 parent 8f20ff8
@elemoine elemoine authored
Showing with 30 additions and 2 deletions.
  1. +30 −2 tests/Layer/Grid.html
View
32 tests/Layer/Grid.html
@@ -24,8 +24,8 @@
*/
- function test_Layer_Grid_constructor (t) {
- t.plan( 6 );
+ function test_constructor (t) {
+ t.plan( 8 );
layer = new OpenLayers.Layer.Grid(name, url, params, null);
t.ok( layer instanceof OpenLayers.Layer.Grid, "returns OpenLayers.Layer.Grid object" );
@@ -33,6 +33,8 @@
t.eq( layer.ratio, 1.5, "ratio default is 1.5");
t.eq( layer.numLoadingTiles, 0, "numLoadingTiles starts at 0");
t.ok( layer.tileClass === OpenLayers.Tile.Image, "tileClass default is OpenLayers.Tile.Image");
+ t.eq( layer.className, 'olLayerGridTile', "className default is olLayerGridTile");
+ t.eq( layer.removeBackBufferDelay, 2500, "removeBackBufferDelay default is 2500");
var obj = {};
var func = function() {};
@@ -41,6 +43,32 @@
t.ok( layer.events.listeners['tileloaded'].length == 1, "one listener for tileloaded after register");
}
+ function test_constructor_singleTile(t) {
+ t.plan(2);
+ layer = new OpenLayers.Layer.Grid(name, url, params, {singleTile: true});
+ t.eq( layer.className, 'olLayerGridSingleTile', "className default is olLayerGridSingleTile");
+ t.eq( layer.removeBackBufferDelay, 0, "removeBackBufferDelay default is 0");
+ }
+
+ function test_setMap(t) {
+ t.plan(1);
+ var map = new OpenLayers.Map('map');
+ layer = new OpenLayers.Layer.Grid(name, url, params, null);
+ map.addLayer(layer);
+ t.ok(OpenLayers.Element.hasClass(layer.div, "olLayerGridTile"),
+ "olLayerGridTile class assigned to layer div");
+ map.destroy();
+ }
+
+ function test_setMap_singleTile(t) {
+ t.plan(1);
+ var map = new OpenLayers.Map('map');
+ layer = new OpenLayers.Layer.Grid(name, url, params, {singleTile: true});
+ map.addLayer(layer);
+ t.ok(OpenLayers.Element.hasClass(layer.div, "olLayerGridSingleTile"),
+ "olLayerGridSingleTile class assigned to layer div");
+ map.destroy();
+ }
function test_Layer_Grid_inittiles (t) {
t.plan( 2 );
Please sign in to comment.
Something went wrong with that request. Please try again.