making google tests conditional so invalid keys don't fail tests - debug reporting instead
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4249 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -130,11 +130,13 @@
|
||||
}
|
||||
|
||||
function test_Layer_Goole_forwardMercator(t){
|
||||
if(validkey) {
|
||||
t.plan(2);
|
||||
//Just test that the fowardMercator function still exists.
|
||||
var layer = new OpenLayers.Layer.Google('Test Layer', {'sphericalMercator': true});
|
||||
layer.forwardMercator = function(evt) {
|
||||
t.ok( true, "GoogleMercator.forwardMercator was called and executed." );
|
||||
t.ok(true,
|
||||
"GoogleMercator.forwardMercator was called and executed." );
|
||||
return;
|
||||
}
|
||||
layer.forwardMercator();
|
||||
@@ -142,12 +144,17 @@
|
||||
var layer = new OpenLayers.Layer.Google('Test Layer', {'sphericalMercator': true});
|
||||
var lonlat2 = new OpenLayers.LonLat(Math.random(),Math.random());
|
||||
var result = layer.forwardMercator(lonlat2.lon, lonlat2.lat);
|
||||
t.ok( result instanceof OpenLayers.LonLat, "OpenLayers.Google.fowardMercator returns LonLat object" );
|
||||
|
||||
t.ok(result instanceof OpenLayers.LonLat, "OpenLayers.Google.fowardMercator returns LonLat object" );
|
||||
} else {
|
||||
t.plan(0);
|
||||
t.debug_print("Google tests can't be run from " +
|
||||
window.location.host);
|
||||
}
|
||||
}
|
||||
|
||||
function test_Layer_Google_overlay(t) {
|
||||
// Test for #849.
|
||||
if(validkey) {
|
||||
t.plan(1);
|
||||
var map = new OpenLayers.Map( 'map' ,
|
||||
{ controls: [] , 'numZoomLevels':20});
|
||||
@@ -164,6 +171,11 @@
|
||||
var px = new OpenLayers.Pixel(size.w, size.h);
|
||||
var br = map.getLonLatFromPixel(px);
|
||||
t.ok(layer.grid[0][0].bounds.containsLonLat(br), "Bottom right pixel is covered by untiled WMS layer");
|
||||
} else {
|
||||
t.plan(0);
|
||||
t.debug_print("Google tests can't be run from " +
|
||||
window.location.host);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user