diff --git a/dom/imptests/testharnessreport.js b/dom/imptests/testharnessreport.js index 58425cf2526..7e2ed31abb7 100644 --- a/dom/imptests/testharnessreport.js +++ b/dom/imptests/testharnessreport.js @@ -69,6 +69,17 @@ var W3CTest = { this.runner[(test.result === !test.todo) ? "log" : "error"](msg); }, + "_logCollapsedMessages": function() { + if (this.collapsedMessages) { + this._log({ + "result": true, + "todo": false, + "message": "Elided " + this.collapsedMessages + " passes or known failures." + }); + } + this.collapsedMessages = 0; + }, + /** * Maybe logs a result, eliding up to MAX_COLLAPSED_MESSAGES consecutive * passes. @@ -78,14 +89,7 @@ var W3CTest = { if (success && ++this.collapsedMessages < this.MAX_COLLAPSED_MESSAGES) { return; } - if (this.collapsedMessages) { - this._log({ - "result": true, - "todo": false, - "message": "Elided " + this.collapsedMessages + " passes or known failures." - }); - } - this.collapsedMessages = 0; + this._logCollapsedMessages(); this._log(test); }, @@ -143,6 +147,8 @@ var W3CTest = { this.expectedFailures[url] === "error" }); + this._logCollapsedMessages(); + if (this.dumpFailures) { dump("@@@ @@@ Failures\n"); dump(url + "@@@" + JSON.stringify(this.failures) + "\n");