gecko-dev/dom/canvas/test/imagebitmap_bug1239300.js
Kaku Kuo 3d85eebfd7 Bug 1293878 part 1 - reject promise with InvalidStateError DOMException; r=smaug
MozReview-Commit-ID: 7c62WCJZWMz

--HG--
extra : rebase_source : c3f90b2a6e10557cc3c3f01e31aab8e70eca6a39
2016-08-16 11:52:58 +08:00

19 lines
562 B
JavaScript

function testBug1239300() {
return new Promise(function(resolve, reject) {
createImageBitmap(new Blob()).then(
function() {
ok(false, "The promise should be rejected with InvalidStateError.");
reject();
},
function(result) {
if (result.name == "InvalidStateError") {
ok(true, "The promise should be rejected with InvalidStateError.");
resolve();
} else {
ok(false, "The promise should be rejected with InvalidStateError.");
reject();
}
}
);
});
}