mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 09:18:42 +09:00
parent
97ec6591f4
commit
1cc92006b6
10 changed files with 143 additions and 60 deletions
|
|
@ -270,13 +270,22 @@ function testSecurityErrors() {
|
|||
}
|
||||
|
||||
function checkPromiseFailedWithSecurityError(p) {
|
||||
return p.then( function(reason) { ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully."); },
|
||||
function(reason) { if (reason == "SecurityError: The operation is insecure.") {
|
||||
ok(true, reason);
|
||||
}
|
||||
else {
|
||||
ok(false, "Did not get SecurityError with unclean source. Error Message: " + reason);
|
||||
}});
|
||||
return p.then(imageBitmap => {
|
||||
ok(!!imageBitmap, "ImageBitmaps are always created");
|
||||
const context = document.createElement("canvas").getContext("2d");
|
||||
context.drawImage(imageBitmap, 0, 0);
|
||||
try {
|
||||
context.getImageData(0, 0, 1, 1);
|
||||
ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully.");
|
||||
} catch (ex) {
|
||||
if (ex == "SecurityError: The operation is insecure.") {
|
||||
ok(true, ex);
|
||||
}
|
||||
else {
|
||||
ok(false, "Did not get SecurityError with unclean source. Error Message: " + ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.all([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue