summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/test_imagebitmap.html
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-14 11:46:21 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-23 02:12:38 +0100
commit6478daf2988b56ae73f941fd471242b7e92b2a4e (patch)
treea572c976e75590a8e5a6748ae40a56f7efdcf89d /dom/canvas/test/test_imagebitmap.html
parent181cb5210e6555102f5215316ea7a9b1771b0717 (diff)
downloadUXP-6478daf2988b56ae73f941fd471242b7e92b2a4e.tar
UXP-6478daf2988b56ae73f941fd471242b7e92b2a4e.tar.gz
UXP-6478daf2988b56ae73f941fd471242b7e92b2a4e.tar.lz
UXP-6478daf2988b56ae73f941fd471242b7e92b2a4e.tar.xz
UXP-6478daf2988b56ae73f941fd471242b7e92b2a4e.zip
Implement origin-clean algorithm for ImageBitmap.
This resolves #973.
Diffstat (limited to 'dom/canvas/test/test_imagebitmap.html')
-rw-r--r--dom/canvas/test/test_imagebitmap.html23
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([