Make mochitest print the amount of time each test takes. (Bug 482162) r=ted

This commit is contained in:
L. David Baron 2010-06-08 18:44:31 -07:00
parent aedb18a96b
commit 48ff3035cf

View File

@ -181,9 +181,12 @@ TestRunner.runNextTest = function() {
* This stub is called by SimpleTest when a test is finished.
**/
TestRunner.testFinished = function(tests) {
if (TestRunner.logEnabled)
TestRunner.logger.debug("SimpleTest finished " +
TestRunner._urls[TestRunner._currentTest]);
if (TestRunner.logEnabled) {
var runtime = new Date().valueOf() - TestRunner._currentTestStartTime;
TestRunner.logger.log("SimpleTest finished " +
TestRunner._urls[TestRunner._currentTest] +
" in " + runtime + "ms");
}
TestRunner.updateUI(tests);
TestRunner._currentTest++;