| Index: pkg/unittest/lib/test_controller.js
|
| diff --git a/pkg/unittest/lib/test_controller.js b/pkg/unittest/lib/test_controller.js
|
| index 4862e03fa9f7130ccf2a1d9f838b23ac7fb0c3cd..96121cc498375c105bb1d7c156dc85886dee685b 100644
|
| --- a/pkg/unittest/lib/test_controller.js
|
| +++ b/pkg/unittest/lib/test_controller.js
|
| @@ -11,9 +11,20 @@
|
| if (typeof console == "object" && typeof console.clear == "function") {
|
| console.clear();
|
| }
|
| +
|
| +// Some tests may expect and have no way to suppress global errors.
|
| +var testExpectsGlobalError = false;
|
| +var testSuppressedGlobalErrors = [];
|
| +
|
| // Set window onerror to make sure that we catch test harness errors across all
|
| // browsers.
|
| window.onerror = function (message, url, lineNumber) {
|
| + if (testExpectsGlobalError) {
|
| + testSuppressedGlobalErrors.push({
|
| + message: message
|
| + });
|
| + return;
|
| + }
|
| if (url) {
|
| showErrorAndExit(
|
| "\n\n" + url + ":" + lineNumber + ":\n" + message + "\n\n");
|
|
|