mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 08:50:26 +03:00
Tests/LibWeb: Add test to verify correctness of getImageData
This commit is contained in:
parent
d2f9ba7db1
commit
dbc94ce92e
Notes:
sideshowbarker
2024-07-17 22:55:25 +09:00
Author: https://github.com/circl-lastname Commit: https://github.com/LadybirdBrowser/ladybird/commit/dbc94ce92e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/166 Issue: https://github.com/LadybirdBrowser/ladybird/issues/120
@ -0,0 +1 @@
|
||||
PASS
|
@ -0,0 +1,20 @@
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let area = document.createElement("canvas");
|
||||
let areaCtx = area.getContext("2d");
|
||||
|
||||
area.width = 1;
|
||||
area.height = 1;
|
||||
|
||||
areaCtx.fillStyle = "#ff8040";
|
||||
areaCtx.fillRect(0, 0, 1, 1);
|
||||
|
||||
let imageData = areaCtx.getImageData(0, 0, area.width, area.height);
|
||||
|
||||
if (imageData.data[0] == 0xff && imageData.data[1] == 0x80 && imageData.data[2] == 0x40)
|
||||
println("PASS");
|
||||
else
|
||||
println("FAIL");
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user