[foozzie] Fix errors in adjusted harness

TBR=yangguo@chromium.org
NOTRY=true

Bug: chromium:813833
Change-Id: I51780d467d9e57ed0621741da7b9fb215c3233c5
Reviewed-on: https://chromium-review.googlesource.com/955082
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51797}
This commit is contained in:
Michael Achenbach 2018-03-08 09:12:05 +01:00 committed by Commit Bot
parent f48ab38a34
commit f24b9271de

View File

@ -18,8 +18,8 @@ try {
// Override prettyPrinted with a version that also recusively prints object
// properties (with a depth of 3).
let origPrettyPrinted = this.prettyPrinted;
this.prettyPrinted = function prettyPrinted(value, depth=3) {
let origPrettyPrinted = prettyPrinted;
prettyPrinted = function prettyPrinted(value, depth=3) {
if (depth == 0) {
return "...";
}
@ -46,55 +46,51 @@ try {
}
// We're not interested in stack traces.
this.MjsUnitAssertionError = function MjsUnitAssertionError(message) {}
MjsUnitAssertionError = function MjsUnitAssertionError(message) {}
MjsUnitAssertionError.prototype.toString = function () { return ""; };
// Do more printing in assertions for more correctness coverage.
this.failWithMessage = function failWithMessage(message) {
failWithMessage = function failWithMessage(message) {
print(prettyPrinted(message))
}
this.fail = function fail(expectedText, found, name_opt) {
assertSame = function assertSame(expected, found, name_opt) {
print(prettyPrinted(found));
}
this.assertSame = function assertSame(expected, found, name_opt) {
assertNotSame = function assertNotSame(expected, found, name_opt) {
print(prettyPrinted(found));
}
this.assertNotSame = function assertNotSame(expected, found, name_opt) {
assertEquals = function assertEquals(expected, found, name_opt) {
print(prettyPrinted(found));
}
this.assertEquals = function assertEquals(expected, found, name_opt) {
assertNotEquals = function assertNotEquals(expected, found, name_opt) {
print(prettyPrinted(found));
}
this.assertNotEquals = function assertNotEquals(expected, found, name_opt) {
print(prettyPrinted(found));
}
this.assertNull = function assertNull(value, name_opt) {
assertNull = function assertNull(value, name_opt) {
print(prettyPrinted(value));
}
this.assertNotNull = function assertNotNull(value, name_opt) {
assertNotNull = function assertNotNull(value, name_opt) {
print(prettyPrinted(value));
}
// Suppress optimization status as it leads to false positives.
this.assertUnoptimized = function assertUnoptimized() {}
assertUnoptimized = function assertUnoptimized() {}
this.assertOptimized = function assertOptimized() {}
assertOptimized = function assertOptimized() {}
this.isNeverOptimize = function isNeverOptimize() {}
isNeverOptimize = function isNeverOptimize() {}
this.isAlwaysOptimize = function isAlwaysOptimize() {}
isAlwaysOptimize = function isAlwaysOptimize() {}
this.isInterpreted = function isInterpreted() {}
isInterpreted = function isInterpreted() {}
this.isOptimized = function isOptimized() {}
isOptimized = function isOptimized() {}
this.isTurboFanned = function isTurboFanned() {}
isTurboFanned = function isTurboFanned() {}
})();
} catch(e) { }