summaryrefslogtreecommitdiff
path: root/tests/unit/image_bitmap_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/image_bitmap_test.ts')
-rw-r--r--tests/unit/image_bitmap_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/image_bitmap_test.ts b/tests/unit/image_bitmap_test.ts
index 364f2a167..006631182 100644
--- a/tests/unit/image_bitmap_test.ts
+++ b/tests/unit/image_bitmap_test.ts
@@ -90,3 +90,14 @@ Deno.test(async function imageBitmapFlipY() {
1, 0, 0, 1, 2, 0, 0, 1, 3, 0, 0, 1,
]));
});
+
+Deno.test(async function imageBitmapFromBlob() {
+ const path = "tests/testdata/image/1x1-white.png";
+ const imageData = new Blob([await Deno.readFile(path)], {
+ type: "image/png",
+ });
+ const imageBitmap = await createImageBitmap(imageData);
+ // @ts-ignore: Deno[Deno.internal].core allowed
+ // deno-fmt-ignore
+ assertEquals(Deno[Deno.internal].getBitmapData(imageBitmap), new Uint8Array([255,255,255,255]));
+});