blob: 79d431506d6145e35bd9e834bc86772097905c68 [file] [log] [blame]
importScripts('../../resources/js-test-pre.js');
description('Test unhandled promise rejection event.');
var global = this;
global.jsTestIsAsync = true;
global.error = null;
global.promise = null;
global.onunhandledrejection = function (e) {
error = e;
shouldBe(`error.type`, `"unhandledrejection"`);
shouldBe(`error.cancelable`, `true`);
shouldBe(`error.promise`, `promise`);
shouldBe(`error.reason`, `"ERROR"`);
finishJSTest();
return false;
};
global.promise = Promise.reject("ERROR");