Add 'loadstart' and 'loadend' events to some of our exciting layers like WFS, GML, GeoRSS, and Text. tests to back it up. (Closes #808)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4252 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -5,6 +5,14 @@
|
||||
|
||||
var name = "GML Layer";
|
||||
|
||||
var gml = "./owls.xml";
|
||||
|
||||
// if this test is running online, different rules apply
|
||||
var isMSIE = (navigator.userAgent.indexOf("MSIE") > -1);
|
||||
if (isMSIE) {
|
||||
gml = "." + gml;
|
||||
}
|
||||
|
||||
function test_01_Layer_GML_constructor(t) {
|
||||
t.plan(3);
|
||||
|
||||
@@ -14,6 +22,24 @@
|
||||
t.ok(layer.renderer.CLASS_NAME, "layer has a renderer");
|
||||
|
||||
}
|
||||
function test_Layer_GML_events(t) {
|
||||
t.plan(3);
|
||||
|
||||
var layer = new OpenLayers.Layer.GML(name, gml, {isBaseLayer: true});
|
||||
layer.events.register("loadstart", layer, function() {
|
||||
t.ok(true, "loadstart called.")
|
||||
});
|
||||
layer.events.register("loadend", layer, function() {
|
||||
t.ok(true, "loadend called.")
|
||||
});
|
||||
var map = new OpenLayers.Map("map");
|
||||
map.addLayer(layer);
|
||||
map.zoomToMaxExtent();
|
||||
t.delay_call(1, function() {
|
||||
t.ok(true, "waited for 1s");
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user