| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <div id="description"></div> |
| <div id="console"></div> |
| <script> |
| description('Test unhandled promise rejection event.'); |
| |
| window.jsTestIsAsync = true; |
| |
| window.error = null; |
| window.promise = null; |
| window.onunhandledrejection = function (e) { |
| error = e; |
| shouldBe(`error.type`, `"unhandledrejection"`); |
| shouldBe(`error.cancelable`, `true`); |
| shouldBe(`error.promise`, `promise`); |
| shouldBe(`error.reason`, `"ERROR"`); |
| finishJSTest(); |
| return false; |
| }; |
| |
| window.promise = Promise.reject("ERROR"); |
| |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |