Fixing tests after r12247 - img.src is now only available after a delay, because it is set in the load handler after setting a blank image as src. There is no need to check for img.src in layer tests, because this is asserted by Tile.Image tests (see #3419)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12249 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-08-15 16:30:43 +00:00
parent c587865bb1
commit 0ebec29df1
5 changed files with 50 additions and 73 deletions
+6 -16
View File
@@ -83,20 +83,15 @@
BBOX: [1,2,3,4],
WIDTH: "256", HEIGHT: "256"
});
t.eq( img.src,
t.eq( tile.url,
layer.getFullRequestString(tParams),
"image src is created correctly via addtile" );
t.eq( tile.frame.style.top, "6px", "image top is set correctly via addtile" );
t.eq( tile.frame.style.left, "5px", "image top is set correctly via addtile" );
var firstChild = layer.div.firstChild.firstChild;
if (!isMozilla)
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( firstChild instanceof HTMLElement, "div first child is an image object" );
t.eq( firstChild.src,
layer.getFullRequestString(tParams),
"div first child is correct image object" );
t.eq( firstChild.nodeName.toLowerCase(), "img", "div first child is an image object" );
t.ok( firstChild == img, "div first child is correct image object" );
t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." );
map.destroy();
}
@@ -119,20 +114,15 @@
BBOX: "1,2,3,4",
WIDTH: "256", HEIGHT: "256"
});
t.eq( img.src,
t.eq( tile.url,
layer.getFullRequestString(tParams),
"image src is created correctly via addtile" );
t.eq( tile.frame.style.top, "6px", "image top is set correctly via addtile" );
t.eq( tile.frame.style.left, "5px", "image top is set correctly via addtile" );
var firstChild = layer.div.firstChild.firstChild;
if (!isMozilla)
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( firstChild instanceof HTMLElement, "div first child is an image object" );
t.eq( firstChild.src,
layer.getFullRequestString(tParams),
"div first child is correct image object" );
t.eq( firstChild.nodeName.toLowerCase(), "img", "div first child is an image object" );
t.ok( firstChild, img, "div first child is correct image object" );
t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." );
map.destroy();
}