Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: test/mjsunit/mjsunit.js

Issue 2752043002: [promises] Add %WaitForPromise runtime call to allow tests to reliably wait for promises to be fini… (Closed)
Patch Set: Don't touch runtime-promise.cc Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/basic-promise.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/mjsunit.js
diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js
index bc3afe502fc6d256d733d13eefb9589e9a9cd4f0..328195f22409f38320d74d302109de46f0704afe 100644
--- a/test/mjsunit/mjsunit.js
+++ b/test/mjsunit/mjsunit.js
@@ -149,6 +149,9 @@ var isCrankshafted;
// Returns true if given function is compiled by TurboFan.
var isTurboFanned;
+// Monkey-patchable all-purpose failure handler.
+var failWithMessage;
+
(function () { // Scope for utility functions.
@@ -233,7 +236,8 @@ var isTurboFanned;
}
- function failWithMessage(message) {
+ failWithMessage = function failWithMessage(message) {
+ print("oh, we failed: " + message);
throw new MjsUnitAssertionError(message);
}
@@ -251,7 +255,7 @@ var isTurboFanned;
} else {
message += ":\nexpected:\n" + expectedText + "\nfound:\n" + foundText;
}
- throw new MjsUnitAssertionError(message);
+ return failWithMessage(message);
}
« no previous file with comments | « test/mjsunit/basic-promise.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698