diff --git a/testing/mochitest/tests/SimpleTest/SimpleTest.js b/testing/mochitest/tests/SimpleTest/SimpleTest.js index 5c530478d47f..b8d33ad10bb1 100644 --- a/testing/mochitest/tests/SimpleTest/SimpleTest.js +++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js @@ -395,3 +395,10 @@ var is = SimpleTest.is; var isnot = SimpleTest.isnot; var todo = SimpleTest.todo; var isDeeply = SimpleTest.isDeeply; +var oldOnError = window.onerror; +window.onerror = function (ev) { + is(0, 1, "Error thrown during test: " + ev); + if (oldOnError) { + oldOnError(ev); + } +}