| <script src="../../resources/js-test-pre.js"></script> |
| <div id="description"></div> |
| description('Test rejection handled event.'); |
| window.jsTestIsAsync = true; |
| window.onunhandledrejection = function (e) { |
| shouldBe(`error.type`, `"unhandledrejection"`); |
| shouldBe(`error.cancelable`, `true`); |
| shouldBe(`error.promise`, `promise`); |
| shouldBe(`error.reason`, `"ERROR"`); |
| promise.catch(function (r) { |
| shouldBe(`reason`, `"ERROR"`); |
| window.onrejectionhandled = function (e) { |
| shouldBe(`handled.type`, `"rejectionhandled"`); |
| shouldBe(`handled.cancelable`, `false`); |
| shouldBe(`handled.promise`, `promise`); |
| shouldBe(`handled.reason`, `"ERROR"`); |
| window.promise = Promise.reject("ERROR"); |
| <script src="../../resources/js-test-post.js"></script> |