Skip to content

Commit

Permalink
Bug 503363 - include filename+linenumber for exceptions thrown during…
Browse files Browse the repository at this point in the history
… mochitest. r=sdwilsh
  • Loading branch information
Dan Witte committed Jul 10, 2009
1 parent 87a2a2f commit b0f176e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion testing/mochitest/browser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0f176e

Please sign in to comment.