blob: a49db99353f4c2648c967946af6b25fbf6778794 [file] [log] [blame]
<!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>