зеркало из https://github.com/mozilla/gecko-dev.git
Bug 763169 - Part b: Miscellaneous fixes; r=jhammel
This commit is contained in:
Родитель
b9ba89999a
Коммит
8b517156fc
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче