Bug 708498 - TPS logging improvements; r=rnewman

This commit is contained in:
Gregory Szorc 2011-12-07 17:57:12 -08:00
parent 9d6d811243
commit dde864d417
2 changed files with 16 additions and 11 deletions

View File

@ -101,14 +101,19 @@ var Logger =
},
AssertTrue: function(bool, msg, showPotentialError) {
if (!bool) {
let message = msg;
if (showPotentialError && this._potentialError) {
message += "; " + this._potentialError;
this._potentialError = null;
}
throw("ASSERTION FAILED! " + message);
if (bool) {
return;
}
if (showPotentialError && this._potentialError) {
msg += "; " + this._potentialError;
this._potentialError = null;
}
throw("ASSERTION FAILED! " + msg);
},
AssertFalse: function(bool, msg, showPotentialError) {
return this.AssertTrue(!bool, msg, showPotentialError);
},
AssertEqual: function(val1, val2, msg) {
@ -126,7 +131,7 @@ var Logger =
var now = new Date()
this.write(now.getFullYear() + "-" + (now.getMonth() < 9 ? '0' : '') +
(now.getMonth() + 1) + "-" +
(now.getDate() < 9 ? '0' : '') + (now.getDate() + 1) + " " +
(now.getDate() < 10 ? '0' : '') + (now.getDate()) + " " +
(now.getHours() < 10 ? '0' : '') + now.getHours() + ":" +
(now.getMinutes() < 10 ? '0' : '') + now.getMinutes() + ":" +
(now.getSeconds() < 10 ? '0' : '') + now.getSeconds() + " " +

View File

@ -148,7 +148,7 @@ var TPS =
}
}
catch(e) {
this.DumpError("Exception caught: " + e);
this.DumpError("Exception caught: " + Utils.exceptionStr(e));
return;
}
},
@ -479,7 +479,7 @@ var TPS =
this._currentAction++;
}
catch(e) {
this.DumpError("Exception caught: " + e);
this.DumpError("Exception caught: " + Utils.exceptionStr(e));
return;
}
this.RunNextTestAction();
@ -538,7 +538,7 @@ var TPS =
this._currentAction = 0;
}
catch(e) {
this.DumpError("Exception caught: " + e);
this.DumpError("Exception caught: " + Utils.exceptionStr(e));
return;
}
},