Bug 1140144 - Non harmful JavaScript Error: syntax error in xpcshell test remoteUpdateXML.js. r=spohl

This commit is contained in:
Robert Strong 2015-03-05 20:59:40 -08:00
parent 2e42c4a7a7
commit 385e34a572

View File

@ -41,9 +41,11 @@ function callHandleEvent() {
gXHR.status = 400;
gXHR.responseText = gResponseBody;
try {
let parser = Cc["@mozilla.org/xmlextras/domparser;1"].
createInstance(Ci.nsIDOMParser);
gXHR.responseXML = parser.parseFromString(gResponseBody, "application/xml");
if (gResponseBody) {
let parser = Cc["@mozilla.org/xmlextras/domparser;1"].
createInstance(Ci.nsIDOMParser);
gXHR.responseXML = parser.parseFromString(gResponseBody, "application/xml");
}
} catch (e) {
gXHR.responseXML = null;
}
@ -224,9 +226,9 @@ function check_test_pt03() {
run_test_pt04();
}
// Empty update xml
// Empty update xml (an empty xml file returns a root node name of parsererror)
function run_test_pt04() {
gResponseBody = "\n";
gResponseBody = "<parsererror/>";
run_test_helper_pt1("testing empty update xml",
null, run_test_pt05);
}