Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Bug 730070: Fix xhr tests on non-nightly builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
ochameau committed Feb 23, 2012
1 parent ff18a3d commit 8ddd0c9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/api-utils/tests/test-xhr.js
Expand Up @@ -5,6 +5,7 @@
var xhr = require("xhr");
var timer = require("timer");
var { Loader } = require("./helpers");
var xulApp = require("xul-app");

/* Test is intentionally disabled until platform bug 707256 is fixed.
exports.testAbortedXhr = function(test) {
Expand Down Expand Up @@ -54,10 +55,16 @@ exports.testResponseHeaders = function(test) {
req.open("GET", module.uri);
req.onreadystatechange = function() {
if (req.readyState == 4 && req.status == 0) {
// Now that bug 608939 is FIXED, headers works correctly on files:
var headers = req.getAllResponseHeaders();
test.assertEqual(headers, "Content-Type: text/plain\n",
"XHR's delegated methods should return");
if (xulApp.versionInRange(xulApp.platformVersion, "13.0a1", "*")) {
// Now that bug 608939 is FIXED, headers works correctly on files:
test.assertEqual(headers, "Content-Type: text/plain\n",
"XHR's headers are valid");
}
else {
test.assert(headers === null || headers === "",
"XHR's headers are empty");
}
test.done();
}
};
Expand Down

0 comments on commit 8ddd0c9

Please sign in to comment.