From fe3dd7f102d316d58a53ca9144431c27f12e7afe Mon Sep 17 00:00:00 2001 From: Dan Witte Date: Fri, 10 Jul 2009 12:34:04 -0700 Subject: [PATCH] Bug 503363 - include filename+linenumber for exceptions thrown during mochitest. r=sdwilsh --- testing/mochitest/browser-test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js index e1834f96ae9..12b11ec3e6b 100644 --- a/testing/mochitest/browser-test.js +++ b/testing/mochitest/browser-test.js @@ -152,8 +152,13 @@ function testResult(aCondition, aName, aDiag, aIsTodo) { else this.result = "TEST-PASS"; } else { - if (aDiag) + if (aDiag) { + if (typeof aDiag == "object" && "fileName" in aDiag) { + // we have an exception - print filename and linenumber information + this.msg += " at " + aDiag.fileName + ":" + aDiag.lineNumber; + } this.msg += " - " + aDiag; + } if (aIsTodo) this.result = "TEST-UNEXPECTED-PASS"; else