mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
26 lines
924 B
JavaScript
26 lines
924 B
JavaScript
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
|
// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.source-out
|
|
// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.
|
|
// Note:
|
|
|
|
importScripts("/resources/testharness.js");
|
|
importScripts("/common/canvas-tests.js");
|
|
|
|
var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
|
|
t.step(function() {
|
|
|
|
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
|
var ctx = offscreenCanvas.getContext('2d');
|
|
|
|
|
|
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
|
ctx.fillRect(0, 0, 100, 50);
|
|
ctx.globalCompositeOperation = 'source-out';
|
|
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
|
|
ctx.drawImage(offscreenCanvas2, 0, 0);
|
|
_assertPixelApprox(offscreenCanvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
|
|
|
|
t.done();
|
|
|
|
});
|
|
done();
|