diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-14 11:46:21 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-14 11:46:21 +0100 |
commit | 91799767e1c575dce6cdb1528f1f10a1fd62e35f (patch) | |
tree | 48d925ea0d3123ef18d8a810724b3cdf7ad3b734 /dom/canvas/test | |
parent | 0e80d10f4a10496a6657df210ff45a89fba68a75 (diff) | |
download | UXP-91799767e1c575dce6cdb1528f1f10a1fd62e35f.tar UXP-91799767e1c575dce6cdb1528f1f10a1fd62e35f.tar.gz UXP-91799767e1c575dce6cdb1528f1f10a1fd62e35f.tar.lz UXP-91799767e1c575dce6cdb1528f1f10a1fd62e35f.tar.xz UXP-91799767e1c575dce6cdb1528f1f10a1fd62e35f.zip |
Implement origin-clean algorithm for ImageBitmap.
This resolves #973.
Diffstat (limited to 'dom/canvas/test')
-rw-r--r-- | dom/canvas/test/test_imagebitmap.html | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/dom/canvas/test/test_imagebitmap.html b/dom/canvas/test/test_imagebitmap.html index b3d3c08ad..3b74970ac 100644 --- a/dom/canvas/test/test_imagebitmap.html +++ b/dom/canvas/test/test_imagebitmap.html @@ -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([ |