Bug 763169 - Part b: Miscellaneous fixes; r=jhammel

This commit is contained in:
Ms2ger 2012-06-17 09:51:22 +02:00
Родитель b9ba89999a
Коммит 8b517156fc
2 изменённых файлов: 45 добавлений и 25 удалений

Просмотреть файл

@ -101,27 +101,51 @@ var W3CTest = {
this.expectedFailures[url] === "error"
});
this.runner.testFinished(this.tests);
},
/**
* Log an unexpected failure. Intended to be used from harness code, not
* from tests.
*/
"logFailure": function(message) {
this.report({
"message": message,
"result": false,
"todo": false
});
},
/**
* Timeout the current test. Intended to be used from harness code, not
* from tests.
*/
"timeout": function() {
timeout();
}
};
(function() {
if (!W3CTest.runner) {
return;
}
// Get expected fails. If there aren't any, there will be a 404, which is
// fine. Anything else is unexpected.
var request = new XMLHttpRequest();
request.open("GET", "/tests/dom/imptests/failures/" + W3CTest.getURL() + ".json", false);
request.send();
if (request.status === 200) {
W3CTest.expectedFailures = JSON.parse(request.responseText);
} else if (request.status !== 404) {
is(request.status, 404, "Request status neither 200 nor 404");
}
try {
if (!W3CTest.runner) {
return;
}
// Get expected fails. If there aren't any, there will be a 404, which is
// fine. Anything else is unexpected.
var request = new XMLHttpRequest();
request.open("GET", "/tests/dom/imptests/failures/" + W3CTest.getURL() + ".json", false);
request.send();
if (request.status === 200) {
W3CTest.expectedFailures = JSON.parse(request.responseText);
} else if (request.status !== 404) {
W3CTest.logFailure("Request status was " + request.status);
}
add_result_callback(W3CTest.result.bind(W3CTest));
add_completion_callback(W3CTest.finish.bind(W3CTest));
setup({
"output": false,
"timeout": 1000000,
});
add_result_callback(W3CTest.result.bind(W3CTest));
add_completion_callback(W3CTest.finish.bind(W3CTest));
setup({
"output": false,
"timeout": 1000000
});
} catch (e) {
W3CTest.logFailure("Unexpected exception: " + e);
}
})();

Просмотреть файл

@ -93,11 +93,7 @@ TestRunner._checkForHangs = function() {
if ("SimpleTest" in win) {
win.SimpleTest.ok(false, msg);
} else if ("W3CTest" in win) {
win.W3CTest.report({
"message": msg,
"result": false,
"todo": false
});
win.W3CTest.logFailure(msg);
}
}
@ -105,7 +101,7 @@ TestRunner._checkForHangs = function() {
if ("SimpleTest" in win) {
win.SimpleTest.finish();
} else if ("W3CTest" in win) {
win.W3CTest.kill();
win.W3CTest.timeout();
}
}