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){
|
function test_Layer_Goole_forwardMercator(t){
|
||||||
|
if(validkey) {
|
||||||
t.plan(2);
|
t.plan(2);
|
||||||
//Just test that the fowardMercator function still exists.
|
//Just test that the fowardMercator function still exists.
|
||||||
var layer = new OpenLayers.Layer.Google('Test Layer', {'sphericalMercator': true});
|
var layer = new OpenLayers.Layer.Google('Test Layer', {'sphericalMercator': true});
|
||||||
layer.forwardMercator = function(evt) {
|
layer.forwardMercator = function(evt) {
|
||||||
t.ok( true, "GoogleMercator.forwardMercator was called and executed." );
|
t.ok(true,
|
||||||
|
"GoogleMercator.forwardMercator was called and executed." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
layer.forwardMercator();
|
layer.forwardMercator();
|
||||||
@@ -142,12 +144,17 @@
|
|||||||
var layer = new OpenLayers.Layer.Google('Test Layer', {'sphericalMercator': true});
|
var layer = new OpenLayers.Layer.Google('Test Layer', {'sphericalMercator': true});
|
||||||
var lonlat2 = new OpenLayers.LonLat(Math.random(),Math.random());
|
var lonlat2 = new OpenLayers.LonLat(Math.random(),Math.random());
|
||||||
var result = layer.forwardMercator(lonlat2.lon, lonlat2.lat);
|
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) {
|
function test_Layer_Google_overlay(t) {
|
||||||
// Test for #849.
|
// Test for #849.
|
||||||
|
if(validkey) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var map = new OpenLayers.Map( 'map' ,
|
var map = new OpenLayers.Map( 'map' ,
|
||||||
{ controls: [] , 'numZoomLevels':20});
|
{ controls: [] , 'numZoomLevels':20});
|
||||||
@@ -164,6 +171,11 @@
|
|||||||
var px = new OpenLayers.Pixel(size.w, size.h);
|
var px = new OpenLayers.Pixel(size.w, size.h);
|
||||||
var br = map.getLonLatFromPixel(px);
|
var br = map.getLonLatFromPixel(px);
|
||||||
t.ok(layer.grid[0][0].bounds.containsLonLat(br), "Bottom right pixel is covered by untiled WMS layer");
|
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>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user