Bug 1446833: Part 3 - Match more common head.js filename patterns when filtering assertion stack frames. r?florian
The xpcshell harness tries to filter out head.js stack frames when reporting
errors. When it fails, it tends to report strange error locations, with the
name of a unit test file, but the line number of a line in a head file. This
changes the filter to match more common head.js files, such as head_addons.js.
MozReview-Commit-ID: FASWNSR0Noc
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -779,17 +779,17 @@ function do_note_exception(ex, text) {
_testLogger.info(text + "Swallowed exception " + _exception_message(ex),
{
source_file: filename,
stack: _format_stack(ex.stack)
});
}
function do_report_result(passed, text, stack, todo) {
- while (stack.filename.includes("head.js") && stack.caller) {
+ while (/(\/head(_.+)?|head)\.js$/.test(stack.filename) && stack.caller) {
stack = stack.caller;
}
let name = _gRunningTest ? _gRunningTest.name : stack.name;
let message;
if (name) {
message = "[" + name + " : " + stack.lineNumber + "] " + text;
} else {