The Request functions now consider a request with null status as a sucessful request. This is relevant for the file 'protocol' where xhr status is never set. r=crschmidt (closes #1638)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7609 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-07-30 16:33:03 +00:00
parent bc06972aea
commit 36d5f49f0d
2 changed files with 11 additions and 5 deletions

View File

@@ -20,7 +20,7 @@
function test_issue(t) {
setup();
t.plan(18);
t.plan(19);
var request, config;
var proto = OpenLayers.Request.XMLHttpRequest.prototype;
var issue = OpenLayers.Function.bind(OpenLayers.Request.issue,
@@ -111,11 +111,11 @@
config = {
success: function(req) {
t.ok(req.status >= 200 && req.status < 300,
t.ok(!req.status || (req.status >= 200 && req.status < 300),
"success callback called with " + req.status + " status");
},
failure: function(req) {
t.ok(req.status < 200 || req.status >= 300,
t.ok(req.status && (req.status < 200 || req.status >= 300),
"failure callback called with " + req.status + " status");
}
};
@@ -137,6 +137,10 @@
// mock up status 300 (1 test)
request.status = 300;
request.onreadystatechange();
// mock up a status null (1 test)
request.status = null;
request.onreadystatechange();
proto.send = _send;