mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 00:19:18 +00:00
32 lines
1.1 KiB
HTML
32 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(async done => {
|
|
let testCounter = 1;
|
|
async function testPart(part) {
|
|
const currentTest = testCounter++;
|
|
try {
|
|
const result = await part();
|
|
println(`${currentTest}.Success: ${JSON.stringify(result)}`);
|
|
} catch (err) {
|
|
println(`${currentTest}.Error: ${err}`);
|
|
}
|
|
}
|
|
|
|
// 1. Export a OffscreenCanvas to a PNG blob
|
|
await testPart(async () => {
|
|
const offscreenCanvas = new OffscreenCanvas(100, 100);
|
|
const result = await offscreenCanvas.convertToBlob({ type: "image/png" });
|
|
return { size: result.size, type: result.type };
|
|
});
|
|
|
|
// 2. Export a OffscreenCanvas to a JPEG blob
|
|
await testPart(async () => {
|
|
const offscreenCanvas = new OffscreenCanvas(100, 100);
|
|
const result = await offscreenCanvas.convertToBlob({ type: "image/jpeg" });
|
|
return { size: result.size, type: result.type };
|
|
});
|
|
|
|
done();
|
|
});
|
|
</script>
|