still need to get into the habit of testing *before* committing. im working on it. i promise. fixing test for Tile.Image based on [173].

git-svn-id: http://svn.openlayers.org/trunk/openlayers@177 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-19 14:46:21 +00:00
parent 50fe4e712f
commit 95d8c8f2c8

View File

@@ -32,17 +32,18 @@
t.eq( tile.img.style.height, "6px", "Image height is correct" );
}
function test_03_Tile_setPosition (t) {
t.plan( 4 );
t.plan( 5 );
tile = new OpenLayers.Tile.Image(
new OpenLayers.Bounds(1,2,3,4), "http://www.openlayers.org/dev/tests/tileimage",
new OpenLayers.Size(5,6));
t.eq( tile.getPosition(), null, "getPosition before draw returns null" );
tile.setPosition(new OpenLayers.Pixel(1,2));
t.eq( tile.getPosition(), null, "setPosition before draw has no effect" );
t.eq( tile.getPosition().x, 1, "tile's x position set correctly " );
t.eq( tile.getPosition().y, 2, "tile's y position set correctly" );
tile.draw();
tile.setPosition(new OpenLayers.Pixel(1,2));
t.eq( tile.getPosition().x, 1, "setPosition sets x after draw" );
t.eq( tile.getPosition().y, 2, "setPosition sets y after draw" );
t.eq( tile.img.style.left, 1 + "px", "setPosition sets x of image correctly after draw" );
t.eq( tile.img.style.top, 2 + "px", "setPosition sets y of image correctly after draw" );
}
// -->