Abort XMLHttpRequest on tile.destroy for WFS. The loadURL function now returns a request object. Thanks pgiraud for the fix. r=crschmidt (closes #964)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5539 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-12-20 17:28:51 +00:00
parent 59dd8b2d99
commit 2d1099d60d
3 changed files with 43 additions and 12 deletions

View File

@@ -42,7 +42,7 @@
}
function test_99_Tile_WFS_destroy(t) {
t.plan( 6 );
t.plan(8);
var layer = {}; // bogus layer
var position = new OpenLayers.Pixel(10,20);
@@ -56,14 +56,28 @@
};
var _gAbort = false;
tile.request = {
transport: {
abort: function() {
_gAbort = true;
}
}
}
tile.destroy();
t.ok(tile.layer == null, "tile.layer set to null");
t.ok(tile.bounds == null, "tile.bounds set to null");
t.ok(tile.size == null, "tile.size set to null");
t.ok(tile.position == null, "tile.position set to null");
t.ok(_gAbort, "request transport is aborted");
t.ok(tile.events == null, "tile.events set to null");
tile.requestSuccess({'requestText': '<xml><foo /></xml>'});
t.ok(true, "Didn't fail after calling requestSuccess on destroyed tile.");
}
</script>